Repository navigation
|
Currently (at least in the latest stable version of Lets take a path like async fn get_location(Path(name): Path<String>) -> String {
todo!()
}This will compile, but it will also completely omit the The recommended (see: #106) way of adding the documentation is by wrapping the parameter in a struct like so: #[derive(Deserialize, JsonSchema)]
struct LocationPathParams {
/// Documentation for the {name} path parameter
name: String
}
async fn get_location(Path(name): Path<LocationPathParams>) -> String {
todo!()
}This adds the Latter is undesired as the only reason this object exists is to coerce aide into generating the path parameter, it is not a valid input/out object for any of the documented endpoints |
Replies: 1 comment
|
The solution is to mark the struct as inline like so: #[derive(Deserialize, JsonSchema)]
#[schemars(inline)] // <---
struct LocationPathParams {
/// Documentation for the {name} path parameter
name: String
}This also works for the |
The solution is to mark the struct as inline like so:
This also works for the
Queryextractor, and presumably any other that I didn't think of.