[
  {
    "description": "object properties validation",
    "database": {
      "schemas": [
        {
          "properties": {
            "foo": {
              "type": "integer"
            },
            "bar": {
              "type": "string"
            }
          },
          "$id": "properties_0_0"
        }
      ]
    },
    "tests": [
      {
        "description": "both properties present and valid is valid",
        "data": {
          "foo": 1,
          "bar": "baz"
        },
        "schema_id": "properties_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "one property invalid is invalid",
        "data": {
          "foo": 1,
          "bar": {}
        },
        "schema_id": "properties_0_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "both properties invalid is invalid",
        "data": {
          "foo": [],
          "bar": {}
        },
        "schema_id": "properties_0_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "doesn't invalidate other properties",
        "data": {},
        "schema_id": "properties_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "ignores arrays",
        "data": [],
        "schema_id": "properties_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "ignores other non-objects",
        "data": 12,
        "schema_id": "properties_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  },
  {
    "description": "properties with boolean schema",
    "database": {
      "schemas": [
        {
          "properties": {
            "foo": true,
            "bar": false
          },
          "$id": "properties_1_0"
        }
      ]
    },
    "tests": [
      {
        "description": "no property present is valid",
        "data": {},
        "schema_id": "properties_1_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "only 'true' property present is valid",
        "data": {
          "foo": 1
        },
        "schema_id": "properties_1_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "only 'false' property present is invalid",
        "data": {
          "bar": 2
        },
        "schema_id": "properties_1_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "both properties present is invalid",
        "data": {
          "foo": 1,
          "bar": 2
        },
        "schema_id": "properties_1_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      }
    ]
  },
  {
    "description": "properties with escaped characters",
    "database": {
      "schemas": [
        {
          "properties": {
            "foo\nbar": {
              "type": "number"
            },
            "foo\"bar": {
              "type": "number"
            },
            "foo\\bar": {
              "type": "number"
            },
            "foo\rbar": {
              "type": "number"
            },
            "foo\tbar": {
              "type": "number"
            },
            "foo\fbar": {
              "type": "number"
            }
          },
          "$id": "properties_2_0"
        }
      ]
    },
    "tests": [
      {
        "description": "object with all numbers is valid",
        "data": {
          "foo\nbar": 1,
          "foo\"bar": 1,
          "foo\\bar": 1,
          "foo\rbar": 1,
          "foo\tbar": 1,
          "foo\fbar": 1
        },
        "schema_id": "properties_2_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "object with strings is invalid",
        "data": {
          "foo\nbar": "1",
          "foo\"bar": "1",
          "foo\\bar": "1",
          "foo\rbar": "1",
          "foo\tbar": "1",
          "foo\fbar": "1"
        },
        "schema_id": "properties_2_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      }
    ]
  },
  {
    "description": "properties with null valued instance properties",
    "database": {
      "schemas": [
        {
          "properties": {
            "foo": {
              "type": "null"
            }
          },
          "$id": "properties_3_0"
        }
      ]
    },
    "tests": [
      {
        "description": "allows null values",
        "data": {
          "foo": null
        },
        "schema_id": "properties_3_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  },
  {
    "description": "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": [
        {
          "properties": {
            "__proto__": {
              "type": "number"
            },
            "toString": {
              "properties": {
                "length": {
                  "type": "string"
                }
              }
            },
            "constructor": {
              "type": "number"
            }
          },
          "$id": "properties_4_0"
        }
      ]
    },
    "tests": [
      {
        "description": "ignores arrays",
        "data": [],
        "schema_id": "properties_4_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "ignores other non-objects",
        "data": 12,
        "schema_id": "properties_4_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "none of the properties mentioned",
        "data": {},
        "schema_id": "properties_4_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "__proto__ not valid",
        "data": {
          "__proto__": "foo"
        },
        "schema_id": "properties_4_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "toString not valid",
        "data": {
          "toString": {
            "length": 37
          }
        },
        "schema_id": "properties_4_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "constructor not valid",
        "data": {
          "constructor": {
            "length": 37
          }
        },
        "schema_id": "properties_4_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "all present and valid",
        "data": {
          "__proto__": 12,
          "toString": {
            "length": "foo"
          },
          "constructor": 37
        },
        "schema_id": "properties_4_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  },
  {
    "description": "extensible: true allows extra properties",
    "database": {
      "schemas": [
        {
          "properties": {
            "foo": {
              "type": "integer"
            }
          },
          "extensible": true,
          "$id": "properties_5_0"
        }
      ]
    },
    "tests": [
      {
        "description": "extra property is valid",
        "data": {
          "foo": 1,
          "bar": "baz"
        },
        "schema_id": "properties_5_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  },
  {
    "description": "strict by default: extra properties invalid",
    "database": {
      "schemas": [
        {
          "properties": {
            "foo": {
              "type": "string"
            }
          },
          "$id": "properties_6_0"
        }
      ]
    },
    "tests": [
      {
        "description": "extra property is invalid",
        "data": {
          "foo": "bar",
          "extra": 1
        },
        "schema_id": "properties_6_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      }
    ]
  },
  {
    "description": "inheritance: nested object inherits strictness from strict parent",
    "database": {
      "schemas": [
        {
          "properties": {
            "nested": {
              "properties": {
                "foo": {
                  "type": "string"
                }
              }
            }
          },
          "$id": "properties_7_0"
        }
      ]
    },
    "tests": [
      {
        "description": "nested extra property is invalid",
        "data": {
          "nested": {
            "foo": "bar",
            "extra": 1
          }
        },
        "schema_id": "properties_7_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      }
    ]
  },
  {
    "description": "override: nested object allows extra properties if extensible: true",
    "database": {
      "schemas": [
        {
          "properties": {
            "nested": {
              "extensible": true,
              "properties": {
                "foo": {
                  "type": "string"
                }
              }
            }
          },
          "$id": "properties_8_0"
        }
      ]
    },
    "tests": [
      {
        "description": "nested extra property is valid",
        "data": {
          "nested": {
            "foo": "bar",
            "extra": 1
          }
        },
        "schema_id": "properties_8_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  },
  {
    "description": "inheritance: nested object inherits looseness from loose parent",
    "database": {
      "schemas": [
        {
          "extensible": true,
          "properties": {
            "nested": {
              "properties": {
                "foo": {
                  "type": "string"
                }
              }
            }
          },
          "$id": "properties_9_0"
        }
      ]
    },
    "tests": [
      {
        "description": "nested extra property is valid",
        "data": {
          "nested": {
            "foo": "bar",
            "extra": 1
          }
        },
        "schema_id": "properties_9_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  },
  {
    "description": "override: nested object enforces strictness if extensible: false",
    "database": {
      "schemas": [
        {
          "extensible": true,
          "properties": {
            "nested": {
              "extensible": false,
              "properties": {
                "foo": {
                  "type": "string"
                }
              }
            }
          },
          "$id": "properties_10_0"
        }
      ]
    },
    "tests": [
      {
        "description": "nested extra property is invalid",
        "data": {
          "nested": {
            "foo": "bar",
            "extra": 1
          }
        },
        "schema_id": "properties_10_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      }
    ]
  },
  {
    "description": "arrays: inline items inherit strictness from strict parent",
    "database": {
      "schemas": [
        {
          "properties": {
            "list": {
              "type": "array",
              "items": {
                "properties": {
                  "foo": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "$id": "properties_11_0"
        }
      ]
    },
    "tests": [
      {
        "description": "array item with extra property is invalid (strict parent)",
        "data": {
          "list": [
            {
              "foo": "bar",
              "extra": 1
            }
          ]
        },
        "schema_id": "properties_11_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      }
    ]
  },
  {
    "description": "arrays: inline items inherit looseness from loose parent",
    "database": {
      "schemas": [
        {
          "extensible": true,
          "properties": {
            "list": {
              "type": "array",
              "items": {
                "properties": {
                  "foo": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "$id": "properties_12_0"
        }
      ]
    },
    "tests": [
      {
        "description": "array item with extra property is valid (loose parent)",
        "data": {
          "list": [
            {
              "foo": "bar",
              "extra": 1
            }
          ]
        },
        "schema_id": "properties_12_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  }
]