-
-
Notifications
You must be signed in to change notification settings - Fork 775
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
'duplicated mapping key' error with unique keys #573
Comments
Seems like it's not specific to the number of keys, I'm guessing it's something else I've missed perhaps like a whitespace issue. Although other YAML validators online show it as valid |
10513478508167781E58455: 2335
11193430644352832E11281: 2452 both keys => big integers in scientific notation (10513478508167781 e 58455) => Seems work as expected. Who generated this yaml data? I would strongly recommend to quote keys. May be other langs can each huge numbers, but JS - no. |
Thank you! Apologies for bringing you an issue that's ultimately not yours, my lack of JS expertise would've had me working on that for days 😆 . I hadn't spotted the As for where it came from, it was actually generated using the python |
yaml/pyyaml#173 AFAIK, there may be difference between spec and real code due need of JSON compatibility. But i don't remember details. In theory, according to spec, your dump is correct, because scientific notation must have sign before exponent: node -e 'console.log(JSON.parse("1e5"))' If anyone wish dive into spec & propose changes - i'm open to suggestions. |
I think I've found an issue when dealing with a YAML mapping containing a large number of keys.
This can be reproduced by running this minimal example through the JS-YAML Demo
This is my minimal example (I'm not including it as a code block here due to the number of lines):
https://gist.github.com/MGough/e38b2cf7b41c151ba8216b77a08c9177
It looks almost like a hash conflict, once the final key/value pair is removed the issue goes away. You can remove a different key value pair and the issue persists. From what I can tell there aren't any duplicate keys. This was also an issue when there were more keys after the final one in this example, I've just removed them as they were redundant.
The text was updated successfully, but these errors were encountered: