You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem:
I have multiple openAPI specs rendered on single page using swagger-ui. I don't want to authorize and write server variables to each of the API separately but do it once and use in all APIs. I was able to do the authorization part by using requestInterceptor and inserting the token based on the input inserted by the user but I struggle with server variables.
Is there a way to set a server variable using javascript based on user input coming from a field ?
Currently after the user sets the value in general field I set the value programatically in each server variable inputs coming from swagger-ui and trigger the change event on them but the computedUrl is not changing. Also when I click on any endpoint at the API the default value appears back again.
Q&A (please complete the following information)
Content & configuration
Swagger/OpenAPI definition:
Swagger-UI configuration options:
How can we help?
Problem:
I have multiple openAPI specs rendered on single page using swagger-ui. I don't want to authorize and write server variables to each of the API separately but do it once and use in all APIs. I was able to do the authorization part by using requestInterceptor and inserting the token based on the input inserted by the user but I struggle with server variables.
Is there a way to set a server variable using javascript based on user input coming from a field ?
Currently after the user sets the value in general field I set the value programatically in each server variable inputs coming from swagger-ui and trigger the change event on them but the computedUrl is not changing. Also when I click on any endpoint at the API the default value appears back again.
Code how setting the value looks like:
I would appreciate any hints how to achieve that.
The text was updated successfully, but these errors were encountered: