keleshev / schema

Schema validation just got Pythonic
MIT License
2.87k stars 214 forks source link

is there conditional schema? #242

Closed ftian1 closed 4 years ago

ftian1 commented 4 years ago

I want to express a dependency relationship between yaml items,

such as:

gender: male beard: # optional, only needed when gender value is male. color: golden

seems this repo doesn't support this semantic? or am i missing sth?

skorokithakis commented 4 years ago

This is not supported, unfortunately.

monstermichl commented 1 year ago

Would it be possible to pass the already evaluated values to a lambda function of a schema property? This way the user could write his own conditional evaluation method.