Skip to content

Discrepancy found on swagger schema 2.0 and swagger schema description in spec #329

@pegasusess

Description

@pegasusess

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:

"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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions