-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Support multiple response class depending on an input parameter #56
Comments
Hi, this may be outside of swagger's goals. Think of it like this. The consumer needs to know the business logic for the return type as a function of input. That's putting them in a position to fail. The only mechanism with swagger right now is to use different return codes (i.e. 200, 201, etc) to indicate different models. If you want, you can file a ticket in the swagger-spec repo for this |
Tony, this is the swagger-spec repo. Basically what's being described here is a request to treat a combination of path+httpmethod +query parameter as a unique operation rather than path+httpmethod only. |
Yes, i misread the repo, i need my bifocals. Sorry about that @perabello |
This did not make it into Swagger 2.0, mostly for the reasons @fehguy mentioned. I'm closing this issue for now and marking it as a proposal for the next version instead of rejecting it. |
Parent: #574. |
@perabello Is this still an issue with the latest OAI v3 draft? |
@RobDolinMS - There's no solution for this in 3.0. Given that this didn't get much traction, I'll close it now. We can revisit if we get more requests for it. |
Stinks that this is closed. This would be so incredibly useful. being able to treat: as distinct endpoints would be incredibly useful. |
I have a get operation that return two different classes (and it could be more) depending on a parameter input.
I could resolve it separating to multiple operations. One for each result class.
But it forces me to add a path for the GET.
Example: /persons/{id}/info=?
It returns PersonDto or EmployeeDto for BASIC or EMPLOYEE parameter.
The result are two classes totally different.
And I don't want to publish something like: /persons/{id}/full
The text was updated successfully, but these errors were encountered: