fix(common): handle missing host and basePath in OpenAPI URL parsing (#4908)
Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com>
This commit is contained in:
parent
2b5395011a
commit
5f3a7754d5
1 changed files with 3 additions and 1 deletions
|
|
@ -745,7 +745,9 @@ const parseOpenAPIUrl = (
|
|||
**/
|
||||
|
||||
if (objectHasProperty(doc, "swagger")) {
|
||||
return `${doc.host}${doc.basePath}`
|
||||
const { host = "<<baseUrl>>", basePath = "" } =
|
||||
doc satisfies OpenAPIV2.Document
|
||||
return `${host}${basePath}`
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue