-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
swagger/fix: []string are not enum by swagger definition #7916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7916 +/- ##
=========================================
Coverage ? 41.59%
=========================================
Files ? 479
Lines ? 64124
Branches ? 0
=========================================
Hits ? 26672
Misses ? 33991
Partials ? 3461 Continue to review full report at Codecov.
|
Somewhat related (at least for the generate limitation part) : go-swagger/go-swagger#1942 |
Yes because permission only take one of the value (enum type) and units is a list (array) of manyof the value wich is not really an enum. |
This could maybe improved by defining an Go enum type for units and declare that units is an array of this Type. I have try but I doesn't have anythings fully working and it need a lot of refactor to be done on other parts of code. There also seems to be issue whit that on go-swagger so I used the example fields. |
[]string
are not enum by swagger definition this led the generation of a client to think thatrepo.code,repo.issues,repo.ext_issues,repo.wiki,repo.pulls,repo.releases,repo.ext_wiki
is an array of[]string
([][]string
).By definition, enum are one of an array like
Permission
that can take one value fromnone,read,write,admin,owner
.This PR change the definition to an example to be able to generate a valid client from the swagger specs. Currently the generated client doesn't compile because it try convert the
[]string
enum to[][]string