-
Notifications
You must be signed in to change notification settings - Fork 0
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
Changed path_item_finder to detect more complex path template patterns #1
Conversation
(from interagent/committee#261) Hi! But there is many bugs
|
@ota42y thanks a lot, I have added a commit with failing specs to cover your feedback. Will work on the implementation for now. I'll close this PR until we have it covered. |
I think we can convert path parameter to regexp 🤔 |
@ota42y your hunch was correct, this code is so much simpler by relying on the underlying Ruby regex engine. Thank you for the idea! I'm ready for review again; if you think this is reasonable, I can open a PR to the main repository. |
@ota42y The only thing I am not certain about is if we need to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is very good code.
But your concerns need to be checked.
Please check these test case.
{id}.json
and123-json
- dose not match.
{id>}.json
and1.json
- Parameter name is "
id>
" and that value is1
- The OpenAPI dosen't define valid character so I think any characters without
{}
is allowed- ( Please tell me if I misread.. I'm not good at English)
- https://github.com/OAI/OpenAPI-Specification/blob/3.0.3/versions/3.0.3.md#path-templating
- Parameter name is "
|
||
regex = schema_path.dup | ||
parameters.each do |parameter| | ||
regex = regex.gsub(parameter, "(?<#{param_name(parameter)}>.+)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 👍 👍
@ota42y Thanks for pointing this out; I've updated the code to escape the non-parameter components. Also, don't worry about your English - it's great! In the worst case, we can also speak Japanese 👍 |
Sorry for my late reply, I think this PR is perfect !!! 🎉 🎉 🎉 |
No description provided.