Julian/jsonschema — pull request #72 by lrowe (2013-03-01 00:27:56+00:00)
Title: Serialization support

Consider this an item for discussion rather than a request to merge, at least for the time being.

[Colander](http://colander.readthedocs.org/) makes the distinction between using a schema for the *serialization* of data for transport to a client and the *deserialization* of a submission from a client. This seems to be a useful distinction.

##Serialization##
During serialization data is trusted. No validation is performed and any *default* values are filled in.

##Deserialization##
During deserialization data is untrusted. Validation is performed and any *missing* values are filled in.

JSON Schema does not make the same distinction between *default* and *missing* values. I've named the method in this pull request *serialize* as it fills the default values, though validation is still performed.

It also has the ability to reorder properties to follow the schema order - while there is no requirement that JSON mapping objects are ordered, in practice browsers do maintain the order of mapping objects (at least those of moderate size.)

Eventually it should grow option to ignore additional properties during deserializtion when additionalProperties is false.

In the long run, I'd like to use json schemas with some of the more advanced functionality that Colander offers. I think that means I will need to extend the schema with support for missing values and richer type specifications for deserialized objects, while maintaing JSON schema compliance for clients who consume the (possibly filtered for purity) schema.