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

[FrameworkBundle][Validator] Add ArrayLoader and wire it in semantic configuration#61831

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

@nicolas-grekas
Copy link
Member

QA
Branch?7.4
Bug fix?no
New feature?yes
Deprecations?no
Issues-
LicenseMIT

I'm submitting this PR for the record, because I didn't convince myself it's worth pursuing.

Attributes apart, validation constraints can be declared using dedicated YAML or XML files.
For bundles, those files should be put in predetermined locations.
For apps, there's theframework.validation.mapping.paths config options to list them, and there is theconfig/validator/ folder that's hardcoded.

In#61545, we added support for configuration via attributes, thanks to#[ExtendsValidationFor].

And I then wondered: what about using plain semantic configuration for apps? That'd be better than the current alternatives, and might be more boring (in a good way) than the new attribute?
That's what this PR achieves, kind of.

framework:validation:mapping:metadata:App\MyClass:constraints:[...]properties:someProp:[...][...]

BUT, I hit a wall: the structure undermetadata is recursive: constraints can list other constraints as options, recursively.
And this is not nicely described using the Config component.
Which means in the end the envisioned DX is going to be poor, because of the lack of descriptive info that'd be required for nice IDE support.

I'm still submitting as food for thoughts.

TL;DR: attributes FTW :)

PS: the same chain of thoughts can be applied to serializer's metadata, related to#61563. There, I don't think the "recursive" argument applies. Yet, we should support both Validator and Serializer if we go this way IMHO. It'd be inconsistent otherwise.

@carsonbotcarsonbot added this to the7.4 milestoneSep 24, 2025
@carsonbotcarsonbot changed the title[Validator][FrameworkBundle] Add ArrayLoader and wire it in semantic configuration[FrameworkBundle][Validator] Add ArrayLoader and wire it in semantic configurationSep 24, 2025
@nicolas-grekasnicolas-grekas deleted the v-array-loader branchSeptember 26, 2025 13:49
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

7.4

Development

Successfully merging this pull request may close these issues.

2 participants

@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp