There’s no way of doing it. A unique identifier for an operation is a 
combination of the verb and the path. Query parameters cannot be used to 
differentiate operations. 

 

 

 

From: <[email protected]> on behalf of umuk 
<[email protected]>
Reply-To: "[email protected]" 
<[email protected]>
Date: Tuesday, 30 May 2017 at 6:52
To: Swagger <[email protected]>
Subject: Re: In swagger, is there a way to specify different response objects 
based on query param? (Workaround?)

 

Further I have found this FAQ at bottom of this page: 

http://swagger.io/docs/specification/describing-responses/

 

Can I have different responses based on a request parameter? Such as:
GET /something -> {200, schema_1}
GET /something?foo=bar -> {200, schema_2}
No, this is not supported.

 

 

I am still wondering how others have overcome this? Maybe some workaround 
exists (regardless of how elegant or unnatural it is) ?

-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to