Julian/jsonschema — Issue #2: divisibleBy with floating point numbers
Author: apple314159
Created: 2012-02-19 15:04:36+00:00
State: open

import jsonschema

s = {
"type": "object",
"properties": {
"price": {
"type": "number",
"divisibleBy": 0.01
}
}
}

jsonschema.validate({"price":1.09}, s) # fail
jsonschema.validate({"price":1.89}, s) # OK