Forum Discussion
fgysin
6 years agoNew Contributor
I was able to solve our issue finally. We were using the wrong query parameter when calling SwaggerEditor it seems.
To correctly load (and resolve) the external YAML specification the query parameter configUrl
should be used (not url
!). For example:
http://127.0.0.1:8080/swagger-editor-master/?configUrl=http://127.0.0.1:8080/foo/bar.yaml
Where...
http://127.0.0.1:8080/swagger-editor-master/
points to the Swagger Editor, andhttp://127.0.0.1:8080/foo/bar.yaml
points to the spec file we want to reference from whatever we're currently editing in the Swagger Editor.
Used like this a reference to the external spec, e.g.
$ref: "http://127.0.0.1:8080/foo/bar.yaml#/components/schemas/Payment"
will be properly resolved in the Swagger UI on the right (e.g. in the Schemas section the referenced properties are expandable, etc.). However it seems that the editor doesn't throw an error if an invalid external reference is given (instead the Swagger UI just shows an 'empty' object).
Related Content
- 2 years ago
- 2 years ago
Recent Discussions
- 4 days ago