path-name-begin-with-forward-slash
Overview
This rule belongs to the swagger-v2-syntax-validation
ruleset and states that:
In Swagger 2.0, each path within the paths
section should start with a leading slash (/
). This violation occurs when a path name is defined without the required leading slash, which is mandatory according to the Swagger 2.0 specification.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Path name does not begin with a leading slash. |
Code | SWAGGER20SYNTAX_V020 |
Type | Validation |
Rule System | Syntax |
Broad Category | Paths |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | swagger2 swagger syntax validation path name leading slash |
Suggested Fixes
- Add a leading slash to the path name: Review the paths defined in your Swagger 2.0 specification. Ensure that each path name starts with a leading slash (
/
). For example, if you have a path likeusers/{id}
, modify it to/users/{id}
.