Closed chuck-flowers closed 1 year ago
There might be an issue with the latest update of the swagger-client and related code in /core/index.js https://github.com/swagger-api/swagger-ui/commit/d89726a24b88d7f5044da61309a6074965bb7a5d
Hi everybody,
The regression will most likely be in swagger-client which was recently heavily refactored. Specifically we've changed how URLs are resolved. Instead of legacy and deprecated url we now use https://url.spec.whatwg.org/.
Let me investigate what went wrong and why.
I can reproduce by passing spec
option directly to SwaggerUI.
SwaggerUI({
spec: {...},
})
Addressed in https://github.com/swagger-api/swagger-ui/pull/9214.
Explanation: if we pass spec
option without url
option, or if we pass a relative URI Reference as a value of url
option, we make it absolute just before the resolution. This is aligned with OpenAPI and JSON Schema specs.
Before we were running resolution on relative URI References, which was just wrong.
Q&A (please complete the following information)
Content & configuration
Example Swagger/OpenAPI definition (redacted):
Swagger-UI configuration options:
Describe the bug you're encountering
Erroneous error messages are showing up at the the top of the documenation page. This happens in
5.7.0
but not in5.6.2
.To reproduce...
Steps to reproduce the behavior:
Expected behavior
No errors should appear
Screenshots
Additional context or thoughts
I'm having trouble tracing where the error is happening based on the browser console but based on the stack trace it seems to be originating from the @swagger-api/apidom-reference in the
url.mjs
module