I have an existing axum webapp, how to add aide? #208
Replies: 2 comments
-
|
You can add docs incrementally by switching to the types "from" aide. They are not re-exports but they are probably compatible with your axum code, if the version matches |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
I'm adding this in case anyone else needs help and doesn't have the intuition to figure it out immediately like I did. The answer is;
This is the resulting route that I got working for one of my existing routes. .api_route_with(
"/api/v1/mint_005_desc",
post_with(
|state: State<SirenState>, body: Json<Mint005Keys>| async move {
match make_mint005_vault_descriptor(state, body).await {
Ok(response) => response.into_response(),
Err(err) => err.into_response()
}
},
|op| {
op.summary("Create Vault Descriptor")
.description("Creates a descriptor for a vault using the Mint005 template")
.tag("Vault Creation")
.input::<Json<Mint005Keys>>()
.response::<200, Json<Value>>()
.response_with::<400, Json<TridentError>, _>(|res| {
res.description("Bad request or invalid input")
})
}
),
|p| p.security_requirement("ApiKey"),
) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I don't want to rewrite my app and change all the types and switch to the version of axum that's reexported by aide.
Is there a way to do this? or is this crate not for me?
Beta Was this translation helpful? Give feedback.
All reactions