{
    "openapi": "3.1.0",
    "info": {
        "title": "Miloslav Hub Public API",
        "description": "Public read-only API providing machine-readable access to intentionally published content on the Miloslav Hub website. The API does not expose private WordPress data or internal plugin interfaces.",
        "version": "1.1.0",
        "license": {
            "name": "GNU Affero General Public License v3.0 or later",
            "identifier": "AGPL-3.0-or-later"
        },
        "x-license-url": "https://www.gnu.org/licenses/agpl-3.0.html",
        "x-documentation-license": {
            "name": "Creative Commons Attribution 4.0 International",
            "identifier": "CC-BY-4.0",
            "url": "https://creativecommons.org/licenses/by/4.0/"
        },
        "x-content-license-policy": "Content exposed through the API remains subject to the copyright and licensing conditions of its original source unless explicitly stated otherwise for a specific item."
    },
    "externalDocs": {
        "description": "Miloslav Hub Public API documentation",
        "url": "https://miloslavhub.cz/en/public-api/"
    },
    "servers": [
        {
            "url": "https://miloslavhub.cz/wp-json/mh/v1",
            "description": "Miloslav Hub Public API v1"
        }
    ],
    "tags": [
        {
            "name": "Site",
            "description": "Basic website information."
        },
        {
            "name": "Content",
            "description": "Public website content."
        },
        {
            "name": "Search",
            "description": "Search across public content."
        },
        {
            "name": "Taxonomies",
            "description": "Public taxonomies and terms."
        },
        {
            "name": "Knowledge Base",
            "description": "Versioned public knowledge-base dataset metadata and downloads."
        },
        {
            "name": "Documentation",
            "description": "Machine-readable API documentation."
        }
    ],
    "x-mh-public-content-types": [
        "post",
        "page",
        "prednaska"
    ],
    "x-mh-public-taxonomies": [
        "category",
        "post_tag",
        "tema_prednasky",
        "typ_prednasky"
    ],
    "paths": {
        "/site": {
            "get": {
                "tags": [
                    "Site"
                ],
                "summary": "Get site information",
                "operationId": "getSite",
                "responses": {
                    "200": {
                        "description": "Website and API information.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Site"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/content-types": {
            "get": {
                "tags": [
                    "Content"
                ],
                "summary": "List public content types",
                "description": "The list is generated automatically from the current public WordPress structure.",
                "operationId": "getContentTypes",
                "responses": {
                    "200": {
                        "description": "Public content types.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ContentTypesResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/content": {
            "get": {
                "tags": [
                    "Content"
                ],
                "summary": "Get public content",
                "description": "Returns published content from allowed public content types only.",
                "operationId": "getContent",
                "parameters": [
                    {
                        "name": "type",
                        "in": "query",
                        "required": false,
                        "description": "Content type.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "post",
                                "page",
                                "prednaska"
                            ],
                            "default": "post"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 10
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "slug",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Public content response.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ContentResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    }
                }
            }
        },
        "/search": {
            "get": {
                "tags": [
                    "Search"
                ],
                "summary": "Search public content",
                "operationId": "searchContent",
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": true,
                        "description": "Search query.",
                        "schema": {
                            "type": "string",
                            "minLength": 1
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "description": "Optional content type or comma-separated list of content types.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 10
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Search results.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SearchResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    }
                }
            }
        },
        "/taxonomies": {
            "get": {
                "tags": [
                    "Taxonomies"
                ],
                "summary": "Get public taxonomies or terms",
                "description": "Without the taxonomy parameter, returns the public taxonomy catalogue. With the taxonomy parameter, returns terms from the selected taxonomy.",
                "operationId": "getTaxonomies",
                "parameters": [
                    {
                        "name": "taxonomy",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "category",
                                "post_tag",
                                "tema_prednasky",
                                "typ_prednasky"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 100
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Taxonomy catalogue or terms from one taxonomy.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "oneOf": [
                                        {
                                            "$ref": "#/components/schemas/TaxonomyCatalogResponse"
                                        },
                                        {
                                            "$ref": "#/components/schemas/TaxonomyTermsResponse"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/BadRequest"
                    }
                }
            }
        },
        "/knowledge-base": {
            "get": {
                "tags": [
                    "Knowledge Base"
                ],
                "summary": "Get public knowledge-base metadata",
                "description": "Returns metadata for the current versioned Miloslav Hub Public Knowledge Base release, including download URLs, checksum, counts and license.",
                "operationId": "getKnowledgeBase",
                "responses": {
                    "200": {
                        "description": "Current public knowledge-base release metadata.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/KnowledgeBaseResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Public knowledge-base metadata is unavailable.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/openapi": {
            "get": {
                "tags": [
                    "Documentation"
                ],
                "summary": "Get OpenAPI specification",
                "description": "Dynamically generated OpenAPI 3.1 specification for the public API.",
                "operationId": "getOpenApi",
                "responses": {
                    "200": {
                        "description": "OpenAPI 3.1 document.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "responses": {
            "BadRequest": {
                "description": "Invalid request.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            }
        },
        "schemas": {
            "Error": {
                "type": "object",
                "properties": {
                    "code": {
                        "type": "string"
                    },
                    "message": {
                        "type": "string"
                    },
                    "data": {
                        "type": "object"
                    }
                },
                "required": [
                    "code",
                    "message"
                ]
            },
            "Site": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "description": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "language": {
                        "type": "string"
                    },
                    "api": {
                        "type": "object",
                        "properties": {
                            "version": {
                                "type": "string"
                            },
                            "base": {
                                "type": "string",
                                "format": "uri"
                            },
                            "openapi": {
                                "type": "string",
                                "format": "uri"
                            }
                        }
                    }
                }
            },
            "TaxonomyReference": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "label": {
                        "type": "string"
                    },
                    "rest_base": {
                        "type": "string"
                    }
                }
            },
            "ContentType": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "enum": [
                            "post",
                            "page",
                            "prednaska"
                        ]
                    },
                    "label": {
                        "type": "string"
                    },
                    "rest_base": {
                        "type": "string"
                    },
                    "archive": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uri"
                    },
                    "taxonomies": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/TaxonomyReference"
                        }
                    }
                }
            },
            "ContentTypesResponse": {
                "type": "object",
                "properties": {
                    "count": {
                        "type": "integer"
                    },
                    "items": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/ContentType"
                        }
                    }
                }
            },
            "TermReference": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "taxonomy": {
                        "type": "string"
                    },
                    "url": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uri"
                    }
                }
            },
            "ContentItem": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "post",
                            "page",
                            "prednaska"
                        ]
                    },
                    "slug": {
                        "type": "string"
                    },
                    "title": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "date": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "modified": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "excerpt": {
                        "type": "string"
                    },
                    "content": {
                        "type": "string",
                        "description": "Rendered public HTML content."
                    },
                    "featured_image": {
                        "type": "string",
                        "format": "uri"
                    },
                    "taxonomies": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "array",
                            "items": {
                                "$ref": "#/components/schemas/TermReference"
                            }
                        }
                    },
                    "acf": {
                        "type": "object",
                        "properties": {
                            "datum_prednasky": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date",
                                "description": "Lecture date."
                            },
                            "instituce": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "misto": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "video_url": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "uri"
                            },
                            "prezentace_pdf": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "uri"
                            }
                        },
                        "additionalProperties": false
                    },
                    "language": {
                        "type": "string"
                    }
                }
            },
            "ContentResponse": {
                "type": "object",
                "properties": {
                    "type": {
                        "type": "string"
                    },
                    "page": {
                        "type": "integer"
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "total": {
                        "type": "integer"
                    },
                    "total_pages": {
                        "type": "integer"
                    },
                    "items": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/ContentItem"
                        }
                    }
                }
            },
            "SearchItem": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "post",
                            "page",
                            "prednaska"
                        ]
                    },
                    "slug": {
                        "type": "string"
                    },
                    "title": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "modified": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "excerpt": {
                        "type": "string"
                    },
                    "language": {
                        "type": "string"
                    }
                }
            },
            "SearchResponse": {
                "type": "object",
                "properties": {
                    "query": {
                        "type": "string"
                    },
                    "types": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "enum": [
                                "post",
                                "page",
                                "prednaska"
                            ]
                        }
                    },
                    "page": {
                        "type": "integer"
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "total": {
                        "type": "integer"
                    },
                    "total_pages": {
                        "type": "integer"
                    },
                    "items": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/SearchItem"
                        }
                    }
                }
            },
            "KnowledgeBaseResponse": {
                "type": "object",
                "properties": {
                    "schemaVersion": {
                        "type": "string"
                    },
                    "dataset": {
                        "type": "string"
                    },
                    "version": {
                        "type": "string"
                    },
                    "createdAt": {
                        "type": "string"
                    },
                    "publishedAt": {
                        "type": "string"
                    },
                    "homepage": {
                        "type": "string",
                        "format": "uri"
                    },
                    "license": {
                        "type": "string"
                    },
                    "licenseUrl": {
                        "type": "string",
                        "format": "uri"
                    },
                    "metadataUrl": {
                        "type": "string",
                        "format": "uri"
                    },
                    "downloads": {
                        "type": "object",
                        "properties": {
                            "latest": {
                                "type": "string",
                                "format": "uri"
                            },
                            "versioned": {
                                "type": "string",
                                "format": "uri"
                            }
                        }
                    },
                    "bytes": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "sha256": {
                        "type": "string"
                    },
                    "contentFingerprint": {
                        "type": "string"
                    },
                    "counts": {
                        "type": "object",
                        "properties": {
                            "documents": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "chunks": {
                                "type": "integer",
                                "minimum": 0
                            },
                            "documentsWithChunks": {
                                "type": "integer",
                                "minimum": 0
                            }
                        }
                    },
                    "distribution": {
                        "type": "object",
                        "properties": {
                            "sourceType": {
                                "type": "object",
                                "additionalProperties": {
                                    "type": "integer",
                                    "minimum": 0
                                }
                            },
                            "language": {
                                "type": "object",
                                "additionalProperties": {
                                    "type": "integer",
                                    "minimum": 0
                                }
                            }
                        }
                    },
                    "embeddingsIncluded": {
                        "type": "boolean"
                    }
                },
                "required": [
                    "schemaVersion",
                    "dataset",
                    "version",
                    "license",
                    "licenseUrl",
                    "metadataUrl",
                    "downloads",
                    "bytes",
                    "sha256",
                    "counts",
                    "distribution",
                    "embeddingsIncluded"
                ]
            },
            "TaxonomyCatalogItem": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "enum": [
                            "category",
                            "post_tag",
                            "tema_prednasky",
                            "typ_prednasky"
                        ]
                    },
                    "label": {
                        "type": "string"
                    },
                    "rest_base": {
                        "type": "string"
                    },
                    "hierarchical": {
                        "type": "boolean"
                    },
                    "content_types": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "enum": [
                                "post",
                                "page",
                                "prednaska"
                            ]
                        }
                    }
                }
            },
            "TaxonomyCatalogResponse": {
                "type": "object",
                "properties": {
                    "count": {
                        "type": "integer"
                    },
                    "items": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/TaxonomyCatalogItem"
                        }
                    }
                }
            },
            "TaxonomyTerm": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "taxonomy": {
                        "type": "string"
                    },
                    "description": {
                        "type": "string"
                    },
                    "count": {
                        "type": "integer"
                    },
                    "parent": {
                        "type": "integer"
                    },
                    "url": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uri"
                    }
                }
            },
            "TaxonomyTermsResponse": {
                "type": "object",
                "properties": {
                    "taxonomy": {
                        "type": "string",
                        "enum": [
                            "category",
                            "post_tag",
                            "tema_prednasky",
                            "typ_prednasky"
                        ]
                    },
                    "page": {
                        "type": "integer"
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "total": {
                        "type": "integer"
                    },
                    "total_pages": {
                        "type": "integer"
                    },
                    "items": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/TaxonomyTerm"
                        }
                    }
                }
            }
        }
    }
}