From 2cfeb93a1567706161960bb1b1f1a3fd887156fb Mon Sep 17 00:00:00 2001 From: Troy Benson Date: Mon, 26 Feb 2024 22:30:25 +0000 Subject: [PATCH] fix: use general parse functions over custom impl --- utoipa-gen/src/path/request_body.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/utoipa-gen/src/path/request_body.rs b/utoipa-gen/src/path/request_body.rs index 4352f719..62f0b6df 100644 --- a/utoipa-gen/src/path/request_body.rs +++ b/utoipa-gen/src/path/request_body.rs @@ -117,17 +117,13 @@ impl Parse for RequestBodyAttr<'_> { request_body_attr.content_type = parse::content_type(&group)?; } "description" => { - request_body_attr.description = - Some(parse_utils::parse_next_literal_str_or_expr(&group)?) + request_body_attr.description = Some(parse::description(&group)?); } "example" => { - request_body_attr.example = Some(parse_utils::parse_next(&group, || { - AnyValue::parse_any(&group) - })?) + request_body_attr.example = Some(parse::example(&group)?); } "examples" => { - request_body_attr.examples = - Some(parse_utils::parse_punctuated_within_parenthesis(&group)?) + request_body_attr.examples = Some(parse::examples(&group)?); } _ => return Err(Error::new(ident.span(), EXPECTED_ATTRIBUTE_MESSAGE)), }