Skip to main content

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.

PropertyValue
EnabledYes
Maximum SeverityError
MessageRequired property basePath in root object of API Declaration document is missing.
CodeSWAGGER1_V201
TypeValidation
Rule SystemSemantic
Broad CategoryAPI Declaration
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsswagger1 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.

For More Information