1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-31 09:24:31 +03:00

Rename the payload struct to appease clippy

This commit is contained in:
Quentin Gliech
2024-07-29 10:40:25 +02:00
parent 221f227baa
commit 94004ce18c
2 changed files with 7 additions and 4 deletions

View File

@ -96,8 +96,10 @@ impl IntoResponse for RouteError {
}
}
/// # JSON payload for the `POST /api/admin/v1/users` endpoint
#[derive(Deserialize, JsonSchema)]
pub struct AddUserParams {
#[serde(rename = "AddUserRequest")]
pub struct Request {
/// The username of the user to add.
username: String,
@ -141,7 +143,7 @@ pub async fn handler(
}: CallContext,
NoApi(mut rng): NoApi<BoxRng>,
State(homeserver): State<BoxHomeserverConnection>,
Json(params): Json<AddUserParams>,
Json(params): Json<Request>,
) -> Result<Json<SingleResponse<User>>, RouteError> {
if repo.user().exists(&params.username).await? {
return Err(RouteError::UserAlreadyExists);

View File

@ -169,7 +169,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AddUserParams"
"$ref": "#/components/schemas/AddUserRequest"
}
}
},
@ -637,7 +637,8 @@
}
}
},
"AddUserParams": {
"AddUserRequest": {
"title": "JSON payload for the `POST /api/admin/v1/users` endpoint",
"type": "object",
"required": [
"username"