pyeve / eve

REST API framework designed for human beings
https://python-eve.org
Other
6.68k stars 747 forks source link

Full custom validation flow. #413

Closed berndca closed 10 years ago

berndca commented 10 years ago

I'm creating an API for IEEE 1685-2009 IP-XACT. There is a special requirement to the schemas. In several schemas there is a choice between required fields, e.g. the valid schema may specify a set of required fields of which exactly one field may be present in the data. This feature does not appear to be supported in most python validation packages, so I decided to roll my own. Looking through the eve sources I found that the constructor for Eve accepts a validator class. I'm wondering if I could just encapsulate my own validator class in a new class emulating the api of cerberus.Validator or is replacing the validator going to be more complex?

Thanks, Bernd

nicolaiarocci commented 10 years ago

Yes you can do that, just check the relevant docs.

PS: sorry for the late reply.