-
-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
matrix parameter type not supported with openapi3 #1863
Comments
Hey! |
Hey! I've tried to set up a working copy to check whether my changes are correct, but i hadnt succeeded. (cloned the repo, but havent found a working entry point :/ ) If you can help me set it up, i can check if my fix is correct. However I think the following change would do the trick: const pathRegex = /(\{;?\??[a-zA-Z0-9_-]+\*?\})/g; and probably this also needed: const p = match[0].replace(/[{}?*;]/g, ''); Also I'm not sure about the reasoning behind that trailing |
I made a PR with these changes, but cannot validate/test it on my own :/ |
Hey! Just add any examples, and the expected results and then run |
* support matrix parameter style for openapi3 #1863 * fix(ruleset): added tests for matrix parameters Co-authored-by: Jakub Rożek <jakub@stoplight.io>
# [@stoplight/spectral-rulesets-v1.2.6](https://github.com/stoplightio/spectral/compare/@stoplight/spectral-rulesets-v1.2.5...@stoplight/spectral-rulesets-v1.2.6) (2021-10-19) ### Bug Fixes * **rulesets:** support matrix parameter style for openapi3 ([#1864](#1864)) ([44b59d5](44b59d5)), closes [#1863](#1863)
🎉 This issue has been resolved in version @stoplight/spectral-rulesets-v1.2.6 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
Describe the bug
openapi 3 (or swagger2) supports matrix parameter style, which looks like this:
/foo/bar;key=value/baz
in this case, the query path should look like this:
/foo/bar{;key}/baz
.however its currently not supported, and gives the following error message:
Parameter "key" must be used in path "/foo/bar{;key}/baz".
It most probably comes from https://github.com/stoplightio/spectral/blob/develop/packages/rulesets/src/oas/functions/oasPathParam.ts#L5 , where the regex does not matches
;
. Note to mention, that it may also contains asterix (*
) and question mark (?
) by the specification.Also it seems it doesnt work even without the
;
, when there are more than one parameters are given.To Reproduce
Expected behavior
Expected to support matrix parameters :)
Environment (remove any that are not applicable):
6.0.0
Additional context
related specs: https://swagger.io/docs/specification/serialization/#query
The text was updated successfully, but these errors were encountered: