-
Notifications
You must be signed in to change notification settings - Fork 56
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
Add OpenAPI 3.1.0 enumeration style #121
Comments
Let's fix this please. What will it take for it to be supported properly by Swagger (UI) and the like? |
Or even x-ms-enum format which gives you the value that should be used, the name and description all of which can be used to generate an extended enum in Dart too. I.e. this
Should be able to generate this:
And of course it should be able to go further and have a get description accessor too. |
Update, I have code that does this properly. It requires that the property have the enum array to be able to determine that it is indeed an enum. If you'd like I can do a pull request and you can hack it up to meet your needs. This is what it produces (I don't have long descriptions only the name repeated):
|
Bump: This is still broken and the enums it creates are "valueXXX" instead of proper names despite the fact that these are indeed available in the schema. It also doesn't properly override toString to return the proper values per the docs on new enums. It also doesn't set the name/value properly per new Dart enums so that it can have a numerical value associated with each item. I'm specifically using dart_mappable, but any of them should generate similar to the above with a proper value and then simple name and then also be mappable to the value not the name for json. |
Handles all cases of proper advanced enums with name/value if available. If not, defaults back to original structure. May also fix Enum as part parameter Carapacik#207
I gave up on my pull request, but this is still a major blocker to this working correctly as it's basically impossible to use enums right now because you don't know which one is what. |
In OpenAPI 3.1.0 there is a new method of enumerating things that allows us to have proper names for enumerations.
Here is an example of that.
The main page of the project says that it supports OpenAPI 3.1 but this part still doesn't seem to be supported.
Here is a thread on the subject
The text was updated successfully, but these errors were encountered: