no-base-path-templating
Overview
This rule belongs to the swagger-v2-syntax-validation
ruleset and states that:
In Swagger 2.0, the basePath
field is used to specify the common path prefix for all API endpoints. This violation occurs when path templating, which involves using variables within the basePath field, is detected. Path templating is not supported in the basePath
field according to the Swagger 2.0 specification.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Path templating found in the basePath which is not supported. |
Code | SWAGGER20SYNTAX_V003 |
Type | Validation |
Rule System | Syntax |
Broad Category | API Server |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | swagger2 swagger syntax validation base path templating |
Suggested Fixes
- Remove path templating from the basePath: Review the
basePath
field in your Swagger 2.0 specification and ensure that it contains a static path without any variables or placeholders. ThebasePath
field should be a fixed value that represents the common path prefix for all API endpoints.