This rule belongs to the
swagger-v2-standards-validation ruleset and states that:
In Swagger 2.0, the
host field is intended to represent the hostname (and optionally the port number) where the API is hosted. This violation occurs when the
host field includes the scheme (such as
https://) or sub-paths (additional path segments) that are not supported according to the Swagger 2.0 specification.
|Message||Scheme or sub-paths found in the host which is not supported.|
|Broad Category||Swagger Root Information|
|Products Impacted||API Transformer, Code Generation, Developer Experience Portal|
- If the host includes a schema, remove the scheme from the host: The
hostfield should only include the hostname and port number (if applicable), without the scheme. For example, instead of
api.example.comas the value of the
- If the host includes any sub-paths, remove sub-paths from the host: The
hostfield should only represent the hostname and port number, without any additional path segments. Ensure that the
hostfield contains the root domain or subdomain where your API is hosted, but not any sub-paths or additional path segments.