Skip to content

Migrate to utoipa-axum and update to utoipa 5.4#11

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/move-to-utoipa-axum
Draft

Migrate to utoipa-axum and update to utoipa 5.4#11
Copilot wants to merge 4 commits intomainfrom
copilot/move-to-utoipa-axum

Conversation

Copy link
Copy Markdown

Copilot AI commented Jan 16, 2026

Migrates from utoipa with axum_extras feature to the dedicated utoipa-axum integration crate, addressing the deprecation path and enabling better compile-time route safety.

Dependency Changes

  • Added utoipa-axum = "0.2.0"
  • Updated utoipa from 5.3.1 to 5.4.0
  • Removed axum_extras feature (deprecated integration path)

Server Implementation

  • Replaced manual route registration with OpenApiRouter::with_openapi() and routes!() macro
  • Each handler registered individually via separate routes!() calls to avoid method/path conflicts
  • Removed context_path attributes from path annotations (handled by .nest() mounting)
  • OpenAPI spec now extracted via .split_for_parts() instead of ::openapi() calls

Before:

let api_router = Router::new()
    .route("/health", get(health))
    .route("/v1/ned/tz/{lng}/{lat}", get(timezone_ned_v1));

Router::new()
    .merge(SwaggerUi::new("/swagger").url("/api-docs/openapi.json", ApiDoc::openapi()))
    .nest("/api", api_router)

After:

let (api_router, api) = OpenApiRouter::with_openapi(ApiDoc::openapi())
    .routes(routes!(health))
    .routes(routes!(timezone_ned_v1))
    .split_for_parts();

Router::new()
    .merge(SwaggerUi::new("/swagger").url("/api-docs/openapi.json", api))
    .nest("/api", api_router)

All existing API endpoints and tests remain unchanged.

Original prompt

This section details on the original issue you should resolve

<issue_title>Move to utoipa_axum, and bump key packages.</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI self-assigned this Jan 16, 2026
Copilot AI and others added 3 commits January 17, 2026 00:05
Co-authored-by: twitchax <549523+twitchax@users.noreply.github.com>
Co-authored-by: twitchax <549523+twitchax@users.noreply.github.com>
Co-authored-by: twitchax <549523+twitchax@users.noreply.github.com>
Copilot AI changed the title [WIP] Move to utoipa_axum and bump key packages Migrate to utoipa-axum and update to utoipa 5.4 Jan 17, 2026
Copilot AI requested a review from twitchax January 17, 2026 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move to utoipa_axum, and bump key packages.

2 participants