Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Symfony validator does not honour (or at least collect info for) #SerializedName #60497

Open
@redbullmarky

Description

@redbullmarky

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:

#[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 todisplayName and, whilst this is not incorrect, it's not hugely useful.
Generally speaking, the value specified in#[SerializedName] is theexternal name. Perhaps the one relating to the API field, or the input field's name.

Possible Solution

Possible solutions:

  1. acknowledge theSerializedName by gathering it into another property, or perhaps:
  2. 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

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp