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

Syntax error when emitting to JSON from a YAML zero leading number value #291

Closed
captain-yoshi opened this issue Aug 10, 2022 · 0 comments · Fixed by #299
Closed

Syntax error when emitting to JSON from a YAML zero leading number value #291

captain-yoshi opened this issue Aug 10, 2022 · 0 comments · Fixed by #299

Comments

@captain-yoshi
Copy link
Contributor

Emitting a JSON file from a YAML with a leading zero value will give a SyntaxError when parsed in JSON.

YAML

error: 04

JSON

{"error": 04}

Not sure if the responsibility is on the user or the library. Not sure if it's easy but when emitting to JSON you could convert to a string if there is a leading zero number, as it is invalid in JSON.

@captain-yoshi captain-yoshi changed the title Syntax error when emitting to JSON from a YAML number with a leading zero Syntax error when emitting to JSON from a YAML zero leading number Aug 10, 2022
@captain-yoshi captain-yoshi changed the title Syntax error when emitting to JSON from a YAML zero leading number Syntax error when emitting to JSON from a YAML zero leading number value Aug 10, 2022
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

Successfully merging a pull request may close this issue.

1 participant