Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Image Added

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

...

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

The following record matches all of the criteria:

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

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

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

...