sunlightlabs/validictory — pull request #33 by nicolaiarocci (2012-08-10 09:11:31+00:00)
Title: Support for disallow_unknown_properties option

Support for disallow_unknown_properties option, available both in the validate method and in the SchemaValidator contstructor. Set to True to prevent injection of unwanted property/value pairs in your document. Defaults to False.

While you can achieve similar results by setting 'additionalProperties = False', that only works for 'object' types and not for the 'array' type. When an array's 'items' property is set to a schema, it will accept any number of incoming dicts (objects) making sure that known fields match the schema, but still allowing for unknown/unmatched fields (the 'additionalItems' property will only block multiple array items).