sunlightlabs/validictory — pull request #50 by dmr (2013-05-14 09:41:44+00:00)
Title: default arguments

Follow-up to #27

I started to include @johnnoone patch but I have a questions regarding this:

1. I removed the test_item ('items': [{'type': 'string'}, {'default': 'baz'},]) case because I think this is too complicated and I don't find it in the specification.

2. In my current implementation it is possible to have values in "default" that are not correct regarding "type" or more details. How can I include a schema validation in a clean way?

The specification states that the default keyword can contain anything but should (obviously) be valid with the schema.
(http://json-schema.org/latest/json-schema-validation.html#anchor101)

My patch is too simple for so much noise but anyway: 54cf528fedb954fadae88fa89a315c86d986138b provides a few tests which describe the new property, I left the test_item tests commented out and in the tests there are my ideas about how this feature should work before merging.

What is your opinion on this?