Comments (5)
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 configUrl
and config
in the docs, here's the commit where they were added: 8e80ca9
And the relevant lines about config:
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, queryOptions
and configUrl
are only used in https://github.com/swagger-api/swagger-ui/blob/master/src/core/index.js. I also tried search for config
but nothing looks like it's actually this parameter.
In my opinion, we can remove the queryOptions.config
- we don't have this option in our documentation and the configUrl
value should take precedence in mergedOptions
at this point.
from swagger-ui.
These options can be used altogether, the order of inheritance is following (from the lowest priority to the highest):
swagger-config.yaml
-> config passed toSwaggerUIBundle
-> config fetched fromconfigUrl
passed toSwaggerUIBundle
-> config fetched from URL passed as a query parameterconfig
So this at least does confirm my assumptions in #9818
from swagger-ui.
- change default configs in
swagger-config.yaml
Note: after changing, the project must be re-built
This confirms my stipulation that it's a compile time thing
from swagger-ui.
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
Notice the config
vs configs
discrepancy.
Currently this works:
http://petstore.swagger.io/?config=http://localhost:3001/config.yaml
http://petstore.swagger.io/?configUrl=http://localhost:3001/config.yaml
This doesn't work at all:
http://petstore.swagger.io/?configs=http://localhost:3001/config.yaml
from swagger-ui.
Addressed in #9840
from swagger-ui.
Related Issues (20)
- Resolver error: Could not resolve reference: Could not resolve pointer:
- Swagger UI not showing on vercel? I have a solution here it is HOT 1
- Only first path parameter is replaced in "Try it out" HOT 4
- ramda-adjunct tried to access ramda HOT 5
- Addition of audience parameter to oauth config
- OpenAPI 3.1.: examples in webhooks are being overwritten by the examples in schema HOT 4
- [OpenAPI 3.1] Example value is not generated for nested objects that are referenced via allOf HOT 11
- Add missing default configuration options HOT 6
- CSS source map is broken HOT 1
- operation level server override option always appears for OAS 3.1 specification HOT 2
- No name property is assigned to "Server" Combobox.
- 5.17.12 HOT 1
- Add a dark mode for the page
- swagger-ui-react: spec does not update on prop change and resets to default on page refresh HOT 1
- Path Parameter is not being passed through Request URL and Curl Command. HOT 3
- UI css scrambled
- Ensures the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds (.btn-primary)
- Swagger-UI DownloadURL autocomplete
- Resolver error at $ref Could not resolve reference: JSON Pointer evaluation failed while evaluating token "paths" against an unexpected Element
- Idk
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swagger-ui.