This rule belongs to the
swagger-v2-syntax-validation ruleset and states that:
In Swagger 2.0, the
host field is used to specify the hostname (and optionally the port number) where the API is hosted. The violation occurs when path templating, which is the use of variables within the host field, is detected. Path templating is not supported in the
host field according to the Swagger 2.0 specification.
|Message||Path templating found in the host which is not supported|
|Broad Category||API Server|
|Products Impacted||API Transformer, Code Generation, Developer Experience Portal|
- Remove path templating from the host: Review the
hostfield in your Swagger 2.0 specification and ensure that it contains a static hostname (and optionally a port number) without any variables or placeholders. The
hostfield should be a fixed value that represents the actual host where the API is hosted.
- Use path parameters instead: If you need to include dynamic elements in the host field, consider using path parameters in the
pathssection of your Swagger specification instead. Path parameters allow you to define variables within the path of individual API endpoints, rather than in the