Replies: 1 comment
-
I know this is old, but yes you can like so: let mut api = OpenApi::default();
let app = ApiRouter::new()
... // Your routes
.finish_api_with(&mut api, api_docs);
if let Some(paths) = api.paths.as_mut() {
if let Some(value) = paths.paths.swap_remove("/foo/") {
paths.paths.insert("/foo".to_owned(), value);
}
}
let app = app.layer(Extension(Arc::new(api))); Not with an operation, but with modifying the |
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
-
My code basically looks like this:
And the server accepts requests to
/foo
and/foo/
.The OpenAPI docs now (correctly) show
/foo/
, but I'd like them to use/foo
instead.Is it somehow possible to declare the route or transform the aide Operation such that this is possible?
Beta Was this translation helpful? Give feedback.
All reactions