Hello,
I’ve noticed an issue with the handling of the externalDocs URL in the OpenAPI specification.
The generated link is always rendered as:
<a href>Navigate to documentation ↗</a>
Even when a valid URL is provided in the OpenAPI spec, for example:
externalDocs:
description: "More details here"
url: http://localhost:8080/doc/more/details
It seems the issue originates from the method:
src/utils/common-utils.js#getSanitizedUrl
The problem is that the URL object returns the protocol with a trailing colon (http: or https:), not http or https.
As a result, the validation fails and the `` attribute ends up empty.
I proposed the fix below :
return url.protocol === 'http:' || url.protocol === 'https:' ? url : '';
The reference:
URL Standard – protocol
"The protocol getter steps are to return this’s URL’s scheme, followed by U+003A (:)."
Thanks for your work, I really appreciate it.
Hello,
I’ve noticed an issue with the handling of the externalDocs URL in the OpenAPI specification.
The generated link is always rendered as:
<a href>Navigate to documentation ↗</a>Even when a valid URL is provided in the OpenAPI spec, for example:
It seems the issue originates from the method:
src/utils/common-utils.js#getSanitizedUrlThe problem is that the URL object returns the protocol with a trailing colon (http: or https:), not http or https.
As a result, the validation fails and the `` attribute ends up empty.
I proposed the fix below :
return url.protocol === 'http:' || url.protocol === 'https:' ? url : '';The reference:
URL Standard – protocol
"The protocol getter steps are to return this’s URL’s scheme, followed by U+003A (:)."
Thanks for your work, I really appreciate it.