Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -185,52 +185,43 @@
{{/isMap}}
{{/isString}}
{{#isBoolean}}
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetBoolean());
{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean());
{{/isBoolean}}
{{#isNumeric}}
{{^isEnum}}
{{#isDouble}}
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetDouble());
{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble());
{{/isDouble}}
{{#isDecimal}}
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetDecimal());
{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal());
{{/isDecimal}}
{{#isFloat}}
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}(float)utf8JsonReader.GetDouble());
{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble());
{{/isFloat}}
{{#isLong}}
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int64());
{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? ({{#vendorExtensions.x-unsigned}}u{{/vendorExtensions.x-unsigned}}long?)null : utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int64());
{{/isLong}}
{{^isLong}}
{{^isFloat}}
{{^isDecimal}}
{{^isDouble}}
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int32());
{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? ({{#vendorExtensions.x-unsigned}}u{{/vendorExtensions.x-unsigned}}int?)null : utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int32());
{{/isDouble}}
{{/isDecimal}}
{{/isFloat}}
{{/isLong}}
{{/isEnum}}
{{/isNumeric}}
{{#isDate}}
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize<{{#supportsDateOnly}}DateOnly{{/supportsDateOnly}}{{^supportsDateOnly}}DateTime{{/supportsDateOnly}}{{#isNullable}}?{{/isNullable}}>(ref utf8JsonReader, jsonSerializerOptions));
{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize<{{#supportsDateOnly}}DateOnly{{/supportsDateOnly}}{{^supportsDateOnly}}DateTime{{/supportsDateOnly}}{{#isNullable}}?{{/isNullable}}>(ref utf8JsonReader, jsonSerializerOptions));
{{/isDate}}
{{#isDateTime}}
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize<DateTime{{#isNullable}}?{{/isNullable}}>(ref utf8JsonReader, jsonSerializerOptions));
{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize<DateTime{{#isNullable}}?{{/isNullable}}>(ref utf8JsonReader, jsonSerializerOptions));
{{/isDateTime}}
{{#isEnum}}
{{^isMap}}
{{#isNumeric}}
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}({{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}})utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int32());
{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? ({{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}?)null : ({{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}})utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int32());
{{/isNumeric}}
{{^isNumeric}}
string{{nrt?}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}RawValue = utf8JsonReader.GetString();
Expand All @@ -246,8 +237,7 @@
{{/isMap}}
{{/isEnum}}
{{#isUuid}}
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetGuid());
{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid());
{{/isUuid}}
{{^isUuid}}
{{^isEnum}}
Expand All @@ -256,8 +246,7 @@
{{^isNumeric}}
{{^isDate}}
{{^isDateTime}}
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize<{{{datatypeWithEnum}}}>(ref utf8JsonReader, jsonSerializerOptions){{^isNullable}}{{nrt!}}{{/isNullable}});
{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize<{{{datatypeWithEnum}}}>(ref utf8JsonReader, jsonSerializerOptions){{^isNullable}}{{nrt!}}{{/isNullable}});
{{/isDateTime}}
{{/isDate}}
{{/isNumeric}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ public override Adult Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert
switch (localVarJsonPropertyName)
{
case "children":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
children = new Option<List<Child>>(JsonSerializer.Deserialize<List<Child>>(ref utf8JsonReader, jsonSerializerOptions));
children = new Option<List<Child>>(JsonSerializer.Deserialize<List<Child>>(ref utf8JsonReader, jsonSerializerOptions));
break;
case "firstName":
firstName = new Option<string>(utf8JsonReader.GetString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ public override Child Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert
switch (localVarJsonPropertyName)
{
case "age":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
age = new Option<int?>(utf8JsonReader.GetInt32());
age = new Option<int?>(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32());
break;
case "firstName":
firstName = new Option<string>(utf8JsonReader.GetString());
Expand All @@ -145,8 +144,7 @@ public override Child Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert
type = new Option<string>(utf8JsonReader.GetString());
break;
case "boosterSeat":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
boosterSeat = new Option<bool?>(utf8JsonReader.GetBoolean());
boosterSeat = new Option<bool?>(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean());
break;
default:
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ public override Banana Read(ref Utf8JsonReader utf8JsonReader, Type typeToConver
switch (localVarJsonPropertyName)
{
case "count":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
count = new Option<decimal?>(utf8JsonReader.GetDecimal());
count = new Option<decimal?>(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal());
break;
default:
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ public override Banana Read(ref Utf8JsonReader utf8JsonReader, Type typeToConver
switch (localVarJsonPropertyName)
{
case "count":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
count = new Option<decimal?>(utf8JsonReader.GetDecimal());
count = new Option<decimal?>(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal());
break;
default:
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ public override Activity Read(ref Utf8JsonReader utf8JsonReader, Type typeToConv
switch (localVarJsonPropertyName)
{
case "activity_outputs":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
activityOutputs = new Option<Dictionary<string, List<ActivityOutputElementRepresentation>>>(JsonSerializer.Deserialize<Dictionary<string, List<ActivityOutputElementRepresentation>>>(ref utf8JsonReader, jsonSerializerOptions));
activityOutputs = new Option<Dictionary<string, List<ActivityOutputElementRepresentation>>>(JsonSerializer.Deserialize<Dictionary<string, List<ActivityOutputElementRepresentation>>>(ref utf8JsonReader, jsonSerializerOptions));
break;
default:
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ public override ActivityOutputElementRepresentation Read(ref Utf8JsonReader utf8
prop1 = new Option<string>(utf8JsonReader.GetString());
break;
case "prop2":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
prop2 = new Option<Object>(JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions));
prop2 = new Option<Object>(JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions));
break;
default:
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,36 +246,28 @@ public override AdditionalPropertiesClass Read(ref Utf8JsonReader utf8JsonReader
switch (localVarJsonPropertyName)
{
case "anytype_1":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
anytype1 = new Option<Object>(JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions));
anytype1 = new Option<Object>(JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions));
break;
case "empty_map":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
emptyMap = new Option<Object>(JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions));
emptyMap = new Option<Object>(JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions));
break;
case "map_of_map_property":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapOfMapProperty = new Option<Dictionary<string, Dictionary<string, string>>>(JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(ref utf8JsonReader, jsonSerializerOptions));
mapOfMapProperty = new Option<Dictionary<string, Dictionary<string, string>>>(JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(ref utf8JsonReader, jsonSerializerOptions));
break;
case "map_property":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapProperty = new Option<Dictionary<string, string>>(JsonSerializer.Deserialize<Dictionary<string, string>>(ref utf8JsonReader, jsonSerializerOptions));
mapProperty = new Option<Dictionary<string, string>>(JsonSerializer.Deserialize<Dictionary<string, string>>(ref utf8JsonReader, jsonSerializerOptions));
break;
case "map_with_undeclared_properties_anytype_1":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapWithUndeclaredPropertiesAnytype1 = new Option<Object>(JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions));
mapWithUndeclaredPropertiesAnytype1 = new Option<Object>(JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions));
break;
case "map_with_undeclared_properties_anytype_2":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapWithUndeclaredPropertiesAnytype2 = new Option<Object>(JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions));
mapWithUndeclaredPropertiesAnytype2 = new Option<Object>(JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions));
break;
case "map_with_undeclared_properties_anytype_3":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapWithUndeclaredPropertiesAnytype3 = new Option<Dictionary<string, Object>>(JsonSerializer.Deserialize<Dictionary<string, Object>>(ref utf8JsonReader, jsonSerializerOptions));
mapWithUndeclaredPropertiesAnytype3 = new Option<Dictionary<string, Object>>(JsonSerializer.Deserialize<Dictionary<string, Object>>(ref utf8JsonReader, jsonSerializerOptions));
break;
case "map_with_undeclared_properties_string":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapWithUndeclaredPropertiesString = new Option<Dictionary<string, string>>(JsonSerializer.Deserialize<Dictionary<string, string>>(ref utf8JsonReader, jsonSerializerOptions));
mapWithUndeclaredPropertiesString = new Option<Dictionary<string, string>>(JsonSerializer.Deserialize<Dictionary<string, string>>(ref utf8JsonReader, jsonSerializerOptions));
break;
default:
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@ public override ApiResponse Read(ref Utf8JsonReader utf8JsonReader, Type typeToC
switch (localVarJsonPropertyName)
{
case "code":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
code = new Option<int?>(utf8JsonReader.GetInt32());
code = new Option<int?>(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32());
break;
case "message":
message = new Option<string>(utf8JsonReader.GetString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ public override AppleReq Read(ref Utf8JsonReader utf8JsonReader, Type typeToConv
cultivar = new Option<string>(utf8JsonReader.GetString());
break;
case "mealy":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mealy = new Option<bool?>(utf8JsonReader.GetBoolean());
mealy = new Option<bool?>(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean());
break;
default:
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ public override ArrayOfArrayOfNumberOnly Read(ref Utf8JsonReader utf8JsonReader,
switch (localVarJsonPropertyName)
{
case "ArrayArrayNumber":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
arrayArrayNumber = new Option<List<List<decimal>>>(JsonSerializer.Deserialize<List<List<decimal>>>(ref utf8JsonReader, jsonSerializerOptions));
arrayArrayNumber = new Option<List<List<decimal>>>(JsonSerializer.Deserialize<List<List<decimal>>>(ref utf8JsonReader, jsonSerializerOptions));
break;
default:
break;
Expand Down
Loading
Loading