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
#56962 appears to reference the same/similar issue however it's closed as completed. The validator does not collect any information about the #SerializedName, limiting the validator's usefulness when dealing with any kind of renamed fields.
How to reproduce
Essentially, if you had a property set up as such:
#[SerializedName('display_name')]
#[Assert\NotBlank()]
public string $displayName;
The validator, on failing, does not have any details that allow you to meaningfully respond to whatever "client" you might have. You'll get an error relating to displayName and, whilst this is not incorrect, it's not hugely useful.
Generally speaking, the value specified in #[SerializedName] is the external name. Perhaps the one relating to the API field, or the input field's name.
Possible Solution
Possible solutions:
acknowledge the SerializedName by gathering it into another property, or perhaps:
provide a method for fetching an object that relates to the property - metadata or reflection instance or whatever - so that these things can be extracted.
Additional Context
No response
The text was updated successfully, but these errors were encountered:
Symfony version(s) affected
6.4
Description
#56962 appears to reference the same/similar issue however it's closed as completed. The validator does not collect any information about the #SerializedName, limiting the validator's usefulness when dealing with any kind of renamed fields.
How to reproduce
Essentially, if you had a property set up as such:
The validator, on failing, does not have any details that allow you to meaningfully respond to whatever "client" you might have. You'll get an error relating to
displayName
and, whilst this is not incorrect, it's not hugely useful.Generally speaking, the value specified in
#[SerializedName]
is the external name. Perhaps the one relating to the API field, or the input field's name.Possible Solution
Possible solutions:
SerializedName
by gathering it into another property, or perhaps:Additional Context
No response
The text was updated successfully, but these errors were encountered: