From 3818a19960495c296ad4bfc421b3e45651f15814 Mon Sep 17 00:00:00 2001 From: Nahuel Date: Wed, 18 Dec 2024 17:23:22 +0100 Subject: [PATCH] Pass `ParsePayload::IS_REQUIRED` to `T` instead of defaulting to `true` (#932) --- poem-openapi/src/payload/json.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poem-openapi/src/payload/json.rs b/poem-openapi/src/payload/json.rs index 62e00900eb..a66a410997 100644 --- a/poem-openapi/src/payload/json.rs +++ b/poem-openapi/src/payload/json.rs @@ -51,7 +51,7 @@ impl Payload for Json { } impl ParsePayload for Json { - const IS_REQUIRED: bool = true; + const IS_REQUIRED: bool = T::IS_REQUIRED; async fn from_request(request: &Request, body: &mut RequestBody) -> Result { let data = Vec::::from_request(request, body).await?;