-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[Validator] Add Xml constraint
#57365
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
base: 8.1
Are you sure you want to change the base?
Conversation
src/Symfony/Component/Validator/Tests/Constraints/YamlValidatorTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Validator/Tests/Constraints/YamlValidatorTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Validator/Constraints/AbstractFormatValidator.php
Outdated
Show resolved
Hide resolved
|
|
9708e02 to
1edfe83
Compare
|
I've made the following changes:
|
Xml constraint
OskarStark
left a comment
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.
Needs a rebase
4716da3 to
ebdab1f
Compare
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.
Just a few nitpicks 🙂 Nice PR!
src/Symfony/Component/Validator/Tests/Constraints/XmlValidatorTest.php
Outdated
Show resolved
Hide resolved
539154e to
ea4c209
Compare
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.
Asserting that a file is XML is pretty weak as a check: one always expects some structure in the XML. It'd be natural to me to allow passing an XSD, isn't it? Up to improve the PR in this direction?
b7ae934 to
08515a5
Compare
src/Symfony/Component/Validator/Tests/Constraints/XmlValidatorTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Validator/Tests/Constraints/XmlValidatorTest.php
Outdated
Show resolved
Hide resolved
@nicolas-grekas Thank you for your feedback. The constraint is intended to assert a string value rather than a file. |
94noni
left a comment
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
|
Any updates? |
I also think that supporting validating the XML content against a schema would make this feature more useful. |
nicolas-grekas
left a comment
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.
Status: needs work
Still up to continue the PR?
|
@nicolas-grekas Yes, I'll work on it when I have some free time. |
92712d9 to
0a18fe2
Compare
|
@nicolas-grekas & @fabpot: Thanks again for the feedback. XSD schema validation is now supported. |
0a18fe2 to
5241b22
Compare
Add
Xmlconstraint