[
  {
    "description": "required validation",
    "database": {
      "schemas": [
        {
          "properties": {
            "foo": {},
            "bar": {}
          },
          "required": [
            "foo"
          ],
          "$id": "required_0_0"
        }
      ]
    },
    "tests": [
      {
        "description": "present required property is valid",
        "data": {
          "foo": 1
        },
        "schema_id": "required_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "non-present required property is invalid",
        "data": {
          "bar": 1
        },
        "schema_id": "required_0_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "ignores arrays",
        "data": [],
        "schema_id": "required_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "ignores strings",
        "data": "",
        "schema_id": "required_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "ignores other non-objects",
        "data": 12,
        "schema_id": "required_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "ignores null",
        "data": null,
        "schema_id": "required_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "ignores boolean",
        "data": true,
        "schema_id": "required_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  },
  {
    "description": "required default validation",
    "database": {
      "schemas": [
        {
          "properties": {
            "foo": {}
          },
          "$id": "required_1_0"
        }
      ]
    },
    "tests": [
      {
        "description": "not required by default",
        "data": {},
        "schema_id": "required_1_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  },
  {
    "description": "required with empty array",
    "database": {
      "schemas": [
        {
          "properties": {
            "foo": {}
          },
          "required": [],
          "$id": "required_2_0"
        }
      ]
    },
    "tests": [
      {
        "description": "property not required",
        "data": {},
        "schema_id": "required_2_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  },
  {
    "description": "required with escaped characters",
    "database": {
      "schemas": [
        {
          "required": [
            "foo\nbar",
            "foo\"bar",
            "foo\\bar",
            "foo\rbar",
            "foo\tbar",
            "foo\fbar"
          ],
          "extensible": true,
          "$id": "required_3_0"
        }
      ]
    },
    "tests": [
      {
        "description": "object with all properties present is valid",
        "data": {
          "foo\nbar": 1,
          "foo\"bar": 1,
          "foo\\bar": 1,
          "foo\rbar": 1,
          "foo\tbar": 1,
          "foo\fbar": 1
        },
        "schema_id": "required_3_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "object with some properties missing is invalid",
        "data": {
          "foo\nbar": "1",
          "foo\"bar": "1"
        },
        "schema_id": "required_3_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      }
    ]
  },
  {
    "description": "required properties whose names are Javascript object property names",
    "comment": "Ensure JS implementations don't universally consider e.g. __proto__ to always be present in an object.",
    "database": {
      "schemas": [
        {
          "required": [
            "__proto__",
            "toString",
            "constructor"
          ],
          "extensible": true,
          "$id": "required_4_0"
        }
      ]
    },
    "tests": [
      {
        "description": "ignores arrays",
        "data": [],
        "schema_id": "required_4_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "ignores other non-objects",
        "data": 12,
        "schema_id": "required_4_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "none of the properties mentioned",
        "data": {},
        "schema_id": "required_4_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "__proto__ present",
        "data": {
          "__proto__": "foo"
        },
        "schema_id": "required_4_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "toString present",
        "data": {
          "toString": {
            "length": 37
          }
        },
        "schema_id": "required_4_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "constructor present",
        "data": {
          "constructor": {
            "length": 37
          }
        },
        "schema_id": "required_4_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "all present",
        "data": {
          "__proto__": 12,
          "toString": {
            "length": "foo"
          },
          "constructor": 37
        },
        "schema_id": "required_4_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  },
  {
    "description": "extensible: true allows extra properties in required",
    "database": {
      "schemas": [
        {
          "required": [
            "foo"
          ],
          "extensible": true,
          "$id": "required_5_0"
        }
      ]
    },
    "tests": [
      {
        "description": "extra property is valid",
        "data": {
          "foo": 1,
          "bar": 2
        },
        "schema_id": "required_5_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  }
]