Skip to content

Commit

Permalink
Pass ParsePayload<T>::IS_REQUIRED to T instead of defaulting to `…
Browse files Browse the repository at this point in the history
…true` (#932)
  • Loading branch information
Nahuel-M authored Dec 18, 2024
1 parent 7d34722 commit 3818a19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion poem-openapi/src/payload/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl<T: Type> Payload for Json<T> {
}

impl<T: ParseFromJSON> ParsePayload for Json<T> {
const IS_REQUIRED: bool = true;
const IS_REQUIRED: bool = T::IS_REQUIRED;

async fn from_request(request: &Request, body: &mut RequestBody) -> Result<Self> {
let data = Vec::<u8>::from_request(request, body).await?;
Expand Down

0 comments on commit 3818a19

Please sign in to comment.