@@ -27,7 +27,7 @@ impl UserRoutes {
2727}
2828
2929#[ derive( HttpError , Serialize ) ]
30- #[ http( axum) ]
30+ #[ http( axum, utoipa ) ]
3131pub enum CreateUserRouteError {
3232 CreateUser ( CreateUserError ) ,
3333}
@@ -47,7 +47,8 @@ impl From<CreateUserError> for CreateUserRouteError {
4747 tags = [ "User" ] ,
4848 request_body = CreateUser ,
4949 responses(
50- ( status = CREATED , description = "The user has been created." , body = User )
50+ ( status = CREATED , description = "The user has been created." , body = User ) ,
51+ CreateUserRouteError ,
5152 )
5253) ]
5354async fn create_user (
@@ -60,7 +61,7 @@ async fn create_user(
6061}
6162
6263#[ derive( HttpError , Serialize ) ]
63- #[ http( axum) ]
64+ #[ http( axum, utoipa ) ]
6465pub enum GetUserRouteError {
6566 GetUserById ( GetUserByIdError ) ,
6667}
@@ -80,7 +81,8 @@ impl From<GetUserByIdError> for GetUserRouteError {
8081 tags = [ "User" ] ,
8182 params( UserPathParams ) ,
8283 responses(
83- ( status = OK , description = "The user." , body = User )
84+ ( status = OK , description = "The user." , body = User ) ,
85+ GetUserRouteError ,
8486 )
8587) ]
8688async fn user (
@@ -93,7 +95,7 @@ async fn user(
9395}
9496
9597#[ derive( HttpError , Serialize ) ]
96- #[ http( axum) ]
98+ #[ http( axum, utoipa ) ]
9799pub enum UpdateUserRouteError {
98100 GetUserById ( GetUserByIdError ) ,
99101
@@ -122,7 +124,8 @@ impl From<UpdateUserError> for UpdateUserRouteError {
122124 params( UserPathParams ) ,
123125 request_body = UpdateUser ,
124126 responses(
125- ( status = OK , description = "The user has been updated." , body = User )
127+ ( status = OK , description = "The user has been updated." , body = User ) ,
128+ UpdateUserRouteError ,
126129 )
127130) ]
128131async fn update_user (
@@ -138,7 +141,7 @@ async fn update_user(
138141}
139142
140143#[ derive( HttpError , Serialize ) ]
141- #[ http( axum) ]
144+ #[ http( axum, utoipa ) ]
142145pub enum DeleteUserRouteError {
143146 GetUserById ( GetUserByIdError ) ,
144147
@@ -166,7 +169,8 @@ impl From<DeleteUserError> for DeleteUserRouteError {
166169 tags = [ "User" ] ,
167170 params( UserPathParams ) ,
168171 responses(
169- ( status = NO_CONTENT , description = "The user has been deleted." )
172+ ( status = NO_CONTENT , description = "The user has been deleted." ) ,
173+ DeleteUserRouteError ,
170174 )
171175) ]
172176async fn delete_user (
0 commit comments