-
Notifications
You must be signed in to change notification settings - Fork 764
Closed
Description
environment:
swagger-js version: v3.8.0
test case:
const spec = {
openapi: '3.0.0',
servers: []
}
const res = baseUrl({
spec,
server: 'http://some-invalid-server.com/',
contextUrl: 'http://google.com/'
})
expect(res).toEqual('http://google.com')
error:
1) buildRequest - OpenAPI Specification 3.0 baseUrl should fall back to contextUrls if servers list is empty:
TypeError: Cannot read property 'url' of undefined
at oas3BaseUrl (src/execute/index.js:284:25)
at baseUrl (src/execute/index.js:261:23)
at Context.<anonymous> (test/oas3/execute/main.js:799:19)
potential fix:
how I found the bug:
Metadata
Metadata
Assignees
Labels
No labels