arrays
open /validator.html
type json {
  "array":[1,2,"a"]
}
type schema {
  "type":"object",
  "properties":{
    "array":{"type":"array"}
  }
}
click bt-validate-js
waitForTextPresent JSON
verifyTextPresent JSON: VALID
click bt-validate-php
waitForTextPresent JSON
verifyTextPresent JSON: VALID
type json {
  "array":[1,2,"a"]
}
type schema {
  "type":"object",
  "properties":{
    "array":{
      "type":"array",
      "items":{"type":"number"}
    }
  }
}
click bt-validate-js
waitForTextPresent JSON:
verifyTextPresent JSON: INVALID
verifyTextPresent array[2]
click bt-validate-php
waitForTextPresent JSON:
verifyTextPresent JSON: INVALID
verifyTextPresent array[2]
type json {
  "array":[1,2,null]
}
type schema {
  "type":"object",
  "properties":{
    "array":{
      "type":"array",
      "items":{"type":["number","boolean"]}
    }
  }
}
click bt-validate-php
waitForTextPresent JSON:
verifyTextPresent NULL value found, but a boolean is required
click bt-validate-js
waitForTextPresent JSON:
verifyTextPresent JSON: INVALID