{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/openvan-camp/json-schema/openvan-camp-toll-country-response-schema.json",
  "title": "TollCountryResponse",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/openvan-camp-openapi.json#/components/schemas/TollCountryResponse",
  "allOf": [
    {
      "$ref": "#/$defs/TollCountrySummary"
    },
    {
      "type": "object",
      "properties": {
        "sections": {
          "type": "array",
          "description": "Concession sections with their own per-km rates.",
          "items": {
            "type": "object",
            "properties": {
              "slug": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "rates_per_km_by_class": {
                "type": "object",
                "additionalProperties": {
                  "type": "number"
                }
              },
              "currency": {
                "type": "string"
              },
              "verified_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date"
              },
              "source_url": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        },
        "objects": {
          "type": "array",
          "description": "Toll bridges, tunnels, passes and ferries with a fixed price.",
          "items": {
            "type": "object",
            "properties": {
              "slug": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "bridge",
                  "tunnel",
                  "ferry",
                  "pass",
                  "gate"
                ]
              },
              "length_km": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "lat": {
                "type": "number"
              },
              "lng": {
                "type": "number"
              },
              "prices_by_class": {
                "type": "object",
                "additionalProperties": {
                  "type": "number"
                }
              },
              "currency": {
                "type": "string"
              },
              "prices_eur_by_class": {
                "type": "object",
                "additionalProperties": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              },
              "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"
        }
      }
    },
    "TollCountrySummary": {
      "type": "object",
      "properties": {
        "country_code": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "system_type": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "closed",
            "open",
            "free_flow",
            "vignette",
            "free",
            null
          ],
          "description": "Payment system for a passenger car. Heavier classes can differ (Poland and Belarus: free for cars, per-km for over 3.5 t) — read rates[].system_type per vehicle_class."
        },
        "rates": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TollRate"
          }
        },
        "vignettes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TollVignette"
          }
        },
        "sections_count": {
          "type": "integer"
        },
        "objects_count": {
          "type": "integer"
        },
        "verified_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        }
      }
    },
    "TollRate": {
      "type": "object",
      "properties": {
        "vehicle_class": {
          "type": "string",
          "enum": [
            "car",
            "van",
            "heavy"
          ],
          "description": "car; van = campervan/motorhome up to 3.5 t; heavy = over 3.5 t."
        },
        "system_type": {
          "type": "string",
          "enum": [
            "closed",
            "open",
            "free_flow",
            "vignette",
            "free"
          ]
        },
        "rate_per_km_local": {
          "type": [
            "number",
            "null"
          ]
        },
        "currency": {
          "type": "string"
        },
        "rate_per_km_eur": {
          "type": [
            "number",
            "null"
          ],
          "description": "Converted at the current exchange rate."
        },
        "seasonal": {
          "type": [
            "object",
            "null"
          ]
        },
        "verified_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "source_url": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "TollVignette": {
      "type": "object",
      "properties": {
        "vehicle_class": {
          "type": "string"
        },
        "period": {
          "type": "string"
        },
        "valid_days": {
          "type": "integer"
        },
        "price_local": {
          "type": "number"
        },
        "currency": {
          "type": "string"
        },
        "price_eur": {
          "type": [
            "number",
            "null"
          ]
        },
        "verified_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "source_url": {
          "type": "string",
          "format": "uri"
        },
        "buy_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        }
      }
    }
  }
}