I would like to constraint maximum length of a key of the property which type is object. All of its values are generated in runtime and I'd like to spot a misbehavior as soon as possible by validating document before further processing.
You can make it like this:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Object with 10 char max properties",
"type": "object",
"additionalProperties": false,
"minProperties": 1,
"patternProperties":
{
"^[a-z]{0,10}$":
{
"description": "Some description",
"type": "string"
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With