-
-
Notifications
You must be signed in to change notification settings - Fork 895
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
Add support for generating property schema with Choice restriction #4162
Add support for generating property schema with Choice restriction #4162
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! This should also target main
src/Bridge/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaChoiceRestriction.php
Outdated
Show resolved
Hide resolved
src/Bridge/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaChoiceRestriction.php
Outdated
Show resolved
Hide resolved
4827efc
to
ed85a5e
Compare
906d90d
to
d40af55
Compare
5075f32
to
fa7f475
Compare
src/Bridge/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaChoiceRestriction.php
Outdated
Show resolved
Hide resolved
src/Bridge/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaChoiceRestriction.php
Outdated
Show resolved
Hide resolved
src/Bridge/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaChoiceRestriction.php
Show resolved
Hide resolved
src/Bridge/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaChoiceRestriction.php
Outdated
Show resolved
Hide resolved
1546b46
to
6c1662a
Compare
6c1662a
to
2a5e21f
Compare
Thank you very much! |
I am trying to make this work with Api Platform Admin module with no luck. |
Add a
PropertySchemaChoiceRestriction
to transform Choice validation constraint into these schemas:@Assert\Choice(choices={"choice1", "choice2"})
@Assert\Choice(choices={"choice1", "choice2"}, multiple=true)
@Assert\Choice(choices={"choice1", "choice2", "choice3", "choice4"}, multiple=true, min=2, max=4)