Liquid Studio 2021
JSON Schema Editor / Graphical Notation Overview / Schema
In This Topic
    Schema
    In This Topic

    A JSON Schema is built up from schema objects, each schema containing its own sub schemas.

    In order to depict this graphically schemas are rendered in number of different ways, but still have the same properties and children.

    Common Properties

    All schema items have the following Inline Properties.

    Properties

    Const
    Comment
    Default
    Description
    Enum
    Examples
    ID
    Read Only
    Title
    TypeWrite Only

    Array Constraints
    Contains
    MaxItems
    MinItems
    UniqueItems

    Numeric Constraints
    ExclusiveMaximum
    ExclusiveMinimum
    Maximum
    Minimum
    MultipleOf

    Object Constraints
    MaxProperties
    MinProperties
    Required

    String Constraints
    MaxLength
    MinLength
    Pattern
    Content Encoding
    Content Media Type

    Many of these properties are dependent on the schemas type

    Common Child Items

    All schemas can also have the following child nodes

    Array Item Container (Array ItemAdditional ItemsContains)

    Properties Container (PropertyPattern PropertyAdditional PropertiesRequired PropertyPropertyNames)

    Dependency Container (Property DependencySchema Dependency)

    Validation Rules : (AllOf, AnyOf, OneOf, NotIf Then Else)

    These child nodes are dependent on the schemas type

     

    The File/Root Schema

    This has all the standard schema properties, but can also have a Definition Container and $schema property.

     

    Property

    The property node is a schema with a name, the name is used to match it against members in the instance object.

     

    Pattern Property

    The Pattern Property node is a schema with a name, the name is used as a regular expression to match it against members in the instance object.

     

    Required Property

    The Pattern Property node is a place holder for a schema, it has none of the properties of child items of a schema, but can be converted into a schema using the 'Convert to Property' setting in the property window.

     

    Additional Properties

    The Additional Properties node initially behaves as a placeholder for a schema, but once a child item is added or the "Convert to schema" property is set it behave like a regular schema.

     

    Array Item

    The Array Item node is a schema, it has no is shown with the name gives it an index which indicates the item in the instance array that it will be used to validate.

     

    Additional Array Items

    The Additional Array Items node can behave as a schema or as a placeholder for a schema.

    When its behaving as a placeholder adding a child or setting the "Convert to schema" property will convert it to a schema and it will then operate as a regular schema.

     

    Definition

    A Definition Node is just a named schema node within the Definition Container node. It behaves the same as any other schema.

     

    Child Schema

    The nodes AllOf, AnyOf, OneOf can contain 1 or more child schemas, these schemas shown in grey behave like any other schema, but are explicitly shown within the diagram.

     

    The Not is similar in that it is an explicitly defined schema, but it behaves as all other schemas do.

    Schema Dependencies

    The child schema node of a Schema Dependency behaves as a normal schema. Note : This is drawn within a container, which makes it visually different from other schemas, but it behaves the same.

    Contains (added in Draft 6)

     

     The schema above specifies a property 'AnArrayOfStrings', which is an array of strings, the Contains rules specifies that at least one item in the array must be the string "My Required Value".

    PropertyNames (added in Draft 6)

     

    In this example "MyObject" is describes an object that can contain string properties with any name. The Property Names rules imposes a limitation on the property names, specifying that they must match the Pattern (regular expression) "VAL_\d+".

    If Then Else (added in Draft 7 )

    The schema describes a property called "Value" which can contain a string or a Number.

    If the value in the instance document is an integer, then the rules in the Then are applied meaning it must be in the range 0-9999.

    If the value is not an integer then the rules in the Else are applied and the value must be a string 1-4 chars long matching the regex pattern "\d+".