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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alias names are too permissive in SnakeYAML-Engine #689

Open
headius opened this issue Oct 6, 2024 · 1 comment
Open

Alias names are too permissive in SnakeYAML-Engine #689

headius opened this issue Oct 6, 2024 · 1 comment

Comments

@headius
Copy link
Contributor

headius commented Oct 6, 2024

See original issue at jruby/jruby#8352.

The following YAML fails to parse in SnakeYAML-Engine, used by the JRuby Psych extension:

--- &1 !ruby/object:Set
hash:
  :one: true
  :two: true
  *1: true

This is due to a bug in SnakeYAML-Engine reported here: https://bitbucket.org/snakeyaml/snakeyaml-engine/issues/54/do-not-allow-colon-to-be-a-part-of-an

This will be fixed shortly in an upcoming release of SnakeYAML-Engine. Psych will need to be updated to the new version and released.

@perlpunk
Copy link

perlpunk commented Oct 6, 2024

The proper fix is to add a space after the alias:

  *1 : true

It's valid to have a colon in anchor names (and yes, I agree that it should have been forbidden, but it isn't).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants