{
    "openapi": "3.1.0",
    "info": {
        "title": "Kubic Public Content API",
        "version": "1.0.0",
        "description": "Read-only access to published Kubic pages and posts through the public WordPress REST API. No private, draft, password-protected, user, or write operations are described."
    },
    "servers": [
        {
            "url": "https://kubic.productions/wp-json/wp/v2",
            "description": "Public WordPress REST API"
        }
    ],
    "security": [],
    "tags": [
        {
            "name": "Pages",
            "description": "Published public pages."
        },
        {
            "name": "Posts",
            "description": "Published public articles."
        }
    ],
    "paths": {
        "/pages": {
            "get": {
                "operationId": "listKubicPages",
                "tags": [
                    "Pages"
                ],
                "summary": "List published Kubic pages",
                "description": "Returns published public pages with pagination, optional search, and slug filtering.",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number of the result set.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Number of records to return.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 10
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Limit results to records matching this search term.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "slug",
                        "in": "query",
                        "description": "Limit results to a specific public URL slug.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A list of published pages.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/PageSummary"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "The request could not be completed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/pages/{id}": {
            "get": {
                "operationId": "getKubicPage",
                "tags": [
                    "Pages"
                ],
                "summary": "Get a published Kubic page",
                "description": "Returns one published public page by its WordPress record identifier.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "WordPress record identifier.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A published page.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Page"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "The request could not be completed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/posts": {
            "get": {
                "operationId": "listKubicPosts",
                "tags": [
                    "Posts"
                ],
                "summary": "List published Kubic posts",
                "description": "Returns published public articles with pagination, optional search, and slug filtering.",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number of the result set.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Number of records to return.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 10
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Limit results to records matching this search term.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "slug",
                        "in": "query",
                        "description": "Limit results to a specific public URL slug.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A list of published posts.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/PostSummary"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "The request could not be completed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/posts/{id}": {
            "get": {
                "operationId": "getKubicPost",
                "tags": [
                    "Posts"
                ],
                "summary": "Get a published Kubic post",
                "description": "Returns one published public article by its WordPress record identifier.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "WordPress record identifier.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A published post.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Post"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "The request could not be completed.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "RenderedText": {
                "type": "object",
                "required": [
                    "rendered"
                ],
                "properties": {
                    "rendered": {
                        "type": "string"
                    },
                    "protected": {
                        "type": "boolean"
                    }
                }
            },
            "PageSummary": {
                "type": "object",
                "required": [
                    "id",
                    "date",
                    "slug",
                    "link",
                    "title",
                    "excerpt"
                ],
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "date": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "link": {
                        "type": "string",
                        "format": "uri"
                    },
                    "title": {
                        "$ref": "#/components/schemas/RenderedText"
                    },
                    "excerpt": {
                        "$ref": "#/components/schemas/RenderedText"
                    }
                }
            },
            "Page": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/PageSummary"
                    },
                    {
                        "type": "object",
                        "required": [
                            "content"
                        ],
                        "properties": {
                            "content": {
                                "$ref": "#/components/schemas/RenderedText"
                            },
                            "parent": {
                                "type": "integer"
                            },
                            "menu_order": {
                                "type": "integer"
                            }
                        }
                    }
                ]
            },
            "PostSummary": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/PageSummary"
                    },
                    {
                        "type": "object",
                        "properties": {
                            "categories": {
                                "type": "array",
                                "items": {
                                    "type": "integer"
                                }
                            },
                            "tags": {
                                "type": "array",
                                "items": {
                                    "type": "integer"
                                }
                            }
                        }
                    }
                ]
            },
            "Post": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/PostSummary"
                    },
                    {
                        "type": "object",
                        "required": [
                            "content"
                        ],
                        "properties": {
                            "content": {
                                "$ref": "#/components/schemas/RenderedText"
                            }
                        }
                    }
                ]
            },
            "Error": {
                "type": "object",
                "required": [
                    "code",
                    "message"
                ],
                "properties": {
                    "code": {
                        "type": "string"
                    },
                    "message": {
                        "type": "string"
                    },
                    "data": {
                        "type": "object",
                        "additionalProperties": true
                    }
                }
            }
        }
    }
}