{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/openvan-camp/json-schema/openvan-camp-toll-route-response-schema.json",
  "title": "TollRouteResponse",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/openvan-camp-openapi.json#/components/schemas/TollRouteResponse",
  "type": "object",
  "properties": {
    "waypoints": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "points": {
      "type": "array",
      "description": "Where each place name resolved to — check country_code to catch ambiguous names.",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "lat": {
            "type": "number"
          },
          "lon": {
            "type": "number"
          },
          "country_code": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    },
    "distance_km": {
      "type": "integer"
    },
    "vehicle_class": {
      "type": "string"
    },
    "route_countries": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Countries the route passes through, in order."
    },
    "total_eur": {
      "type": [
        "number",
        "null"
      ]
    },
    "range_eur": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "min": {
          "type": "number"
        },
        "max": {
          "type": "number"
        }
      },
      "description": "Honest range: exit choice in closed systems changes the price."
    },
    "partial": {
      "type": "boolean",
      "description": "true = not all tolls are included; see unknown_countries and unchecked_countries."
    },
    "unknown_countries": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Countries on the route with no toll data in our reference (or none for this vehicle class). Not the same as toll-free."
    },
    "unchecked_countries": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Countries with per-km tolls where tolled kilometres on this route could not be measured."
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "per_km",
              "section",
              "vignette",
              "object"
            ]
          },
          "country": {
            "type": "string"
          },
          "amount_local": {
            "type": "number"
          },
          "currency": {
            "type": "string"
          },
          "amount_eur": {
            "type": [
              "number",
              "null"
            ]
          },
          "meta": {
            "type": "object"
          },
          "verified_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "source_url": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    },
    "_attribution": {
      "$ref": "#/$defs/Attribution"
    }
  },
  "$defs": {
    "Attribution": {
      "type": "object",
      "properties": {
        "data_source": {
          "type": "string"
        },
        "license": {
          "type": "string"
        },
        "required": {
          "type": "boolean",
          "description": "Attribution is required by the CC BY 4.0 license."
        },
        "attribution_url": {
          "type": "string",
          "format": "uri"
        },
        "attribution_html": {
          "type": "string",
          "description": "Show this HTML visibly next to the data."
        },
        "instructions": {
          "type": "string",
          "description": "Plain-language attribution requirement for developers and AI coding agents."
        },
        "your_source": {
          "type": "string"
        }
      }
    }
  }
}