valid-api-declaration-base-path
Overview
This rule belongs to the swagger-v1-validation ruleset and states that:
An API Declaration document can define the base path at which the API being defined is served, using the basePath property. This path must be an absolute URL path as relative paths are not allowed.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Error |
| Message | Base path provided for the API using property basePath is invalid. |
| Code | SWAGGER1_V202 |
| Type | Validation |
| Rule System | Semantic |
| Broad Category | API Declaration |
| Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
| Tags | swagger1 swagger semantic validation base path api api declaration |
Suggested Fixes
- Ensure that the
basePathvalue is not a relative path. - Make sure that the
basePathproperty is not empty or null. - Ensure that the
basePathURL is an absolute path and points to where the API is served. - Ensure that the base path value does not contain any forbidden characters.
- The base path of the API is not necessarily the same as the path to a Resource Listing or API Declaration document.