Support for x-tagGroups
imran-mirza79 opened this issue · 4 comments
imran-mirza79 commented
How can I achieve the following
x-tagGroups
y-haidar commented
Use tag
method of TransformOperation
. The example in the repo show case this.
aide/examples/example-axum/src/main.rs
Lines 53 to 57 in 6a3ca01
Another example
fn test_fn_docs(op: TransformOperation) -> TransformOperation {
op.description("Test fn.").tag("Test Tag")
}
let app = ApiRouter::new()
.api_route("/api/test_fn", routing::get_with(test_fn, test_fn_docs))
// ...
imran-mirza79 commented
I am already using this tag method. I want group it, as highlighted in red box in the image.
Screenshot from this link: x-tagGroups
y-haidar commented
Oh it is a "group" of other tags. I could be wrong but I don't think I have seen this option in aide. I did a quick google search on this, and I think this is a redoc
specific feature and not part of OpenAPI Specification.
Wicpar commented
you can add x-tagGroups
like this:
use serde_json::json;
use aide::openapi::OpenApi;
let mut api: OpenApi = ...; // get the api struct that you initialize at the start, and where you finish the api into.
api.extensions.insert("x-tagGroups".into(), json!({
"name": "My Group",
"tags": ["tag1", "tag2", "etc..."]
}));