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

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -