-
Notifications
You must be signed in to change notification settings - Fork 21
Add placeholders to method naming client generator to avoid duplicate… #128
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
… case when there's placeholdered and placeholderless URIs with same method on resource
|
Note: CI seems broken / something with composer version. |
|
The problem happens when we have URIs with same HTTP method for same URI prefix with and without placeholder. E.g. THere're multiple cases of such issue at least in delivery-admin-api-client Screenshot illustrating problem and fix This is a breaking version change as it renames methods, so consumers must beware to properly update their code to new names, if placeholdered variant happened to come after placeholderless, as now after change placeholderless version would be calling other endpoint / previously overwritten. How to test: Run command bin/console js-generator:package <path_to_api_spec_raml_repo>/raml/app-delivery-api/admin-api-client/api.raml ./generated delivery-admin-api-client --library_name=@paysera/delivery-admin-api-client Check ./generated/src/service/DeliveryAdminApiClient.js Assert duplicate placeholderless/placeholdered endpoints with same URI and method are now disambiguated by |
| return ''; | ||
| } | ||
|
|
||
| return '_by' . ucfirst(str_replace(['{', '}'], '', $part->getPlaceholder())); |
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.
Please add test case that reflects the change, thanks. Looks like the change changes case...
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.
@mSprunskas
I could probably add to cover specifically this case, but there's big problem with this repo and tests as noted on prev note.
Existing tests in this repo broken for me / reporting various composer package version mismatches(why are tests checking that) and at least newline mismatches(mb someone commited it with windows CRLFs) in like 98%+ of tests.
Also gitlab pipelines seem broken because of wrong composer version i guess.
I don't have scope to fix all issues of this 8-year old repo on this ticket.
So not sure if there would be much use with that state, as added test case would be only intended for manual run at that point, which is barely any use beyond what QA will check.
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.
@mSprunskas ping
|
closed as can't run tests on this repo on my machine |


… case when there's placeholdered and placeholderless URIs with same method on resource