python-jsonschema-objects
python-jsonschema-objects copied to clipboard
Fix 0 default values appearing as None
Consider the following json schema snippet to define a property:
{
"type" : "number",
"minimum" : 0,
"maximum" : 1,
"default": 0
}
The code that sets the default reads:
"__default__": clsdata.get("default") or clsdata.get("const"),
If the default is 0
as in the example above, then the right branch of the or
will be selected and result to None.