-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Separate description per allowableValue #1012
Comments
The spec doesn't really provide a way to give a description per enum value. Without going too much into details, that's pretty much a limitation of JSON Schema. The only way to provide such a documentation would be via the |
@webron Is this a limitation of the Swagger schema? Or the limitation of the JSON protocol? |
Not JSON protocol but JSON Schema. It's a bit of a limitation of both. JSON Schema doesn't allow it, and we didn't provide an alternative solution in the spec. |
@cowwoc - don't think we can do much more here. |
@webron Okay, please provide an alternative solution in the spec as you mentioned (change this issue to a feature request). |
You can open an issue on swagger-spec with a detailed request if you'd like it to be considered for a future version of the spec. For now, you'd have to document it manually in the |
Done. Closing this issue. |
It's not clear how to document enums in a scalable manner. I want to provide users with a list of all possible enum values, and for each value provide a description of its meaning.
Ideally, I would like to link to the enum from the REST method that returns it and then provide a separate description (annotation) per value.
@ApiModelProperty(dataType = "string", allowableValues = "Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday", value = "description", notes = "notes")
is not a good fit because:notes
field. This clutters the code and is hard to maintain.Any ideas?
The text was updated successfully, but these errors were encountered: