[
  {
    "description": "propertyNames validation",
    "database": {
      "schemas": [
        {
          "propertyNames": {
            "maxLength": 3
          },
          "extensible": true,
          "$id": "propertyNames_0_0"
        }
      ]
    },
    "tests": [
      {
        "description": "all property names valid",
        "data": {
          "f": {},
          "foo": {}
        },
        "schema_id": "propertyNames_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "some property names invalid",
        "data": {
          "foo": {},
          "foobar": {}
        },
        "schema_id": "propertyNames_0_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "object without properties is valid",
        "data": {},
        "schema_id": "propertyNames_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "ignores arrays",
        "data": [
          1,
          2,
          3,
          4
        ],
        "schema_id": "propertyNames_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "ignores strings",
        "data": "foobar",
        "schema_id": "propertyNames_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "ignores other non-objects",
        "data": 12,
        "schema_id": "propertyNames_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  },
  {
    "description": "propertyNames validation with pattern",
    "database": {
      "schemas": [
        {
          "propertyNames": {
            "pattern": "^a+$"
          },
          "extensible": true,
          "$id": "propertyNames_1_0"
        }
      ]
    },
    "tests": [
      {
        "description": "matching property names valid",
        "data": {
          "a": {},
          "aa": {},
          "aaa": {}
        },
        "schema_id": "propertyNames_1_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "non-matching property name is invalid",
        "data": {
          "aaA": {}
        },
        "schema_id": "propertyNames_1_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "object without properties is valid",
        "data": {},
        "schema_id": "propertyNames_1_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  },
  {
    "description": "propertyNames with boolean schema true",
    "database": {
      "schemas": [
        {
          "propertyNames": true,
          "extensible": true,
          "$id": "propertyNames_2_0"
        }
      ]
    },
    "tests": [
      {
        "description": "object with any properties is valid",
        "data": {
          "foo": 1
        },
        "schema_id": "propertyNames_2_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "empty object is valid",
        "data": {},
        "schema_id": "propertyNames_2_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  },
  {
    "description": "propertyNames with boolean schema false",
    "database": {
      "schemas": [
        {
          "propertyNames": false,
          "extensible": true,
          "$id": "propertyNames_3_0"
        }
      ]
    },
    "tests": [
      {
        "description": "object with any properties is invalid",
        "data": {
          "foo": 1
        },
        "schema_id": "propertyNames_3_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "empty object is valid",
        "data": {},
        "schema_id": "propertyNames_3_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  },
  {
    "description": "propertyNames with const",
    "database": {
      "schemas": [
        {
          "propertyNames": {
            "const": "foo"
          },
          "extensible": true,
          "$id": "propertyNames_4_0"
        }
      ]
    },
    "tests": [
      {
        "description": "object with property foo is valid",
        "data": {
          "foo": 1
        },
        "schema_id": "propertyNames_4_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "object with any other property is invalid",
        "data": {
          "bar": 1
        },
        "schema_id": "propertyNames_4_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "empty object is valid",
        "data": {},
        "schema_id": "propertyNames_4_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  },
  {
    "description": "propertyNames with enum",
    "database": {
      "schemas": [
        {
          "propertyNames": {
            "enum": [
              "foo",
              "bar"
            ]
          },
          "extensible": true,
          "$id": "propertyNames_5_0"
        }
      ]
    },
    "tests": [
      {
        "description": "object with property foo is valid",
        "data": {
          "foo": 1
        },
        "schema_id": "propertyNames_5_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "object with property foo and bar is valid",
        "data": {
          "foo": 1,
          "bar": 1
        },
        "schema_id": "propertyNames_5_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "object with any other property is invalid",
        "data": {
          "baz": 1
        },
        "schema_id": "propertyNames_5_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "empty object is valid",
        "data": {},
        "schema_id": "propertyNames_5_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  },
  {
    "description": "extensible: true allows extra properties (checked by propertyNames)",
    "database": {
      "schemas": [
        {
          "propertyNames": {
            "maxLength": 3
          },
          "extensible": true,
          "$id": "propertyNames_6_0"
        }
      ]
    },
    "tests": [
      {
        "description": "extra property with valid name is valid",
        "data": {
          "foo": 1
        },
        "schema_id": "propertyNames_6_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "extra property with invalid name is invalid",
        "data": {
          "foobar": 1
        },
        "schema_id": "propertyNames_6_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      }
    ]
  }
]