diff --git a/templates_orig/model.mustache b/templates/model.mustache index dd7ac5a..8ecb33a 100644 --- a/templates_orig/model.mustache +++ b/templates/model.mustache @@ -11,7 +11,9 @@ use serde_with::serde_as; {{/description}} {{!-- for enum schemas --}} {{#isEnum}} -/// {{{description}}} +{{#description}} +/// {{{.}}} +{{/description}} #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum {{{classname}}} { {{#allowableValues}} @@ -110,7 +112,7 @@ impl {{{classname}}} { pub fn new({{#requiredVars}}{{{name}}}: {{#isNullable}}Option<{{/isNullable}}{{#isEnum}}{{#isArray}}{{#uniqueItems}}std::collections::HashSet<{{/uniqueItems}}{{^uniqueItems}}Vec<{{/uniqueItems}}{{/isArray}}{{{enumName}}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{#isByteArray}}Vec{{/isByteArray}}{{^isByteArray}}{{{dataType}}}{{/isByteArray}}{{/isEnum}}{{#isNullable}}>{{/isNullable}}{{^-last}}, {{/-last}}{{/requiredVars}}) -> {{{classname}}} { {{{classname}}} { {{#vars}} - {{{name}}}{{^required}}: None{{/required}}{{#required}}{{#isModel}}{{^avoidBoxedModels}}: {{^isNullable}}Box::new({{{name}}}){{/isNullable}}{{#isNullable}}if let Some(x) = {{{name}}} {Some(Box::new(x))} else {None}{{/isNullable}}{{/avoidBoxedModels}}{{/isModel}}{{/required}}, + {{{name}}}{{^required}}: None{{/required}}{{#required}}{{#isModel}}{{^avoidBoxedModels}}: {{^isNullable}}Box::new({{{name}}}){{/isNullable}}{{#isNullable}}{{{name}}}.map(Box::new){{/isNullable}}{{/avoidBoxedModels}}{{/isModel}}{{/required}}, {{/vars}} } } @@ -143,7 +145,9 @@ impl Default for {{classname}} { {{!-- for properties that are of enum type --}} {{#vars}} {{#isEnum}} -/// {{{description}}} +{{#description}} +/// {{{.}}} +{{/description}} #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum {{{enumName}}} { {{#allowableValues}} diff --git a/templates_orig/reqwest/api.mustache b/templates/reqwest/api.mustache index f9e6e9d..f4c0a8d 100644 --- a/templates_orig/reqwest/api.mustache +++ b/templates/reqwest/api.mustache @@ -11,7 +11,7 @@ use super::{Error, configuration}; {{#allParams}} {{#-first}} /// struct for passing parameters to the method [`{{operationId}}`] -#[derive(Clone, Debug)] +#[derive(Clone, Debug, Default)] pub struct {{{operationIdCamelCase}}}Params { {{/-first}} {{#description}}