{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://quadruper.invalid/contracts/geoapi-info-response.v1.schema.json",
  "title": "InfoResponse",
  "description": "GET /v2/info 200 body. A capability is listed only when its endpoint works.",
  "type": "object",
  "properties": {
    "contract_version": { "type": "string", "pattern": "^2\\.[0-9]+$" },
    "coverage": {
      "type": "object",
      "properties": { "bbox": { "$ref": "geoapi-common.v1.schema.json#/$defs/bbox" } },
      "required": ["bbox"],
      "additionalProperties": false
    },
    "routing": {
      "type": "object",
      "properties": {
        "engine": { "type": "string", "minLength": 1 },
        "version": { "type": "string", "minLength": 1 },
        "profiles": {
          "type": "array",
          "minItems": 1,
          "items": {
            "title": "ProfileInfo",
            "type": "object",
            "properties": {
              "name": { "$ref": "geoapi-common.v1.schema.json#/$defs/profile" },
              "approximate": { "type": "boolean" }
            },
            "required": ["name", "approximate"],
            "additionalProperties": false
          }
        }
      },
      "required": ["engine", "version", "profiles"],
      "additionalProperties": false
    },
    "geocoding": {
      "type": "object",
      "properties": {
        "engine": { "type": "string", "minLength": 1 },
        "version": { "type": "string", "minLength": 1 }
      },
      "required": ["engine", "version"],
      "additionalProperties": false
    },
    "sources": {
      "type": "array",
      "minItems": 1,
      "items": {
        "title": "SourceInfo",
        "type": "object",
        "properties": {
          "source": { "enum": ["osm", "local"] },
          "data_date": {
            "oneOf": [{ "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$" }, { "type": "null" }]
          }
        },
        "required": ["source", "data_date"],
        "additionalProperties": false
      }
    },
    "capabilities": {
      "title": "Capabilities",
      "type": "object",
      "properties": {
        "route": {
          "type": "object",
          "properties": { "max_points": { "const": 10 }, "steps": { "type": "boolean" } },
          "required": ["max_points", "steps"],
          "additionalProperties": false
        },
        "nearest": { "type": "object", "additionalProperties": false },
        "isochrone": {
          "type": "object",
          "properties": { "max_values": { "const": 3 }, "max_time_s": { "const": 1800 }, "step_s": { "const": 60 } },
          "required": ["max_values", "max_time_s", "step_s"],
          "additionalProperties": false
        },
        "matrix": {
          "type": "object",
          "properties": { "max_cells": { "const": 25 } },
          "required": ["max_cells"],
          "additionalProperties": false
        },
        "geocode": {
          "type": "object",
          "properties": {
            "max_limit": { "const": 10 },
            "structured": { "type": "boolean" },
            "near": { "type": "boolean" },
            "near_text": { "type": "boolean" },
            "bbox": { "type": "boolean" }
          },
          "required": ["max_limit", "structured", "near", "near_text", "bbox"],
          "additionalProperties": false
        },
        "reverse": { "type": "object", "additionalProperties": false }
      },
      "required": ["route", "geocode", "reverse"],
      "additionalProperties": false
    },
    "attribution": { "$ref": "geoapi-common.v1.schema.json#/$defs/attribution" }
  },
  "required": ["contract_version", "coverage", "routing", "geocoding", "sources", "capabilities", "attribution"],
  "additionalProperties": false
}
