YAML syntax permits elements of a sequence under a map key to be at the same indentation level as the map key itself. In fact, this is the default format for Ruby's psych #to_yaml emitter. Since I need to validate YAML generated by psych, and I haven't figured out how to tell it to indent sequences, this is a serious problem for me. That kwalify is failing to correctly parse valid YAML is a serious issue for the package.
Both of these are valid YAML:
---
foo:
- bar
- bletch
---
foo:
- bar
- bletch
However, kwalify fails to correctly parse the second example.
Why kwalify (Ruby) has its own YAML parser rather than instrumenting one of the upstream packages (like psych) is something I do not understand.
The attachment contains three YAML files:
kwalify's validation; andkwalify considers invalid.The two conformant files differ only in the sequence indentation as shown above.
Here is a transcript of validating these files:
$ kwalify -v
0.7.2
$ kwalify -lf seqindent-schema.yaml seqindent-pass.yaml
seqindent-pass.yaml#0: valid.
$ kwalify -lf seqindent-schema.yaml seqindent-fail.yaml
ERROR: seqindent-fail.yaml:3:1 [/] document end expected (maybe invalid tab char found).