{
  "openapi": "3.1.0",
  "info": {
    "title": "Odwołania2JSON API",
    "version": "1.0.0",
    "description": "API programu Odwołania2JSON. Program czyta PDF ze spraw odwoławczych KIO, rozpoznaje rodzaj dokumentu po treści i zwraca JSON w formacie Urzędu Zamówień Publicznych. Każde żądanie do /api/v1 wymaga klucza API w nagłówku Authorization: Bearer. Klucz tworzysz na ekranie Konto; serwer pokazuje go raz. W przeglądarce po zalogowaniu wystarcza ciasteczko sesji, a żądania zmieniające dane wysyłają też nagłówek X-CSRF."
  },
  "servers": [
    {
      "url": "/",
      "description": "ten serwer"
    }
  ],
  "security": [
    {
      "klucz": []
    },
    {
      "sesja": []
    }
  ],
  "paths": {
    "/api/v1/analizuj": {
      "post": {
        "summary": "Analiza jednego PDF jednym wywołaniem",
        "description": "Wgrywa jeden PDF, uruchamia program i czeka na wynik (w kolejce za innymi analizami). Odpowiedź zawiera JSON wyniku i ślad ekstrakcji.",
        "parameters": [
          {
            "name": "nazwa",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Nazwa pliku, np. odwolanie.pdf"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/pdf": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          },
          "description": "Surowa treść pliku PDF (bez multipart). Plik musi zaczynać się od %PDF, najwyżej 50 MB."
        },
        "responses": {
          "200": {
            "description": "Wynik i ślad",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WynikJednego"
                }
              }
            }
          },
          "400": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          },
          "401": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          },
          "413": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          },
          "415": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          },
          "500": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/analizy": {
      "get": {
        "summary": "Lista analiz od najnowszej",
        "responses": {
          "200": {
            "description": "Analizy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "analizy": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Analiza"
                      }
                    }
                  },
                  "required": [
                    "analizy"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Nowa analiza (jeden albo wiele PDF)",
        "description": "Tworzy pustą analizę. Pliki wysyłasz potem kolejno metodą PUT, a analizę uruchamiasz osobnym wywołaniem.",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "nazwa": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Utworzona analiza",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Analiza"
                }
              }
            }
          },
          "400": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          },
          "401": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          },
          "403": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/analizy/{id}": {
      "get": {
        "summary": "Stan i postęp analizy",
        "description": "Postęp to liczba gotowych plików JSON (`gotowe`) wobec liczby PDF (`pdf`).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{16}$"
            },
            "description": "Identyfikator analizy"
          }
        ],
        "responses": {
          "200": {
            "description": "Stan analizy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Analiza"
                }
              }
            }
          },
          "401": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          },
          "404": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Usunięcie analizy z plikami i wynikami",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{16}$"
            },
            "description": "Identyfikator analizy"
          }
        ],
        "responses": {
          "204": {
            "description": "Usunięta"
          },
          "401": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          },
          "404": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          },
          "409": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/analizy/{id}/pliki/{nazwa}": {
      "put": {
        "summary": "Wgranie jednego PDF do analizy",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{16}$"
            },
            "description": "Identyfikator analizy"
          },
          {
            "name": "nazwa",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Nazwa pliku albo `sprawa/plik.pdf` (zakodowana w adresie). Serwer zostawia ostatnie dwa człony."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/pdf": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          },
          "description": "Surowa treść pliku PDF (bez multipart). Plik musi zaczynać się od %PDF, najwyżej 50 MB."
        },
        "responses": {
          "201": {
            "description": "Plik zapisany",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "nazwa": {
                      "type": "string"
                    },
                    "rozmiar": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "nazwa",
                    "rozmiar"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          },
          "401": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          },
          "404": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          },
          "409": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          },
          "411": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          },
          "413": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          },
          "415": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/analizy/{id}/uruchom": {
      "post": {
        "summary": "Uruchomienie analizy",
        "description": "Program pracuje w tle, jedna analiza naraz; kolejne czekają w kolejce. Stan sprawdzasz przez GET /api/v1/analizy/{id}.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{16}$"
            },
            "description": "Identyfikator analizy"
          }
        ],
        "responses": {
          "202": {
            "description": "Analiza w kolejce albo w toku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Analiza"
                }
              }
            }
          },
          "401": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          },
          "404": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          },
          "409": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/analizy/{id}/wyniki/{nazwa}.json": {
      "get": {
        "summary": "Wynik JSON jednego dokumentu",
        "description": "Plik wyniku bajt w bajt taki, jak zapisał program. Dokument spoza klas ma {}.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{16}$"
            },
            "description": "Identyfikator analizy"
          },
          {
            "name": "nazwa",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Ścieżka wyniku bez .json, np. przyklad_01/odwolanie"
          }
        ],
        "responses": {
          "200": {
            "description": "Wynik w formacie UZP",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WynikUZP"
                }
              }
            }
          },
          "401": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          },
          "404": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/analizy/{id}/wyniki.zip": {
      "get": {
        "summary": "Wszystkie wyniki JSON w jednym pliku ZIP",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{16}$"
            },
            "description": "Identyfikator analizy"
          }
        ],
        "responses": {
          "200": {
            "description": "Archiwum ZIP z drzewem folderów jak w input",
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          },
          "404": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          },
          "409": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/klucze": {
      "get": {
        "summary": "Lista kluczy API (bez wartości kluczy)",
        "security": [
          {
            "sesja": []
          }
        ],
        "responses": {
          "200": {
            "description": "Klucze",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "klucze": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Klucz"
                      }
                    }
                  },
                  "required": [
                    "klucze"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Nowy klucz API",
        "security": [
          {
            "sesja": []
          }
        ],
        "description": "Wartość klucza jest w odpowiedzi tylko raz. Serwer przechowuje wyłącznie jej skrót SHA-256.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "nazwa": {
                    "type": "string"
                  }
                },
                "required": [
                  "nazwa"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Utworzony klucz",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "nazwa": {
                      "type": "string"
                    },
                    "klucz": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "nazwa",
                    "klucz"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          },
          "401": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          },
          "403": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/klucze/{id}": {
      "delete": {
        "summary": "Usunięcie klucza API",
        "security": [
          {
            "sesja": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Identyfikator klucza API"
          }
        ],
        "responses": {
          "204": {
            "description": "Usunięty"
          },
          "401": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          },
          "403": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          },
          "404": {
            "description": "Błąd z opisem po polsku",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Blad"
                }
              }
            }
          }
        }
      }
    },
    "/api/openapi.json": {
      "get": {
        "summary": "Ta specyfikacja",
        "security": [],
        "responses": {
          "200": {
            "description": "OpenAPI 3.1"
          }
        }
      }
    },
    "/zdrowie": {
      "get": {
        "summary": "Stan serwera",
        "security": [],
        "responses": {
          "200": {
            "description": "Serwer działa",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "ok"
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "klucz": {
        "type": "http",
        "scheme": "bearer",
        "description": "Klucz API z ekranu Konto."
      },
      "sesja": {
        "type": "apiKey",
        "in": "cookie",
        "name": "o2j_sesja",
        "description": "Sesja po zalogowaniu w przeglądarce. POST, PUT i DELETE wymagają nagłówka X-CSRF z wartością ciasteczka o2j_csrf."
      }
    },
    "schemas": {
      "Blad": {
        "type": "object",
        "properties": {
          "blad": {
            "type": "string",
            "description": "Co się stało i co zrobić"
          }
        },
        "required": [
          "blad"
        ]
      },
      "Klucz": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "nazwa": {
            "type": "string"
          },
          "utworzony": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "ISO 8601 UTC"
          },
          "ostatnio": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "ISO 8601 UTC"
          }
        },
        "required": [
          "id",
          "nazwa",
          "utworzony",
          "ostatnio"
        ]
      },
      "Analiza": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "nazwa": {
            "type": "string"
          },
          "stan": {
            "type": "string",
            "enum": [
              "nowa",
              "w_toku",
              "gotowa",
              "blad"
            ]
          },
          "pdf": {
            "type": "integer",
            "description": "liczba PDF w analizie"
          },
          "gotowe": {
            "type": "integer",
            "description": "liczba gotowych plików JSON"
          },
          "bledy": {
            "type": "integer",
            "description": "liczba dokumentów bez wyniku albo z błędem w śladzie"
          },
          "blad": {
            "type": [
              "string",
              "null"
            ],
            "description": "opis błędu całej analizy"
          },
          "utworzona": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "ISO 8601 UTC"
          },
          "zakonczona": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "ISO 8601 UTC"
          },
          "czas_s": {
            "type": "number"
          },
          "pliki": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "tylko w GET /api/v1/analizy/{id}"
          },
          "podglad": {
            "type": "string"
          },
          "zip": {
            "type": "string"
          }
        }
      },
      "WynikJednego": {
        "type": "object",
        "properties": {
          "nazwa": {
            "type": "string"
          },
          "klasa": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "odwolanie",
              "pelnomocnictwo",
              "przelew",
              null
            ]
          },
          "wynik": {
            "$ref": "#/components/schemas/WynikUZP"
          },
          "slad": {
            "type": [
              "object",
              "null"
            ],
            "description": "Ślad: plik, klasa, strony, pola (ścieżka, wartość, strona, fragment, metoda), bledy, czas_ms"
          },
          "analiza": {
            "type": "string"
          },
          "podglad": {
            "type": "string"
          }
        },
        "required": [
          "nazwa",
          "klasa",
          "wynik",
          "slad",
          "analiza",
          "podglad"
        ]
      },
      "WynikUZP": {
        "description": "Jeden z trzech kształtów UZP albo {} dla dokumentu spoza klas. Brak wartości to null.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/Odwolanie"
          },
          {
            "$ref": "#/components/schemas/Pelnomocnictwo"
          },
          {
            "$ref": "#/components/schemas/Przelew"
          },
          {
            "type": "object",
            "maxProperties": 0
          }
        ]
      },
      "Odwolanie": {
        "type": "object",
        "properties": {
          "OdwolanieKIO": {
            "type": "object",
            "properties": {
              "data": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date",
                "description": "RRRR-MM-DD"
              },
              "czynnosc_dzien": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date",
                "description": "RRRR-MM-DD"
              },
              "czynnosc_powod_id": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "czynnosc_opis": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "miejscowosc": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "data",
              "czynnosc_dzien",
              "czynnosc_powod_id",
              "czynnosc_opis",
              "miejscowosc"
            ]
          },
          "Odwolujacy": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "krs": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^[0-9]+$",
                  "description": "same cyfry"
                },
                "nazwa": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "nip": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^[0-9]+$",
                  "description": "same cyfry"
                },
                "regon": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^[0-9]+$",
                  "description": "same cyfry"
                },
                "przez-pelnomocnika": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "enum": [
                    0,
                    1,
                    null
                  ]
                },
                "pelnomocnik": {
                  "type": "object",
                  "properties": {
                    "imie_nazwisko": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "nazwa": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "mail": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "imie_nazwisko",
                    "nazwa",
                    "mail"
                  ]
                }
              },
              "required": [
                "krs",
                "nazwa",
                "nip",
                "regon",
                "przez-pelnomocnika",
                "pelnomocnik"
              ]
            }
          },
          "Zamawiajacy": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "krs": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^[0-9]+$",
                  "description": "same cyfry"
                },
                "nazwa": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "nip": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^[0-9]+$",
                  "description": "same cyfry"
                },
                "regon": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^[0-9]+$",
                  "description": "same cyfry"
                },
                "prowadzacy_postepowanie": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "krs",
                "nazwa",
                "nip",
                "regon",
                "prowadzacy_postepowanie"
              ]
            }
          },
          "ZamowieniePubliczne": {
            "type": "object",
            "properties": {
              "numer_bzp": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "numer_postepowania": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "numer_ted": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "tytul": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "numer_bzp",
              "numer_postepowania",
              "numer_ted",
              "tytul"
            ]
          }
        },
        "required": [
          "OdwolanieKIO",
          "Odwolujacy",
          "Zamawiajacy",
          "ZamowieniePubliczne"
        ]
      },
      "Pelnomocnictwo": {
        "type": "object",
        "properties": {
          "mocodawca": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "data": {
                  "type": "object",
                  "properties": {
                    "imie_nazwisko": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "krs": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "pattern": "^[0-9]+$",
                      "description": "same cyfry"
                    },
                    "nazwa": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "nip": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "pattern": "^[0-9]+$",
                      "description": "same cyfry"
                    },
                    "typ": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "imie_nazwisko",
                    "krs",
                    "nazwa",
                    "nip",
                    "typ"
                  ]
                },
                "podpisujacy": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "imie_nazwisko": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "imie_nazwisko"
                    ]
                  }
                }
              },
              "required": [
                "data",
                "podpisujacy"
              ]
            }
          },
          "pelnomocnicy": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "imie_nazwisko": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "pesel": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^[0-9]+$",
                  "description": "same cyfry"
                }
              },
              "required": [
                "imie_nazwisko",
                "pesel"
              ]
            }
          }
        },
        "required": [
          "mocodawca",
          "pelnomocnicy"
        ]
      },
      "Przelew": {
        "type": "object",
        "properties": {
          "przelew_bankowy": {
            "type": "object",
            "properties": {
              "data_operacji": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date",
                "description": "RRRR-MM-DD"
              },
              "kwota": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "na_rachunek": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^[0-9]+$",
                "description": "same cyfry"
              },
              "numer_transakcji": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "tytul": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "z_rachunku": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^[0-9]+$",
                "description": "same cyfry"
              }
            },
            "required": [
              "data_operacji",
              "kwota",
              "na_rachunek",
              "numer_transakcji",
              "tytul",
              "z_rachunku"
            ]
          }
        },
        "required": [
          "przelew_bankowy"
        ]
      }
    }
  }
}