{
  "openapi": "3.0.3",
  "info": {
    "title": "Judic API v2",
    "version": "2.0.0",
    "description": "Öffentliche REST-API von Judic mit durchgängig deutschen JSON-Keys.\nKeine v1-Legacy-Aliase (z. B. keyword/sg_kw, ref neben reference, language neben\nsprache). v1 bleibt unter /api/v1/ unverändert.\n\nNeben Bundesrecht (Fedlex) liefert die API kantonale Gesetzestexte —\nderzeit Zürich (ZH-Lex), Aargau (LexWork) und Schwyz (SRSZ). Fehlende\nErlasse werden on-demand vom jeweiligen Katalog geholt und geparst.\n"
  },
  "servers": [
    {
      "url": "https://judic.ch"
    },
    {
      "url": "http://localhost:8080"
    }
  ],
  "tags": [
    {
      "name": "Entscheide"
    },
    {
      "name": "Gesetze",
      "description": "Bundeserlasse (Fedlex / SR)."
    },
    {
      "name": "Kantonsgesetze",
      "description": "Kantonale Gesetzestexte. Derzeit Zürich (`ZH`, ZH-Lex), Aargau (`AG`, LexWork)\nund Schwyz (`SZ`, SRSZ). `gesetz_id` ist Kürzel (z. B. GOG, KV) oder\nsystematische Nummer (211.1, 110.000, 100.100). Fehlt der Text lokal, wird\ner on-demand geholt.\n"
    },
    {
      "name": "Meta"
    },
    {
      "name": "Übersetzung"
    }
  ],
  "paths": {
    "/api/v2/entscheide": {
      "get": {
        "summary": "Paginierte Entscheidliste",
        "tags": [
          "Entscheide"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/versatz"
          },
          {
            "$ref": "#/components/parameters/sortierung"
          },
          {
            "$ref": "#/components/parameters/reihenfolge"
          },
          {
            "$ref": "#/components/parameters/gericht"
          },
          {
            "name": "von",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "bis",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "sachgebiet",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "erledigung",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Mehrfach möglich"
          },
          {
            "name": "stichwort",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Mehrfach möglich; matcht Sachgebiet, Themen, Abteilung"
          },
          {
            "name": "sprache",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "DE",
                "FR",
                "IT"
              ]
            },
            "description": "Mehrfach möglich"
          },
          {
            "name": "richter",
            "in": "query",
            "schema": {
              "type": "integer",
              "enum": [
                1,
                3,
                5
              ]
            },
            "description": "Mehrfach möglich"
          },
          {
            "name": "vorinstanz",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Gericht|Kammer, mehrfach möglich"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EntscheidListe"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/entscheid/{decision_id}": {
      "get": {
        "summary": "Vollständiger Entscheid",
        "tags": [
          "Entscheide"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/entscheid_id"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Entscheid"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/entscheid/{decision_id}/metadaten": {
      "get": {
        "summary": "Entscheid ohne Volltext",
        "tags": [
          "Entscheide"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/entscheid_id"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Entscheid"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/status/{decision_id}": {
      "get": {
        "summary": "Verfügbarkeitsstatus",
        "tags": [
          "Entscheide"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/entscheid_id"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/vorinstanzen": {
      "get": {
        "summary": "Häufigste Vorinstanzen für Filter",
        "tags": [
          "Meta"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/gericht"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 80
            }
          },
          {
            "name": "min_anzahl",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/statistik": {
      "get": {
        "summary": "Bestandsstatistik",
        "tags": [
          "Meta"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statistik"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/taxonomie": {
      "get": {
        "summary": "Rechtsgebiets-Taxonomie",
        "tags": [
          "Meta"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/letzte-aktualisierung": {
      "get": {
        "summary": "Letzter Pipeline-Lauf",
        "tags": [
          "Meta"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LetzteAktualisierung"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/openapi.json": {
      "get": {
        "summary": "OpenAPI 3 Spezifikation (JSON)",
        "tags": [
          "Meta"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/openapi.yaml": {
      "get": {
        "summary": "OpenAPI 3 Spezifikation (YAML)",
        "tags": [
          "Meta"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/gesetz/{identifier}": {
      "get": {
        "summary": "Bundeserlass-Übersicht",
        "tags": [
          "Gesetze"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/identifier"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GesetzUebersicht"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/gesetz/{identifier}/kopf": {
      "get": {
        "summary": "Gesetzeskopf (Titel/Abkürzung)",
        "tags": [
          "Gesetze"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/identifier"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/gesetz/{identifier}/gliederung": {
      "get": {
        "summary": "Gesetzesgliederung",
        "tags": [
          "Gesetze"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/identifier"
          },
          {
            "$ref": "#/components/parameters/sprache"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/gesetz/{identifier}/{article}": {
      "get": {
        "summary": "Artikel-Metadaten",
        "tags": [
          "Gesetze"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/identifier"
          },
          {
            "$ref": "#/components/parameters/article"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/gesetz/{identifier}/{article}/wortlaut": {
      "get": {
        "summary": "Artikelwortlaut",
        "tags": [
          "Gesetze"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/identifier"
          },
          {
            "$ref": "#/components/parameters/article"
          },
          {
            "$ref": "#/components/parameters/sprache"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/gesetz/{identifier}/{article}/zitiert-von": {
      "get": {
        "summary": "Zitierende Entscheide",
        "tags": [
          "Gesetze"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/identifier"
          },
          {
            "$ref": "#/components/parameters/article"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/versatz"
          },
          {
            "$ref": "#/components/parameters/sortierung"
          },
          {
            "$ref": "#/components/parameters/reihenfolge"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/gesetz/{identifier}/{article}/materialien": {
      "get": {
        "summary": "Materialien / Änderungsrefs",
        "tags": [
          "Gesetze"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/identifier"
          },
          {
            "$ref": "#/components/parameters/article"
          },
          {
            "$ref": "#/components/parameters/sprache"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/gesetz/{identifier}/{article}/kommentar": {
      "get": {
        "summary": "Kommentar",
        "tags": [
          "Gesetze"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/identifier"
          },
          {
            "$ref": "#/components/parameters/article"
          },
          {
            "$ref": "#/components/parameters/sprache"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/gesetz/{identifier}/{article}/historie": {
      "get": {
        "summary": "Artikelhistorie",
        "tags": [
          "Gesetze"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/identifier"
          },
          {
            "$ref": "#/components/parameters/article"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/gesetz/{identifier}/{article}/leitentscheide": {
      "get": {
        "summary": "Leitentscheide",
        "tags": [
          "Gesetze"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/identifier"
          },
          {
            "$ref": "#/components/parameters/article"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/aenderungs-ref": {
      "get": {
        "summary": "AS/BBl → Fedlex-URL",
        "tags": [
          "Gesetze"
        ],
        "parameters": [
          {
            "name": "typ",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "AS",
                "BBl"
              ]
            }
          },
          {
            "name": "jahr",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "seite",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/kantongesetz/{canton}/{law_id}": {
      "get": {
        "summary": "Kantonsgesetz-Übersicht",
        "description": "Metadaten zu einem kantonalen Erlass (`ZH`, `AG` oder `SZ`).\nFehlt der Text lokal, wird er on-demand geholt.\n",
        "tags": [
          "Kantonsgesetze"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/canton"
          },
          {
            "$ref": "#/components/parameters/law_id"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KantongesetzUebersicht"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/kantongesetz/{canton}/{law_id}/kopf": {
      "get": {
        "summary": "Kantonsgesetz-Kopf",
        "description": "Titel-/Versionskopf für den Gesetzesreader.",
        "tags": [
          "Kantonsgesetze"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/canton"
          },
          {
            "$ref": "#/components/parameters/law_id"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/kantongesetz/{canton}/{law_id}/gliederung": {
      "get": {
        "summary": "Kantonsgesetz-Gliederung",
        "description": "Inhaltsverzeichnis aus dem gecachten Reader-JSON.",
        "tags": [
          "Kantonsgesetze"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/canton"
          },
          {
            "$ref": "#/components/parameters/law_id"
          },
          {
            "$ref": "#/components/parameters/sprache"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/kantongesetz/{canton}/{law_id}/{article}": {
      "get": {
        "summary": "Kantonsartikel-Metadaten",
        "description": "Metadaten zu einem Paragraphen/Artikel eines kantonalen Erlasses.",
        "tags": [
          "Kantonsgesetze"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/canton"
          },
          {
            "$ref": "#/components/parameters/law_id"
          },
          {
            "$ref": "#/components/parameters/article"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/kantongesetz/{canton}/{law_id}/{article}/wortlaut": {
      "get": {
        "summary": "Kantonsartikel-Wortlaut",
        "description": "Wortlaut eines Paragraphen/Artikels (Absätze, Fussnoten).\nReader-Äquivalent: `/gesetz/ZH/GOG/3`, `/gesetz/AG/KV/1`, `/gesetz/SZ/KV/1`.\n",
        "tags": [
          "Kantonsgesetze"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/canton"
          },
          {
            "$ref": "#/components/parameters/law_id"
          },
          {
            "$ref": "#/components/parameters/article"
          },
          {
            "$ref": "#/components/parameters/sprache"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/uebersetzen": {
      "post": {
        "summary": "Rechtstext übersetzen (de/fr/it)",
        "tags": [
          "Übersetzung"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UebersetzenAnfrage"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UebersetzenAntwort"
                }
              }
            }
          },
          "400": {
            "description": "Ungültige Anfrage",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "413": {
            "description": "Text zu lang",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "503": {
            "description": "Nicht konfiguriert",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Fehler": {
        "type": "object",
        "required": [
          "fehler"
        ],
        "properties": {
          "fehler": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "ListenMeta": {
        "type": "object",
        "required": [
          "gesamt",
          "limit",
          "versatz",
          "geliefert",
          "zaehlung_ausstehend"
        ],
        "properties": {
          "gesamt": {
            "type": [
              "integer",
              "null"
            ],
            "description": "null solange COUNT asynchron läuft"
          },
          "limit": {
            "type": "integer"
          },
          "versatz": {
            "type": "integer"
          },
          "geliefert": {
            "type": "integer"
          },
          "zaehlung_ausstehend": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "EntscheidListeEintrag": {
        "type": "object",
        "required": [
          "referenz",
          "entscheid_id",
          "gericht"
        ],
        "properties": {
          "referenz": {
            "type": "string"
          },
          "entscheid_id": {
            "type": "string"
          },
          "entscheiddatum": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "publikationsdatum": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "sachgebiet": {
            "type": [
              "string",
              "null"
            ]
          },
          "themen": {
            "type": [
              "string",
              "null"
            ]
          },
          "erledigung": {
            "type": [
              "string",
              "null"
            ]
          },
          "sprache": {
            "type": [
              "string",
              "null"
            ]
          },
          "anzahl_richter": {
            "type": [
              "integer",
              "null"
            ]
          },
          "gericht": {
            "type": "string"
          },
          "ist_bge": {
            "type": "boolean"
          },
          "ist_bge_geplant": {
            "type": "boolean"
          },
          "vorinstanz_gericht": {
            "type": [
              "string",
              "null"
            ]
          },
          "vorinstanz_kammer": {
            "type": [
              "string",
              "null"
            ]
          },
          "regeste": {
            "type": [
              "string",
              "null"
            ]
          },
          "titel": {
            "type": [
              "string",
              "null"
            ]
          },
          "api_url": {
            "type": "string"
          },
          "viewer_url": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "EntscheidListe": {
        "type": "object",
        "required": [
          "daten",
          "meta"
        ],
        "properties": {
          "daten": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EntscheidListeEintrag"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/ListenMeta"
          }
        },
        "additionalProperties": false
      },
      "Vorinstanz": {
        "type": "object",
        "properties": {
          "gericht": {
            "type": "string"
          },
          "kammer": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Zitat": {
        "type": "object",
        "required": [
          "referenz"
        ],
        "properties": {
          "referenz": {
            "type": "string"
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "existiert": {
            "type": "boolean"
          },
          "verlinkt": {
            "type": "boolean"
          },
          "text": {
            "type": "string"
          }
        }
      },
      "GesetzZitat": {
        "type": "object",
        "required": [
          "text"
        ],
        "properties": {
          "text": {
            "type": "string"
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Referenzen": {
        "type": "object",
        "properties": {
          "bge_zitiert": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Zitat"
            }
          },
          "bger_zitiert": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Zitat"
            }
          },
          "bstger_zitiert": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Zitat"
            }
          },
          "gesetze": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GesetzZitat"
            }
          }
        },
        "additionalProperties": false
      },
      "EntscheidMeta": {
        "type": "object",
        "properties": {
          "referenz": {
            "type": "string"
          },
          "datum": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "publikationsdatum": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "sprache": {
            "type": [
              "string",
              "null"
            ]
          },
          "abteilung": {
            "type": [
              "string",
              "null"
            ]
          },
          "gegenstand": {
            "type": [
              "string",
              "null"
            ]
          },
          "erledigung": {
            "type": [
              "string",
              "null"
            ]
          },
          "anzahl_richter": {
            "type": [
              "integer",
              "null"
            ]
          },
          "ist_bge": {
            "type": "boolean"
          },
          "ist_bstger": {
            "type": "boolean"
          },
          "bge_publikation_vorgesehen": {
            "type": "boolean"
          },
          "besetzung": {
            "type": [
              "string",
              "null"
            ]
          },
          "gerichtsschreiber": {
            "type": [
              "string",
              "null"
            ]
          },
          "parteien": {
            "type": [
              "string",
              "null"
            ]
          },
          "vorinstanz": {
            "$ref": "#/components/schemas/Vorinstanz"
          },
          "quelle_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "bge_meta": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "Entscheid": {
        "type": "object",
        "required": [
          "meta",
          "entscheid_id",
          "referenz",
          "sachverhalt",
          "erwaegungen",
          "dispositiv",
          "referenzen"
        ],
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/EntscheidMeta"
          },
          "entscheid_id": {
            "type": "string"
          },
          "referenz": {
            "type": "string"
          },
          "sprache": {
            "type": [
              "string",
              "null"
            ]
          },
          "erledigung": {
            "type": [
              "string",
              "null"
            ]
          },
          "anzahl_richter": {
            "type": [
              "integer",
              "null"
            ]
          },
          "regeste": {
            "type": "string"
          },
          "titel": {
            "type": [
              "string",
              "null"
            ]
          },
          "quelle_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "entscheiddatum": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "gericht": {
            "type": [
              "string",
              "null"
            ]
          },
          "vorinstanz_gericht": {
            "type": [
              "string",
              "null"
            ]
          },
          "vorinstanz_kammer": {
            "type": [
              "string",
              "null"
            ]
          },
          "sachverhalt": {
            "type": "object"
          },
          "erwaegungen": {
            "type": "object"
          },
          "dispositiv": {
            "type": "object"
          },
          "referenzen": {
            "$ref": "#/components/schemas/Referenzen"
          }
        },
        "additionalProperties": false
      },
      "Statistik": {
        "type": "object",
        "required": [
          "entscheide_gesamt",
          "mit_volltext",
          "entscheiddatum_bereich",
          "nach_gericht",
          "gesetze_durchsuchbar"
        ],
        "properties": {
          "entscheide_gesamt": {
            "type": "integer"
          },
          "mit_volltext": {
            "type": "integer"
          },
          "entscheiddatum_bereich": {
            "type": "object",
            "properties": {
              "fruehestes": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date"
              },
              "spaetestes": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date"
              }
            },
            "additionalProperties": false
          },
          "neuestes_publikationsdatum": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "nach_gericht": {
            "type": "object",
            "properties": {
              "bger": {
                "type": "integer"
              },
              "bge": {
                "type": "integer"
              },
              "bge_egmr": {
                "type": "integer"
              },
              "bstger": {
                "type": "integer"
              }
            }
          },
          "gesetze_durchsuchbar": {
            "type": "integer"
          }
        },
        "additionalProperties": false
      },
      "LetzteAktualisierung": {
        "type": "object",
        "properties": {
          "letzte_aktualisierung": {
            "type": [
              "string",
              "null"
            ]
          },
          "letzte_aktualisierung_quelle": {
            "type": [
              "string",
              "null"
            ]
          },
          "heute_hinzugefuegt": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          }
        },
        "additionalProperties": false
      },
      "VorinstanzEintrag": {
        "type": "object",
        "required": [
          "gericht",
          "anzahl",
          "vorinstanz"
        ],
        "properties": {
          "gericht": {
            "type": "string"
          },
          "kammer": {
            "type": [
              "string",
              "null"
            ]
          },
          "anzahl": {
            "type": "integer"
          },
          "vorinstanz": {
            "type": "string",
            "description": "Wert für Query-Parameter vorinstanz"
          }
        },
        "additionalProperties": false
      },
      "GesetzUebersicht": {
        "type": "object",
        "required": [
          "sr",
          "abkuerzung"
        ],
        "properties": {
          "sr": {
            "type": "string"
          },
          "abkuerzung": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "titel": {
            "type": [
              "string",
              "null"
            ]
          },
          "fedlex_url": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "zitierte_artikel_anzahl": {
            "type": "integer"
          },
          "meistzitierte_artikel": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "artikel": {
                  "type": "string"
                },
                "anzahl": {
                  "type": "integer"
                },
                "url": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          }
        },
        "additionalProperties": false
      },
      "UebersetzenAnfrage": {
        "type": "object",
        "required": [
          "text",
          "quell_sprache",
          "ziel_sprache"
        ],
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 12000
          },
          "quell_sprache": {
            "type": "string",
            "enum": [
              "de",
              "fr",
              "it"
            ]
          },
          "ziel_sprache": {
            "type": "string",
            "enum": [
              "de",
              "fr",
              "it"
            ]
          }
        },
        "additionalProperties": false
      },
      "UebersetzenAntwort": {
        "type": "object",
        "required": [
          "uebersetzter_text",
          "quelle"
        ],
        "properties": {
          "uebersetzter_text": {
            "type": "string"
          },
          "quelle": {
            "type": "string",
            "enum": [
              "noop",
              "cache",
              "db",
              "claude"
            ]
          }
        },
        "additionalProperties": false
      },
      "KantongesetzUebersicht": {
        "type": "object",
        "required": [
          "ebene",
          "kanton",
          "gesetz_id"
        ],
        "properties": {
          "ebene": {
            "type": "string",
            "enum": [
              "kantonal"
            ]
          },
          "kanton": {
            "type": "string"
          },
          "gesetz_id": {
            "type": "string"
          },
          "systematische_nummer": {
            "type": [
              "string",
              "null"
            ]
          },
          "lexfind_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "abkuerzung": {
            "type": "object"
          },
          "titel": {
            "type": [
              "string",
              "null"
            ]
          },
          "quelle_url": {
            "type": "object"
          },
          "artikel_anzahl": {
            "type": [
              "integer",
              "null"
            ]
          },
          "version_aktiv_seit": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "additionalProperties": false
      }
    },
    "parameters": {
      "limit": {
        "name": "limit",
        "in": "query",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 500,
          "default": 20
        }
      },
      "versatz": {
        "name": "versatz",
        "in": "query",
        "schema": {
          "type": "integer",
          "minimum": 0,
          "default": 0
        }
      },
      "sprache": {
        "name": "sprache",
        "in": "query",
        "schema": {
          "type": "string",
          "enum": [
            "de",
            "fr",
            "it"
          ],
          "default": "de"
        },
        "description": "Antwortsprache für Gesetzestexte (de/fr/it)."
      },
      "sortierung": {
        "name": "sortierung",
        "in": "query",
        "schema": {
          "type": "string",
          "enum": [
            "publikationsdatum",
            "entscheiddatum",
            "geschaeftsnummer",
            "erledigung",
            "sachgebiet"
          ],
          "default": "publikationsdatum"
        }
      },
      "reihenfolge": {
        "name": "reihenfolge",
        "in": "query",
        "schema": {
          "type": "string",
          "enum": [
            "absteigend",
            "aufsteigend"
          ],
          "default": "absteigend"
        }
      },
      "gericht": {
        "name": "gericht",
        "in": "query",
        "schema": {
          "type": "string"
        },
        "description": "Gerichtscode oder Kommaliste, z. B. bger,bge,bstger"
      },
      "entscheid_id": {
        "name": "decision_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        },
        "description": "Normalisierte ID, z. B. bger_8C_388_2024"
      },
      "identifier": {
        "name": "identifier",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        },
        "description": "SR-Nummer oder Abkürzung (z. B. 311.0 oder StGB)"
      },
      "article": {
        "name": "article",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        },
        "description": "Artikelnummer in Kleinbuchstaben, z. B. 269quater"
      },
      "canton": {
        "name": "canton",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        },
        "description": "Kantonskürzel. Derzeit ZH (Zürich/ZH-Lex), AG (Aargau/LexWork), SZ (Schwyz/SRSZ)."
      },
      "law_id": {
        "name": "law_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        },
        "description": "Gesetzeskürzel (GOG, KV, …) oder systematische Nummer (211.1, 110.000, 100.100)"
      }
    }
  }
}
