mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-06 21:30:21 +03:00
fix: wrong base url format causing error when constructing new URL
This commit is contained in:
parent
311d2ce64d
commit
7ceb434034
|
@ -58,7 +58,7 @@ export class OpenAPIParser {
|
||||||
this.spec = spec;
|
this.spec = spec;
|
||||||
this.allowMergeRefs = spec.openapi.startsWith('3.1');
|
this.allowMergeRefs = spec.openapi.startsWith('3.1');
|
||||||
|
|
||||||
const href = IS_BROWSER ? window.location.href : '';
|
const href = IS_BROWSER ? window.location.href : undefined;
|
||||||
if (typeof specUrl === 'string') {
|
if (typeof specUrl === 'string') {
|
||||||
this.specUrl = new URL(specUrl, href).href;
|
this.specUrl = new URL(specUrl, href).href;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ export class ExampleModel {
|
||||||
this.summary = example.summary;
|
this.summary = example.summary;
|
||||||
this.description = example.description;
|
this.description = example.description;
|
||||||
if (example.externalValue) {
|
if (example.externalValue) {
|
||||||
this.externalValueUrl = new URL(example.externalValue, parser.specUrl || '').href;
|
this.externalValueUrl = new URL(example.externalValue, parser.specUrl).href;
|
||||||
}
|
}
|
||||||
parser.exitRef(infoOrRef);
|
parser.exitRef(infoOrRef);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user