Skip to content

feat: add support for matched path feature in axum integration - #298

Open
Phosphorus-M wants to merge 3 commits into
tamasfe:mainfrom
Phosphorus-M:matched-paths
Open

feat: add support for matched path feature in axum integration#298
Phosphorus-M wants to merge 3 commits into
tamasfe:mainfrom
Phosphorus-M:matched-paths

Conversation

@Phosphorus-M

@Phosphorus-M Phosphorus-M commented Apr 18, 2026

Copy link
Copy Markdown

This change enable the path params into Swagger, Scalar and Redocs:

Scalar
Before After
image image
Swagger
Before After
image image
Redocs
Before After
image image

@jplatte

jplatte commented Apr 18, 2026

Copy link
Copy Markdown
Collaborator

What does this PR intend to do, and why? The code changes make very little sense to me.

@Phosphorus-M

Phosphorus-M commented Apr 18, 2026

Copy link
Copy Markdown
Author

Sorry, I was updating the description. This basically adds support for path parameters in axum
Before this PR, paths weren't recognized

Before this patch:

Redoc image
Swagger image
Redoc image

@jplatte

jplatte commented Apr 18, 2026

Copy link
Copy Markdown
Collaborator

Then it has nothing to do with the axum-matched-path feature though, which is purely about the MatchedPath extractor from axum (which is not required for using path parameters).

Also why did you make serde_qs a default feature?

@Phosphorus-M

Copy link
Copy Markdown
Author

Also why did you make serde_qs a default feature?

Lol it was a fail, sorry I'm going to fix that

Then it has nothing to do with the axum-matched-path feature though, which is purely about the MatchedPath extractor from axum (which is not required for using path parameters).

Oh ok, I'm going to change that, thanks!

@Phosphorus-M

Copy link
Copy Markdown
Author

Okay I added the type of the path

Scalar image
Swagger image
Redoc image

@Phosphorus-M

Copy link
Copy Markdown
Author

@jplatte Don't hate me but can you review this? I know that you are not payed but just to know if I must to change something 😭

@jplatte jplatte left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I have very little time for open source at the moment. I left a small comment, I think the overall approach works (it's a bit hacky, but I can't think of a better solution without bigger refactors).

Maybe @tamasfe or @Wicpar can properly review?

Comment thread crates/aide/src/axum/inputs.rs Outdated
};

#[cfg(feature = "axum")]
pub(crate) const MATCHED_PATH_EXTENSION: &str = "x-aide-axum-matched-path";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't appear to be used for anything. It's inserted in one place, removed in another (without its presence being used for any branching).

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.

2 participants