fix: import openapi file servers url detection (#4373)

Co-authored-by: Claudio Pennati <claudio.pennati@lastminute.com>
This commit is contained in:
Claudio Pennati 2025-02-07 10:51:18 +01:00 committed by GitHub
parent 98a2631ba4
commit 35a471f120
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -735,7 +735,7 @@ const parseOpenAPIUrl = (
* Relevant v3 reference: https://swagger.io/specification/#server-object * Relevant v3 reference: https://swagger.io/specification/#server-object
**/ **/
if (objectHasProperty(doc, "servers")) { if (objectHasProperty(doc, "servers")) {
return doc.servers?.[0].url ?? "<<baseUrl>>" return doc.servers?.[0]?.url ?? "<<baseUrl>>"
} }
// If the document is neither v2 nor v3 then return a env variable as placeholder // If the document is neither v2 nor v3 then return a env variable as placeholder