feat(http): OpenAPI アノテーションと utoipa-axum 統合#14
Merged
Conversation
build_core_routes を OpenApiRouter 化し、ルート登録と OpenAPI spec 生成を routes! マクロで一体化。ルートを追加すれば必ず spec に載るため、 アノテーション付け忘れによるドリフトが構造的に発生しなくなる。 - 15 ハンドラに #[utoipa::path] を付与(path/method/status/description/security) - レスポンスモデル 15 struct に ToSchema を derive(リッチなスキーマ) - Query/Body struct に IntoParams / ToSchema を derive - /api index の手書き endpoints 配列を廃止し、spec から導出(endpoints_from_spec) - 標準サーバー用に ApiDoc / SecurityAddon を追加(埋め込み時はホストが merge) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ホストアプリ (NoteDeck) が DB/client を構築せずにフル spec を生成できるよう、 ルート登録部を core_openapi_router() に切り出し、state-free な core_openapi() を 公開。/api/openapi.json・Tauri command・コミット済みスナップショットが 同一の spec source を共有できる。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
hitalin
added a commit
to hitalin/notedeck
that referenced
this pull request
May 14, 2026
PR hitalin/notecli#14 がマージされたため、フィーチャーブランチの commit から main の マージ commit (59b39c2) に更新。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
なぜ
notecli の HTTP サーバー (
build_core_routes) が登録する Misskey コア API 15 本には OpenAPI アノテーションが一切なく、これを埋め込む NoteDeck 側の Scalar API ドキュメントから完全に欠落していた(全 22 本中 7 本しか表示されていなかった)。何を
utoipa-axumのOpenApiRouter+routes!マクロを導入し、ルート登録と OpenAPI spec 生成を 1 操作に統合。ルートを登録すれば必ず spec に載るため、アノテーション付け忘れによるドリフトが構造的に発生しない。#[utoipa::path]を付与(path/method/status/description/security)ToSchemaを derive(リッチなスキーマ)IntoParams/ToSchemaを derivebuild_core_routesをOpenApiRouter化、build_routerはsplit_for_parts()でRouterを返す(外部シグネチャ不変)core_openapi()を公開 — ホストアプリ (NoteDeck) が DB/client を構築せずにフル spec を生成できる/apiindex の手書き endpoints 配列を廃止し、spec から導出(endpoints_from_spec)ApiDoc/SecurityAddonを追加(埋め込み時はホストが merge)core_routes_are_all_in_the_specテストでOpenApiRouter配線のリグレッションをガード影響範囲
build_core_routesの戻り値型変更の影響は noteclibuild_routerと NoteDeckserve()の 2 箇所のみ。utoipa/utoipa-axumを通常依存として追加(--no-default-featuresビルドも確認済み)。テスト
cargo test全 142 件 green(http_server の新規 2 件含む)cargo clippy --lib警告なし(既存のmanual_flatten1 件のみ、本 PR と無関係)cargo check --no-default-features通過🤖 Generated with Claude Code