$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.yaml
- required:
  - objectSelector
  properties:
    objectSelector:
      allOf:
      - $ref: https://ogcincubator.github.io/chek-profiles-bblocks/build/annotated/chekdbp/templates/object-selector/schema.yaml
      - type: object
        properties:
          requiredSubPath:
            description: 'Array with city object path, starting from the last element
              of "path", that is required to be present.

              If this is provided, only one of the objects in this sub path will have
              to comply with the attribute

              requirements.

              '
            minItems: 1
            $ref: https://ogcincubator.github.io/chek-profiles-bblocks/build/annotated/chekdbp/templates/object-selector/schema.yaml#/$defs/CityObjectArray
          geometrySurface:
            description: 'Geometry surface on which the attribute will be checked.

              Only one geometry surface is required to comply with the attribute requirements.

              '
            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'
