Skip to content

Commit

Permalink
fix: use general parse functions over custom impl
Browse files Browse the repository at this point in the history
  • Loading branch information
TroyKomodo committed Feb 26, 2024
1 parent 360e324 commit 2cfeb93
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions utoipa-gen/src/path/request_body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
}
Expand Down

0 comments on commit 2cfeb93

Please sign in to comment.