-
Notifications
You must be signed in to change notification settings - Fork 763
Regression: Inherited response data not displaying in Swagger-UI when using swagger-js v2.1.10 #680
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
@xiehan - I'm afraid none of the "XXXWithDocument" definitions is valid. I'm even surprised it worked in previous versions, but this is not really a bug. Not only that a |
I don't understand this. Then how are the top-level Response Definitions intended to be used?
So is there any way to create any sort of inheritance model among Responses at all? If not, I find that incredibly frustrating. The amount of copy-pasting I've had to do for Swagger v2 compared to v1.2 has increased enormously, to the point where it's becoming unmanageable. |
There's a difference between the top-level Response Definitions Object than the operation-level responses. The top-level Response Definitions Object is a map between a name and a Response Object. However, the Response Object is a map between an HTTP response code (or The inheritance that can be defined in the responses is only at the schema level. 1.2 didn't even allow you to have top level definitions and you had to repeat everything anyways. I do understand the frustration though, it's just something we didn't think of when creating the spec. To improve that, I'd ask you to open an issue on the spec so we can take into account in the next version. I admit it makes sense to add such level of extensible. |
All right, ticket open. And just FYI, part of the problem for me was that swagger-php used to have a feature called 'Partials' in 1.x, which was designed to solve exactly this problem -- allowing annotations to be reused so you didn't have to copy-paste things over and over. Unfortunately, Partials were removed in 2.x because the maintainers said "Swagger 2.0 now has definitions! We don't need partials anymore!" But now it seems like there are some use cases for partials, like this one, that fell through the cracks. |
@xiehan - aha! Thanks for providing the details. Definitely helps explaining the expectations. |
Here's v2.1.9:
And here's v2.1.10:
Here's the relevant parts of our spec, other stuff not relevant to this bug removed for length:
The text was updated successfully, but these errors were encountered: