{
  "openapi": "3.0.3",
  "info": {
    "title": "Hackmovie Catalog API",
    "version": "1.0.0",
    "description": "Публичные метаданные фильмов. API только для чтения; видеоконтент не предоставляется."
  },
  "servers": [
    {
      "url": "https://api.hackmovie.ru"
    }
  ],
  "paths": {
    "/v1/catalog": {
      "get": {
        "summary": "Получить каталог",
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "version",
                    "total",
                    "items"
                  ],
                  "properties": {
                    "version": {
                      "type": "string"
                    },
                    "total": {
                      "type": "integer"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Film"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "summary": "Доступность API",
        "responses": {
          "200": {
            "description": "Успешный ответ",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok"
                      ]
                    },
                    "service": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Film": {
        "type": "object",
        "required": [
          "id",
          "title",
          "original_title",
          "year",
          "genres"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "original_title": {
            "type": "string"
          },
          "year": {
            "type": "integer"
          },
          "genres": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}
