sunlightlabs/validictory — pull request #38 by EisenSheng (2012-09-21 21:47:42+00:00)
Title: Allow Decimal to be used in number

Json parsers allow a custom type to be used for parsing float values. It is common practice to use Decimal as float storage to prevent precision loss.

Example:

parsed_data = json.loads(raw_data, parse_float=Decimal)
validictory.validate(parsed_data, SCHEMA)

would fail horrible with now option to allow Decimal to be used.

A better approach would be to extend the API and allow users to specify which types are allowed in which case. This commit fixes my current issue with Decimal though.