-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Swagger.next: Let's not use hashes anymore #208
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
There's a reason why hashes were introduces instead of array, and that was to enforce uniqueness. With arrays, you can have duplicate paths/operations and that makes the validation that much more difficult. I'm not sure I understand your comment regarding have other keys other than As for the ordering, that's been thoroughly discussed in the Swagger 2.0 work group. Ordering is a presentation issue and not a documentation one. Swagger-UI allows you to manipulation the paths and operation ordering and that should be enough. |
I think using hashes was a bad decision. It's up to WG to make decision about it but we should look into this issue for the next version. |
And to be clear, I'm all for revisiting decisions and changing them as needed, though personally here I don't see a reason for it. |
Lets keep this open for next version discussions. Hopefully we can talk about this in details at some point :) |
Reference #560 |
@OAI/tdc propose closing this with no action, please approve / reject |
Voting to close. |
@DavidBiesack for #146 I would prefer not to repeat the same path twice, but have the consumes/produces distinction under the operation level. |
Putting
paths
andoperations
in a hash made all sort of problems. The biggest problem is keeping order status of paths and operations. Tags can help organize the paths and operations but that's not enough. Most of people expect Swagger document keep it's order status when they are authoring one.Other problem with using hashes is that we are using keys as a data storage. This makes it impossible to have other keys in
paths
oroperation
because every key is a path or operation.Lets use arrays for the next version and make life easier for everyone. It will not make specs uglier. Here is an example:
The text was updated successfully, but these errors were encountered: