You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-07-29 22:01:14 +03:00
Tweak the schema to use summary instead of description and add tags
This commit is contained in:
@ -14,7 +14,7 @@
|
||||
|
||||
use aide::{
|
||||
axum::ApiRouter,
|
||||
openapi::{OAuth2Flow, OAuth2Flows, OpenApi, SecurityScheme, Server},
|
||||
openapi::{OAuth2Flow, OAuth2Flows, OpenApi, SecurityScheme, Server, Tag},
|
||||
};
|
||||
use axum::{
|
||||
extract::{FromRef, FromRequestParts, State},
|
||||
@ -53,6 +53,11 @@ where
|
||||
.nest("/api/admin/v1", self::v1::router())
|
||||
.finish_api_with(&mut api, |t| {
|
||||
t.title("Matrix Authentication Service admin API")
|
||||
.tag(Tag {
|
||||
name: "user".to_owned(),
|
||||
description: Some("Manage users".to_owned()),
|
||||
..Tag::default()
|
||||
})
|
||||
.security_scheme(
|
||||
"oauth2",
|
||||
SecurityScheme::OAuth2 {
|
||||
|
@ -58,7 +58,8 @@ pub struct UsernamePathParam {
|
||||
|
||||
pub fn doc(operation: TransformOperation) -> TransformOperation {
|
||||
operation
|
||||
.description("Get a user by its username (localpart)")
|
||||
.summary("Get a user by its username (localpart)")
|
||||
.tag("user")
|
||||
.response_with::<200, Json<SingleResponse<User>>, _>(|t| {
|
||||
let [sample, ..] = User::samples();
|
||||
let response =
|
||||
|
@ -52,7 +52,8 @@ impl IntoResponse for RouteError {
|
||||
|
||||
pub fn doc(operation: TransformOperation) -> TransformOperation {
|
||||
operation
|
||||
.description("Get a user")
|
||||
.summary("Get a user")
|
||||
.tag("user")
|
||||
.response_with::<200, Json<SingleResponse<User>>, _>(|t| {
|
||||
let [sample, ..] = User::samples();
|
||||
let response = SingleResponse::new_canonical(sample);
|
||||
|
@ -100,7 +100,8 @@ impl IntoResponse for RouteError {
|
||||
|
||||
pub fn doc(operation: TransformOperation) -> TransformOperation {
|
||||
operation
|
||||
.description("List users")
|
||||
.summary("List users")
|
||||
.tag("user")
|
||||
.response_with::<200, Json<PaginatedResponse<User>>, _>(|t| {
|
||||
let users = User::samples();
|
||||
let pagination = mas_storage::Pagination::first(users.len());
|
||||
|
Reference in New Issue
Block a user