how do I specify x>0

1 view
Skip to first unread message

Ricardo SIGNES

unread,
Sep 4, 2008, 8:46:13 AM9/4/08
to JSON Schema
If I want to validate a datum that is guaranteed to be a positive (non-
zero) number, how do I do that? I see a way to specify minimum, but
not a way to make the endpoint exclusive of its value.

A practical example would be in a schema defining the returned data
from an RPC random number generator. I'd expect something like:

{
"type": "object",
"properties": {
"usedAlgorithm": { "type": "string" },
"result": { "type": "number", "minimum": 0, "maximum": 1,
"exclusiveMaximum": true}
},
}

Kris Zyp

unread,
Sep 4, 2008, 9:00:11 AM9/4/08
to JSON Schema

That may be worth adding.
Kris

Reply all
Reply to author
Forward
0 new messages