-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Enum are "anonymous" in the Model preview section, it shows only "Enum" - 3.x #2875
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
Comments
As you said, there are two separate issues here. In the models view (@bodnia) - anything that's not an object has no name, an it should (the name of the definition). In the operation view - you can't reference types from non-body parameters. This is split into two - @shockey, we need to make sure the new validator marks this as an error (like the old one). And two (@bodnia, @shockey) - no type should be displayed for the parameter when it's invalid. |
Hello, Concerning "you can't reference types from non-body parameters", I think the problem is more relative to Open API Initiative spec. Problem for current spec with enums, wich are absolutely usable as query or path param ( string, int etc ), is that when using code generator we are facing anonymous enums, sometimes 3/4 times the same enum.. That's why we used to referenced enum definition from non body parameters. It worked like a charm before with swagger-ui ui 2., and swagger code gen :) OAI ( swagger ) should allow use of enum definition :) It 's also more natural to define them in model and then use it in model, body param, or path/query/header param |
3.0 is already going to allow it. But 2.0 does not, and we will not support it in the UI. You can still use enums directly in the parameter definition, just not reference it. |
There's a workaround to reference an enum using YAML |
Non-object definitions now have the name displayed under the Models section, and the editor shows errors for the wrong definition. |
Locking due to inactivity. |
There are two points:
enum reference from parameter, and enum reference from another definition object
This definition was ok for swagger-ui 2.x and swagger-parser": "~3.4.1. But it is now ko with swagger-ui 3.x and online swagger editor.. :(
In swagger-ui 3.x both model and parameter are "anonymous"
enum.swagger.json.zip
In swagger editor: error for parameter reference
It's very confusing from one version to another, and from one tool to another :)
The text was updated successfully, but these errors were encountered: