{
  "openapi": "3.1.0",
  "info": {
    "title": "SzuperSuli API",
    "version": "1.0.0",
    "description": "Tantárgyak, évfolyamok, fejezetek és videóleckék katalógusa az 1–12. osztály számára, valamint az előfizetési csomagok. A nyilvános olvasások névtelenek, és 5 percig gyorsítótárazhatók. Korlátozás: IP-címenként 200 kérés / 5 perc, utána fokozatos késleltetés.",
    "termsOfService": "https://szupersuli.ro/terms",
    "contact": {
      "name": "SzuperSuli",
      "url": "https://szupersuli.ro/contact"
    }
  },
  "servers": [
    {
      "url": "https://szupersuli.ro/api"
    }
  ],
  "paths": {
    "/public/subjects": {
      "get": {
        "operationId": "listSubjects",
        "summary": "Az aktív tantárgyak listája, címduplikátumok nélkül.",
        "security": [
          {},
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Az elérhető tantárgyak.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Subject"
                  }
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/public/grouped-subjects": {
      "get": {
        "operationId": "listGroupedSubjects",
        "summary": "A tantárgyak az évfolyamaikkal, a navigációs menühöz.",
        "security": [
          {},
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Tantárgyak alkategóriákkal.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/SubjectSummary"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "subcategories": {
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/SubjectSummary"
                            }
                          }
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/public/courses": {
      "get": {
        "operationId": "listCourses",
        "summary": "Egy tantárgy évfolyamai (kurzusai).",
        "parameters": [
          {
            "name": "subjectId",
            "in": "query",
            "required": true,
            "description": "A szülő tantárgy azonosítója.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A kért tantárgy évfolyamai.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Course"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/public/packages": {
      "get": {
        "operationId": "listPackages",
        "summary": "Az aktív előfizetési csomagok és az ajánlat visszaszámlálója.",
        "responses": {
          "200": {
            "description": "A csomagok és a visszaszámláló beállításai.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "packages": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Package"
                      }
                    },
                    "offersCountdown": {
                      "type": "object",
                      "properties": {
                        "OffersCountdownText": {
                          "type": "string"
                        },
                        "OffersCountdownTextVisible": {
                          "type": "boolean"
                        },
                        "OffersCountdownVisible": {
                          "type": "boolean"
                        },
                        "OffersCountdownExpiresAt": {
                          "type": ["string", "null"],
                          "format": "date-time"
                        }
                      }
                    }
                  },
                  "required": ["packages", "offersCountdown"]
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/public/packages/{parameter}": {
      "get": {
        "operationId": "viewPackage",
        "summary": "Egy csomag adatai a nyilvános paramétere alapján.",
        "parameters": [
          {
            "name": "parameter",
            "in": "path",
            "required": true,
            "description": "A csomag nyilvános paramétere.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A kért csomag az előnyeivel és az alkalmazott kuponnal.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Package"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "description": {
                          "type": ["string", "null"]
                        },
                        "months": {
                          "type": ["integer", "null"]
                        },
                        "categoryId": {
                          "type": ["integer", "null"]
                        },
                        "categoryType": {
                          "type": ["string", "null"]
                        },
                        "couponDiscountPercent": {
                          "type": ["number", "null"]
                        },
                        "couponDiscountValue": {
                          "type": ["number", "null"]
                        },
                        "coupon": {
                          "type": "object",
                          "properties": {
                            "duration": {
                              "type": "string"
                            },
                            "durationInMonths": {
                              "type": ["integer", "null"]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/public/autocomplete-lessons": {
      "get": {
        "operationId": "autocompleteLessons",
        "summary": "Leckecím-javaslatok a gyorskereséshez.",
        "parameters": [
          {
            "name": "searchTerm",
            "in": "query",
            "required": true,
            "description": "A keresett kifejezés, legalább 3 karakter.",
            "schema": {
              "type": "string",
              "minLength": 3
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Legfeljebb 14 normalizált cím.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/public/sitemap-paths": {
      "get": {
        "operationId": "listSitemapPaths",
        "summary": "A platform összes nyilvános URL-je a sitemaphez.",
        "responses": {
          "200": {
            "description": "A sitemap bejegyzései.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "loc": {
                        "type": "string",
                        "format": "uri"
                      },
                      "priority": {
                        "type": "number"
                      },
                      "changefreq": {
                        "type": "string"
                      }
                    },
                    "required": ["loc", "priority", "changefreq"]
                  }
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/public/button-settings": {
      "get": {
        "operationId": "getButtonSettings",
        "summary": "Az adminban beállított regisztrációs gombok szövegei.",
        "responses": {
          "200": {
            "description": "A jelenlegi szövegek.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "RegistrationButtonText": {
                      "type": "string"
                    },
                    "FreeRegistrationButtonText": {
                      "type": "string"
                    }
                  },
                  "required": ["RegistrationButtonText", "FreeRegistrationButtonText"]
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/public/breadcrumbs": {
      "post": {
        "operationId": "getBreadcrumbs",
        "summary": "Az URL slugjait morzsamenü-címkékké alakítja.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "object",
                    "properties": {
                      "subjectSlug": {
                        "type": "string"
                      },
                      "categorySlug": {
                        "type": "string"
                      },
                      "chapterSlug": {
                        "type": "string"
                      }
                    },
                    "required": ["subjectSlug"]
                  }
                },
                "required": ["query"]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A morzsamenü elemei, a tantárgytól a fejezetig.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string"
                      },
                      "href": {
                        "type": "string"
                      }
                    },
                    "required": ["label", "href"]
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/client/subjects/{id}": {
      "get": {
        "operationId": "viewSubject",
        "summary": "Egy tantárgy azonosító alapján.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdPath"
          }
        ],
        "responses": {
          "200": {
            "description": "A kért tantárgy.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Subject"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/client/lessons": {
      "get": {
        "operationId": "listLessons",
        "summary": "Egy évfolyam fejezetei, mindegyik a leckéivel.",
        "parameters": [
          {
            "name": "courseId",
            "in": "query",
            "required": true,
            "description": "Az évfolyam (kurzus) azonosítója.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Az évfolyam fejezetei a leckéikkel.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "Id": {
                        "type": "integer"
                      },
                      "CategoryId": {
                        "type": "integer"
                      },
                      "Title": {
                        "type": "string"
                      },
                      "OrderNo": {
                        "type": "integer"
                      },
                      "IsActive": {
                        "type": "boolean"
                      },
                      "IsDeleted": {
                        "type": "boolean"
                      },
                      "IsFree": {
                        "type": "boolean"
                      },
                      "MetaTitle": {
                        "type": ["string", "null"]
                      },
                      "MetaDescription": {
                        "type": ["string", "null"]
                      },
                      "Chapters": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/Lesson"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/client/lessons/{id}": {
      "get": {
        "operationId": "viewLesson",
        "summary": "Egy lecke azonosító alapján, a környezetével és a következő leckékkel.",
        "security": [
          {},
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdPath"
          }
        ],
        "responses": {
          "200": {
            "description": "A kért lecke.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Lesson"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "ChapterId": {
                          "type": "integer"
                        },
                        "ChapterTitle": {
                          "type": "string"
                        },
                        "CategoryId": {
                          "type": "integer"
                        },
                        "CategoryTitle": {
                          "type": "string"
                        },
                        "SubjectId": {
                          "type": "integer"
                        },
                        "SubjectTitle": {
                          "type": "string"
                        },
                        "DiplomaEnabled": {
                          "type": "boolean"
                        },
                        "HasExercise": {
                          "type": "boolean"
                        },
                        "Slug": {
                          "type": "string"
                        },
                        "UploadDate": {
                          "type": ["string", "null"]
                        },
                        "NextLessons": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Lesson"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/client/search-lessons": {
      "get": {
        "operationId": "searchLessons",
        "summary": "Keresés a leckékben, tantárgy és évfolyam szerint csoportosítva.",
        "parameters": [
          {
            "name": "searchTerm",
            "in": "query",
            "required": true,
            "description": "A keresett kifejezés; 3 karakter alatt üres listát ad vissza.",
            "schema": {
              "type": "string",
              "minLength": 3
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Találati csoportok.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "SubjectId": {
                        "type": "integer"
                      },
                      "SubjectTitle": {
                        "type": "string"
                      },
                      "CourseId": {
                        "type": "integer"
                      },
                      "CourseTitle": {
                        "type": "string"
                      },
                      "CourseOrder": {
                        "type": "integer"
                      },
                      "Videos": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/Lesson"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Opcionális. Token nélkül a válaszok csak a nyilvános tartalmat tartalmazzák."
      }
    },
    "parameters": {
      "IdPath": {
        "name": "id",
        "in": "path",
        "required": true,
        "description": "Numerikus azonosító.",
        "schema": {
          "type": "integer"
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Hiányzó vagy érvénytelen paraméterek.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "Az erőforrás nem létezik.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "ServerError": {
        "description": "Belső hiba.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "description": "Az API egységes hibaformátuma.",
        "properties": {
          "name": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": ["name", "message"]
      },
      "Badge": {
        "type": "object",
        "properties": {
          "IconName": {
            "type": "string"
          },
          "BadgeTitle": {
            "type": "string"
          }
        }
      },
      "SubjectSummary": {
        "type": "object",
        "description": "Tantárgy vagy évfolyam, csak a navigációs és SEO-mezőkkel.",
        "properties": {
          "Id": {
            "type": "integer"
          },
          "Title": {
            "type": "string"
          },
          "ParentCategoryId": {
            "type": ["integer", "null"]
          },
          "OrderNo": {
            "type": "integer"
          },
          "MetaTitle": {
            "type": ["string", "null"]
          },
          "MetaDescription": {
            "type": ["string", "null"]
          }
        }
      },
      "Subject": {
        "type": "object",
        "description": "Tantárgy (gyökérkategória).",
        "properties": {
          "Id": {
            "type": "integer"
          },
          "Title": {
            "type": "string"
          },
          "Description1": {
            "type": ["string", "null"]
          },
          "Description2": {
            "type": ["string", "null"]
          },
          "Description3": {
            "type": ["string", "null"]
          },
          "Image1Url": {
            "type": ["string", "null"]
          },
          "Image2Url": {
            "type": ["string", "null"]
          },
          "Image3Url": {
            "type": ["string", "null"]
          },
          "IsActive": {
            "type": "boolean"
          },
          "IsDeleted": {
            "type": "boolean"
          },
          "OrderNo": {
            "type": "integer"
          },
          "ParentCategoryId": {
            "type": ["integer", "null"]
          },
          "MetaTitle": {
            "type": ["string", "null"]
          },
          "MetaDescription": {
            "type": ["string", "null"]
          },
          "Badges": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Badge"
            }
          }
        }
      },
      "Course": {
        "$ref": "#/components/schemas/Subject",
        "description": "Egy tantárgy évfolyama; ugyanolyan szerkezetű, mint a Subject, beállított ParentCategoryId-val."
      },
      "Lesson": {
        "type": "object",
        "description": "Videólecke; a tartalommezők hiányoznak, ha az AccessType korlátozott.",
        "properties": {
          "Id": {
            "type": "integer"
          },
          "SubcategoryId": {
            "type": "integer"
          },
          "SubcategoryTitle": {
            "type": ["string", "null"]
          },
          "Title": {
            "type": "string"
          },
          "Description1": {
            "type": ["string", "null"]
          },
          "Description2": {
            "type": ["string", "null"]
          },
          "Image1Url": {
            "type": ["string", "null"]
          },
          "Image2Url": {
            "type": ["string", "null"]
          },
          "VideoUrl": {
            "type": ["string", "null"]
          },
          "ShortVideoUrl": {
            "type": ["string", "null"]
          },
          "PreviewUrl": {
            "type": ["string", "null"]
          },
          "TextScriptUrl": {
            "type": ["string", "null"]
          },
          "TranscriptUrl": {
            "type": ["string", "null"]
          },
          "LessonHtmlContent": {
            "type": ["string", "null"]
          },
          "TestEmbeddedCode": {
            "type": ["string", "null"]
          },
          "TestId": {
            "type": ["integer", "null"]
          },
          "QuizId": {
            "type": ["integer", "null"]
          },
          "ExerciseId": {
            "type": ["integer", "null"]
          },
          "IsFree": {
            "type": "boolean"
          },
          "IsFreeForRegistered": {
            "type": "boolean"
          },
          "IsDeleted": {
            "type": "boolean"
          },
          "HasCC": {
            "type": "boolean"
          },
          "OrderNo": {
            "type": "integer"
          },
          "MetaTitle": {
            "type": ["string", "null"]
          },
          "MetaDescription": {
            "type": ["string", "null"]
          },
          "MetaImage": {
            "type": ["string", "null"]
          },
          "LessonKeywords": {
            "type": ["string", "null"]
          },
          "Type": {
            "type": ["string", "null"]
          },
          "Status": {
            "type": ["string", "null"]
          },
          "AccessType": {
            "type": "string"
          },
          "Badges": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Badge"
            }
          }
        }
      },
      "Package": {
        "type": "object",
        "description": "Előfizetési csomag.",
        "properties": {
          "id": {
            "type": "integer"
          },
          "parameter": {
            "type": "string"
          },
          "shortTitle": {
            "type": "string"
          },
          "longTitle": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "price": {
            "type": "number"
          },
          "listPrice": {
            "type": ["number", "null"]
          },
          "discountedPrice": {
            "type": "number"
          },
          "firstMonthPrice": {
            "type": ["number", "null"]
          },
          "firstMonthAfterTrialPrice": {
            "type": ["number", "null"]
          },
          "trialDays": {
            "type": ["integer", "null"]
          },
          "couponDiscountMonths": {
            "type": ["integer", "null"]
          },
          "badgeContent": {
            "type": ["string", "null"]
          },
          "priceNote": {
            "type": ["string", "null"]
          },
          "secondPriceNote": {
            "type": ["string", "null"]
          },
          "period": {
            "type": ["string", "null"]
          },
          "benefits": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "Id": {
                  "type": "integer"
                },
                "BenefitText": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}
