-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help with validation array via yaml mapping #7648
Comments
Hello @alexpts, the documentation of the Collection contraint looks pretty explicit to me in all format, I've only spotted a typo while checking it (see #7686). To use yaml definition, you should use something like: ClassName:
properties:
someArrayPropertyName:
- Collection:
fields:
name:
- NotBlank
- { Length: { min: 2 } }
email:
- Email Your problem may come from the absence of model data to validate though, this is not needed in full PHP, but using yaml you cannot just define a constraint, you need to map a class and class properties to constraints. It means a simple PHP array cannot have mapped constraint through yml or xml. Anyway I'm closing here, feel free to ask your question through one of our dedicated support channel. |
Ok, Thanks! |
I try validate assoc array via symfony validation.
I could validate array in php notation:
I want use yaml definition rule.
Can someone help me check an assoc array with a description of the rules through yaml?
In the documentation, very little is described about working with arrays.
The text was updated successfully, but these errors were encountered: