You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ExactFilter on enum typed property is not generating enums in docs.jsonopenapi #3017
Description
I'm rewriting the legacy ApiFilter BackedEnumFilter to a #[QueryParameter] attribute using the ExactFilter that is kept in 6.0 (see this documentation: https://api-platform.com/docs/core/upgrade-guide/#legacy-doctrine-filters). The filter works but the enums are not generated anymore (which means the dropdown with available values is lost on the SwaggerUI). Now a normal text input is given which is not desired for our UI.
How to reproduce
So the old situation was: #[ApiFilter(BackedEnumFilter::class, properties: ['type'])]
This generated the enums belonging to this type property in the docs.jsonopenapi of our api
In the new situation a QueryParameter is used with ExactFilter:
#[ApiResource(
operations: [
new GetCollection(
'/activiteiten/bijeenkomsten{._format}',
parameters: [
'type' => new QueryParameter(
filter: new ExactFilter(),
property: 'type',
),
]
),
],
)]
to the requestParameter to retrieve the values of the enums here for the dropdown is not possible since only constant values can be given here.
Another idea is creating a custom filter and using the getOpenApiParameters() function to document the filter, but this seems impossible because ExactFilter is a final class.
changed the title [-]ExactFilter on enum typed property is not showing enums as dropdown in the swaggerUI[/-][+]ExactFilter on enum typed property is not generating enums in docs.jsonopenapi[/+]on Oct 19, 2026
Activity
[-]ExactFilter on enum typed property is not showing enums as dropdown in the swaggerUI[/-][+]ExactFilter on enum typed property is not generating enums in docs.jsonopenapi[/+]