Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[Validator] AddYaml
constraint for validating YAML content#53749
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
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.
Resolved :)
Can you please rebase your changes onto the latest |
Uh oh!
There was an error while loading.Please reload this page.
3b2514c
to5cf1714
CompareThe followingPsalm issue looks like false positive to me 🤔 :
Thisbit of code is a copy of theLintCommand::validate() method. |
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Validator/Tests/Constraints/YamlValidatorTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
d549f65
to594682c
Compare594682c
to912607b
CompareUh oh!
There was an error while loading.Please reload this page.
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.
with the suggested change
Uh oh!
There was an error while loading.Please reload this page.
17c1c8d
to5b95cfd
Comparesymfonyaml commentedApr 19, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
2c88c44
toe26da28
Compareif (\E_USER_DEPRECATED === $level) { | ||
throw new ParseException($message, $this->getParser()->getRealCurrentLineNb() + 1); | ||
} |
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.
what's the purpose of this?
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.
@ro0NL Taken from the YamlLintCommand.php
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.
Rebase needed.
e26da28
tobcbeb64
CompareYaml
constraint for validating YAML contentUh oh!
There was an error while loading.Please reload this page.
1e36e57
to023d48c
CompareThank you@symfonyaml. |
e0ad00c
intosymfony:7.2Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Purpose
Inspired by theJson constraint, I've added a new feature to the Validator component for validating YAML content with a dedicated constraint.
Real world use case: Having configuration settings stored in YAML format within a database. With this new feature, you can validate the integrity of these configurations, ensuring the YAML syntax is OK.
Options
I've added a
flags
option to this constraint, aligning with theYaml parser flags.Exemple