fix: diverging axum route and openapi spec#1199
Merged
juhaku merged 3 commits intojuhaku:masterfrom Nov 21, 2024
Merged
Conversation
juhaku
requested changes
Nov 14, 2024
Owner
juhaku
left a comment
There was a problem hiding this comment.
This is pretty neat, 👍
However could you add a line to CHANGELOG.md for the addition at beginning of file.
## Unreleased
### Fixed
* title (http;//PR)
juhaku
approved these changes
Nov 21, 2024
Owner
|
I added the CHANGELOG markings for the PR 👌 |
juhaku
added a commit
that referenced
this pull request
Dec 9, 2024
Fix axum path nesting in `OpenApiRouter` to allow empty paths and correctly template the path for `OpenApiRouter` from colons. Relates to #1199
Merged
juhaku
added a commit
that referenced
this pull request
Dec 9, 2024
Fix axum path nesting in `OpenApiRouter` to allow empty paths and correctly template the path for `OpenApiRouter` from colons. Relates to #1199
juhaku
added a commit
that referenced
this pull request
Dec 9, 2024
Fix axum path nesting in `OpenApiRouter` to allow empty paths and correctly template the path for `OpenApiRouter` from colons. Relates to #1199
tom-weelborg
pushed a commit
to tom-weelborg/utoipa
that referenced
this pull request
Apr 5, 2026
Unify the `axum::Router::nest` functionality with `utoipa_axum::Router::nest` functionality while keeping the base implementation same as before, default to `utoipa`. --------- Co-authored-by: Benjamin Mollier <benjamin@paxlife.aero> Co-authored-by: Juha Kukkonen <juha7kukkonen@gmail.com>
tom-weelborg
pushed a commit
to tom-weelborg/utoipa
that referenced
this pull request
Apr 5, 2026
Fix axum path nesting in `OpenApiRouter` to allow empty paths and correctly template the path for `OpenApiRouter` from colons. Relates to juhaku#1199
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.
Currently there is the possibility that the swagger-ui does not work with
utoipa_axumin certain conditions.The reason for this is, that the path resolution in the
.nest(router)function is different in axum and utoipa.This pull request fixes it by applying the same logic for the OpenAPI spec generation, that is used in axum.
How to reproduce this issue
With the following minimal reproducible example, open the swagger ui on
localhost:3000/docs.The only endpoint is
/a/, but when you perform the request, it returns404 Not Found.Cause of the issue
In Axum the
.nestlogic joins the prefix and nested path in a different way than utopia. E.g. for nested routes the trailing/is stripped away and other logic to prevent double//in the joined path.