File tree Expand file tree Collapse file tree
modules/openapi-generator/src/main/resources/rust Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -488,7 +488,12 @@ impl {{classname}} for {{classname}}Client {
488488 { {/returnType} }
489489 { {#returnType} }
490490 match local_var_content_type {
491+ {{^useSerdePathToError} }
491492 ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
493+ { {/useSerdePathToError} }
494+ { {#useSerdePathToError} }
495+ ContentType::Json => serde_path_to_error::deserialize(&mut serde_json::Deserializer::from_str(&local_var_content)).map_err(Error::from),
496+ { {/useSerdePathToError} }
492497 { {#vendorExtensions.x-supports-plain-text} }
493498 ContentType::Text => return Ok(local_var_content),
494499 { {/vendorExtensions.x-supports-plain-text} }
Original file line number Diff line number Diff line change @@ -528,7 +528,12 @@ pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration:
528528 { {#returnType} }
529529 let content = resp.text(){ {#supportAsync} }.await{ {/supportAsync} }?;
530530 match content_type {
531+ {{^useSerdePathToError} }
531532 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
533+ { {/useSerdePathToError} }
534+ { {#useSerdePathToError} }
535+ ContentType::Json => serde_path_to_error::deserialize(&mut serde_json::Deserializer::from_str(&content)).map_err(Error::from),
536+ { {/useSerdePathToError} }
532537 { {#vendorExtensions.x-supports-plain-text} }
533538 ContentType::Text => return Ok(content),
534539 { {/vendorExtensions.x-supports-plain-text} }
You can’t perform that action at this time.
0 commit comments