{
  "openapi": "3.0.1",
  "info": {
    "title": "Khabrilal News Aggregator API",
    "description": "Serves aggregated news articles read from JSON files on disk.",
    "version": "v1"
  },
  "paths": {
    "/api/info": {
      "get": {
        "tags": [
          "Meta"
        ],
        "summary": "Machine-readable service information.",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/languages": {
      "get": {
        "tags": [
          "Meta"
        ],
        "summary": "Languages the API can serve, default language first.",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/news/{language}/top10": {
      "get": {
        "tags": [
          "News"
        ],
        "summary": "Return the 10 most recent articles for one language.",
        "operationId": "GetTop10",
        "parameters": [
          {
            "name": "language",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/news/{language}/latest/{timestamp}/previous/{top}": {
      "get": {
        "tags": [
          "News"
        ],
        "summary": "Return top N articles for one language published BEFORE the given timestamp.",
        "operationId": "GetLatestPrevious",
        "parameters": [
          {
            "name": "language",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "timestamp",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "top",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/news/{language}/latest/{timestamp}/next/{top}": {
      "get": {
        "tags": [
          "News"
        ],
        "summary": "Return top N articles for one language published AFTER the given timestamp.",
        "operationId": "GetLatestNext",
        "parameters": [
          {
            "name": "language",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "timestamp",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "top",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/news/{language}/category/{category}/latest/{timestamp}/previous/{top}": {
      "get": {
        "tags": [
          "News"
        ],
        "summary": "Return top N category articles for one language published BEFORE the timestamp, ranked highest first.",
        "operationId": "GetCategoryLatestPrevious",
        "parameters": [
          {
            "name": "language",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "timestamp",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "top",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/news/{language}/category/{category}/latest/{timestamp}/next/{top}": {
      "get": {
        "tags": [
          "News"
        ],
        "summary": "Return top N category articles for one language published AFTER the timestamp, ranked highest first.",
        "operationId": "GetCategoryLatestNext",
        "parameters": [
          {
            "name": "language",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "timestamp",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "top",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/top10": {
      "get": {
        "tags": [
          "News"
        ],
        "summary": "Return the 10 most recent articles for the default language.",
        "operationId": "GetTop10Legacy",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/latest/{timestamp}/previous/{top}": {
      "get": {
        "tags": [
          "News"
        ],
        "summary": "Default-language alias of /news/{language}/latest/{timestamp}/previous/{top}.",
        "operationId": "GetLatestPreviousLegacy",
        "parameters": [
          {
            "name": "timestamp",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "top",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/latest/{timestamp}/next/{top}": {
      "get": {
        "tags": [
          "News"
        ],
        "summary": "Default-language alias of /news/{language}/latest/{timestamp}/next/{top}.",
        "operationId": "GetLatestNextLegacy",
        "parameters": [
          {
            "name": "timestamp",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "top",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/news/category/{category}/latest/{timestamp}/previous/{top}": {
      "get": {
        "tags": [
          "News"
        ],
        "summary": "Default-language alias of /news/{language}/category/{category}/latest/{timestamp}/previous/{top}.",
        "operationId": "GetCategoryLatestPreviousLegacy",
        "parameters": [
          {
            "name": "category",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "timestamp",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "top",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/news/category/{category}/latest/{timestamp}/next/{top}": {
      "get": {
        "tags": [
          "News"
        ],
        "summary": "Default-language alias of /news/{language}/category/{category}/latest/{timestamp}/next/{top}.",
        "operationId": "GetCategoryLatestNextLegacy",
        "parameters": [
          {
            "name": "category",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "timestamp",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "top",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/files": {
      "get": {
        "tags": [
          "Output files"
        ],
        "summary": "List the available output JSON files for every language, newest first.",
        "operationId": "GetOutputFileList",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/files/{language}": {
      "get": {
        "tags": [
          "Output files"
        ],
        "summary": "List the available output JSON files for one language, newest first.",
        "operationId": "GetOutputFileListByLanguage",
        "parameters": [
          {
            "name": "language",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/files/{language}/{fileName}": {
      "get": {
        "tags": [
          "Output files"
        ],
        "summary": "Return the raw contents of one output JSON file for one language.",
        "operationId": "GetOutputFile",
        "parameters": [
          {
            "name": "language",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fileName",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/files/{fileName}": {
      "get": {
        "tags": [
          "Output files"
        ],
        "summary": "Default-language alias of /files/{language}/{fileName}.",
        "operationId": "GetOutputFileLegacy",
        "parameters": [
          {
            "name": "fileName",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^[^/]+\\.json$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": { }
}