Skip to content

PropertyFilter generated description isn't shown as parameter description in openapi #5415

@frankdekker

Description

@frankdekker

API Platform version(s) affected: 3.1.2

Description
In the PropertyFilter.php::getDescription method a nice description is generated, but this message doesn't appear in openapi docs.
image

How to reproduce
Create resource with GetCollection and add a PropertyFilter

#[ApiResource(operations: [new GetCollection(security: 'is_granted("USER")')])]
#[ApiFilter(PropertyFilter::class, arguments: [])]

The parameter description of this field isn't displayed in openapi docs

Possible Solution
In OpenApiFactory.php::getFiltersParameters the description is retrieved for each filter. There the property $data['description'] is used as description for the filter. The PropertyFilter.php however returns $data['openapi']['description'] and $data['swagger']['description']. These properties aren't used and get lost. A solution would be to also set the $data['description'] property in PropertyFilter.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions