Kwalify is a tiny schema validator for YAML document.
It is in fact very poor compared to Relax NG or DTD.
I hope you extend/customize Kwalify for your own way.
Evert Mouw, 2014-09-23
The first space after the colon is needed and also will be ignored for the pattern matching.
So this key-value pair will not be recognized:
But this one will work normally:
The key is "color" and the value is "red" (without the space).
The enum operator does not validate empty values, even when the field is not required. This is a bug.
If you want to only validate a value when the whole value matches your pattern, and not only a part of it, then you need to pay close attention.
E.g., you want to match "ant" or "dinosaur" or "dino" or "ant, dino" or "ant, dinosaur" or "ant, dino*" ...
You specify this pattern in schema.yaml:
pattern: /[ ]|ant,[ ]*elek\w*|ant|dinosaur|dino/
Then this will be validated, because a part of it matches!
producten: ank, dinosaur
But this one will not be validated, because no part matches:
You need to make sure that the whole value, including the beginning (^) and the end ($), are matched.
pattern: /^$|^ant,[ ]*dino\w*$|^ant$|^dinosaur$|^elek$/
This works as expected.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.