You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
According to this definition, ip_address:port_number should make a valid 'host' field. However when I tried to validate my swagger json doc against swagger json schema (which can be found on http://swagger.io/v2/schema.json), 'host' field has to follow the following format:
"host": {
"type": "string",
"format": "uri",
"pattern": "^[^{}/ :\\\\]+(?::\\d+)?$",
"description": "The fully qualified URI to the host of the API."
}
ip_address:port_number failed on this validation check. Only when I changed it to domain_address:port_number,, this validation check is passed successfully.
this has caused confusion. Please make the description in spec match with the schema
The text was updated successfully, but these errors were encountered:
It's the other way around @pegasusess - the problem is with the schema, not the spec. We caught this issue yesterday and I'm a bit baffled by it. This an issue with the escaping in the regex which shouldn't occur, but I'll investigate more tomorrow.
Hi, I just found this issue after raising a PR that I think fixes this. I ran into a similar confusion around validating using a range of tools, some passed and some failed, here's my PR with my explanation of what I believe is the problem: #420
I think the regex is fine, it just conflicts with the format: uri, and how different validators deal with the conflict is undefined.
According to swagger schema spec (which can be found on https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md), the field "host" should be as following:
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.
According to this definition, ip_address:port_number should make a valid 'host' field. However when I tried to validate my swagger json doc against swagger json schema (which can be found on http://swagger.io/v2/schema.json), 'host' field has to follow the following format:
ip_address:port_number failed on this validation check. Only when I changed it to domain_address:port_number,, this validation check is passed successfully.
this has caused confusion. Please make the description in spec match with the schema
The text was updated successfully, but these errors were encountered: