Bug Report Checklist
Description
The return type in function declaration contains only one type, the doc comments can contain multiple (even not unique)
...
* @return \OpenAPI\Client\Model\Permission|\OpenAPI\Client\Model\OdataError|\OpenAPI\Client\Model\OdataError
*/
public function invite(
string $drive_id,
string $item_id,
?\OpenAPI\Client\Model\DriveItemInvite $drive_item_invite = null,
string $contentType = self::contentTypes['invite'][0]
): \OpenAPI\Client\Model\Permission
....
openapi-generator version
7.1.0
OpenAPI declaration file content or url
https://github.com/owncloud/libre-graph-api/blob/main/api/openapi-spec/v1.0.yaml
Generation Details
docker run --rm -v $PWD:/local openapitools/openapi-generator-cli:v7.1.0 generate --enable-post-process-file -i /local/api/openapi-spec/v1.0.yaml --additional-properties=packageName=libregraph --git-user-id=owncloud --git-repo-id=libre-graph-api-php -g php-nextgen -o /local/out/php-nextgen
Steps to reproduce
- generate PHP-nextgen code from the above specs
Suggest a fix
- ether set the return value to
mixed in
|
operation.vendorExtensions.putIfAbsent("x-php-return-type", operation.returnType); |
- or list all possible return types in the function declaration, but then it must be ensured that no type is repeated
Bug Report Checklist
Description
The return type in function declaration contains only one type, the doc comments can contain multiple (even not unique)
openapi-generator version
7.1.0
OpenAPI declaration file content or url
https://github.com/owncloud/libre-graph-api/blob/main/api/openapi-spec/v1.0.yaml
Generation Details
docker run --rm -v $PWD:/local openapitools/openapi-generator-cli:v7.1.0 generate --enable-post-process-file -i /local/api/openapi-spec/v1.0.yaml --additional-properties=packageName=libregraph --git-user-id=owncloud --git-repo-id=libre-graph-api-php -g php-nextgen -o /local/out/php-nextgenSteps to reproduce
Suggest a fix
mixedinopenapi-generator/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpNextgenClientCodegen.java
Line 183 in 48f454c