-
-
Notifications
You must be signed in to change notification settings - Fork 929
Refactor Swagger paths generation #698
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
LGTM, thanks @teohhanhui |
private function getPath(string $resourceShortName, array $operation, bool $collection) : string | ||
{ | ||
$path = $this->operationPathResolver->resolveOperationPath($resourceShortName, $operation, $collection); | ||
if (substr($path, -10) === '.{_format}') { | ||
if ('.{_format}' === substr($path, -10)) { |
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.
It looks not very solid to rely on such hardcoded values (missed it on previous PRs). Anyway, it's not related with this PR and can be fixed in another PR.
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.
Yes, there are many other issues I've identified. But this PR is just for refactoring / better code quality.
Looks good to me 👍. By curiosity, why do you use |
Because PHP sucks. Also, I see that we might want to turn these into VOs so this is a good first step? |
0183a98
to
56ab5bb
Compare
Thanks @teohhanhui |
Refactor Swagger paths generation
Some refactoring but also fixed
$operation['swagger_context']
handling by checking for existing values./cc @Simperfit