Draft 04 | Draft 06 | Draft 07 | Draft 2019-09 | Draft 2020-12 |
![]() |
![]() |
![]() |
![]() |
![]() |
The Property Container(0) determines the validation rules applied to the child members within an instance object.
The property container can contain a number of different nodes types.
A property node validates an instance object with a matching name. If it s drawn with a solid border then it is required in the instance object, if it has a dotted line then it is optional.
The Property Container can hold 0-n Property nodes.
A required property is one that must exist within the instance object, but is not explicitly defined by a property, meaning it must fit into a rule defined by a pattern property or the additional properties node must be present.
The Property Container can hold 0-n Required Properties nodes.
A pattern Property node validates an instance object with a matching name. If it s drawn with a solid border then it is required in the instance object, if it has a dotted line then it is optional.
The Property Container can hold 0-n Pattern Property nodes.
The Additional Properties node contains validation rules for any instance objects that do not match a property or pattern property.
The Property Container can hold 0-1 Additional Properties node.
The Property Container always draw the property nodes in groups, in the following order
The propertyNames property makes it possible to define rules that specify the property names that are allowable within the JSON Instance object.
In this example all the properties must match the regular expression "VAL_\d+", i.e. VAL_1, VAL_2 etc.
For more in depth information regarding see the keywords properties, patternProperties, additionalProperties and propertyNames.