-
Notifications
You must be signed in to change notification settings - Fork 54
Recognize path parameters in path segment fragments #39 #40
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
Conversation
I am not sure if this is supported for openapi 2.0 spec |
Codecov Report
@@ Coverage Diff @@
## master #40 +/- ##
==========================================
+ Coverage 84.49% 84.53% +0.04%
==========================================
Files 10 10
Lines 1412 1429 +17
==========================================
+ Hits 1193 1208 +15
- Misses 177 178 +1
- Partials 42 43 +1
Continue to review full report at Codecov.
|
Hi @casualjim, thank you for looking into this. I don't find the Open-API 2.0 spec explicitly allowing this URI template usage but neither forbidding this usage of URI templates. There is a related ticket about this URI template usage at OAP/OpenAPI-Specification where Ron mentioned that the spec itself does not forbid this usage. |
ok, but making this work for just validation might not be enough, are you planning on also sending a PR to the runtime to support this in the router? |
Yes. i'll work on the corresponding change to the server side and create a PR. It seems the denco code that does the parameters extraction needs to be modified. The path matching is actually working and the operation is fired but the parameters are not extracted correctly. By the way, why the denco code is in middleware/ and not in vendor? Has it been customized locally? |
Hi @casualjim, By the way, without this change in go-openapi/runtime, the client side code already works fine and also the server side code if there is one parameter per segment e.g. So maybe, you could merge this PR into validation and I can open an issue in runtime to track this more-than one param per segment at the server side issue? regards, aki |
@elakito 🥇 thanks |
PR for #39