PayU / openapi-validator-middleware

Input validation using Swagger (Open API) and ajv
Apache License 2.0
144 stars 50 forks source link

Invalid Server URL error #154

Closed udamir closed 3 years ago

udamir commented 3 years ago

I don't want to put a specific url of server in OpenAPI file, as it can be used in different environments, so I use the following:

openapi: '3.0.2'
servers:
  - url: /api

On init method I get the error:

TypeError [ERR_INVALID_URL]: Invalid URL: /api
    at onParseError (internal/url.js:257:9)
    at new URL (internal/url.js:333:5)
udamir commented 3 years ago

Issue will be resolved with PR https://github.com/PayU/api-schema-builder/pull/69