jpmckinney / validictory

🎓 deprecated general purpose python data validator
Other
240 stars 57 forks source link

Support for extends #23

Closed ahassany closed 10 years ago

ahassany commented 12 years ago

I wonder if validictory supports "extends" or if there are any plans to add support for it?

jamesturk commented 12 years ago

No support/plans as of now, seeing as we're validating dictionaries I'm a bit disinclined to add support for it but I'd be open to discussing it.

On Wed, Mar 7, 2012 at 11:28 AM, Ahmed El-Hassany reply@reply.github.com wrote:

I wonder if validictory supports "extends" or if there are any plans to add support for it?


Reply to this email directly or view it on GitHub: https://github.com/sunlightlabs/validictory/issues/23

ahassany commented 12 years ago

That would be an interesting thing to work on. However, as quick work around I wrote a small recursive function to merge properties from the parent schema. I know this is not a clean approach to handle extends but it serves my purpose for the time being. I hope I would have time in the future to have a cleaner method to deal with extends and $ref and I would definitely contribute it back to this project.

Honn commented 12 years ago

We needed extends for our project so I have forked validictory and added support for it based on the 03 draft. We will try it some more and see if it is stable, but it seems to work fine.

The drawback of our method is that extending a schema requires that schema to exist as a file (extends is based on extending from a path). We have that anyway so it posed no problem for us, but it might not be in line with validictorys original flow.

jamesturk commented 10 years ago

closing this as there seems to be little to no interest & dictionaries are easy enough to .update()