-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Avoid return type when method does not return #20639
base: master
Are you sure you want to change the base?
Conversation
the change makes sense to me can you please update the samples to fix https://github.com/OpenAPITools/openapi-generator/actions/runs/13258449446/job/37009641140?pr=20639 ? thanks for the PR |
Signed-off-by: Viktor Szépe <[email protected]>
Done 🍏 |
Seems like the return type was left there to have "void". |
cc @juanavilactn as well shall we keep the |
@@ -185,7 +187,7 @@ use {{invokerPackage}}\ObjectSerializer; | |||
{{#vendorExtensions.x-group-parameters}} | |||
array $associative_array | |||
{{/vendorExtensions.x-group-parameters}} | |||
): {{{vendorExtensions.x-php-return-type}}} | |||
){{#returnType}}: {{{vendorExtensions.x-php-return-type}}}{{/returnType}} |
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.
maybe we should keep it as seems like that's what the php community prefers: https://stackoverflow.com/a/33671413
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 note we get this: return type without return
statement: https://github.com/conedevelopment/billingo-php/blob/0504445fd3f060dedcb36ec0b7b1e04d12ca26c5/src/Api/BankAccountApi.php#L714-L721
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.
ah ok. looks like a different issue ...
i'll take a further look
* @return {{{vendorExtensions.x-php-doc-return-type}}} | ||
{{/returnType}} |
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.
in other languages such as java, the doc is also completely omitted if it's void so make senses php follows the same.
cc |
I don't really know what I'm doing but return tag and return type should not be present when the method does not return anything.
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master
(upcoming7.x.0
minor release - breaking changes with fallbacks),8.0.x
(breaking changes without fallbacks)