jpmckinney / validictory

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

additionalProperties bug #15

Closed ericmjonas closed 12 years ago

ericmjonas commented 12 years ago

This is a pull req for the additionalProperties bug that I recently filed an issue on. I want to stress:

  1. I'm insanely grateful for validictory -- it solves so many problems for us!
  2. This might not be a real bug, but rather me mis-specifying a schema
  3. I added a test which exhibits the behavior and then
  4. tried to fix it by prioritizing the order in which the schema tests are applied (via _prioritize)

Thanks!

jamesturk commented 12 years ago

Thanks for this, I'm on a deadline at the moment but everything looks good, just need to make sure this is the correct behavior (or if not technically correct at least desired, i'll admit that json-schema is annoying at some times so i'm in favor of doing things that make sense)

jamesturk commented 12 years ago

Sorry this slipped for so long, finally looking at it. as I understand it though additionalProperties is for properties (items in a dict) if you want to specify a type constraint on items in a list you want additionalItems. If I'm misunderstanding what you're trying to do though let me know.

jamesturk commented 12 years ago

a recent fix to additionalProperties makes the test pass without the additional code, additionalProperties is ignored for non-objects, I agree with that decision that another contributor made, and it has the bonus of fixing the issue that you had, going to close this for now b/c I think this is resolved, if you have another error please do re-open