Skip to content

Bug: BackedEnumFilter does not support integer-backed enums (e.g. enum Status: int) #7126

Closed
@MeronNagy

Description

@MeronNagy

API Platform version(s) affected: 4.1.7

Description
The built-in BackedEnumFilter does not support enums backed by integers. When attempting to filter using such enums, API Platform logs "Invalid filter ignored" and the filter is not applied.

How to reproduce
Minimal reproduction repo: https://github.com/MeronNagy/api-platform-integer-backed-enum
Includes a working and non-working example with full README instructions.

Possible Solution
Converting string $value to integer in the normalizeValuefunction in BackendFilterTrait.
I will link a PR shortly.

Solved:
#7127

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions