Skip to content

[serializer] Extra attributes may throw exception when denormalize #19948

Closed
@juliendidier

Description

@juliendidier

During the denormalization of an object, the AbstractObjectNormalizer do not throw exception when an attribute is not in allowed. As a result I can denormalize an array to an object with not mapped attributes.

I'm currently designing an API.
Users are not allowed to send extra attributes that are not mapped to my class.
I want to throw an exception on this case.

Is it possible to implement this feature inside the Serializer component ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureGood first issueIdeal for your first contribution! (some Symfony experience may be required)Serializer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions