{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://quadruper.invalid/contracts/geoapi-nearby-query.v1.schema.json",
  "title": "NearbyQuery",
  "description": "GET /v2/nearby query, parsed. Name the tags with category (plus an optional type list) or with tags, never both. limit counts per tag and defaults to min(10, floor(60 / n)) for n tags. The schema cannot check repeated tags or n x limit > 60; the route rejects those.",
  "type": "object",
  "properties": {
    "point": { "$ref": "geoapi-common.v1.schema.json#/$defs/lnglat" },
    "category": { "type": "string", "pattern": "^[a-z][a-z0-9_]{0,39}$" },
    "type": { "type": "string", "pattern": "^[a-z0-9_]{1,40}(,[a-z0-9_]{1,40}){0,11}$" },
    "tags": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_]{0,39}(:[a-z0-9_]{1,40})?(,[a-z][a-z0-9_]{0,39}(:[a-z0-9_]{1,40})?){0,11}$"
    },
    "limit": { "type": "integer", "minimum": 1, "maximum": 20 },
    "lang": { "type": "string", "pattern": "^[a-z]{2}$" }
  },
  "required": ["point"],
  "oneOf": [{ "required": ["category"] }, { "required": ["tags"] }],
  "dependentRequired": { "type": ["category"] },
  "additionalProperties": false
}
