no-paths-key-trailing-slash
Overview
This rule belongs to the openapi-v3-apimatic-syntax-linting
ruleset and states that:
Keep trailing slashes off of paths, as it can cause some confusion. Some web tooling (like mock servers, real servers, code generators, application frameworks, etc.) will treat example.com/foo and example.com/foo/ as the same thing, but other tooling will not. Avoid any confusion by just documenting them without the slash, and maybe some tooling will let people shove a / on there when they're using it or maybe not, but at least the docs are suggesting how it should be done properly.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Warning |
Message | Path key should not have a trailing slash. |
Code | OPENAPI3APIMATICSYNTAX_L180 |
Type | Linting |
Rule System | Syntax |
Broad Category | OpenAPI Paths |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi syntax linting apimatic path trailing slash |
Suggested Fixes
- Ensure that there is no trailing slash in path keys.