Expected behaviour:
Host: test.com/api
Sets the Host to test.com/api
Actual behaviour:
✖ Swagger Error
The host (name or ip) of the API. Example: 'swagger.io'
Jump to line 5
Details
Object
code: "PATTERN"
message: "String does not match pattern ^[^{}/ :\\]+(?::\d+)?$: test.com/api"
path: Array [1]
0: "host"
description: "The host (name or ip) of the API. Example: 'swagger.io'"
level: 900
type: "Swagger Error"
lineNumber: 5
The swagger spec says the host can only be a hostname or ip address. It does not support path.
If you want to use a subdirectory then look into the basePath property.
https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md
"The host (name or ip) serving the API. This MUST be the host only and does not include the scheme nor sub-paths. It MAY include a port. If the host is not included, the host serving the documentation is to be used (including the port). The host does not support path templating."
Thank you. A hint in the editor error to this specification may be nice, I'm certainly not the only one running into this. I'm closing this issue.
Most helpful comment
The swagger spec says the host can only be a hostname or ip address. It does not support path.
If you want to use a subdirectory then look into the basePath property.
https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md
"The host (name or ip) serving the API. This MUST be the host only and does not include the scheme nor sub-paths. It MAY include a port. If the host is not included, the host serving the documentation is to be used (including the port). The host does not support path templating."