ErikWittern / openapi-snippet

Generates code snippets for given Swagger / Open API documents
MIT License
115 stars 66 forks source link

Issues with multiple servers in swagger file #62

Open sukanya-ramakrishnan opened 3 years ago

sukanya-ramakrishnan commented 3 years ago

I have a swagger file with multiple servers in the file(came across such a file accidentally). The swagger UI is rendered with a select in this case on my web page. But the results got from openApiSnippets seems to default to the first server only always. I can work around it by changing the json object sent to openapisnippets everytime when the selection of server is changed, but can this be fixed at the openapi-snippets project level please ?

ErikWittern commented 3 years ago

@sukanya-ramakrishnan Thanks for filing the issue. This library at the moment does indeed arbitrarily chose the first server.

I think exposing an option to select which server to use may require a larger API change, see https://github.com/ErikWittern/openapi-snippet/issues/64.