diff --git a/crates/handlers/src/admin/v1/users/add.rs b/crates/handlers/src/admin/v1/users/add.rs index 647a8d18..06bd4ae5 100644 --- a/crates/handlers/src/admin/v1/users/add.rs +++ b/crates/handlers/src/admin/v1/users/add.rs @@ -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, State(homeserver): State, - Json(params): Json, + Json(params): Json, ) -> Result>, RouteError> { if repo.user().exists(¶ms.username).await? { return Err(RouteError::UserAlreadyExists); diff --git a/docs/api/spec.json b/docs/api/spec.json index bf640b01..4058fa9b 100644 --- a/docs/api/spec.json +++ b/docs/api/spec.json @@ -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"