Feature request: support for deprecated endpoints
I couldn't find a way to mark an endpoint as deprecated with Aide.
For example, Utoipa (which uses macros to generate documentation), makes use of Rust’s #[deprecated] attribute (https://docs.rs/utoipa/latest/utoipa/attr.path.html).
A deprecated endpoint should look like this (in Swagger):
Here is its raw OpenAPI JSON (simplified):
"/some/deprecated/route": {
"get": {
"summary": "Guys, don't use this endpoint anymore.",
"deprecated": true
}
}
Aide could use the following syntax for this feature:
ApiRouter::new()
.api_route(
"/path/to/route",
get_with(handler, |o| o.deprecated()),
)
Should not be hard to add this. I was wondering if there's a better syntax
Should not be hard to add this. I was wondering if there's a better syntax
The only alternative I can imagine is also accepting a boolean parameter:
.api_route(
"/path/to/route",
get_with(handler, |o| o.deprecated(true)),
)
But to think of it, who would pass .deprecated(false)? 😁
I think this is currently possible using o.inner_mut().deprecated = true;.