Skip to content

Commit

Permalink
fix OpenAPI response body definitions in some places (#640)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebadob authored Dec 9, 2024
1 parent 4ceaa38 commit a36639f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/api/src/auth_providers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use tracing::debug;
path = "/providers",
tag = "providers",
responses(
(status = 200, description = "OK", body = ProviderResponse),
(status = 200, description = "OK", body = [ProviderResponse]),
(status = 401, description = "Unauthorized", body = ErrorResponse),
(status = 403, description = "Forbidden", body = ErrorResponse),
),
Expand Down
2 changes: 1 addition & 1 deletion src/api/src/clients.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use tracing::debug;
path = "/clients",
tag = "clients",
responses(
(status = 200, description = "Ok", body = ClientResponse),
(status = 200, description = "Ok", body = [ClientResponse]),
(status = 400, description = "BadRequest"),
(status = 401, description = "Unauthorized"),
(status = 403, description = "Forbidden"),
Expand Down
10 changes: 5 additions & 5 deletions src/api/src/oidc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ pub async fn get_callback_html(principal: ReqPrincipal) -> Result<HttpResponse,
get,
path = "/oidc/certs",
tag = "oidc",
responses((status = 200, description = "Ok")),
responses((status = 200, description = "Ok", body = JWKSCerts)),
)]
#[get("/oidc/certs")]
pub async fn get_certs() -> Result<HttpResponse, ErrorResponse> {
Expand All @@ -369,7 +369,7 @@ pub async fn get_certs() -> Result<HttpResponse, ErrorResponse> {
Ok(HttpResponse::Ok()
.insert_header((
header::ACCESS_CONTROL_ALLOW_ORIGIN,
HeaderValue::from_str("*").unwrap(),
HeaderValue::from_static("*"),
))
.json(res))
}
Expand All @@ -381,7 +381,7 @@ pub async fn get_certs() -> Result<HttpResponse, ErrorResponse> {
get,
path = "/oidc/certs/{kid}",
tag = "oidc",
responses((status = 200, description = "Ok")),
responses((status = 200, description = "Ok", body = JWKSPublicKeyCerts)),
)]
#[get("/oidc/certs/{kid}")]
pub async fn get_cert_by_kid(kid: web::Path<String>) -> Result<HttpResponse, ErrorResponse> {
Expand Down Expand Up @@ -773,7 +773,7 @@ pub async fn post_session(
path = "/oidc/sessioninfo",
tag = "oidc",
responses(
(status = 200, description = "Ok"),
(status = 200, description = "Ok", body = SessionInfoResponse),
),
)]
#[get("/oidc/sessioninfo")]
Expand Down Expand Up @@ -833,7 +833,7 @@ pub async fn get_session_info(data: web::Data<AppState>, principal: ReqPrincipal
path = "/oidc/sessioninfo/xsrf",
tag = "oidc",
responses(
(status = 200, description = "Ok"),
(status = 200, description = "Ok", body = SessionInfoResponse),
),
)]
#[get("/oidc/sessioninfo/xsrf")]
Expand Down
6 changes: 3 additions & 3 deletions src/api/src/users.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ pub async fn post_users(
path = "/users/attr",
tag = "users",
responses(
(status = 200, description = "Ok", body = UserAttrConfigResponse),
(status = 200, description = "Ok", body = [UserAttrConfigResponse]),
(status = 403, description = "Forbidden"),
),
)]
Expand Down Expand Up @@ -457,7 +457,7 @@ pub async fn put_user_attr(
path = "/users/{id}/devices",
tag = "users",
responses(
(status = 200, description = "Ok", body = DeviceResponse),
(status = 200, description = "Ok", body = [DeviceResponse]),
(status = 401, description = "Unauthorized", body = ErrorResponse),
(status = 403, description = "Forbidden", body = ErrorResponse),
),
Expand Down Expand Up @@ -699,7 +699,7 @@ pub async fn put_user_password_reset(
path = "/users/{id}/webauthn",
tag = "users",
responses(
(status = 200, description = "Ok"),
(status = 200, description = "Ok", body = [PasskeyResponse]),
(status = 401, description = "Unauthorized", body = ErrorResponse),
(status = 403, description = "Forbidden", body = ErrorResponse),
),
Expand Down

0 comments on commit a36639f

Please sign in to comment.