{
  "openapi": "3.1.0",
  "info": {
    "title": "jvm.news API",
    "description": "Content hub and knowledge management for the JVM ecosystem",
    "version": "0.1.0"
  },
  "servers": [
    {
      "url": "http://localhost:8080",
      "description": "Local development server"
    }
  ],
  "paths": {
    "/posts/{id}": {
      "put": {
        "tags": [
          "Posts"
        ],
        "summary": "Edit a post",
        "operationId": "editPost",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EditContentHttpRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Post updated",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ContentDetail"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "403": {
            "description": "Not authorized to edit this post",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "404": {
            "description": "Post not found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/comments/{id}": {
      "put": {
        "tags": [
          "Comments"
        ],
        "summary": "Edit a comment within the edit window",
        "operationId": "editComment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EditCommentHttpRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Comment updated",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CommentDetail"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "403": {
            "description": "Not authorized or edit window expired",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "404": {
            "description": "Comment not found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/auth/password": {
      "put": {
        "tags": [
          "Authentication"
        ],
        "summary": "Change password for the authenticated user",
        "operationId": "changePassword",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangePasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Password changed",
            "content": {
              "*/*": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid password data",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/admin/users/{username}/role": {
      "put": {
        "tags": [
          "Admin - User Management"
        ],
        "summary": "Change a user's role",
        "operationId": "changeRole",
        "parameters": [
          {
            "name": "username",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoleUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Role updated",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/UserPrincipal"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient privileges",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/admin/posts/{id}": {
      "put": {
        "tags": [
          "Admin - Post Management"
        ],
        "summary": "Admin edit a post",
        "operationId": "editPost_1",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EditContentHttpRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Post updated",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ContentDetail"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "403": {
            "description": "Admin access required",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "404": {
            "description": "Post not found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Admin - Post Management"
        ],
        "summary": "Delete a post (soft by default, hard with ?hard=true)",
        "operationId": "deletePost",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "hard",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Post deleted",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ContentOperationConfirmation"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "403": {
            "description": "Admin access required",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "404": {
            "description": "Post not found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/admin/posts/{id}/approve": {
      "put": {
        "tags": [
          "Admin - Post Management"
        ],
        "summary": "Approve a draft post and set publication date",
        "operationId": "approvePost",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApproveContentHttpRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Post approved",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ContentDetail"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "403": {
            "description": "Admin access required",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "404": {
            "description": "Post not found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/posts": {
      "get": {
        "tags": [
          "Posts"
        ],
        "summary": "List published posts",
        "operationId": "listPosts",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of published posts",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ContentListResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Posts"
        ],
        "summary": "Create a new blog post draft",
        "operationId": "createPost",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateContentHttpRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Post created",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CreateContentResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/posts/{year}/{month}/{slug}/comments": {
      "get": {
        "tags": [
          "Comments"
        ],
        "summary": "Get threaded comments for a post",
        "operationId": "getComments",
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "month",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Comment thread",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CommentThreadResponse"
                }
              }
            }
          },
          "404": {
            "description": "Post not found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Comments"
        ],
        "summary": "Add a comment to a post",
        "operationId": "createComment",
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "month",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCommentHttpRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Comment created",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CommentDetail"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "404": {
            "description": "Post or parent comment not found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/auth/verify": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Verify email address with token",
        "operationId": "verify",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyEmailRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Email verified",
            "content": {
              "*/*": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or expired verification token",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        }
      }
    },
    "/auth/reset-password": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Reset password using a reset token",
        "operationId": "resetPassword",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetPasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Password reset successful",
            "content": {
              "*/*": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or expired reset token",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        }
      }
    },
    "/auth/register": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Register a new user account",
        "operationId": "register",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegistrationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Registration successful",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/UserPrincipal"
                }
              }
            }
          },
          "400": {
            "description": "Invalid registration data",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "409": {
            "description": "Username already taken",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        }
      }
    },
    "/auth/refresh": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Refresh an expired JWT token",
        "operationId": "refresh",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TokenRefreshRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Token refreshed",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/LoginResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired refresh token",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        }
      }
    },
    "/auth/logout": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Log out the current session",
        "operationId": "logout",
        "responses": {
          "204": {
            "description": "Logged out"
          }
        }
      }
    },
    "/auth/login": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Authenticate with username and password",
        "operationId": "login",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Login successful",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/LoginResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        }
      }
    },
    "/auth/forgot-password": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Request a password reset email",
        "operationId": "forgotPassword",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ForgotPasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Reset email sent if account exists",
            "content": {
              "*/*": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        }
      }
    },
    "/admin/users/{username}/reset-password": {
      "post": {
        "tags": [
          "Admin - User Management"
        ],
        "summary": "Reset a user's password and generate a temporary one",
        "operationId": "resetPassword_1",
        "parameters": [
          {
            "name": "username",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Password reset with temporary password",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/PasswordResetResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient privileges",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/admin/categories": {
      "post": {
        "tags": [
          "Admin - Category Management"
        ],
        "summary": "Create a new category",
        "operationId": "createCategory",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCategoryRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Category created",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CreateCategoryResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "403": {
            "description": "Admin access required",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/posts/{year}/{month}/{slug}": {
      "get": {
        "tags": [
          "Posts"
        ],
        "summary": "Get a published post by slug",
        "operationId": "getPost",
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "month",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Post detail",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ContentDetail"
                }
              }
            }
          },
          "404": {
            "description": "Post not found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        }
      }
    },
    "/posts/search": {
      "get": {
        "tags": [
          "Posts"
        ],
        "summary": "Search published posts",
        "operationId": "searchPosts",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search results",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ContentListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/factoids": {
      "get": {
        "tags": [
          "factoid-controller"
        ],
        "operationId": "list",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/PageFactoidSummaryResponse"
                }
              }
            }
          }
        }
      }
    },
    "/factoids/{selector}": {
      "get": {
        "tags": [
          "factoid-controller"
        ],
        "operationId": "get",
        "parameters": [
          {
            "name": "selector",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/FactoidDetailResponse"
                }
              }
            }
          }
        }
      }
    },
    "/categories": {
      "get": {
        "tags": [
          "Categories"
        ],
        "summary": "List active categories",
        "operationId": "listCategories",
        "responses": {
          "200": {
            "description": "List of active categories",
            "content": {
              "*/*": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CategorySummary"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/blog/rss.xml": {
      "get": {
        "tags": [
          "rss-feed-controller"
        ],
        "operationId": "rssFeed",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/admin/posts/pending": {
      "get": {
        "tags": [
          "Admin - Post Management"
        ],
        "summary": "List pending draft posts for review",
        "operationId": "listPending",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of draft posts",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ContentListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "403": {
            "description": "Admin access required",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/auth/account": {
      "delete": {
        "tags": [
          "Authentication"
        ],
        "summary": "Soft-delete the authenticated user's account",
        "operationId": "deleteAccount",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteAccountRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Account deleted",
            "content": {
              "*/*": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient privileges",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/admin/comments/{id}": {
      "delete": {
        "tags": [
          "Admin - Comment Management"
        ],
        "summary": "Delete a comment (soft by default, hard with ?hard=true)",
        "operationId": "deleteComment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "hard",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Comment deleted",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ContentOperationConfirmation"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "403": {
            "description": "Admin access required",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "404": {
            "description": "Comment not found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/admin/categories/{id}": {
      "delete": {
        "tags": [
          "Admin - Category Management"
        ],
        "summary": "Soft-delete a category",
        "operationId": "deleteCategory",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Category deleted",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ContentOperationConfirmation"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "403": {
            "description": "Admin access required",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "404": {
            "description": "Category not found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "EditContentHttpRequest": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "markdownSource": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "categoryIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        }
      },
      "ContentDetail": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "renderedHtml": {
            "type": "string"
          },
          "excerpt": {
            "type": "string"
          },
          "authorId": {
            "type": "string",
            "format": "uuid"
          },
          "authorDisplayName": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "DRAFT",
              "APPROVED"
            ]
          },
          "publishedAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "commentCount": {
            "type": "integer",
            "format": "int32"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "authorDisplayName",
          "categories",
          "commentCount",
          "createdAt",
          "id",
          "renderedHtml",
          "slug",
          "status",
          "tags",
          "title",
          "updatedAt"
        ]
      },
      "ProblemDetail": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "format": "uri"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "detail": {
            "type": "string"
          },
          "instance": {
            "type": "string",
            "format": "uri"
          },
          "properties": {
            "type": "object",
            "additionalProperties": {}
          }
        }
      },
      "EditCommentHttpRequest": {
        "type": "object",
        "properties": {
          "markdownSource": {
            "type": "string"
          }
        },
        "required": [
          "markdownSource"
        ]
      },
      "CommentDetail": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "postId": {
            "type": "string",
            "format": "uuid"
          },
          "authorDisplayName": {
            "type": "string"
          },
          "renderedHtml": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "authorDisplayName",
          "createdAt",
          "id",
          "postId",
          "renderedHtml"
        ]
      },
      "ChangePasswordRequest": {
        "type": "object",
        "properties": {
          "oldPassword": {
            "type": "string"
          },
          "newPassword": {
            "type": "string"
          }
        },
        "required": [
          "newPassword",
          "oldPassword"
        ]
      },
      "RoleUpdateRequest": {
        "type": "object",
        "properties": {
          "newRole": {
            "type": "string",
            "enum": [
              "GUEST",
              "USER",
              "ADMIN",
              "SUPER_ADMIN"
            ]
          }
        },
        "required": [
          "newRole"
        ]
      },
      "UserPrincipal": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "username": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "GUEST",
              "USER",
              "ADMIN",
              "SUPER_ADMIN"
            ]
          }
        },
        "required": [
          "displayName",
          "id",
          "role",
          "username"
        ]
      },
      "ApproveContentHttpRequest": {
        "type": "object",
        "properties": {
          "publishedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "publishedAt"
        ]
      },
      "CreateContentHttpRequest": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "markdownSource": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "categoryIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        "required": [
          "markdownSource",
          "title"
        ]
      },
      "CreateContentResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "excerpt": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "DRAFT",
              "APPROVED"
            ]
          },
          "authorId": {
            "type": "string",
            "format": "uuid"
          },
          "authorDisplayName": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "authorDisplayName",
          "authorId",
          "categories",
          "createdAt",
          "id",
          "slug",
          "status",
          "tags",
          "title"
        ]
      },
      "CreateCommentHttpRequest": {
        "type": "object",
        "properties": {
          "parentCommentId": {
            "type": "string",
            "format": "uuid"
          },
          "markdownSource": {
            "type": "string"
          }
        },
        "required": [
          "markdownSource"
        ]
      },
      "VerifyEmailRequest": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          }
        },
        "required": [
          "token"
        ]
      },
      "ResetPasswordRequest": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          },
          "newPassword": {
            "type": "string"
          }
        },
        "required": [
          "newPassword",
          "token"
        ]
      },
      "RegistrationRequest": {
        "type": "object",
        "properties": {
          "username": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "password": {
            "type": "string"
          }
        },
        "required": [
          "displayName",
          "email",
          "password",
          "username"
        ]
      },
      "TokenRefreshRequest": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          }
        },
        "required": [
          "token"
        ]
      },
      "LoginResponse": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          },
          "principal": {
            "$ref": "#/components/schemas/UserPrincipal"
          }
        },
        "required": [
          "principal",
          "token"
        ]
      },
      "LoginRequest": {
        "type": "object",
        "properties": {
          "username": {
            "type": "string"
          },
          "password": {
            "type": "string"
          }
        },
        "required": [
          "password",
          "username"
        ]
      },
      "ForgotPasswordRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          }
        },
        "required": [
          "email"
        ]
      },
      "PasswordResetResponse": {
        "type": "object",
        "properties": {
          "username": {
            "type": "string"
          },
          "temporaryPassword": {
            "type": "string"
          }
        },
        "required": [
          "temporaryPassword",
          "username"
        ]
      },
      "CreateCategoryRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "parentId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "name"
        ]
      },
      "CreateCategoryResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "parentName": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "slug"
        ]
      },
      "ContentListResponse": {
        "type": "object",
        "properties": {
          "posts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContentSummary"
            }
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "format": "int64"
          }
        },
        "required": [
          "page",
          "posts",
          "totalCount",
          "totalPages"
        ]
      },
      "ContentSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "excerpt": {
            "type": "string"
          },
          "authorDisplayName": {
            "type": "string"
          },
          "publishedAt": {
            "type": "string",
            "format": "date-time"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "authorDisplayName",
          "categories",
          "id",
          "slug",
          "tags",
          "title"
        ]
      },
      "CommentNode": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "authorId": {
            "type": "string",
            "format": "uuid"
          },
          "authorDisplayName": {
            "type": "string"
          },
          "renderedHtml": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "deleted": {
            "type": "boolean"
          },
          "editable": {
            "type": "boolean"
          },
          "children": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CommentNode"
            }
          }
        },
        "required": [
          "authorDisplayName",
          "children",
          "createdAt",
          "deleted",
          "editable",
          "id",
          "renderedHtml",
          "updatedAt"
        ]
      },
      "CommentThreadResponse": {
        "type": "object",
        "properties": {
          "postId": {
            "type": "string",
            "format": "uuid"
          },
          "comments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CommentNode"
            }
          },
          "totalActiveCount": {
            "type": "integer",
            "format": "int32"
          }
        },
        "required": [
          "comments",
          "postId",
          "totalActiveCount"
        ]
      },
      "FactoidSummaryResponse": {
        "type": "object",
        "properties": {
          "selector": {
            "type": "string"
          },
          "locked": {
            "type": "boolean"
          },
          "updatedBy": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "locked",
          "selector",
          "updatedAt"
        ]
      },
      "PageFactoidSummaryResponse": {
        "type": "object",
        "properties": {
          "totalPages": {
            "type": "integer",
            "format": "int32"
          },
          "totalElements": {
            "type": "integer",
            "format": "int64"
          },
          "numberOfElements": {
            "type": "integer",
            "format": "int32"
          },
          "first": {
            "type": "boolean"
          },
          "last": {
            "type": "boolean"
          },
          "sort": {
            "$ref": "#/components/schemas/SortObject"
          },
          "pageable": {
            "$ref": "#/components/schemas/PageableObject"
          },
          "size": {
            "type": "integer",
            "format": "int32"
          },
          "content": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FactoidSummaryResponse"
            }
          },
          "number": {
            "type": "integer",
            "format": "int32"
          },
          "empty": {
            "type": "boolean"
          }
        }
      },
      "PageableObject": {
        "type": "object",
        "properties": {
          "sort": {
            "$ref": "#/components/schemas/SortObject"
          },
          "unpaged": {
            "type": "boolean"
          },
          "paged": {
            "type": "boolean"
          },
          "pageNumber": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "offset": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "SortObject": {
        "type": "object",
        "properties": {
          "unsorted": {
            "type": "boolean"
          },
          "sorted": {
            "type": "boolean"
          },
          "empty": {
            "type": "boolean"
          }
        }
      },
      "FactoidAttributeResponse": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "rendered": {
            "type": "string"
          }
        },
        "required": [
          "rendered",
          "type"
        ]
      },
      "FactoidDetailResponse": {
        "type": "object",
        "properties": {
          "selector": {
            "type": "string"
          },
          "locked": {
            "type": "boolean"
          },
          "updatedBy": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "attributes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FactoidAttributeResponse"
            }
          }
        },
        "required": [
          "attributes",
          "locked",
          "selector",
          "updatedAt"
        ]
      },
      "CategorySummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "parentName": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "slug"
        ]
      },
      "DeleteAccountRequest": {
        "type": "object",
        "properties": {
          "username": {
            "type": "string"
          }
        }
      },
      "ContentOperationConfirmation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "message"
        ]
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  }
}