required-api-declaration-base-path
Overview
This rule belongs to the swagger-v1-validation
ruleset and states that:
The root object of a Swagger v1 API Declaration document must specify the absolute URL serving the current API being defined, using the basePath
property. If a base URL is not provided, a dummy value may be assigned at the time of import/transformations in APIMatic.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Required property basePath in root object of API Declaration document is missing. |
Code | SWAGGER1_V201 |
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
- Add missing
basePath
property in the root object i.e. in the top level properties of the document. - Make sure that the
basePath
property is not empty or null. - Ensure that the
basePath
URL is an absolute path and points to where the API is served. - The base path of the API is not necessarily the same as the path to a Resource Listing or API Declaration document.