YAML specification is so ambiguous, that you can't be sure if tomorrow you will parse the same data from YAML file as you have yesterday.
Let's see how different implementations parse YAML code. Settings are default or near to default or typical for that language. We use JSON to represent data the uniform way.
YAML source | yaml2json.hs | yaml2json.pl | yaml2json.py | yaml2json.rb | rq |
---|---|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| ❌ [ERROR] [rq] Encountered: YAML error [ERROR] [rq] Caused by: EOF while parsing a value [ERROR] [rq] (Re-run with --trace or RUST_BACKTRACE=1 for a backtrace) |
|
|
|
| ❌ /usr/lib/ruby/2.5.0/json/common.rb:286:in `generate': 862: -Infinity not allowed in JSON (JSON::GeneratorError) from /usr/lib/ruby/2.5.0/json/common.rb:286:in `pretty_generate' from ./yaml2json.rb:6:in `' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| ❌ ConstructorError: could not determine a constructor for the tag 'tag:yaml.org,2002:merge' in "", line 1, column 1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| ❌ ConstructorError: while constructing a mapping in "", line 1, column 1 expected a mapping or list of mappings for merging, but found scalar in "", line 1, column 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|