{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$defs": {
    "scalar": {
      "not": {
        "anyOf": [
          {
            "type": "object"
          },
          {
            "type": "array"
          }
        ]
      }
    }
  },
  "type": "object",
  "allOf": [
    {
      "$ref": "https://ogcincubator.github.io/chek-profiles-bblocks/build/annotated/chekdbp/templates/base-rule/schema.json"
    },
    {
      "required": [
        "objectSelector"
      ],
      "properties": {
        "objectSelector": {
          "allOf": [
            {
              "$ref": "https://ogcincubator.github.io/chek-profiles-bblocks/build/annotated/chekdbp/templates/object-selector/schema.json"
            },
            {
              "type": "object",
              "properties": {
                "requiredSubPath": {
                  "description": "Array with city object path, starting from the last element of \"path\", that is required to be present.\nIf this is provided, only one of the objects in this sub path will have to comply with the attribute\nrequirements.\n",
                  "minItems": 1,
                  "$ref": "https://ogcincubator.github.io/chek-profiles-bblocks/build/annotated/chekdbp/templates/object-selector/schema.json#/$defs/CityObjectArray"
                },
                "geometrySurface": {
                  "description": "Geometry surface on which the attribute will be checked.\nOnly one geometry surface is required to comply with the attribute requirements.\n",
                  "type": "string"
                }
              }
            }
          ]
        },
        "attributes": {
          "description": "Attributes to be checked",
          "additionalProperties": {
            "type": "object",
            "minProperties": 1,
            "additionalProperties": false,
            "properties": {
              "required": {
                "type": "boolean",
                "default": false
              },
              "regex": {
                "type": "string"
              }
            },
            "patternProperties": {
              "^(=|>|>=|<|<=)$": {
                "$ref": "#/$defs/scalar"
              }
            }
          }
        }
      }
    }
  ]
}