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
window.onload = function() {
//<editor-fold desc="Changeable Configuration Block">
// the following lines will be replaced by docker/configurator, when it runs in a docker-container
window.ui = SwaggerUIBundle({
//url: "https://petstore.swagger.io/v2/swagger.json",
spec: {
"openapi": "3.1.0",
"info": {
"title": "Swagger Petstore - OpenAPI 3.1",
...
},
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
});
//</editor-fold>
};
Describe the bug you're encountering
Dear swagger-ui team,
there occurs the error „Resolver error at requestBody.content.application/json.schema.$ref“ when using swagger-ui as standalone without server, withe "spec" core parameter istead of "url".
This means that the dereference/resolution will now work in file system mode. baseURI is estabilished as file:///home/char0n/Documents/GitHub/swagger-ui/dist/index.html and from security reasons, SwaggerUI will NOT try to read any additional files from your filesystem due to the security reasons.
You need to serve your index.html under some HTTP server to have something like this in your browser URL bar (it needs to be served under HTTP or HTTPS protocol):
http://localhost:3200/
Now the baseURI is established as http://localhost:3200/ which dereference/resolution can and will access.
Q&A
Content & configuration
Example Swagger/OpenAPI definition:
Swagger Petstore OpenAPI 3.1 release 1.0.6 - openapi.json
Swagger-UI configuration options:
Describe the bug you're encountering
Dear swagger-ui team,
there occurs the error „Resolver error at requestBody.content.application/json.schema.$ref“ when using swagger-ui as standalone without server, withe "spec" core parameter istead of "url".
To reproduce...
Steps to reproduce the behavior:
url: "https://petstore.swagger.io/v2/swagger.json
, as comment ->//url: "https://petstore.swagger.io/v2/swagger.json
,spec:
– See also swagger-ui configuration – Core – Parameters namespec
spec:
,
after itExpected behavior
No error
Screenshots
The text was updated successfully, but these errors were encountered: