[PHP-Symfony] Wrong type hint in model setter
Created by: LudoMon
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:
/**
* 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
openapi-generator version
3.3.2-SNAPSHOT
OpenAPI declaration file content or url
MyArray:
type: object
required:
- myProp
properties:
myProp:
type: array
items:
$ref: "#/components/schemas/MyObject"
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