From 835401820cce5819a8b8c0da7abf64613d265d41 Mon Sep 17 00:00:00 2001 From: miyado <10195648+hmiyado@users.noreply.github.com> Date: Wed, 15 Oct 2025 23:07:44 +0900 Subject: [PATCH 01/11] feat: add Serena. .gitignore for Serena memory files --- .claude/settings.local.json | 11 +++++++++-- .gitignore | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.claude/settings.local.json b/.claude/settings.local.json index d7cffefe..31d72bf7 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -8,9 +8,16 @@ "Bash(./gradlew:*)", "Bash(docker-compose up:*)", "Bash(docker-compose:*)", - "Bash(docker logs:*)" + "Bash(docker logs:*)", + "mcp__serena__get_current_config", + "mcp__serena__check_onboarding_performed", + "mcp__serena__onboarding", + "mcp__serena__list_dir", + "mcp__serena__find_file", + "mcp__serena__write_memory", + "mcp__serena__think_about_whether_you_are_done" ], "deny": [], "ask": [] } -} \ No newline at end of file +} diff --git a/.gitignore b/.gitignore index 6c3aca4e..4e0904c6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.serena +# Serena memory files (local AI assistant context) +.serena/ From aee7e79293923f4a6bf2bc1e09702b9016e002e5 Mon Sep 17 00:00:00 2001 From: miyado <10195648+hmiyado@users.noreply.github.com> Date: Wed, 15 Oct 2025 23:21:06 +0900 Subject: [PATCH 02/11] refactor: move OpenAPI spec to monorepo root MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OpenAPIの仕様ファイルをbackend配下からmonorepoのrootに移動し、frontendとbackendの両方から参照しやすくした。 Changes: - Move api-spec from backend/src/main/resources/ to root/api-spec/ - Update backend/build.gradle.kts inputSpec path - Update frontend/openapitools.json inputSpec and glob paths --- .claude/settings.local.json | 3 ++- .../resources/api-spec => api-spec}/headers/set-cookie.json | 0 .../resources/api-spec => api-spec}/model/accountLink.json | 0 .../main/resources/api-spec => api-spec}/model/comment.json | 0 .../main/resources/api-spec => api-spec}/model/comments.json | 0 .../main/resources/api-spec => api-spec}/model/entries.json | 0 .../src/main/resources/api-spec => api-spec}/model/entry.json | 0 .../resources/api-spec => api-spec}/model/error/error400.json | 0 .../resources/api-spec => api-spec}/model/error/error401.json | 0 .../resources/api-spec => api-spec}/model/error/error403.json | 0 .../resources/api-spec => api-spec}/model/error/error404.json | 0 .../resources/api-spec => api-spec}/model/error/error409.json | 0 .../api-spec => api-spec}/model/error/errorBase.json | 0 .../api-spec => api-spec}/model/error/errorCause.json | 0 .../main/resources/api-spec => api-spec}/model/health.json | 0 .../src/main/resources/api-spec => api-spec}/model/user.json | 0 .../resources/api-spec => api-spec}/model/userDetail.json | 0 .../src/main/resources/api-spec => api-spec}/model/users.json | 0 .../api-spec => api-spec}/path/comments/comments.json | 0 .../path/entries/_serialNumber/_serialNumber.json | 0 .../entries/_serialNumber/comments/_commentId/_commentId.json | 0 .../path/entries/_serialNumber/comments/comments.json | 0 .../entries/_serialNumber/comments/commentsPostRequest.json | 0 .../_serialNumber/entriesSerialNumberPatchRequest.json | 0 .../resources/api-spec => api-spec}/path/entries/entries.json | 0 .../path/entries/entriesPostRequest.json | 0 .../resources/api-spec => api-spec}/path/health/health.json | 0 .../resources/api-spec => api-spec}/path/sign-in/sign-in.json | 0 .../path/sign-in/sign-inPostRequest.json | 0 .../path/sign-out/responseOkHeaderSetCookie.json | 0 .../api-spec => api-spec}/path/sign-out/sign-out.json | 0 .../resources/api-spec => api-spec}/path/users/_id/_id.json | 0 .../path/users/_id/usersIdPatchRequest.json | 0 .../api-spec => api-spec}/path/users/admins/admin.json | 0 .../api-spec => api-spec}/path/users/admins/admins.json | 0 .../path/users/admins/adminsGetResponse.json | 0 .../api-spec => api-spec}/path/users/current/current.json | 0 .../resources/api-spec => api-spec}/path/users/users.json | 0 .../api-spec => api-spec}/path/users/usersPostRequest.json | 0 {backend/src/main/resources/api-spec => api-spec}/root.json | 0 backend/build.gradle.kts | 2 +- frontend/openapitools.json | 4 ++-- .../src/repository/openapi/generated/.openapi-generator/FILES | 1 - 43 files changed, 5 insertions(+), 5 deletions(-) rename {backend/src/main/resources/api-spec => api-spec}/headers/set-cookie.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/model/accountLink.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/model/comment.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/model/comments.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/model/entries.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/model/entry.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/model/error/error400.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/model/error/error401.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/model/error/error403.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/model/error/error404.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/model/error/error409.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/model/error/errorBase.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/model/error/errorCause.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/model/health.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/model/user.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/model/userDetail.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/model/users.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/path/comments/comments.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/path/entries/_serialNumber/_serialNumber.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/path/entries/_serialNumber/comments/_commentId/_commentId.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/path/entries/_serialNumber/comments/comments.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/path/entries/_serialNumber/comments/commentsPostRequest.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/path/entries/_serialNumber/entriesSerialNumberPatchRequest.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/path/entries/entries.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/path/entries/entriesPostRequest.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/path/health/health.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/path/sign-in/sign-in.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/path/sign-in/sign-inPostRequest.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/path/sign-out/responseOkHeaderSetCookie.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/path/sign-out/sign-out.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/path/users/_id/_id.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/path/users/_id/usersIdPatchRequest.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/path/users/admins/admin.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/path/users/admins/admins.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/path/users/admins/adminsGetResponse.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/path/users/current/current.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/path/users/users.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/path/users/usersPostRequest.json (100%) rename {backend/src/main/resources/api-spec => api-spec}/root.json (100%) diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 31d72bf7..889069b4 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -15,7 +15,8 @@ "mcp__serena__list_dir", "mcp__serena__find_file", "mcp__serena__write_memory", - "mcp__serena__think_about_whether_you_are_done" + "mcp__serena__think_about_whether_you_are_done", + "mcp__serena__search_for_pattern" ], "deny": [], "ask": [] diff --git a/backend/src/main/resources/api-spec/headers/set-cookie.json b/api-spec/headers/set-cookie.json similarity index 100% rename from backend/src/main/resources/api-spec/headers/set-cookie.json rename to api-spec/headers/set-cookie.json diff --git a/backend/src/main/resources/api-spec/model/accountLink.json b/api-spec/model/accountLink.json similarity index 100% rename from backend/src/main/resources/api-spec/model/accountLink.json rename to api-spec/model/accountLink.json diff --git a/backend/src/main/resources/api-spec/model/comment.json b/api-spec/model/comment.json similarity index 100% rename from backend/src/main/resources/api-spec/model/comment.json rename to api-spec/model/comment.json diff --git a/backend/src/main/resources/api-spec/model/comments.json b/api-spec/model/comments.json similarity index 100% rename from backend/src/main/resources/api-spec/model/comments.json rename to api-spec/model/comments.json diff --git a/backend/src/main/resources/api-spec/model/entries.json b/api-spec/model/entries.json similarity index 100% rename from backend/src/main/resources/api-spec/model/entries.json rename to api-spec/model/entries.json diff --git a/backend/src/main/resources/api-spec/model/entry.json b/api-spec/model/entry.json similarity index 100% rename from backend/src/main/resources/api-spec/model/entry.json rename to api-spec/model/entry.json diff --git a/backend/src/main/resources/api-spec/model/error/error400.json b/api-spec/model/error/error400.json similarity index 100% rename from backend/src/main/resources/api-spec/model/error/error400.json rename to api-spec/model/error/error400.json diff --git a/backend/src/main/resources/api-spec/model/error/error401.json b/api-spec/model/error/error401.json similarity index 100% rename from backend/src/main/resources/api-spec/model/error/error401.json rename to api-spec/model/error/error401.json diff --git a/backend/src/main/resources/api-spec/model/error/error403.json b/api-spec/model/error/error403.json similarity index 100% rename from backend/src/main/resources/api-spec/model/error/error403.json rename to api-spec/model/error/error403.json diff --git a/backend/src/main/resources/api-spec/model/error/error404.json b/api-spec/model/error/error404.json similarity index 100% rename from backend/src/main/resources/api-spec/model/error/error404.json rename to api-spec/model/error/error404.json diff --git a/backend/src/main/resources/api-spec/model/error/error409.json b/api-spec/model/error/error409.json similarity index 100% rename from backend/src/main/resources/api-spec/model/error/error409.json rename to api-spec/model/error/error409.json diff --git a/backend/src/main/resources/api-spec/model/error/errorBase.json b/api-spec/model/error/errorBase.json similarity index 100% rename from backend/src/main/resources/api-spec/model/error/errorBase.json rename to api-spec/model/error/errorBase.json diff --git a/backend/src/main/resources/api-spec/model/error/errorCause.json b/api-spec/model/error/errorCause.json similarity index 100% rename from backend/src/main/resources/api-spec/model/error/errorCause.json rename to api-spec/model/error/errorCause.json diff --git a/backend/src/main/resources/api-spec/model/health.json b/api-spec/model/health.json similarity index 100% rename from backend/src/main/resources/api-spec/model/health.json rename to api-spec/model/health.json diff --git a/backend/src/main/resources/api-spec/model/user.json b/api-spec/model/user.json similarity index 100% rename from backend/src/main/resources/api-spec/model/user.json rename to api-spec/model/user.json diff --git a/backend/src/main/resources/api-spec/model/userDetail.json b/api-spec/model/userDetail.json similarity index 100% rename from backend/src/main/resources/api-spec/model/userDetail.json rename to api-spec/model/userDetail.json diff --git a/backend/src/main/resources/api-spec/model/users.json b/api-spec/model/users.json similarity index 100% rename from backend/src/main/resources/api-spec/model/users.json rename to api-spec/model/users.json diff --git a/backend/src/main/resources/api-spec/path/comments/comments.json b/api-spec/path/comments/comments.json similarity index 100% rename from backend/src/main/resources/api-spec/path/comments/comments.json rename to api-spec/path/comments/comments.json diff --git a/backend/src/main/resources/api-spec/path/entries/_serialNumber/_serialNumber.json b/api-spec/path/entries/_serialNumber/_serialNumber.json similarity index 100% rename from backend/src/main/resources/api-spec/path/entries/_serialNumber/_serialNumber.json rename to api-spec/path/entries/_serialNumber/_serialNumber.json diff --git a/backend/src/main/resources/api-spec/path/entries/_serialNumber/comments/_commentId/_commentId.json b/api-spec/path/entries/_serialNumber/comments/_commentId/_commentId.json similarity index 100% rename from backend/src/main/resources/api-spec/path/entries/_serialNumber/comments/_commentId/_commentId.json rename to api-spec/path/entries/_serialNumber/comments/_commentId/_commentId.json diff --git a/backend/src/main/resources/api-spec/path/entries/_serialNumber/comments/comments.json b/api-spec/path/entries/_serialNumber/comments/comments.json similarity index 100% rename from backend/src/main/resources/api-spec/path/entries/_serialNumber/comments/comments.json rename to api-spec/path/entries/_serialNumber/comments/comments.json diff --git a/backend/src/main/resources/api-spec/path/entries/_serialNumber/comments/commentsPostRequest.json b/api-spec/path/entries/_serialNumber/comments/commentsPostRequest.json similarity index 100% rename from backend/src/main/resources/api-spec/path/entries/_serialNumber/comments/commentsPostRequest.json rename to api-spec/path/entries/_serialNumber/comments/commentsPostRequest.json diff --git a/backend/src/main/resources/api-spec/path/entries/_serialNumber/entriesSerialNumberPatchRequest.json b/api-spec/path/entries/_serialNumber/entriesSerialNumberPatchRequest.json similarity index 100% rename from backend/src/main/resources/api-spec/path/entries/_serialNumber/entriesSerialNumberPatchRequest.json rename to api-spec/path/entries/_serialNumber/entriesSerialNumberPatchRequest.json diff --git a/backend/src/main/resources/api-spec/path/entries/entries.json b/api-spec/path/entries/entries.json similarity index 100% rename from backend/src/main/resources/api-spec/path/entries/entries.json rename to api-spec/path/entries/entries.json diff --git a/backend/src/main/resources/api-spec/path/entries/entriesPostRequest.json b/api-spec/path/entries/entriesPostRequest.json similarity index 100% rename from backend/src/main/resources/api-spec/path/entries/entriesPostRequest.json rename to api-spec/path/entries/entriesPostRequest.json diff --git a/backend/src/main/resources/api-spec/path/health/health.json b/api-spec/path/health/health.json similarity index 100% rename from backend/src/main/resources/api-spec/path/health/health.json rename to api-spec/path/health/health.json diff --git a/backend/src/main/resources/api-spec/path/sign-in/sign-in.json b/api-spec/path/sign-in/sign-in.json similarity index 100% rename from backend/src/main/resources/api-spec/path/sign-in/sign-in.json rename to api-spec/path/sign-in/sign-in.json diff --git a/backend/src/main/resources/api-spec/path/sign-in/sign-inPostRequest.json b/api-spec/path/sign-in/sign-inPostRequest.json similarity index 100% rename from backend/src/main/resources/api-spec/path/sign-in/sign-inPostRequest.json rename to api-spec/path/sign-in/sign-inPostRequest.json diff --git a/backend/src/main/resources/api-spec/path/sign-out/responseOkHeaderSetCookie.json b/api-spec/path/sign-out/responseOkHeaderSetCookie.json similarity index 100% rename from backend/src/main/resources/api-spec/path/sign-out/responseOkHeaderSetCookie.json rename to api-spec/path/sign-out/responseOkHeaderSetCookie.json diff --git a/backend/src/main/resources/api-spec/path/sign-out/sign-out.json b/api-spec/path/sign-out/sign-out.json similarity index 100% rename from backend/src/main/resources/api-spec/path/sign-out/sign-out.json rename to api-spec/path/sign-out/sign-out.json diff --git a/backend/src/main/resources/api-spec/path/users/_id/_id.json b/api-spec/path/users/_id/_id.json similarity index 100% rename from backend/src/main/resources/api-spec/path/users/_id/_id.json rename to api-spec/path/users/_id/_id.json diff --git a/backend/src/main/resources/api-spec/path/users/_id/usersIdPatchRequest.json b/api-spec/path/users/_id/usersIdPatchRequest.json similarity index 100% rename from backend/src/main/resources/api-spec/path/users/_id/usersIdPatchRequest.json rename to api-spec/path/users/_id/usersIdPatchRequest.json diff --git a/backend/src/main/resources/api-spec/path/users/admins/admin.json b/api-spec/path/users/admins/admin.json similarity index 100% rename from backend/src/main/resources/api-spec/path/users/admins/admin.json rename to api-spec/path/users/admins/admin.json diff --git a/backend/src/main/resources/api-spec/path/users/admins/admins.json b/api-spec/path/users/admins/admins.json similarity index 100% rename from backend/src/main/resources/api-spec/path/users/admins/admins.json rename to api-spec/path/users/admins/admins.json diff --git a/backend/src/main/resources/api-spec/path/users/admins/adminsGetResponse.json b/api-spec/path/users/admins/adminsGetResponse.json similarity index 100% rename from backend/src/main/resources/api-spec/path/users/admins/adminsGetResponse.json rename to api-spec/path/users/admins/adminsGetResponse.json diff --git a/backend/src/main/resources/api-spec/path/users/current/current.json b/api-spec/path/users/current/current.json similarity index 100% rename from backend/src/main/resources/api-spec/path/users/current/current.json rename to api-spec/path/users/current/current.json diff --git a/backend/src/main/resources/api-spec/path/users/users.json b/api-spec/path/users/users.json similarity index 100% rename from backend/src/main/resources/api-spec/path/users/users.json rename to api-spec/path/users/users.json diff --git a/backend/src/main/resources/api-spec/path/users/usersPostRequest.json b/api-spec/path/users/usersPostRequest.json similarity index 100% rename from backend/src/main/resources/api-spec/path/users/usersPostRequest.json rename to api-spec/path/users/usersPostRequest.json diff --git a/backend/src/main/resources/api-spec/root.json b/api-spec/root.json similarity index 100% rename from backend/src/main/resources/api-spec/root.json rename to api-spec/root.json diff --git a/backend/build.gradle.kts b/backend/build.gradle.kts index 6d698912..842e30e4 100644 --- a/backend/build.gradle.kts +++ b/backend/build.gradle.kts @@ -45,7 +45,7 @@ application { // https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators/kotlin-server.md openApiGenerate { generatorName.set("kotlin-server") - inputSpec.set("$rootDir/src/main/resources/api-spec/root.json") + inputSpec.set("$rootDir/../api-spec/root.json") val generatedDirPath = layout .buildDirectory diff --git a/frontend/openapitools.json b/frontend/openapitools.json index 8526c4b3..4d7f2307 100644 --- a/frontend/openapitools.json +++ b/frontend/openapitools.json @@ -6,8 +6,8 @@ "generators": { "v1.0": { "generatorName": "typescript-fetch", - "inputSpec": "#{cwd}/../backend/src/main/resources/api-spec/root.json", - "glob": "../backend/src/main/resources/api-spec/*.json", + "inputSpec": "#{cwd}/../api-spec/root.json", + "glob": "../api-spec/*.json", "output": "#{cwd}/src/repository/openapi/generated", "ignoreFileOverride": "#{cwd}/src/repository/openapi/.openapi-generator-ignore", "additionalProperties": { diff --git a/frontend/src/repository/openapi/generated/.openapi-generator/FILES b/frontend/src/repository/openapi/generated/.openapi-generator/FILES index 65d266bc..0800e7be 100644 --- a/frontend/src/repository/openapi/generated/.openapi-generator/FILES +++ b/frontend/src/repository/openapi/generated/.openapi-generator/FILES @@ -1,4 +1,3 @@ -.openapi-generator-ignore apis/DefaultApi.ts apis/index.ts index.ts From 3e6c2d09263f2b64127d00661d109246465c1302 Mon Sep 17 00:00:00 2001 From: miyado <10195648+hmiyado@users.noreply.github.com> Date: Wed, 15 Oct 2025 23:23:30 +0900 Subject: [PATCH 03/11] feat: add api-spec filter to CI workflow for backend and frontend --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 28d54d5a..87e35e55 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,9 +19,11 @@ jobs: filters: | backend: - 'backend/**' + - 'api-spec/**' - '.github/workflows/**' frontend: - 'frontend/**' + - 'api-spec/**' - '.github/workflows/**' backend_lint: From d5dfc934a5ead0f6438c378ada5e9844c3ab2508 Mon Sep 17 00:00:00 2001 From: miyado <10195648+hmiyado@users.noreply.github.com> Date: Wed, 15 Oct 2025 23:53:58 +0900 Subject: [PATCH 04/11] feat: update error models and add new Error4031 model with enums for status and description --- .claude/settings.local.json | 3 +- api-spec/model/accountLink.json | 2 +- api-spec/model/error/error400.json | 4 +- api-spec/model/error/error401.json | 4 +- api-spec/model/error/error403.json | 9 +- api-spec/model/error/error404.json | 4 +- api-spec/model/error/error409.json | 4 +- api-spec/model/error/errorBase.json | 2 +- .../entries/_serialNumber/_serialNumber.json | 1 + .../comments/_commentId/_commentId.json | 1 + .../_serialNumber/comments/comments.json | 1 + api-spec/path/entries/entries.json | 1 + api-spec/path/sign-in/sign-in.json | 3 + api-spec/path/sign-out/sign-out.json | 5 +- api-spec/path/users/_id/_id.json | 10 +- api-spec/path/users/admins/admins.json | 5 +- api-spec/path/users/users.json | 5 +- frontend/.gitignore | 3 + .../generated/.openapi-generator/FILES | 30 ----- .../generated/.openapi-generator/VERSION | 1 - .../openapi/generated/apis/DefaultApi.ts | 3 + .../openapi/generated/models/Error400.ts | 22 +++- .../openapi/generated/models/Error401.ts | 22 +++- .../openapi/generated/models/Error403.ts | 43 +++++-- .../openapi/generated/models/Error4031.ts | 113 ++++++++++++++++++ .../openapi/generated/models/Error404.ts | 22 +++- .../openapi/generated/models/Error409.ts | 22 +++- .../openapi/generated/models/index.ts | 2 +- 28 files changed, 276 insertions(+), 71 deletions(-) delete mode 100644 frontend/src/repository/openapi/generated/.openapi-generator/FILES delete mode 100644 frontend/src/repository/openapi/generated/.openapi-generator/VERSION create mode 100644 frontend/src/repository/openapi/generated/models/Error4031.ts diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 889069b4..84eea3a4 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -16,7 +16,8 @@ "mcp__serena__find_file", "mcp__serena__write_memory", "mcp__serena__think_about_whether_you_are_done", - "mcp__serena__search_for_pattern" + "mcp__serena__search_for_pattern", + "Bash(cat:*)" ], "deny": [], "ask": [] diff --git a/api-spec/model/accountLink.json b/api-spec/model/accountLink.json index 2191ed22..cb0fc3c9 100644 --- a/api-spec/model/accountLink.json +++ b/api-spec/model/accountLink.json @@ -9,7 +9,7 @@ }, "linking": { "type": "boolean", - "example": "true" + "example": true } }, "required": [ diff --git a/api-spec/model/error/error400.json b/api-spec/model/error/error400.json index ab30a6f0..e2fe69be 100644 --- a/api-spec/model/error/error400.json +++ b/api-spec/model/error/error400.json @@ -8,11 +8,11 @@ "properties": { "status": { "type": "integer", - "const": 400 + "enum": [400] }, "description": { "type": "string", - "const": "BadRequest" + "enum": ["BadRequest"] } }, "required": [ diff --git a/api-spec/model/error/error401.json b/api-spec/model/error/error401.json index adba8259..791ccc4a 100644 --- a/api-spec/model/error/error401.json +++ b/api-spec/model/error/error401.json @@ -8,11 +8,11 @@ "properties": { "status": { "type": "integer", - "const": 401 + "enum": [401] }, "description": { "type": "string", - "const": "Unauthorized" + "enum": ["Unauthorized"] } }, "required": [ diff --git a/api-spec/model/error/error403.json b/api-spec/model/error/error403.json index e2533cf7..52ca8db7 100644 --- a/api-spec/model/error/error403.json +++ b/api-spec/model/error/error403.json @@ -1,13 +1,18 @@ { + "allOf": [ + { + "$ref": "./errorBase.json" + } + ], "type": "object", "properties": { "status": { "type": "integer", - "const": 403 + "enum": [403] }, "description": { "type": "string", - "const": "Forbidden" + "enum": ["Forbidden"] }, "cause": { "type": "object", diff --git a/api-spec/model/error/error404.json b/api-spec/model/error/error404.json index 0232fc11..7c909d60 100644 --- a/api-spec/model/error/error404.json +++ b/api-spec/model/error/error404.json @@ -8,11 +8,11 @@ "properties": { "status": { "type": "integer", - "const": 404 + "enum": [404] }, "description": { "type": "string", - "const": "NotFound" + "enum": ["NotFound"] } }, "required": [ diff --git a/api-spec/model/error/error409.json b/api-spec/model/error/error409.json index 816da4b7..93bf577e 100644 --- a/api-spec/model/error/error409.json +++ b/api-spec/model/error/error409.json @@ -8,11 +8,11 @@ "properties": { "status": { "type": "integer", - "const": 409 + "enum": [409] }, "description": { "type": "string", - "const": "Conflict" + "enum": ["Conflict"] } }, "required": [ diff --git a/api-spec/model/error/errorBase.json b/api-spec/model/error/errorBase.json index b786eb7e..bf57f89b 100644 --- a/api-spec/model/error/errorBase.json +++ b/api-spec/model/error/errorBase.json @@ -4,7 +4,7 @@ "status": { "type": "integer", "minimum": 400, - "exclusiveMaximum": 600, + "maximum": 599, "example": 401 }, "description": { diff --git a/api-spec/path/entries/_serialNumber/_serialNumber.json b/api-spec/path/entries/_serialNumber/_serialNumber.json index fa018fa0..4dd01cc5 100644 --- a/api-spec/path/entries/_serialNumber/_serialNumber.json +++ b/api-spec/path/entries/_serialNumber/_serialNumber.json @@ -52,6 +52,7 @@ "description": "unauthorized or not signed in" }, "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { diff --git a/api-spec/path/entries/_serialNumber/comments/_commentId/_commentId.json b/api-spec/path/entries/_serialNumber/comments/_commentId/_commentId.json index 8a8f11f0..d10b9d62 100644 --- a/api-spec/path/entries/_serialNumber/comments/_commentId/_commentId.json +++ b/api-spec/path/entries/_serialNumber/comments/_commentId/_commentId.json @@ -12,6 +12,7 @@ "description": "unauthorized or not signed in" }, "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { diff --git a/api-spec/path/entries/_serialNumber/comments/comments.json b/api-spec/path/entries/_serialNumber/comments/comments.json index ed8d6081..1bc87d4c 100644 --- a/api-spec/path/entries/_serialNumber/comments/comments.json +++ b/api-spec/path/entries/_serialNumber/comments/comments.json @@ -65,6 +65,7 @@ "description": "unauthorized to create a new comment" }, "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { diff --git a/api-spec/path/entries/entries.json b/api-spec/path/entries/entries.json index f8e6ff14..d95b269e 100644 --- a/api-spec/path/entries/entries.json +++ b/api-spec/path/entries/entries.json @@ -79,6 +79,7 @@ } }, "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { diff --git a/api-spec/path/sign-in/sign-in.json b/api-spec/path/sign-in/sign-in.json index 550745d9..442e6308 100644 --- a/api-spec/path/sign-in/sign-in.json +++ b/api-spec/path/sign-in/sign-in.json @@ -29,6 +29,7 @@ } }, "403": { + "description": "Forbidden", "content": { "application/json": { "schema": { @@ -38,6 +39,7 @@ } }, "404": { + "description": "Not Found", "content": { "application/json": { "schema": { @@ -47,6 +49,7 @@ } }, "409": { + "description": "Conflict", "content": { "application/json": { "schema": { diff --git a/api-spec/path/sign-out/sign-out.json b/api-spec/path/sign-out/sign-out.json index 0dcb32dd..9316e408 100644 --- a/api-spec/path/sign-out/sign-out.json +++ b/api-spec/path/sign-out/sign-out.json @@ -12,9 +12,12 @@ } }, "403": { + "description": "Forbidden", "content": { "application/json": { - "$ref": "../../model/error/error403.json" + "schema": { + "$ref": "../../model/error/error403.json" + } } } } diff --git a/api-spec/path/users/_id/_id.json b/api-spec/path/users/_id/_id.json index b83f17fd..31739116 100644 --- a/api-spec/path/users/_id/_id.json +++ b/api-spec/path/users/_id/_id.json @@ -58,9 +58,12 @@ "description": "unauthorized or not signed in" }, "403": { + "description": "Forbidden", "content": { "application/json": { - "$ref": "../../../model/error/error403.json" + "schema": { + "$ref": "../../../model/error/error403.json" + } } } } @@ -84,9 +87,12 @@ "description": "unauthorized or not signed in" }, "403": { + "description": "Forbidden", "content": { "application/json": { - "$ref": "../../../model/error/error403.json" + "schema": { + "$ref": "../../../model/error/error403.json" + } } } } diff --git a/api-spec/path/users/admins/admins.json b/api-spec/path/users/admins/admins.json index bd05c9ad..08f5ff61 100644 --- a/api-spec/path/users/admins/admins.json +++ b/api-spec/path/users/admins/admins.json @@ -39,9 +39,12 @@ "description": "Bad Request" }, "403": { + "description": "Forbidden", "content": { "application/json": { - "$ref": "../../../model/error/error403.json" + "schema": { + "$ref": "../../../model/error/error403.json" + } } } } diff --git a/api-spec/path/users/users.json b/api-spec/path/users/users.json index 5a4cd400..68b3d0e1 100644 --- a/api-spec/path/users/users.json +++ b/api-spec/path/users/users.json @@ -54,9 +54,12 @@ "description": "Bad Request. Maybe screen name is duplicated" }, "403": { + "description": "Forbidden", "content": { "application/json": { - "$ref": "../../model/error/error403.json" + "schema": { + "$ref": "../../model/error/error403.json" + } } } } diff --git a/frontend/.gitignore b/frontend/.gitignore index f519984c..3bc438a9 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -53,3 +53,6 @@ yarn-error.log* # switch tsconfig.json by environment and replace default config tsconfig.json tsconfig.tsbuildinfo + +# OpenAPI Generator metadata +src/repository/openapi/generated/.openapi-generator/ diff --git a/frontend/src/repository/openapi/generated/.openapi-generator/FILES b/frontend/src/repository/openapi/generated/.openapi-generator/FILES deleted file mode 100644 index 0800e7be..00000000 --- a/frontend/src/repository/openapi/generated/.openapi-generator/FILES +++ /dev/null @@ -1,30 +0,0 @@ -apis/DefaultApi.ts -apis/index.ts -index.ts -models/AccountLink.ts -models/Admin.ts -models/AdminsGetResponse.ts -models/Comment.ts -models/Comments.ts -models/CommentsPostRequest.ts -models/Entries.ts -models/EntriesPostRequest.ts -models/EntriesSerialNumberPatchRequest.ts -models/Entry.ts -models/Error400.ts -models/Error401.ts -models/Error403.ts -models/Error403Cause.ts -models/Error404.ts -models/Error409.ts -models/ErrorBase.ts -models/ErrorCause.ts -models/Health.ts -models/SignInPostRequest.ts -models/User.ts -models/UserDetail.ts -models/Users.ts -models/UsersIdPatchRequest.ts -models/UsersPostRequest.ts -models/index.ts -runtime.ts diff --git a/frontend/src/repository/openapi/generated/.openapi-generator/VERSION b/frontend/src/repository/openapi/generated/.openapi-generator/VERSION deleted file mode 100644 index 368fd8fd..00000000 --- a/frontend/src/repository/openapi/generated/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.15.0 diff --git a/frontend/src/repository/openapi/generated/apis/DefaultApi.ts b/frontend/src/repository/openapi/generated/apis/DefaultApi.ts index 71a7d2f1..abcd6422 100644 --- a/frontend/src/repository/openapi/generated/apis/DefaultApi.ts +++ b/frontend/src/repository/openapi/generated/apis/DefaultApi.ts @@ -26,6 +26,7 @@ import type { Error400, Error401, Error403, + Error4031, Error404, Error409, Health, @@ -61,6 +62,8 @@ import { Error401ToJSON, Error403FromJSON, Error403ToJSON, + Error4031FromJSON, + Error4031ToJSON, Error404FromJSON, Error404ToJSON, Error409FromJSON, diff --git a/frontend/src/repository/openapi/generated/models/Error400.ts b/frontend/src/repository/openapi/generated/models/Error400.ts index 781e19ef..479b4950 100644 --- a/frontend/src/repository/openapi/generated/models/Error400.ts +++ b/frontend/src/repository/openapi/generated/models/Error400.ts @@ -32,13 +32,13 @@ export interface Error400 { * @type {number} * @memberof Error400 */ - status: number + status: Error400StatusEnum /** * * @type {string} * @memberof Error400 */ - description: string + description: Error400DescriptionEnum /** * * @type {ErrorCause} @@ -47,6 +47,24 @@ export interface Error400 { cause?: ErrorCause } +/** + * @export + */ +export const Error400StatusEnum = { + NUMBER_400: 400, +} as const +export type Error400StatusEnum = + (typeof Error400StatusEnum)[keyof typeof Error400StatusEnum] + +/** + * @export + */ +export const Error400DescriptionEnum = { + BadRequest: 'BadRequest', +} as const +export type Error400DescriptionEnum = + (typeof Error400DescriptionEnum)[keyof typeof Error400DescriptionEnum] + /** * Check if a given object implements the Error400 interface. */ diff --git a/frontend/src/repository/openapi/generated/models/Error401.ts b/frontend/src/repository/openapi/generated/models/Error401.ts index f1f0b724..75c5cb3f 100644 --- a/frontend/src/repository/openapi/generated/models/Error401.ts +++ b/frontend/src/repository/openapi/generated/models/Error401.ts @@ -32,13 +32,13 @@ export interface Error401 { * @type {number} * @memberof Error401 */ - status: number + status: Error401StatusEnum /** * * @type {string} * @memberof Error401 */ - description: string + description: Error401DescriptionEnum /** * * @type {ErrorCause} @@ -47,6 +47,24 @@ export interface Error401 { cause?: ErrorCause } +/** + * @export + */ +export const Error401StatusEnum = { + NUMBER_401: 401, +} as const +export type Error401StatusEnum = + (typeof Error401StatusEnum)[keyof typeof Error401StatusEnum] + +/** + * @export + */ +export const Error401DescriptionEnum = { + Unauthorized: 'Unauthorized', +} as const +export type Error401DescriptionEnum = + (typeof Error401DescriptionEnum)[keyof typeof Error401DescriptionEnum] + /** * Check if a given object implements the Error401 interface. */ diff --git a/frontend/src/repository/openapi/generated/models/Error403.ts b/frontend/src/repository/openapi/generated/models/Error403.ts index e0752448..6b4ab9d5 100644 --- a/frontend/src/repository/openapi/generated/models/Error403.ts +++ b/frontend/src/repository/openapi/generated/models/Error403.ts @@ -13,13 +13,13 @@ */ import { mapValues } from '../runtime' -import type { Error403Cause } from './Error403Cause' +import type { ErrorCause } from './ErrorCause' import { - Error403CauseFromJSON, - Error403CauseFromJSONTyped, - Error403CauseToJSON, - Error403CauseToJSONTyped, -} from './Error403Cause' + ErrorCauseFromJSON, + ErrorCauseFromJSONTyped, + ErrorCauseToJSON, + ErrorCauseToJSONTyped, +} from './ErrorCause' /** * @@ -32,21 +32,39 @@ export interface Error403 { * @type {number} * @memberof Error403 */ - status: number + status: Error403StatusEnum /** * * @type {string} * @memberof Error403 */ - description: string + description: Error403DescriptionEnum /** * - * @type {Error403Cause} + * @type {object} * @memberof Error403 */ - cause?: Error403Cause + cause?: object } +/** + * @export + */ +export const Error403StatusEnum = { + NUMBER_403: 403, +} as const +export type Error403StatusEnum = + (typeof Error403StatusEnum)[keyof typeof Error403StatusEnum] + +/** + * @export + */ +export const Error403DescriptionEnum = { + Forbidden: 'Forbidden', +} as const +export type Error403DescriptionEnum = + (typeof Error403DescriptionEnum)[keyof typeof Error403DescriptionEnum] + /** * Check if a given object implements the Error403 interface. */ @@ -71,8 +89,7 @@ export function Error403FromJSONTyped( return { status: json['status'], description: json['description'], - cause: - json['cause'] == null ? undefined : Error403CauseFromJSON(json['cause']), + cause: json['cause'] == null ? undefined : json['cause'], } } @@ -91,6 +108,6 @@ export function Error403ToJSONTyped( return { status: value['status'], description: value['description'], - cause: Error403CauseToJSON(value['cause']), + cause: value['cause'], } } diff --git a/frontend/src/repository/openapi/generated/models/Error4031.ts b/frontend/src/repository/openapi/generated/models/Error4031.ts new file mode 100644 index 00000000..0c2bfaaa --- /dev/null +++ b/frontend/src/repository/openapi/generated/models/Error4031.ts @@ -0,0 +1,113 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * kottage + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime' +import type { ErrorCause } from './ErrorCause' +import { + ErrorCauseFromJSON, + ErrorCauseFromJSONTyped, + ErrorCauseToJSON, + ErrorCauseToJSONTyped, +} from './ErrorCause' + +/** + * + * @export + * @interface Error4031 + */ +export interface Error4031 { + /** + * + * @type {number} + * @memberof Error4031 + */ + status: Error4031StatusEnum + /** + * + * @type {string} + * @memberof Error4031 + */ + description: Error4031DescriptionEnum + /** + * + * @type {object} + * @memberof Error4031 + */ + cause?: object +} + +/** + * @export + */ +export const Error4031StatusEnum = { + NUMBER_403: 403, +} as const +export type Error4031StatusEnum = + (typeof Error4031StatusEnum)[keyof typeof Error4031StatusEnum] + +/** + * @export + */ +export const Error4031DescriptionEnum = { + Forbidden: 'Forbidden', +} as const +export type Error4031DescriptionEnum = + (typeof Error4031DescriptionEnum)[keyof typeof Error4031DescriptionEnum] + +/** + * Check if a given object implements the Error4031 interface. + */ +export function instanceOfError4031(value: object): value is Error4031 { + if (!('status' in value) || value['status'] === undefined) return false + if (!('description' in value) || value['description'] === undefined) + return false + return true +} + +export function Error4031FromJSON(json: any): Error4031 { + return Error4031FromJSONTyped(json, false) +} + +export function Error4031FromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): Error4031 { + if (json == null) { + return json + } + return { + status: json['status'], + description: json['description'], + cause: json['cause'] == null ? undefined : json['cause'], + } +} + +export function Error4031ToJSON(json: any): Error4031 { + return Error4031ToJSONTyped(json, false) +} + +export function Error4031ToJSONTyped( + value?: Error4031 | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value + } + + return { + status: value['status'], + description: value['description'], + cause: value['cause'], + } +} diff --git a/frontend/src/repository/openapi/generated/models/Error404.ts b/frontend/src/repository/openapi/generated/models/Error404.ts index ab8c0a13..2311469d 100644 --- a/frontend/src/repository/openapi/generated/models/Error404.ts +++ b/frontend/src/repository/openapi/generated/models/Error404.ts @@ -32,13 +32,13 @@ export interface Error404 { * @type {number} * @memberof Error404 */ - status: number + status: Error404StatusEnum /** * * @type {string} * @memberof Error404 */ - description: string + description: Error404DescriptionEnum /** * * @type {ErrorCause} @@ -47,6 +47,24 @@ export interface Error404 { cause?: ErrorCause } +/** + * @export + */ +export const Error404StatusEnum = { + NUMBER_404: 404, +} as const +export type Error404StatusEnum = + (typeof Error404StatusEnum)[keyof typeof Error404StatusEnum] + +/** + * @export + */ +export const Error404DescriptionEnum = { + NotFound: 'NotFound', +} as const +export type Error404DescriptionEnum = + (typeof Error404DescriptionEnum)[keyof typeof Error404DescriptionEnum] + /** * Check if a given object implements the Error404 interface. */ diff --git a/frontend/src/repository/openapi/generated/models/Error409.ts b/frontend/src/repository/openapi/generated/models/Error409.ts index 51f50de5..851ef94b 100644 --- a/frontend/src/repository/openapi/generated/models/Error409.ts +++ b/frontend/src/repository/openapi/generated/models/Error409.ts @@ -32,13 +32,13 @@ export interface Error409 { * @type {number} * @memberof Error409 */ - status: number + status: Error409StatusEnum /** * * @type {string} * @memberof Error409 */ - description: string + description: Error409DescriptionEnum /** * * @type {ErrorCause} @@ -47,6 +47,24 @@ export interface Error409 { cause?: ErrorCause } +/** + * @export + */ +export const Error409StatusEnum = { + NUMBER_409: 409, +} as const +export type Error409StatusEnum = + (typeof Error409StatusEnum)[keyof typeof Error409StatusEnum] + +/** + * @export + */ +export const Error409DescriptionEnum = { + Conflict: 'Conflict', +} as const +export type Error409DescriptionEnum = + (typeof Error409DescriptionEnum)[keyof typeof Error409DescriptionEnum] + /** * Check if a given object implements the Error409 interface. */ diff --git a/frontend/src/repository/openapi/generated/models/index.ts b/frontend/src/repository/openapi/generated/models/index.ts index 66e9de0c..3990c443 100644 --- a/frontend/src/repository/openapi/generated/models/index.ts +++ b/frontend/src/repository/openapi/generated/models/index.ts @@ -13,7 +13,7 @@ export * from './Entry' export * from './Error400' export * from './Error401' export * from './Error403' -export * from './Error403Cause' +export * from './Error4031' export * from './Error404' export * from './Error409' export * from './ErrorBase' From 006df0143d4833574a29830260ee16db3a1faf48 Mon Sep 17 00:00:00 2001 From: miyado <10195648+hmiyado@users.noreply.github.com> Date: Thu, 16 Oct 2025 22:45:28 +0900 Subject: [PATCH 05/11] feat: refactor Error403 and Error4031 models to use Error403Cause for cause property --- api-spec/model/error/error403.json | 15 +-------------- api-spec/model/error/error403Cause.json | 16 ++++++++++++++++ .../openapi/generated/models/Error403.ts | 16 ++++++++++++---- .../openapi/generated/models/Error4031.ts | 16 ++++++++++++---- .../repository/openapi/generated/models/index.ts | 1 + 5 files changed, 42 insertions(+), 22 deletions(-) create mode 100644 api-spec/model/error/error403Cause.json diff --git a/api-spec/model/error/error403.json b/api-spec/model/error/error403.json index 52ca8db7..927b35f4 100644 --- a/api-spec/model/error/error403.json +++ b/api-spec/model/error/error403.json @@ -15,20 +15,7 @@ "enum": ["Forbidden"] }, "cause": { - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "CsrfTokenRequired", - "CsrfHeaderRequired", - "InvalidOrigin" - ] - } - }, - "required": [ - "kind" - ] + "$ref": "./error403Cause.json" } }, "required": [ diff --git a/api-spec/model/error/error403Cause.json b/api-spec/model/error/error403Cause.json new file mode 100644 index 00000000..bef5afd8 --- /dev/null +++ b/api-spec/model/error/error403Cause.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "kind": { + "type": "string", + "enum": [ + "CsrfTokenRequired", + "CsrfHeaderRequired", + "InvalidOrigin" + ] + } + }, + "required": [ + "kind" + ] +} diff --git a/frontend/src/repository/openapi/generated/models/Error403.ts b/frontend/src/repository/openapi/generated/models/Error403.ts index 6b4ab9d5..fa7a60bc 100644 --- a/frontend/src/repository/openapi/generated/models/Error403.ts +++ b/frontend/src/repository/openapi/generated/models/Error403.ts @@ -20,6 +20,13 @@ import { ErrorCauseToJSON, ErrorCauseToJSONTyped, } from './ErrorCause' +import type { Error403Cause } from './Error403Cause' +import { + Error403CauseFromJSON, + Error403CauseFromJSONTyped, + Error403CauseToJSON, + Error403CauseToJSONTyped, +} from './Error403Cause' /** * @@ -41,10 +48,10 @@ export interface Error403 { description: Error403DescriptionEnum /** * - * @type {object} + * @type {Error403Cause} * @memberof Error403 */ - cause?: object + cause?: Error403Cause } /** @@ -89,7 +96,8 @@ export function Error403FromJSONTyped( return { status: json['status'], description: json['description'], - cause: json['cause'] == null ? undefined : json['cause'], + cause: + json['cause'] == null ? undefined : Error403CauseFromJSON(json['cause']), } } @@ -108,6 +116,6 @@ export function Error403ToJSONTyped( return { status: value['status'], description: value['description'], - cause: value['cause'], + cause: Error403CauseToJSON(value['cause']), } } diff --git a/frontend/src/repository/openapi/generated/models/Error4031.ts b/frontend/src/repository/openapi/generated/models/Error4031.ts index 0c2bfaaa..5030f914 100644 --- a/frontend/src/repository/openapi/generated/models/Error4031.ts +++ b/frontend/src/repository/openapi/generated/models/Error4031.ts @@ -20,6 +20,13 @@ import { ErrorCauseToJSON, ErrorCauseToJSONTyped, } from './ErrorCause' +import type { Error403Cause } from './Error403Cause' +import { + Error403CauseFromJSON, + Error403CauseFromJSONTyped, + Error403CauseToJSON, + Error403CauseToJSONTyped, +} from './Error403Cause' /** * @@ -41,10 +48,10 @@ export interface Error4031 { description: Error4031DescriptionEnum /** * - * @type {object} + * @type {Error403Cause} * @memberof Error4031 */ - cause?: object + cause?: Error403Cause } /** @@ -89,7 +96,8 @@ export function Error4031FromJSONTyped( return { status: json['status'], description: json['description'], - cause: json['cause'] == null ? undefined : json['cause'], + cause: + json['cause'] == null ? undefined : Error403CauseFromJSON(json['cause']), } } @@ -108,6 +116,6 @@ export function Error4031ToJSONTyped( return { status: value['status'], description: value['description'], - cause: value['cause'], + cause: Error403CauseToJSON(value['cause']), } } diff --git a/frontend/src/repository/openapi/generated/models/index.ts b/frontend/src/repository/openapi/generated/models/index.ts index 3990c443..c2f4bbb4 100644 --- a/frontend/src/repository/openapi/generated/models/index.ts +++ b/frontend/src/repository/openapi/generated/models/index.ts @@ -14,6 +14,7 @@ export * from './Error400' export * from './Error401' export * from './Error403' export * from './Error4031' +export * from './Error403Cause' export * from './Error404' export * from './Error409' export * from './ErrorBase' From 7f306cc287419c08d2b125ce7aada0e21e6011d6 Mon Sep 17 00:00:00 2001 From: miyado <10195648+hmiyado@users.noreply.github.com> Date: Thu, 16 Oct 2025 22:57:55 +0900 Subject: [PATCH 06/11] fix: update JSON schema references for comments and comment models --- api-spec/path/entries/_serialNumber/comments/comments.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api-spec/path/entries/_serialNumber/comments/comments.json b/api-spec/path/entries/_serialNumber/comments/comments.json index 1bc87d4c..19e9c297 100644 --- a/api-spec/path/entries/_serialNumber/comments/comments.json +++ b/api-spec/path/entries/_serialNumber/comments/comments.json @@ -28,7 +28,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Comments" + "$ref": "../../../../model/comments.json" } } } @@ -53,7 +53,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Comment" + "$ref": "../../../../model/comment.json" } } } From 8682fa288117bdcbfdee3f9f8ee75a36b7e69cbd Mon Sep 17 00:00:00 2001 From: miyado <10195648+hmiyado@users.noreply.github.com> Date: Thu, 16 Oct 2025 23:18:12 +0900 Subject: [PATCH 07/11] feat: update error handling to use enums for status and description in ErrorFactory feat: update JSON schema reference for CommentsPostRequest in API spec --- .../entries/_serialNumber/comments/comments.json | 2 +- api-spec/root.json | 3 +++ .../application/plugins/statuspages/ErrorFactory.kt | 12 ++++++------ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/api-spec/path/entries/_serialNumber/comments/comments.json b/api-spec/path/entries/_serialNumber/comments/comments.json index 19e9c297..61c07f1e 100644 --- a/api-spec/path/entries/_serialNumber/comments/comments.json +++ b/api-spec/path/entries/_serialNumber/comments/comments.json @@ -42,7 +42,7 @@ "content": { "application/json": { "schema": { - "$ref": "path/entries/_serialNumber/comments/commentsPostRequest.json" + "$ref": "#/components/schemas/CommentsPostRequest" } } } diff --git a/api-spec/root.json b/api-spec/root.json index 9596b4ad..a300c160 100644 --- a/api-spec/root.json +++ b/api-spec/root.json @@ -71,6 +71,9 @@ }, "Comments": { "$ref": "model/comments.json" + }, + "CommentsPostRequest": { + "$ref": "path/entries/_serialNumber/comments/commentsPostRequest.json" } } } diff --git a/backend/src/main/kotlin/com/github/hmiyado/kottage/application/plugins/statuspages/ErrorFactory.kt b/backend/src/main/kotlin/com/github/hmiyado/kottage/application/plugins/statuspages/ErrorFactory.kt index b95d6cd7..67dc46b7 100644 --- a/backend/src/main/kotlin/com/github/hmiyado/kottage/application/plugins/statuspages/ErrorFactory.kt +++ b/backend/src/main/kotlin/com/github/hmiyado/kottage/application/plugins/statuspages/ErrorFactory.kt @@ -8,14 +8,14 @@ import com.github.hmiyado.kottage.openapi.models.Error409 object ErrorFactory { fun create400(description: String = "BadRequest") = Error400( - status = 400, - description = description, + status = Error400.Status._400, + description = Error400.Description.BadRequest, ) fun create403(kind: Error403Cause.Kind? = null) = Error403( - status = 403, - description = "Forbidden", + status = Error403.Status._403, + description = Error403.Description.Forbidden, cause = kind?.let { Error403Cause( @@ -26,7 +26,7 @@ object ErrorFactory { fun create409() = Error409( - status = 409, - description = "Conflict", + status = Error409.Status._409, + description = Error409.Description.Conflict, ) } From 7e863e94a1f1a48918f9ce706e17c5d87238596b Mon Sep 17 00:00:00 2001 From: miyado <10195648+hmiyado@users.noreply.github.com> Date: Thu, 16 Oct 2025 23:37:18 +0900 Subject: [PATCH 08/11] feat: add Redocly configuration and update JSON schema references for comments --- .redocly.yaml | 5 +++++ api-spec/path/entries/_serialNumber/comments/comments.json | 2 +- api-spec/root.json | 3 --- 3 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 .redocly.yaml diff --git a/.redocly.yaml b/.redocly.yaml new file mode 100644 index 00000000..976079dc --- /dev/null +++ b/.redocly.yaml @@ -0,0 +1,5 @@ +apis: + main: + root: api-spec/root.json +rules: + no-unresolved-refs: off diff --git a/api-spec/path/entries/_serialNumber/comments/comments.json b/api-spec/path/entries/_serialNumber/comments/comments.json index 61c07f1e..19e9c297 100644 --- a/api-spec/path/entries/_serialNumber/comments/comments.json +++ b/api-spec/path/entries/_serialNumber/comments/comments.json @@ -42,7 +42,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CommentsPostRequest" + "$ref": "path/entries/_serialNumber/comments/commentsPostRequest.json" } } } diff --git a/api-spec/root.json b/api-spec/root.json index a300c160..9596b4ad 100644 --- a/api-spec/root.json +++ b/api-spec/root.json @@ -71,9 +71,6 @@ }, "Comments": { "$ref": "model/comments.json" - }, - "CommentsPostRequest": { - "$ref": "path/entries/_serialNumber/comments/commentsPostRequest.json" } } } From b79c23e722cf7a377cfd38abd8f049c77f30eb40 Mon Sep 17 00:00:00 2001 From: miyado <10195648+hmiyado@users.noreply.github.com> Date: Thu, 16 Oct 2025 23:40:51 +0900 Subject: [PATCH 09/11] feat: add OpenAPI configuration file path to CI workflow --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87e35e55..2e78bc5f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,6 +49,7 @@ jobs: VALIDATE_MARKDOWN: true VALIDATE_OPENAPI: true VALIDATE_SHELL_SHFMT: true + OPENAPI_CONFIG_FILE: .redocly.yaml DEFAULT_BRANCH: main GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 5a664e976e5eee16c6ad87bc1cf5b3594e7f2240 Mon Sep 17 00:00:00 2001 From: miyado <10195648+hmiyado@users.noreply.github.com> Date: Fri, 17 Oct 2025 23:19:45 +0900 Subject: [PATCH 10/11] feat: add Redocly configuration file for OpenAPI validation --- .redocly.yaml => .github/linters/.redocly.yaml | 0 .github/workflows/ci.yml | 1 - 2 files changed, 1 deletion(-) rename .redocly.yaml => .github/linters/.redocly.yaml (100%) diff --git a/.redocly.yaml b/.github/linters/.redocly.yaml similarity index 100% rename from .redocly.yaml rename to .github/linters/.redocly.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e78bc5f..87e35e55 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,7 +49,6 @@ jobs: VALIDATE_MARKDOWN: true VALIDATE_OPENAPI: true VALIDATE_SHELL_SHFMT: true - OPENAPI_CONFIG_FILE: .redocly.yaml DEFAULT_BRANCH: main GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From e554b466050f3e70704c043bd93fa31e0693fe12 Mon Sep 17 00:00:00 2001 From: miyado <10195648+hmiyado@users.noreply.github.com> Date: Tue, 11 Nov 2025 09:43:00 +0900 Subject: [PATCH 11/11] fix: correct $ref for comments POST request to use ./commentsPostRequest.json --- api-spec/path/entries/_serialNumber/comments/comments.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-spec/path/entries/_serialNumber/comments/comments.json b/api-spec/path/entries/_serialNumber/comments/comments.json index 19e9c297..197db55b 100644 --- a/api-spec/path/entries/_serialNumber/comments/comments.json +++ b/api-spec/path/entries/_serialNumber/comments/comments.json @@ -42,7 +42,7 @@ "content": { "application/json": { "schema": { - "$ref": "path/entries/_serialNumber/comments/commentsPostRequest.json" + "$ref": "./commentsPostRequest.json" } } }