HN2new | past | comments | ask | show | jobs | submitlogin

> 1e2 is a valid JSON number, but YAML 1.1 requires it to be written as 1.0e+2

Then a program can be made that writes it as "1.0e+2", which is also valid in JSON as well as YAML, regardless of what the reader expects. (However, some formats will not need numbers that will need the scientific notation anyways.)

It does not help if you are trying to use a YAML parser to parse a JSON file, but at least, it avoids a different problem.

If you are making your own which does not need to work with an existing format, then you do not necessarily need to use YAML nor JSON; you can choose the appropriate format for it. You can consider what numbers and what character sets you intend to use, and if you will use binary data, etc. If you like the structured data but do not need a text format than DER is another way.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: