File tree Expand file tree Collapse file tree 3 files changed +7
-10
lines changed
crates/handlers/src/admin Expand file tree Collapse file tree 3 files changed +7
-10
lines changed Original file line number Diff line number Diff line change 4747 Templates : FromRef < S > ,
4848 UrlBuilder : FromRef < S > ,
4949{
50+ // We *always* want to explicitly set the possible responses, beacuse the
51+ // infered ones are not necessarily correct
52+ aide:: generate:: infer_responses ( false ) ;
53+
5054 aide:: generate:: in_context ( |ctx| {
5155 ctx. schema = schemars:: gen:: SchemaGenerator :: new ( schemars:: gen:: SchemaSettings :: openapi3 ( ) ) ;
5256 } ) ;
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ pub fn doc(operation: TransformOperation) -> TransformOperation {
7474 . id ( "setUserPassword" )
7575 . summary ( "Set the password for a user" )
7676 . tag ( "user" )
77- . response_with :: < 200 , StatusCode , _ > ( |t| t. description ( "Password was set" ) )
77+ . response_with :: < 204 , ( ) , _ > ( |t| t. description ( "Password was set" ) )
7878 . response_with :: < 400 , RouteError , _ > ( |t| {
7979 let response = ErrorResponse :: from_error ( & RouteError :: PasswordTooWeak ) ;
8080 t. description ( "Password is too weak" ) . example ( response)
Original file line number Diff line number Diff line change 906906 "required" : true
907907 },
908908 "responses" : {
909- "200" : {
910- "description" : " " ,
911- "content" : {
912- "application/json" : {
913- "schema" : {
914- "$ref" : " #/components/schemas/ErrorResponse"
915- }
916- }
917- }
909+ "204" : {
910+ "description" : " Password was set"
918911 },
919912 "400" : {
920913 "description" : " Password is too weak" ,
You can’t perform that action at this time.
0 commit comments