{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/kviria-com/json-schema/kviria-com-target-schema.json",
  "title": "target",
  "x-generated": "2026-11-14",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/kviria-com-openapi.json#/components/schemas/target",
  "type": "object",
  "properties": {
    "gers": {
      "type": "string",
      "description": "Stable global entity id, persistent across turns and sessions."
    },
    "name": {
      "type": [
        "string",
        "null"
      ],
      "description": "The place name as-is; never paraphrase it."
    },
    "category": {
      "type": [
        "string",
        "null"
      ],
      "description": "The place category label."
    },
    "confidence": {
      "type": [
        "number",
        "null"
      ],
      "minimum": 0,
      "maximum": 1,
      "description": "Existence confidence, 0 to 1, or null."
    },
    "location": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number"
        },
        "lng": {
          "type": "number"
        }
      },
      "required": [
        "lat",
        "lng"
      ],
      "description": "Named lat/lng fields; no coordinate-array ordering ambiguity. Absent on one_unconfirmed: the coordinate comes with the user's yes."
    },
    "distanceM": {
      "type": "number",
      "minimum": 0,
      "description": "Straight-line meters from the anchor."
    },
    "walkM": {
      "type": "number",
      "minimum": 0,
      "description": "Meters a person walks from the anchor to the place's door, along the streets. distanceM stays the straight line."
    },
    "direction": {
      "type": "string",
      "enum": [
        "northwest",
        "northeast",
        "southwest",
        "southeast"
      ],
      "description": "The place's compass quadrant seen from the anchor. Absent when the place is at the anchor."
    },
    "address": {
      "type": "object",
      "properties": {
        "number": {
          "type": [
            "string",
            "null"
          ]
        },
        "street": {
          "type": "string"
        }
      },
      "required": [
        "street"
      ],
      "description": "The street address: the place's own (a unit left out), or the door's when the target is a door. Absent when the data has none."
    },
    "corner": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Set when the place is on a street corner: its own street, then the cross streets."
    },
    "acrossFromYou": {
      "type": "string",
      "description": "Set when the place is across the user's own street from the user: that street."
    },
    "relative": {
      "type": "string",
      "enum": [
        "ahead",
        "ahead-right",
        "right",
        "behind-right",
        "behind",
        "behind-left",
        "left",
        "ahead-left"
      ],
      "description": "Where the place is from what the user faces (45 degree sectors), when a heading is known and the place is 10 m or more away."
    },
    "nextTo": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Up to two places or addresses beside it on its own street and side, nearest first."
    },
    "nearAddress": {
      "type": "object",
      "properties": {
        "number": {
          "type": [
            "string",
            "null"
          ]
        },
        "street": {
          "type": "string"
        },
        "distanceM": {
          "type": "number"
        }
      },
      "required": [
        "street",
        "distanceM"
      ],
      "description": "Set only when the place has no address of its own: the nearest address within 30 meters. Not the place's own address: say it as near it."
    },
    "sameBuilding": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Up to two names in the same building as the place: the place the user named (near, next to) first, then other places in the answer. Never on across answers."
    },
    "tallBuilding": {
      "type": "boolean",
      "const": true,
      "description": "Set when the place's building is at least 1.5 times as tall as the tallest building within 60 meters. Never a height or a floor."
    },
    "intersection": {
      "type": "object",
      "properties": {
        "streets": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "streets"
      ],
      "description": "Set when the target is a street corner: every street that meets there. Such a target has category and confidence null."
    },
    "acrossStreet": {
      "type": "string",
      "description": "The street the answer is across: the base's own street when the user named none, the named street, or the corner's street when the place has two acrosses. One answer per street, each naming the street it is across."
    },
    "baseDistanceM": {
      "type": "number",
      "description": "Set when the answer is relative to a place (near, across, next to): metres from that place. distanceM stays the distance from the user."
    }
  },
  "required": [
    "gers",
    "name",
    "category",
    "confidence",
    "distanceM"
  ]
}