As per swagger documentation,
Swagger-UI accepts configuration parameters in four locations.
From lowest to highest precedence:
- The swagger-config.yaml in the project root directory, if it exists, is baked into the application
- configuration object passed as an argument to Swagger-UI (SwaggerUI({ ... }))
- configuration document fetched from a specified configUrl
- configuration items passed as key/value pairs in the URL query string
I have tried to put swagger-config.yaml in root pat of application but its not working.
I have followed swagger Installation steps and its working correct. but steps for swagger custom config is not working. I have kept files as below,
swagger-ui
|--swagger-config.yaml
|--index.html
swagger-config.yaml
url: "https://petstore.swagger.io/v2/swagger.json"
dom_id: "#swagger-ui"
validatorUrl: "https://online.swagger.io/validator"
oauth2RedirectUrl: "http://localhost:3200/oauth2-redirect.html"
index.html
// Begin Swagger UI call region
const ui = SwaggerUIBundle({
//url: "https://petstore.swagger.io/v2/swagger.json",
//dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
})
Any idea if I am missing anything ?
npm start
? – Anabatic