Skip to content

Incompatibilities caused by Symfony 7.4 due to internal changes to symfony/validator metadata class #1219

@bosam

Description

@bosam

Hi,

I have been migrating a project from 7.3 to 7.4 in preparation of release (they actually released at the time of me writing) and I have noticed an issue caused by this commit in the symfony/validator repository:

symfony/validator@29a8a56#diff-d9de9e155152165bf4c1664f1e24827951477245eba29119e1a676b5ee6e9af7

These changes turn the class ObjectMetadata ( https://github.com/overblog/GraphQLBundle/blob/master/src/Validator/Mapping/ObjectMetadata.php ) unable to access the properties of the parent MetadataClass.

The code now creates scoped $properties and $members instead of adding to the parent's properties.

What this causes is the failure for validating types of any kind before accessing mutations.

To validate my hypothesis, I managed to patch the ObjectMetadata class to use reflection in order to get the parent's properties and change them. It fixes the issue (same as replacing the symfony/validator file with the 7.3 version), but any of these solutions don't feel like an efficient one way.

Hopefully someone with more insight of the project can look into it and provide a fix for future 7.4 users.
Thank you!

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