You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -332,7 +341,12 @@ public class {{classname}}JsonConverter : JsonConverter<{{classname}}>
332
341
{{#composedSchemas.allOf}}
333
342
// Deserialize all the common properties of the model so they can be used in object initializers later
334
343
{{#allVars}}
344
+
{{#required}}
335
345
var {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = jsonDoc.RootElement.GetProperty("{{baseName}}").Deserialize<{{#isEnum}}{{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}>(DeserializingOptions)!;
346
+
{{/required}}
347
+
{{^required}}
348
+
var {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = jsonDoc.RootElement.TryGetProperty("{{baseName}}", out var {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}Element) ? {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}Element.Deserialize<{{#isEnum}}{{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}>(DeserializingOptions) : null;
0 commit comments