{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "$id": "https://openbeautystandard.org/schema/0.9/search-request.schema.json",
 "title": "OBS search request",
 "type": "object",
 "required": [
  "service_code"
 ],
 "properties": {
  "obs_version": {
   "$ref": "common.schema.json#/$defs/obs_version"
  },
  "service_code": {
   "$ref": "common.schema.json#/$defs/code"
  },
  "expand": {
   "type": "string",
   "default": "nearby",
   "description": "how far to look: exact | narrower | nearby (exact, narrower, broader, sibling) | category; unknown values are read as nearby"
  },
  "include_descendants": {
   "type": "boolean",
   "description": "0.9.0: true reads as expand narrower, false as exact; still accepted"
  },
  "facets": {
   "$ref": "common.schema.json#/$defs/facets"
  },
  "location": {
   "type": "object",
   "properties": {
    "query": {
     "type": "string"
    },
    "lat": {
     "type": "number"
    },
    "lng": {
     "type": "number"
    },
    "radius_km": {
     "type": "number",
     "exclusiveMinimum": 0
    }
   }
  },
  "price": {
   "type": "object",
   "required": [
    "currency"
   ],
   "properties": {
    "max": {
     "type": "number",
     "minimum": 0
    },
    "currency": {
     "$ref": "common.schema.json#/$defs/currency"
    },
    "basis": {
     "enum": [
      "fixed",
      "from",
      "range"
     ],
     "default": "fixed"
    }
   }
  },
  "include_uncertain": {
   "type": "boolean",
   "default": true
  },
  "page": {
   "type": "object",
   "properties": {
    "size": {
     "type": "integer",
     "minimum": 1,
     "maximum": 100,
     "default": 20
    },
    "cursor": {
     "type": "string"
    }
   }
  }
 }
}
