Open DanCRichards opened 1 week ago
I have started to work on this.
https://github.com/DanCRichards/spectral/tree/bugfix/2647-OpenAPI-Ruleset-Allow-Wildcard-In-Path
Note my latest commit doesn't take into consideration the fact that a path object should only be either alphanumeric (including -) or a wild card.
I am looking into it but the regex that I am developing is causing failures with other test cases.
Describe the bug The spectral:oas ruleset does not allow for {*} to be included within the path params.
To Reproduce
In the function above the expected argument is empty for the endpoint in question. The function is called by oasPathParams(path) function here
When running the endpoint path in question isn't validated against the regex and isn't added to the
pathElements
array, which is then passed through as the 'expected' path params object which raises the error.The regex defined here doesn't allow for the {*} to be defined. It is only looking for alphanumber characters and -.
Proof that this endpoint does not pass the regex can be found here
This can be fixed by adding * to the regex.
Additional context This error relates to fastify-swagger generating the documentation/static/{} endpoint for some other people this may be /docs/static/{}
Any one dealing with this error can modify their .spectral.yaml file to be.