Description
Version
4.26
Description
Whenever I document a property that has a getter method with the word "ADD" in its name, the bundle fails with the following error:
The PropertyInfo component was not able to guess the type of Company::$edAt. You may need to add a `@var` annotation or use `@OA\Property(type="")` to make its type explicit
In this error, the property addedAt
has a getter method with the same name addedAt()
, and the bundle parses or interprets the ADD part, and only reads the rest (in this case edAt
).

Company class
#[Schema(properties: [
new Property(property: 'id', type: 'string', example: '8a8f8e8e-8e8e-8e8e-8e8e-8e8e8e8e8e8e'),
new Property(property: 'name', type: 'string', example: 'Agency Name'),
new Property(property: 'addedAt', type: 'integer', example: 1631610000),
])]
class Company
{
public function addedAt(): int
{
return $this->addedAt;
}
Company Controller
class CompanyController extends SymfonyController
{
#[Get(description: 'Get company details', summary: 'Get company details')]
#[Response(content: new JsonContent(properties: [
new Property(property: 'data', ref: new Model(type: Company::class))
]))]
public function index()
{
Additional context
Check this reproducible repository, and you can see it yourself.
https://github.com/tomasvts/nelmioApiDocBundleBug
Note: If I change the name of the getter to getAddedAt(), the problem goes away, which is the temporary solution I'm using. Nevertheless, I believe I have the right to name my getters the way I want.