{
  "openapi": "3.1.0",
  "info": {
    "title": "AlexTech Content API",
    "description": "API pubblica per l'accesso agli articoli del blog e alle tech news pubblicate su AlexTech. Tutti gli endpoint sono read-only, no autenticazione richiesta, no rate limit esplicito (rispettare robots.txt).",
    "version": "1.0.0",
    "contact": {
      "name": "AlexTech Labs",
      "url": "https://www.alextech.ai/contatti/",
      "email": "info@alextech.ai"
    },
    "license": {
      "name": "RSL — Really Simple Licensing",
      "identifier": "https://www.alextech.ai/license.xml",
      "url": "https://www.alextech.ai/license.xml"
    }
  },
  "servers": [
    {
      "url": "https://www.alextech.ai",
      "description": "Production"
    }
  ],
  "tags": [
    {"name": "search", "description": "Ricerca fulltext sugli articoli pubblicati."},
    {"name": "blog", "description": "Articoli del blog."},
    {"name": "news", "description": "Tech news curate."},
    {"name": "trending", "description": "Articoli più visualizzati."}
  ],
  "paths": {
    "/search.php": {
      "get": {
        "tags": ["search"],
        "summary": "Ricerca fulltext su tutti i contenuti pubblicati",
        "operationId": "searchContent",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Query di ricerca (fulltext MATCH).",
            "schema": {"type": "string", "minLength": 1, "maxLength": 200}
          },
          {
            "name": "lang",
            "in": "query",
            "description": "Filtra per lingua dei contenuti.",
            "schema": {"type": "string", "enum": ["it", "en"], "default": "it"}
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Numero massimo di risultati.",
            "schema": {"type": "integer", "minimum": 1, "maximum": 50, "default": 10}
          }
        ],
        "responses": {
          "200": {
            "description": "Risultati della ricerca.",
            "content": {
              "application/json": {
                "schema": {"$ref": "#/components/schemas/SearchResponse"}
              }
            }
          },
          "400": {"description": "Parametro 'q' mancante o non valido."}
        }
      }
    },
    "/blog/": {
      "get": {
        "tags": ["blog"],
        "summary": "Lista articoli del blog",
        "operationId": "listBlogPosts",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Numero di pagina.",
            "schema": {"type": "integer", "minimum": 1, "default": 1}
          }
        ],
        "responses": {
          "200": {
            "description": "Pagina del blog.",
            "content": {"text/html": {"schema": {"type": "string"}}}
          }
        }
      }
    },
    "/blog/{slug}/": {
      "get": {
        "tags": ["blog"],
        "summary": "Recupera un singolo articolo del blog per slug",
        "operationId": "getBlogPost",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Slug URL-safe dell'articolo.",
            "schema": {"type": "string"}
          }
        ],
        "responses": {
          "200": {"description": "Articolo HTML."},
          "404": {"description": "Articolo non trovato."}
        }
      }
    },
    "/news/": {
      "get": {
        "tags": ["news"],
        "summary": "Lista tech news pubblicate",
        "operationId": "listNews",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {"type": "integer", "minimum": 1, "default": 1}
          }
        ],
        "responses": {
          "200": {"description": "Pagina delle news."}
        }
      }
    },
    "/news/{slug}/": {
      "get": {
        "tags": ["news"],
        "summary": "Recupera una singola tech news per slug",
        "operationId": "getNewsArticle",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {"type": "string"}
          }
        ],
        "responses": {
          "200": {"description": "News HTML."},
          "404": {"description": "News non trovata."}
        }
      }
    },
    "/trending.php": {
      "get": {
        "tags": ["trending"],
        "summary": "Articoli più visualizzati",
        "operationId": "getTrending",
        "responses": {
          "200": {
            "description": "Mappa slug -> views.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {"type": "integer"}
                }
              }
            }
          }
        }
      }
    },
    "/rss.xml": {
      "get": {
        "tags": ["blog"],
        "summary": "Feed RSS del blog (IT)",
        "operationId": "getBlogRSS",
        "responses": {
          "200": {
            "description": "Feed RSS XML.",
            "content": {"application/rss+xml": {"schema": {"type": "string"}}}
          }
        }
      }
    },
    "/sitemap-index.xml": {
      "get": {
        "tags": ["blog"],
        "summary": "Indice sitemap del sito",
        "operationId": "getSitemapIndex",
        "responses": {
          "200": {"description": "Sitemap index XML."}
        }
      }
    }
  },
  "components": {
    "schemas": {
      "SearchResult": {
        "type": "object",
        "properties": {
          "slug": {"type": "string"},
          "title": {"type": "string"},
          "excerpt": {"type": "string"},
          "url": {"type": "string", "format": "uri"},
          "category": {"type": "string"},
          "pubDate": {"type": "string", "format": "date"},
          "lang": {"type": "string", "enum": ["it", "en"]}
        },
        "required": ["slug", "title", "url"]
      },
      "SearchResponse": {
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "items": {"$ref": "#/components/schemas/SearchResult"}
          },
          "total": {"type": "integer"}
        }
      }
    }
  },
  "externalDocs": {
    "description": "LLM-optimized manifest of the site",
    "url": "https://www.alextech.ai/llms.txt"
  }
}