-
Notifications
You must be signed in to change notification settings - Fork 135
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
Matching paths with parameters does not recognize due to failing to split on extension .
#261
Comments
Thanks for the bug report, I didn't know the problem Probably it doesn't matter how we divide the path. This method split these paths by
And we doesn't supported even if multiple parameters are put in one hierarchy. Perhaps, I think we can fix this problem by these changes.
Thanks your good issue :) |
@ota42y I've started a pull request on my local copy of the repo to address this feature in |
This issue can be closed by updating |
@ota42y I can easily make a PR to In my case, I would very much like to make use of the new changes I implemented in I am not sure of the normal release process for this Gem... |
You can use the latest
I released for different reasons, so we can use If you want to use newest |
Foremost, thanks for the great Gem.
I am applying this Gem retroactively to a project to add an OAS3 specification to its API. The API in question explicitly requires the response format as part of the URL, instead of a MIME type. I believe Committee cannot recognize this at the moment, thus I'm leaving an issue here. I'm happy to help fix, but given that is my first issue, I wanted to reach out first.
Here's the issue: for my project, if I want to update an object called a
Fribble
, with the ID parameter123
, I would call:... to invoke the API. In my OAS3 document, it looks like this:
Expected behavior: path matches, and my request/response is validated by Committee.
Actual behavior: path does not match, and nothing is validated.
Upon investigation, I noticed that
OpenAPIParser::PathItemFinder
splits path names on the/
character when trying to infer path parameters inmatching_paths_with_params
.Doing so leaves my actual parameter --
123
-- mixed in with.json
, which does not match the parameter type ofinteger
(at least, I am assuming this is why it does not match), and thus, I assume that the request remains unmatched.I locally can "fix" the problem by changing the
split('/')
method to instead split on forward slashes or periods:split(/[\/\.]/)
, however I feel that that may have adverse effects as well if paths had periods in them (which is totally valid).I could attempt to fix this by only splitting on the
.
when it is at the end of the request path (e.g. there is no trailing/
afterward).If I am merely "holding it wrong", I sincerely apologize for raising the issue; I do understand that the API spec I am trying to model is quite odd in its interpretation, but that is precisely why I want to use this tool to improve it :)
Thanks in advance for your time.
The text was updated successfully, but these errors were encountered: