Skip to content

[Question]: Is using #[Context(...)] supposed to be supported? #2402

@mathroc

Description

@mathroc

Version

4.33.4

Question

I implemented a Symfony normalizer that supports normalizing / denormalizing enum by their name when adding a #[Context('_nelmio_enum_force_names' => true)] attribute and I'm trying to get nelmio to generate a model with type = string and using the enum names for the values in this case.

I created an EnumModelDescriber that does the same thing as the one in NelmioBundleDocBundle but also acceptd UnitEnum when _nelmio_enum_force_names is true in the serialization context. But the context is empty even if I add the #[Context('_nelmio_enum_force_names' => true)] attribute on the property holding the enum.

Is this expected?

Additional context

No response

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