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

Problem with maps using integer keys #15

Open
cassiel opened this issue Aug 4, 2013 · 2 comments
Open

Problem with maps using integer keys #15

cassiel opened this issue Aug 4, 2013 · 2 comments

Comments

@cassiel
Copy link

cassiel commented Aug 4, 2013

(yaml/generate-string {46 "MAYBE" 52 "DEFINITELY"})
"{46: MAYBE, 52: DEFINITELY}\n"

(yaml/parse-string (yaml/generate-string {46 "MAYBE" 52 "DEFINITELY"}))
{nil "DEFINITELY"}

This seems to be legal YAML, and SnakeYAML itself seems to handle it AFAICT.

@radix
Copy link

radix commented Oct 31, 2013

I ran into this when trying to parse RAML: http://raml.org/

It uses numeric keys representing HTTP response codes.

@radix
Copy link

radix commented Oct 31, 2013

I discovered a workaround -- apparently the bug is in the behavior of "keywordizing" the keys in a YAML map.

If you use (parse-string yaml false), this indicates that keywordization shouldn't happen, and keys will be normal strings (actually this is what I wanted anyway, since I was converting the keywords to strings manually before).

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

No branches or pull requests

2 participants