-
Notifications
You must be signed in to change notification settings - Fork 303
Open
Description
I'm using Rocket,
here is my Route
#[utoipa::path(
request_body = User,
responses(
(
status = 201,
description = "User created successfully",
body = APIResponse,
example = json!({ "message": Message::Successful, "result": null })
),
(
status = 401,
description = "Insufficient access level",
body = APIResponse,
example = json!({ "message": Message::InsufficientAccessLevel, "result": Value::Null }),
),
(
status = 401,
description = "Insufficient permission",
body = APIResponse,
example = json!({ "message": Message::InsufficientPermission, "result": null })
),
(
status = 400,
description = "Invalid data",
body = APIResponse,
example = json!({ "message": Message::InvalidData, "result": "username and password is required for user creation" })
)
),
security(
("api_key" = [])
)
)]
#[post("/", data = "<user>")]
async fn create(
_access: UserPageAccess,
last_login: &State<Mutex<Option<LastLogin>>>,
admin: &User,
db: Db,
mut user: Validated<Json<User>>,
) -> APIResponse {
...
}
the scalar gives me

the swagger gives me

also Swagger UI does not provide the two different 401 responses
Metadata
Metadata
Assignees
Labels
No labels