{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/stream-estate/json-schema/stream-estate-search-collection-schema.json",
  "title": "SearchCollection",
  "description": "Paginated collection of searches.",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/stream-estate-openapi.json#/components/schemas/SearchCollection",
  "type": "object",
  "properties": {
    "hydra:member": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Search"
      }
    },
    "hydra:totalItems": {
      "type": "integer"
    },
    "hydra:view": {
      "$ref": "#/$defs/HydraView"
    },
    "hydra:search": {
      "$ref": "#/$defs/HydraSearch"
    }
  },
  "$defs": {
    "HydraSearch": {
      "type": "object",
      "properties": {
        "@type": {
          "type": "string"
        },
        "hydra:template": {
          "type": "string"
        },
        "hydra:variableRepresentation": {
          "type": "string"
        },
        "hydra:mapping": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "@type": {
                "type": "string"
              },
              "variable": {
                "type": "string"
              },
              "property": {
                "type": "string"
              },
              "required": {
                "type": "boolean"
              }
            }
          }
        }
      }
    },
    "HydraView": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string"
        },
        "@type": {
          "type": "string"
        },
        "hydra:first": {
          "type": "string"
        },
        "hydra:last": {
          "type": "string"
        },
        "hydra:next": {
          "type": "string"
        }
      }
    },
    "Search": {
      "type": "object",
      "description": "A saved search with optional webhook / email notifications.",
      "properties": {
        "@context": {
          "type": "string"
        },
        "@id": {
          "type": "string"
        },
        "@type": {
          "type": "string"
        },
        "bedroomMin": {
          "type": [
            "integer",
            "null"
          ]
        },
        "bedroomMax": {
          "type": [
            "integer",
            "null"
          ]
        },
        "budgetMax": {
          "type": [
            "number",
            "null"
          ]
        },
        "budgetMin": {
          "type": [
            "number",
            "null"
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "endpointRecipient": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "HTTPS webhook that receives `match` payloads."
        },
        "eventEndpoint": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "HTTPS webhook that receives advert `event` payloads."
        },
        "excludedCities": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "excludedSiteCategories": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "expressions": {
          "description": "Full text matching rules applied to the title or description."
        },
        "furnished": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "hidePropertyContact": {
          "type": "boolean"
        },
        "includedCities": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "includedDepartments": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "includedSiteCategories": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "landSurfaceMax": {
          "type": [
            "number",
            "null"
          ]
        },
        "landSurfaceMin": {
          "type": [
            "number",
            "null"
          ]
        },
        "lastAlertAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "lat": {
          "type": [
            "number",
            "null"
          ]
        },
        "lon": {
          "type": [
            "number",
            "null"
          ]
        },
        "notificationEnabled": {
          "type": "boolean"
        },
        "notificationRecipient": {
          "type": [
            "string",
            "null"
          ]
        },
        "pricePerMeterMax": {
          "type": [
            "number",
            "null"
          ]
        },
        "pricePerMeterMin": {
          "type": [
            "number",
            "null"
          ]
        },
        "propertyTypes": {
          "type": "array",
          "description": "Apartment `0`, House `1`, Building `2`, Parking `3`, Office `4`, Land `5`, Shop `6`.",
          "items": {
            "type": "integer",
            "enum": [
              0,
              1,
              2,
              3,
              4,
              5,
              6
            ]
          }
        },
        "publisherTypes": {
          "type": "array",
          "description": "Individual `0`, Professional `1`.",
          "items": {
            "type": "integer",
            "enum": [
              0,
              1
            ]
          }
        },
        "radius": {
          "type": [
            "number",
            "null"
          ],
          "description": "Distance in kilometers around `lat`/`lon`."
        },
        "roomMin": {
          "type": [
            "integer",
            "null"
          ]
        },
        "roomMax": {
          "type": [
            "integer",
            "null"
          ]
        },
        "subscribedEvents": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "ad.update.price",
              "ad.update.surface",
              "ad.update.pictures",
              "ad.update.expired",
              "property.ad.create",
              "property.ad.update"
            ]
          }
        },
        "surfaceMax": {
          "type": [
            "number",
            "null"
          ]
        },
        "surfaceMin": {
          "type": [
            "number",
            "null"
          ]
        },
        "title": {
          "type": "string"
        },
        "token": {
          "type": "string"
        },
        "transactionType": {
          "type": "integer",
          "description": "Sell `0`, Rent `1`.",
          "enum": [
            0,
            1
          ]
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "user": {
          "type": "string"
        },
        "withCoherentPrice": {
          "type": "boolean"
        },
        "withVirtualTour": {
          "type": [
            "boolean",
            "null"
          ]
        }
      }
    }
  }
}