Skip to main content

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.

PropertyValue
EnabledYes
Maximum SeverityError
MessagePath templating found in the basePath which is not supported.
CodeSWAGGER20SYNTAX_V003
TypeValidation
Rule SystemSyntax
Broad CategoryAPI Server
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsswagger2 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. The basePath field should be a fixed value that represents the common path prefix for all API endpoints.

For More Information