asottile / cfgv

Validate configuration and produce human readable error messages
MIT License
46 stars 7 forks source link

Adding check_or conditional #129

Closed kaidokert closed 10 months ago

kaidokert commented 10 months ago

Adds an "or" clause validator, a logical addition to check_and

asottile commented 10 months ago

I can't think of a good reason you would want this in a schema. is there a use case you had in mind?

kaidokert commented 10 months ago

Yes, in some cases accepting either a string or a list of strings for instance is perfectly okay.

asottile commented 10 months ago

cfgv tries to encourage schemas of structured data. what you're describing is not well structured and so I think it's best for you to use your own custom checkers on your own (and not something that's encouraged here)

thanks for the pr nonetheless!