We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I use the php-symfony generator to generate some models. One of them has an array property, that contains objects
When I generate the model, the generated setter has the wrong typehint:
/** * Sets myProp. * * @param \MyNamespace\MyObject[] $myProp * * @return $this */ public function setMyProp(MyObject $myProp) { $this->myProp= $myProp; return $this; }
The method expects an array of objects, the generated PhpDoc is right but not the type hint
3.3.2-SNAPSHOT
MyArray: type: object required: - myProp properties: myProp: type: array items: $ref: "#/components/schemas/MyObject"
java -jar /opt/openapi-generator-cli/openapi-generator-cli.jar generate -DsrcBasePath=app/src -DvariableNamingConvention=camelCase -DphpLegacySupport=false -Dmodels -DmodelTests=false -DmodelDocs=false --invoker-package MyPackage --model-package MyModelPackage --model-name-suffix DTO -i openapi.yaml -g php-symfony -o /var/project
The text was updated successfully, but these errors were encountered:
fix OpenAPITools#1272 Fix wrong PHP Symfony typehint
b777d10
A model with an array property used to have the wrong PHP typehint in the setter: the array item object type instead of "array"
fix #1272 Fix wrong PHP Symfony typehint (#1453)
7f8ff35
fix OpenAPITools#1272 Fix wrong PHP Symfony typehint (OpenAPITools#1453)
9f2c233
Successfully merging a pull request may close this issue.
Description
I use the php-symfony generator to generate some models.
One of them has an array property, that contains objects
When I generate the model, the generated setter has the wrong typehint:
The method expects an array of objects, the generated PhpDoc is right but not the type hint
openapi-generator version
3.3.2-SNAPSHOT
OpenAPI declaration file content or url
Command line used for generation
java -jar /opt/openapi-generator-cli/openapi-generator-cli.jar generate
-DsrcBasePath=app/src
-DvariableNamingConvention=camelCase
-DphpLegacySupport=false
-Dmodels
-DmodelTests=false
-DmodelDocs=false
--invoker-package MyPackage
--model-package MyModelPackage
--model-name-suffix DTO
-i openapi.yaml
-g php-symfony
-o /var/project
The text was updated successfully, but these errors were encountered: