Recommended

path-declarations-must-exist


Formats: Severity:

JSON Path: $.paths

When defining Paths and using Path Parameters It’s important to not add blank declarations.

This rule checks that no paths is using empty path parameters.

Why did this violation appear?

One or more paths definitions has an empty parameter defined.

Bad example

 paths:
  /pizza/{}/{icecream}:
    get:
      parameters:
        - in: path
          name: "icecream"  
          ...

Good example

 paths:
  /pizza/{cake}/{icecream}:
    get:
      parameters:
      - in: path
        name: "cake"
      - in: path
        name: "icecream"  
        ...

How do I fix this violation?

Ensure there are no empty ‘{}’ path parameters defined anywhere.

Spectral Equivalent

The rule is equivalent to path-declarations-must-exist