Open SAJLinders opened 2 years ago
Guess this is related to this issue: https://github.com/swagger-api/swagger-ui/issues/7835
I just tested it locally. I got it working with setting DEEP_LINKING=true But only in combination with QUERY_CONFIG_ENABLED=true
Background:
As a part of my job I work on a distributed web application containing of several (micro-) services. We have a Swagger file for every one of these services and store them in a raw repository. I have deployed a NodeJS project using swagger-ui-express to easily visualize the various API definitions from the raw repository.
A simplified example of how this is done can be seen below:
Problem:
When a link to a specific definition is shared to someone in the team, the query parameter is not respected. Imagine I wanted to share the URL to the following definition:
Regardless of the value of urls.primaryName, the default definition (being the first in the list) would always be rendered. Ideally, the value of this query parameter would be used to determine which definition should be displayed.
Hacky fix:
Because the first element in the swaggeroptions.urls array is used to determine which definition should be loaded first, I extracted the urls.primaryName parameter from the URL by hand. And then if I find a definition matching that name, I move it to the front of the array.