Skip to content
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

Multiple operations that share a path and method (but differ in content type) get deduplicated erroneously. #1694

Closed
Lattyware opened this issue Oct 21, 2015 · 3 comments

Comments

@Lattyware
Copy link

It appears that multiple operations that share a path are merged into a single operation, even if they are different. Say, for example, I have two operations, one gives my resource as XML, one as JSON.

image

Only one of the operations appears. This used to work correctly in previous versions, but appears to be broken now (using swagger-ui 2.1.3).

@webron
Copy link
Contributor

webron commented Oct 21, 2015

In the current version of Swagger (and previous ones) a unique operation is a combination of a path and an HTTP verb. The content-type plays no part in it. Prior to 2.0, it was possible to add such definitions due to the structure of the JSON, but that was still invalid and unsupported. In 2.0, you simply cannot do that structure-wise. If you're using an older version, swagger-ui will first transform your spec to 2.0 which will lead to one definition clobbering the other. This is not a bug, this is by design.

@Lattyware
Copy link
Author

I see, so this is just an extension of issue #182 in swagger-spec. Ugh, really not a fan of that decision, but fair enough.

@webron
Copy link
Contributor

webron commented Oct 21, 2015

Yup. Sorry about that, but it's been that way since day one of the spec. The only difference is it wasn't possible to enforce it versions prior to 2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants