You've already forked authentication-service
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:
@ -96,8 +96,10 @@ impl IntoResponse for RouteError {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// # JSON payload for the `POST /api/admin/v1/users` endpoint
|
||||||
#[derive(Deserialize, JsonSchema)]
|
#[derive(Deserialize, JsonSchema)]
|
||||||
pub struct AddUserParams {
|
#[serde(rename = "AddUserRequest")]
|
||||||
|
pub struct Request {
|
||||||
/// The username of the user to add.
|
/// The username of the user to add.
|
||||||
username: String,
|
username: String,
|
||||||
|
|
||||||
@ -141,7 +143,7 @@ pub async fn handler(
|
|||||||
}: CallContext,
|
}: CallContext,
|
||||||
NoApi(mut rng): NoApi<BoxRng>,
|
NoApi(mut rng): NoApi<BoxRng>,
|
||||||
State(homeserver): State<BoxHomeserverConnection>,
|
State(homeserver): State<BoxHomeserverConnection>,
|
||||||
Json(params): Json<AddUserParams>,
|
Json(params): Json<Request>,
|
||||||
) -> Result<Json<SingleResponse<User>>, RouteError> {
|
) -> Result<Json<SingleResponse<User>>, RouteError> {
|
||||||
if repo.user().exists(¶ms.username).await? {
|
if repo.user().exists(¶ms.username).await? {
|
||||||
return Err(RouteError::UserAlreadyExists);
|
return Err(RouteError::UserAlreadyExists);
|
||||||
|
@ -169,7 +169,7 @@
|
|||||||
"content": {
|
"content": {
|
||||||
"application/json": {
|
"application/json": {
|
||||||
"schema": {
|
"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",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"username"
|
"username"
|
||||||
|
Reference in New Issue
Block a user