Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

A valid example is when the field called "value" is of a string and between 2 and 3 characters in length. 

In the JSON schema example below, the following fields are required to be included in each record:

  • brand
  • model
  • color
  • date
{
  "required": [
    "brand",
    "color",
    "model",
    "date"
  ],
  "properties": {
    "value": {
      "type": "string",
      "minLength": 2,
      "maxLength": 3
    }
  }
}

The following record matches all of the criteria:

{
    "brand": "brand1",
    "model": "modelA",
    "color": "red",
    "date":  "20 March 2019",
    "value": "cat" 
}

The following record is discarded because hamster has more than 3 characters:

{
    "brand": "brand1",
    "model": "modelA",
    "color": "red",
    "date":  "20 March 2019",
    "value": "hamster" 
}

For further information on how to use JSON schema, see https://json-schema.org/.

  • No labels