cancel
Showing results for 
Search instead for 
Did you mean: 
Welcome to the September Hub-bub

We are inviting you to join our exciting online event where you can learn a lot of useful information, share your knowledge and have fun. Each week, we will reward the best posters with free gift cards .

Just pick any topic you like in the SwaggerHub Community, or create your own to dive into the wonderful September Hub-bub.

Event duration: September 2-27. More information.

This Week Top Contributors:

We will decide the winners next Monday

Depending on parameter how to change response in swagger

SOLVED
New Contributor

Depending on parameter how to change response in swagger

Hi,

I want to change the response value depending on the paramter.

for example:-

I want to send response as Cat when 1 parameter and Dog when 2 parameter is passed.

 

 

Thanks,

Shirin Parkar

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator

Re: Depending on parameter how to change response in swagger

Hello,

 

Currently the OpenAPI/Swagger specifications do not support differentiation based on query parameters - not for input nor for output. Work on supporting it is candidate for future versions of the spec, you can find out more information at https://github.com/OAI/OpenAPI-Specification/issues/182.

1 REPLY 1
Moderator

Re: Depending on parameter how to change response in swagger

Hello,

 

Currently the OpenAPI/Swagger specifications do not support differentiation based on query parameters - not for input nor for output. Work on supporting it is candidate for future versions of the spec, you can find out more information at https://github.com/OAI/OpenAPI-Specification/issues/182.

New Here?
Join us and watch the welcome video:
Top Kudoed Authors
Join the September Hub-bub to show off, learn and win