stoplightio / spectral

A flexible JSON/YAML linter for creating automated style guides, with baked in support for OpenAPI v3.1, v3.0, and v2.0 as well as AsyncAPI v2.x.
https://stoplight.io/spectral
Apache License 2.0
2.37k stars 228 forks source link

path params isn't working for params with "." in the name #2546

Open fantapop opened 9 months ago

fantapop commented 9 months ago

Describe the bug I'm getting an error from the path-params checker saying that a parameter is unused in the path however its clearly being used. I believe this is because the parameter name includes a ".". According to #1969, there should be no restrictions on characters in the path parameters.

To Reproduce

  1. Given this OpenAPI Document: petstore.json and a recommended ruleset.json

  2. Run this CLI command: spectral lint petstore.json --ruleset ruleset.json

  3. See error

    24:11    error  path-params            Parameter "pet.id" must be used in path "/pets/{pet.id}".      paths./pets/{pet.id}.get.parameters[0]

    Expected behavior I expect there to be no path-params error