Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Validator] Add the Yaml constraint #19965

Merged
merged 1 commit into from
Jun 25, 2024
Merged

Conversation

javiereguiluz
Copy link
Member

Fixes #19963.

Ping @xabbuh for help 馃檹 I don't know how to express this --> YamlParser::PARSE_CONSTANT | YamlParser::PARSE_CUSTOM_TAGS | Yaml::PARSE_DATETIME in YAML and XML config formats. Can you help me? Thanks!

@alexandre-daubois
Copy link
Contributor

alexandre-daubois commented Jun 25, 2024

I don't know how to express this --> YamlParser::PARSE_CONSTANT | YamlParser::PARSE_CUSTOM_TAGS | Yaml::PARSE_DATETIME in YAML and XML config formats

If I'm right, you cannot. You have to deal with the integer result of the bit operation. It is indeed not ideal.

Speaking of that, what would you think of a custom tag in the Yaml parser, like !flags YamlParser::PARSE_CONSTANT | YamlParser::PARSE_CUSTOM_TAGS? Would it make sense to you? I think it could be a nice addition to deal with flags in Yaml which seems still widely used in configs.

Edit: worked on something to achieve this: symfony/symfony#57522

@javiereguiluz
Copy link
Member Author

Alex, thanks for reviewing this. For now, I removed the advanced flags example for YAML and XML. We can always re-add that later if your proposal is accepted. Thanks!

@javiereguiluz javiereguiluz merged commit eb1e384 into symfony:7.2 Jun 25, 2024
3 checks passed
@javiereguiluz javiereguiluz deleted the fix_19963 branch June 25, 2024 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants