ruby - How to check if a key exists in YAML input when it is referenced in the same YAML file -


i using kwalify ruby gem. have following yaml schema.

map1:     type: map     required: true     mapping:        key1:             type: str            required: false        key2:            type: str            required: false  # here str1 value should valid key map1. str1:     type: str     required: false 

i need following yaml input validation fail.

map1:     key1: value1     # note key2 data not passed. # since key2 not passed in map1, validation should fail.  str1: key2  

can requirement above resolved using yaml schema without making use of validate_hook methods?


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -