Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions crates/handlers/src/admin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ where
Templates: FromRef<S>,
UrlBuilder: FromRef<S>,
{
// We *always* want to explicitly set the possible responses, beacuse the
// infered ones are not necessarily correct
aide::generate::infer_responses(false);

aide::generate::in_context(|ctx| {
ctx.schema = schemars::gen::SchemaGenerator::new(schemars::gen::SchemaSettings::openapi3());
});
Expand Down
2 changes: 1 addition & 1 deletion crates/handlers/src/admin/v1/users/set_password.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pub fn doc(operation: TransformOperation) -> TransformOperation {
.id("setUserPassword")
.summary("Set the password for a user")
.tag("user")
.response_with::<200, StatusCode, _>(|t| t.description("Password was set"))
.response_with::<204, (), _>(|t| t.description("Password was set"))
.response_with::<400, RouteError, _>(|t| {
let response = ErrorResponse::from_error(&RouteError::PasswordTooWeak);
t.description("Password is too weak").example(response)
Expand Down
11 changes: 2 additions & 9 deletions docs/api/spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -906,15 +906,8 @@
"required": true
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
"204": {
"description": "Password was set"
},
"400": {
"description": "Password is too weak",
Expand Down
Loading