-
Notifications
You must be signed in to change notification settings - Fork 9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Address getting configUrl value from options in query #9819
Address getting configUrl value from options in query #9819
Comments
It looks like this line const configURL = queryOptions.config ?? mergedOptions.configUrl was added in 8130168 as: let configUrl = queryConfig.config || constructorConfig.configUrl It actually included this logic that was there before, added in f22a628: swagger-ui/src/plugins/configs/index.js Lines 46 to 47 in f22a628
For the mentions of There are three options of passing config:
- add a query parameter `config` with URL to a server where the configs are hosted. For ex. http://petstore.swagger.io/?configs=http://localhost:3001/config.yaml
- add a config `configUrl` with URL to SwaggerUIBundle
- change default configs in `swagger-config.yaml` *Note: after changing, the project must be re-built*
These options can be used altogether, the order of inheritance is following (from the lowest priority to the highest):
`swagger-config.yaml` -> config passed to `SwaggerUIBundle` -> config fetched from `configUrl` passed to `SwaggerUIBundle` -> config fetched from URL passed as a query parameter `config` So it looks like this difference might have been done so that the query config takes precedence as we didn't merge it into the configs before: Line 39 in 8130168
we just got query options separately later: Line 69 in 8130168
Currently, In my opinion, we can remove the |
So this at least does confirm my assumptions in #9818 |
This confirms my stipulation that it's a compile time thing |
Notice the Currently this works: http://petstore.swagger.io/?config=http://localhost:3001/config.yaml This doesn't work at all: |
Addressed in #9840 |
According to our docs, the setting for getting configuration options from an URL is
configUrl
.In our code, we have the following for getting the
configUrl
from our defined options:swagger-ui/src/core/index.js
Line 64 in 68eb346
We need to investigate whether this
config
option is expected somewhere else or if we can safely change this toas
mergedOptions
should have theconfigUrl
fromqueryOptions
, if it was defined there.If we do this change, we need to properly document it, as some users might be using
config
instead ofconfigUrl
.The text was updated successfully, but these errors were encountered: