amorimjj / redoc-try-it-out

Add Try It Out option on Redoc
MIT License
29 stars 10 forks source link

Ability to Select Server? #1

Open homestar9 opened 2 years ago

homestar9 commented 2 years ago

This extension is awesome! Thank you for creating it. I was curious if there was a way to select from a list of servers defined in the Swaggerfile servers key? It's common to have both production and development environment servers present.

image

The default Swagger UI shows a dropdown like this: image

Sawmonabo commented 1 year ago

Were you able to test around with the script implementation? Using the RedocTryItOut.init(), how did you get the options parameter to work and take multiple arguments?

homestar9 commented 1 year ago

Hi @Sawmonabo, I couldn't figure out how to get Redoc to show a list of all servers in a dropdown. RedocTryItOut sends all requests to the first server in the servers array. There doesn't seem to be a way to select which server you want to send requests to.