{
 "openapi": "3.1.0",
 "info": {
  "title": "Rozvrhy škôl SR",
  "version": "1.0.0",
  "description": "Zvonenie a rozvrhy tried základných a stredných škôl na Slovensku. Bez kľúča, CORS otvorený, 60 požiadaviek za minútu na IP. Celé dáta naraz: /data/skoly.json, /data/skoly.csv, /data/skoly/{eduid}.json. Voľne na použitie s uvedením zdroja."
 },
 "servers": [
  {
   "url": "https://rozvrh.dvoriste.xyz"
  }
 ],
 "paths": {
  "/api/v1/schools": {
   "get": {
    "summary": "Hľadanie škôl",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "schema": {
       "type": "string",
       "maxLength": 100
      },
      "description": "Slová z názvu, obce alebo okresu"
     },
     {
      "name": "mesto",
      "in": "query",
      "schema": {
       "type": "string",
       "maxLength": 100
      }
     },
     {
      "name": "kraj",
      "in": "query",
      "schema": {
       "type": "string",
       "maxLength": 100
      }
     },
     {
      "name": "stupen",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "SŠ",
        "ZŠ"
       ]
      }
     },
     {
      "name": "stav",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "verejny_rozvrh",
        "len_zvonenie",
        "nenajdene"
       ]
      }
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 500,
       "default": 50
      }
     }
    ],
    "responses": {
     "200": {
      "description": "{ pocet, vytvorene, skoly[] }",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "400": {
      "description": "Chyba",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "chyba": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Príliš veľa požiadaviek (60 za minútu na IP)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "chyba": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/schools/{id}": {
   "get": {
    "summary": "Celý záznam školy vrátane rozvrhov tried",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "EDUID z registra CVTI, subdoména EduPage (napr. gvoza) alebo adresa stránky školy",
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9-]{1,100}$"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Škola",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "404": {
      "description": "Chyba",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "chyba": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Príliš veľa požiadaviek (60 za minútu na IP)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "chyba": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/schools/{id}/zvonenie": {
   "get": {
    "summary": "Zvonenie školy",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "EDUID z registra CVTI, subdoména EduPage (napr. gvoza) alebo adresa stránky školy",
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9-]{1,100}$"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Zvonenie a jeho zdroj",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "404": {
      "description": "Chyba",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "chyba": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Príliš veľa požiadaviek (60 za minútu na IP)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "chyba": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/schools/{id}/triedy": {
   "get": {
    "summary": "Zoznam tried s verejným rozvrhom",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "EDUID z registra CVTI, subdoména EduPage (napr. gvoza) alebo adresa stránky školy",
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9-]{1,100}$"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Triedy",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "404": {
      "description": "Chyba",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "chyba": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Príliš veľa požiadaviek (60 za minútu na IP)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "chyba": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/schools/{id}/triedy/{trieda}/rozvrh": {
   "get": {
    "summary": "Týždenný rozvrh triedy",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "EDUID z registra CVTI, subdoména EduPage (napr. gvoza) alebo adresa stránky školy",
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9-]{1,100}$"
      }
     },
     {
      "name": "trieda",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "maxLength": 50
      },
      "description": "Názov triedy, napr. I.A"
     }
    ],
    "responses": {
     "200": {
      "description": "Bloky rozvrhu s časmi",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "404": {
      "description": "Chyba",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "chyba": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Príliš veľa požiadaviek (60 za minútu na IP)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "chyba": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
}