better deserialization (#14945)

This commit is contained in:
devhl-labs
2023-03-13 23:40:40 -04:00
committed by GitHub
parent 8b1e80d360
commit dc1386c134
112 changed files with 703 additions and 315 deletions
@@ -560,6 +560,11 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
property.datatypeWithEnum = property.datatypeWithEnum.replace("Dictionary>", property.items.datatypeWithEnum + ">");
property.dataType = property.datatypeWithEnum;
}
// HOTFIX: https://github.com/OpenAPITools/openapi-generator/issues/14944
if (property.datatypeWithEnum.equals("decimal")) {
property.isDecimal = true;
}
}
/** Mitigates https://github.com/OpenAPITools/openapi-generator/issues/13709 */
@@ -84,33 +84,44 @@
{{/isMap}}
{{/isString}}
{{#isBoolean}}
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = utf8JsonReader.GetBoolean();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = utf8JsonReader.GetBoolean();
{{/isBoolean}}
{{#isNumeric}}
{{^isEnum}}
{{#isDouble}}
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = utf8JsonReader.GetDouble();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetDouble(out {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}});
{{/isDouble}}
{{#isDecimal}}
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = utf8JsonReader.GetDecimal();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetDecimal(out {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}});
{{/isDecimal}}
{{#isFloat}}
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = (float)utf8JsonReader.GetDouble();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{
utf8JsonReader.TryGetDouble(out double {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}Result);
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = (float){{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}Result;
}
{{/isFloat}}
{{#isLong}}
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int64();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGet{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int64(out {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}});
{{/isLong}}
{{^isLong}}
{{^isFloat}}
{{^isDecimal}}
{{^isDouble}}
{{#isNullable}}
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int32();
{{/isNullable}}
{{^isNullable}}
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int32();
{{/isNullable}}
{{#isNullable}}
{
utf8JsonReader.TryGet{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int32(out {{#vendorExtensions.x-unsigned}}u{{/vendorExtensions.x-unsigned}}int {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}Result);
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}Result;
}
{{/isNullable}}
{{^isNullable}}
utf8JsonReader.TryGet{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int32(out {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}});
{{/isNullable}}
{{/isDouble}}
{{/isDecimal}}
{{/isFloat}}
@@ -118,15 +129,21 @@
{{/isEnum}}
{{/isNumeric}}
{{#isDate}}
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = JsonSerializer.Deserialize<DateTime{{#isNullable}}?{{/isNullable}}>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = JsonSerializer.Deserialize<DateTime{{#isNullable}}?{{/isNullable}}>(ref utf8JsonReader, jsonSerializerOptions);
{{/isDate}}
{{#isDateTime}}
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = JsonSerializer.Deserialize<DateTime{{#isNullable}}?{{/isNullable}}>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = JsonSerializer.Deserialize<DateTime{{#isNullable}}?{{/isNullable}}>(ref utf8JsonReader, jsonSerializerOptions);
{{/isDateTime}}
{{#isEnum}}
{{^isMap}}
{{#isNumeric}}
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = ({{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}) utf8JsonReader.Get{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{
utf8JsonReader.TryGet{{#vendorExtensions.x-unsigned}}U{{/vendorExtensions.x-unsigned}}Int32(out {{#vendorExtensions.x-unsigned}}u{{/vendorExtensions.x-unsigned}}int {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}Result);
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = ({{#isInnerEnum}}{{classname}}.{{/isInnerEnum}}{{{datatypeWithEnum}}}){{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}Result;
}
{{/isNumeric}}
{{^isNumeric}}
string {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}RawValue = utf8JsonReader.GetString();
@@ -140,7 +157,16 @@
{{/isMap}}
{{/isEnum}}
{{#isUuid}}
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = utf8JsonReader.GetGuid();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{{#isNullable}}
{
utf8JsonReader.TryGetGuid(out Guid {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}Result);
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}Result;
}
{{/isNullable}}
{{^isNullable}}
utf8JsonReader.TryGetGuid(out {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}});
{{/isNullable}}
{{/isUuid}}
{{^isUuid}}
{{^isEnum}}
@@ -149,7 +175,8 @@
{{^isNumeric}}
{{^isDate}}
{{^isDateTime}}
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = JsonSerializer.Deserialize<{{{datatypeWithEnum}}}>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = JsonSerializer.Deserialize<{{{datatypeWithEnum}}}>(ref utf8JsonReader, jsonSerializerOptions);
{{/isDateTime}}
{{/isDate}}
{{/isNumeric}}
@@ -125,7 +125,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "activity_outputs":
activityOutputs = JsonSerializer.Deserialize<Dictionary<string, List<ActivityOutputElementRepresentation>>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
activityOutputs = JsonSerializer.Deserialize<Dictionary<string, List<ActivityOutputElementRepresentation>>>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -141,7 +141,8 @@ namespace Org.OpenAPITools.Model
prop1 = utf8JsonReader.GetString();
break;
case "prop2":
prop2 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
prop2 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -214,28 +214,36 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "empty_map":
emptyMap = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
emptyMap = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "map_of_map_property":
mapOfMapProperty = JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapOfMapProperty = JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "map_property":
mapProperty = JsonSerializer.Deserialize<Dictionary<string, string>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapProperty = JsonSerializer.Deserialize<Dictionary<string, string>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "map_with_undeclared_properties_anytype_1":
mapWithUndeclaredPropertiesAnytype1 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapWithUndeclaredPropertiesAnytype1 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "map_with_undeclared_properties_anytype_2":
mapWithUndeclaredPropertiesAnytype2 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapWithUndeclaredPropertiesAnytype2 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "map_with_undeclared_properties_anytype_3":
mapWithUndeclaredPropertiesAnytype3 = JsonSerializer.Deserialize<Dictionary<string, Object>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapWithUndeclaredPropertiesAnytype3 = JsonSerializer.Deserialize<Dictionary<string, Object>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "map_with_undeclared_properties_string":
mapWithUndeclaredPropertiesString = JsonSerializer.Deserialize<Dictionary<string, string>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapWithUndeclaredPropertiesString = JsonSerializer.Deserialize<Dictionary<string, string>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "anytype_1":
anytype1 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
anytype1 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -151,7 +151,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "code":
code = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt32(out code);
break;
case "message":
message = utf8JsonReader.GetString();
@@ -134,7 +134,8 @@ namespace Org.OpenAPITools.Model
cultivar = utf8JsonReader.GetString();
break;
case "mealy":
mealy = utf8JsonReader.GetBoolean();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mealy = utf8JsonReader.GetBoolean();
break;
default:
break;
@@ -125,7 +125,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "ArrayArrayNumber":
arrayArrayNumber = JsonSerializer.Deserialize<List<List<decimal>>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
arrayArrayNumber = JsonSerializer.Deserialize<List<List<decimal>>>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -125,7 +125,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "ArrayNumber":
arrayNumber = JsonSerializer.Deserialize<List<decimal>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
arrayNumber = JsonSerializer.Deserialize<List<decimal>>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -151,13 +151,16 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "array_array_of_integer":
arrayArrayOfInteger = JsonSerializer.Deserialize<List<List<long>>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
arrayArrayOfInteger = JsonSerializer.Deserialize<List<List<long>>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "array_array_of_model":
arrayArrayOfModel = JsonSerializer.Deserialize<List<List<ReadOnlyFirst>>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
arrayArrayOfModel = JsonSerializer.Deserialize<List<List<ReadOnlyFirst>>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "array_of_string":
arrayOfString = JsonSerializer.Deserialize<List<string>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
arrayOfString = JsonSerializer.Deserialize<List<string>>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -125,7 +125,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "lengthCm":
lengthCm = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetDecimal(out lengthCm);
break;
default:
break;
@@ -131,10 +131,12 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "lengthCm":
lengthCm = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetDecimal(out lengthCm);
break;
case "sweet":
sweet = utf8JsonReader.GetBoolean();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
sweet = utf8JsonReader.GetBoolean();
break;
default:
break;
@@ -125,7 +125,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "declawed":
declawed = utf8JsonReader.GetBoolean();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
declawed = utf8JsonReader.GetBoolean();
break;
default:
break;
@@ -138,7 +138,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "id":
id = utf8JsonReader.GetInt64();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt64(out id);
break;
case "name":
name = utf8JsonReader.GetString();
@@ -131,7 +131,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "dateOnlyProperty":
dateOnlyProperty = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
dateOnlyProperty = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -155,16 +155,20 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "mainShape":
mainShape = JsonSerializer.Deserialize<Shape>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mainShape = JsonSerializer.Deserialize<Shape>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "shapeOrNull":
shapeOrNull = JsonSerializer.Deserialize<ShapeOrNull>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
shapeOrNull = JsonSerializer.Deserialize<ShapeOrNull>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "shapes":
shapes = JsonSerializer.Deserialize<List<Shape>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
shapes = JsonSerializer.Deserialize<List<Shape>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "nullableShape":
nullableShape = JsonSerializer.Deserialize<NullableShape>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
nullableShape = JsonSerializer.Deserialize<NullableShape>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -238,7 +238,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "array_enum":
arrayEnum = JsonSerializer.Deserialize<List<EnumArrays.ArrayEnumEnum>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
arrayEnum = JsonSerializer.Deserialize<List<EnumArrays.ArrayEnumEnum>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "just_symbol":
string justSymbolRawValue = utf8JsonReader.GetString();
@@ -486,13 +486,25 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "enum_integer":
enumInteger = (EnumTest.EnumIntegerEnum) utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{
utf8JsonReader.TryGetInt32(out int enumIntegerResult);
enumInteger = (EnumTest.EnumIntegerEnum)enumIntegerResult;
}
break;
case "enum_integer_only":
enumIntegerOnly = (EnumTest.EnumIntegerOnlyEnum) utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{
utf8JsonReader.TryGetInt32(out int enumIntegerOnlyResult);
enumIntegerOnly = (EnumTest.EnumIntegerOnlyEnum)enumIntegerOnlyResult;
}
break;
case "enum_number":
enumNumber = (EnumTest.EnumNumberEnum) utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{
utf8JsonReader.TryGetInt32(out int enumNumberResult);
enumNumber = (EnumTest.EnumNumberEnum)enumNumberResult;
}
break;
case "enum_string":
string enumStringRawValue = utf8JsonReader.GetString();
@@ -138,10 +138,12 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "file":
file = JsonSerializer.Deserialize<File>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
file = JsonSerializer.Deserialize<File>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "files":
files = JsonSerializer.Deserialize<List<File>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
files = JsonSerializer.Deserialize<List<File>>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -125,7 +125,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "string":
stringProperty = JsonSerializer.Deserialize<Foo>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
stringProperty = JsonSerializer.Deserialize<Foo>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -466,37 +466,51 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "binary":
binary = JsonSerializer.Deserialize<System.IO.Stream>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
binary = JsonSerializer.Deserialize<System.IO.Stream>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "byte":
byteProperty = JsonSerializer.Deserialize<byte[]>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
byteProperty = JsonSerializer.Deserialize<byte[]>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "date":
date = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
date = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "dateTime":
dateTime = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
dateTime = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "decimal":
decimalProperty = JsonSerializer.Deserialize<decimal>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
decimalProperty = JsonSerializer.Deserialize<decimal>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "double":
doubleProperty = utf8JsonReader.GetDouble();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetDouble(out doubleProperty);
break;
case "float":
floatProperty = (float)utf8JsonReader.GetDouble();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{
utf8JsonReader.TryGetDouble(out double floatPropertyResult);
floatProperty = (float)floatPropertyResult;
}
break;
case "int32":
int32 = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt32(out int32);
break;
case "int64":
int64 = utf8JsonReader.GetInt64();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt64(out int64);
break;
case "integer":
integer = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt32(out integer);
break;
case "number":
number = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetDecimal(out number);
break;
case "password":
password = utf8JsonReader.GetString();
@@ -511,13 +525,16 @@ namespace Org.OpenAPITools.Model
stringProperty = utf8JsonReader.GetString();
break;
case "unsigned_integer":
unsignedInteger = utf8JsonReader.GetUInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetUInt32(out unsignedInteger);
break;
case "unsigned_long":
unsignedLong = utf8JsonReader.GetUInt64();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetUInt64(out unsignedLong);
break;
case "uuid":
uuid = utf8JsonReader.GetGuid();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetGuid(out uuid);
break;
default:
break;
@@ -214,16 +214,20 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "direct_map":
directMap = JsonSerializer.Deserialize<Dictionary<string, bool>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
directMap = JsonSerializer.Deserialize<Dictionary<string, bool>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "indirect_map":
indirectMap = JsonSerializer.Deserialize<Dictionary<string, bool>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
indirectMap = JsonSerializer.Deserialize<Dictionary<string, bool>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "map_map_of_string":
mapMapOfString = JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapMapOfString = JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "map_of_enum_string":
mapOfEnumString = JsonSerializer.Deserialize<Dictionary<string, MapTest.InnerEnum>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapOfEnumString = JsonSerializer.Deserialize<Dictionary<string, MapTest.InnerEnum>>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -176,16 +176,20 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "dateTime":
dateTime = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
dateTime = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "map":
map = JsonSerializer.Deserialize<Dictionary<string, Animal>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
map = JsonSerializer.Deserialize<Dictionary<string, Animal>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "uuid":
uuid = utf8JsonReader.GetGuid();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetGuid(out uuid);
break;
case "uuid_with_pattern":
uuidWithPattern = utf8JsonReader.GetGuid();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetGuid(out uuidWithPattern);
break;
default:
break;
@@ -141,7 +141,8 @@ namespace Org.OpenAPITools.Model
classProperty = utf8JsonReader.GetString();
break;
case "name":
name = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt32(out name);
break;
default:
break;
@@ -201,16 +201,19 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "name":
nameProperty = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt32(out nameProperty);
break;
case "property":
property = utf8JsonReader.GetString();
break;
case "snake_case":
snakeCase = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt32(out snakeCase);
break;
case "123Number":
_123number = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt32(out _123number);
break;
default:
break;
@@ -242,39 +242,54 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "array_items_nullable":
arrayItemsNullable = JsonSerializer.Deserialize<List<Object>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
arrayItemsNullable = JsonSerializer.Deserialize<List<Object>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "object_items_nullable":
objectItemsNullable = JsonSerializer.Deserialize<Dictionary<string, Object>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
objectItemsNullable = JsonSerializer.Deserialize<Dictionary<string, Object>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "array_and_items_nullable_prop":
arrayAndItemsNullableProp = JsonSerializer.Deserialize<List<Object>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
arrayAndItemsNullableProp = JsonSerializer.Deserialize<List<Object>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "array_nullable_prop":
arrayNullableProp = JsonSerializer.Deserialize<List<Object>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
arrayNullableProp = JsonSerializer.Deserialize<List<Object>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "boolean_prop":
booleanProp = utf8JsonReader.GetBoolean();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
booleanProp = utf8JsonReader.GetBoolean();
break;
case "date_prop":
dateProp = JsonSerializer.Deserialize<DateTime?>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
dateProp = JsonSerializer.Deserialize<DateTime?>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "datetime_prop":
datetimeProp = JsonSerializer.Deserialize<DateTime?>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
datetimeProp = JsonSerializer.Deserialize<DateTime?>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "integer_prop":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
integerProp = utf8JsonReader.GetInt32();
{
utf8JsonReader.TryGetInt32(out int integerPropResult);
integerProp = integerPropResult;
}
break;
case "number_prop":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
numberProp = utf8JsonReader.GetInt32();
{
utf8JsonReader.TryGetInt32(out int numberPropResult);
numberProp = numberPropResult;
}
break;
case "object_and_items_nullable_prop":
objectAndItemsNullableProp = JsonSerializer.Deserialize<Dictionary<string, Object>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
objectAndItemsNullableProp = JsonSerializer.Deserialize<Dictionary<string, Object>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "object_nullable_prop":
objectNullableProp = JsonSerializer.Deserialize<Dictionary<string, Object>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
objectNullableProp = JsonSerializer.Deserialize<Dictionary<string, Object>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "string_prop":
stringProp = utf8JsonReader.GetString();
@@ -117,7 +117,11 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "uuid":
uuid = utf8JsonReader.GetGuid();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{
utf8JsonReader.TryGetGuid(out Guid uuidResult);
uuid = uuidResult;
}
break;
default:
break;
@@ -125,7 +125,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "JustNumber":
justNumber = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetDecimal(out justNumber);
break;
default:
break;
@@ -167,13 +167,16 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "bars":
bars = JsonSerializer.Deserialize<List<string>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
bars = JsonSerializer.Deserialize<List<string>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "deprecatedRef":
deprecatedRef = JsonSerializer.Deserialize<DeprecatedObject>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
deprecatedRef = JsonSerializer.Deserialize<DeprecatedObject>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "id":
id = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetDecimal(out id);
break;
case "uuid":
uuid = utf8JsonReader.GetString();
@@ -259,23 +259,28 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "id":
id = utf8JsonReader.GetInt64();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt64(out id);
break;
case "petId":
petId = utf8JsonReader.GetInt64();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt64(out petId);
break;
case "quantity":
quantity = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt32(out quantity);
break;
case "shipDate":
shipDate = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
shipDate = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "status":
string statusRawValue = utf8JsonReader.GetString();
status = Order.StatusEnumFromString(statusRawValue);
break;
case "complete":
complete = utf8JsonReader.GetBoolean();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
complete = utf8JsonReader.GetBoolean();
break;
default:
break;
@@ -151,10 +151,12 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "my_boolean":
myBoolean = utf8JsonReader.GetBoolean();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
myBoolean = utf8JsonReader.GetBoolean();
break;
case "my_number":
myNumber = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetDecimal(out myNumber);
break;
case "my_string":
myString = utf8JsonReader.GetString();
@@ -254,23 +254,27 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "category":
category = JsonSerializer.Deserialize<Category>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
category = JsonSerializer.Deserialize<Category>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "id":
id = utf8JsonReader.GetInt64();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt64(out id);
break;
case "name":
name = utf8JsonReader.GetString();
break;
case "photoUrls":
photoUrls = JsonSerializer.Deserialize<List<string>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
photoUrls = JsonSerializer.Deserialize<List<string>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "status":
string statusRawValue = utf8JsonReader.GetString();
status = Pet.StatusEnumFromString(statusRawValue);
break;
case "tags":
tags = JsonSerializer.Deserialize<List<Tag>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
tags = JsonSerializer.Deserialize<List<Tag>>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -125,7 +125,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "return":
returnProperty = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt32(out returnProperty);
break;
default:
break;
@@ -141,7 +141,8 @@ namespace Org.OpenAPITools.Model
specialModelNameProperty = utf8JsonReader.GetString();
break;
case "$special[property.name]":
specialPropertyName = utf8JsonReader.GetInt64();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt64(out specialPropertyName);
break;
default:
break;
@@ -138,7 +138,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "id":
id = utf8JsonReader.GetInt64();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt64(out id);
break;
case "name":
name = utf8JsonReader.GetString();
@@ -270,13 +270,15 @@ namespace Org.OpenAPITools.Model
firstName = utf8JsonReader.GetString();
break;
case "id":
id = utf8JsonReader.GetInt64();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt64(out id);
break;
case "lastName":
lastName = utf8JsonReader.GetString();
break;
case "objectWithNoDeclaredProps":
objectWithNoDeclaredProps = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
objectWithNoDeclaredProps = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "password":
password = utf8JsonReader.GetString();
@@ -285,19 +287,23 @@ namespace Org.OpenAPITools.Model
phone = utf8JsonReader.GetString();
break;
case "userStatus":
userStatus = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt32(out userStatus);
break;
case "username":
username = utf8JsonReader.GetString();
break;
case "anyTypeProp":
anyTypeProp = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
anyTypeProp = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "anyTypePropNullable":
anyTypePropNullable = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
anyTypePropNullable = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "objectWithNoDeclaredPropsNullable":
objectWithNoDeclaredPropsNullable = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
objectWithNoDeclaredPropsNullable = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -154,10 +154,12 @@ namespace Org.OpenAPITools.Model
className = utf8JsonReader.GetString();
break;
case "hasBaleen":
hasBaleen = utf8JsonReader.GetBoolean();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
hasBaleen = utf8JsonReader.GetBoolean();
break;
case "hasTeeth":
hasTeeth = utf8JsonReader.GetBoolean();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
hasTeeth = utf8JsonReader.GetBoolean();
break;
default:
break;
@@ -123,7 +123,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "activity_outputs":
activityOutputs = JsonSerializer.Deserialize<Dictionary<string, List<ActivityOutputElementRepresentation>>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
activityOutputs = JsonSerializer.Deserialize<Dictionary<string, List<ActivityOutputElementRepresentation>>>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -139,7 +139,8 @@ namespace Org.OpenAPITools.Model
prop1 = utf8JsonReader.GetString();
break;
case "prop2":
prop2 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
prop2 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -212,28 +212,36 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "empty_map":
emptyMap = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
emptyMap = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "map_of_map_property":
mapOfMapProperty = JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapOfMapProperty = JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "map_property":
mapProperty = JsonSerializer.Deserialize<Dictionary<string, string>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapProperty = JsonSerializer.Deserialize<Dictionary<string, string>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "map_with_undeclared_properties_anytype_1":
mapWithUndeclaredPropertiesAnytype1 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapWithUndeclaredPropertiesAnytype1 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "map_with_undeclared_properties_anytype_2":
mapWithUndeclaredPropertiesAnytype2 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapWithUndeclaredPropertiesAnytype2 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "map_with_undeclared_properties_anytype_3":
mapWithUndeclaredPropertiesAnytype3 = JsonSerializer.Deserialize<Dictionary<string, Object>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapWithUndeclaredPropertiesAnytype3 = JsonSerializer.Deserialize<Dictionary<string, Object>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "map_with_undeclared_properties_string":
mapWithUndeclaredPropertiesString = JsonSerializer.Deserialize<Dictionary<string, string>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapWithUndeclaredPropertiesString = JsonSerializer.Deserialize<Dictionary<string, string>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "anytype_1":
anytype1 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
anytype1 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -149,7 +149,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "code":
code = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt32(out code);
break;
case "message":
message = utf8JsonReader.GetString();
@@ -132,7 +132,8 @@ namespace Org.OpenAPITools.Model
cultivar = utf8JsonReader.GetString();
break;
case "mealy":
mealy = utf8JsonReader.GetBoolean();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mealy = utf8JsonReader.GetBoolean();
break;
default:
break;
@@ -123,7 +123,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "ArrayArrayNumber":
arrayArrayNumber = JsonSerializer.Deserialize<List<List<decimal>>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
arrayArrayNumber = JsonSerializer.Deserialize<List<List<decimal>>>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -123,7 +123,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "ArrayNumber":
arrayNumber = JsonSerializer.Deserialize<List<decimal>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
arrayNumber = JsonSerializer.Deserialize<List<decimal>>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -149,13 +149,16 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "array_array_of_integer":
arrayArrayOfInteger = JsonSerializer.Deserialize<List<List<long>>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
arrayArrayOfInteger = JsonSerializer.Deserialize<List<List<long>>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "array_array_of_model":
arrayArrayOfModel = JsonSerializer.Deserialize<List<List<ReadOnlyFirst>>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
arrayArrayOfModel = JsonSerializer.Deserialize<List<List<ReadOnlyFirst>>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "array_of_string":
arrayOfString = JsonSerializer.Deserialize<List<string>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
arrayOfString = JsonSerializer.Deserialize<List<string>>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -123,7 +123,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "lengthCm":
lengthCm = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetDecimal(out lengthCm);
break;
default:
break;
@@ -129,10 +129,12 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "lengthCm":
lengthCm = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetDecimal(out lengthCm);
break;
case "sweet":
sweet = utf8JsonReader.GetBoolean();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
sweet = utf8JsonReader.GetBoolean();
break;
default:
break;
@@ -123,7 +123,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "declawed":
declawed = utf8JsonReader.GetBoolean();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
declawed = utf8JsonReader.GetBoolean();
break;
default:
break;
@@ -136,7 +136,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "id":
id = utf8JsonReader.GetInt64();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt64(out id);
break;
case "name":
name = utf8JsonReader.GetString();
@@ -129,7 +129,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "dateOnlyProperty":
dateOnlyProperty = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
dateOnlyProperty = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -153,16 +153,20 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "mainShape":
mainShape = JsonSerializer.Deserialize<Shape>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mainShape = JsonSerializer.Deserialize<Shape>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "shapeOrNull":
shapeOrNull = JsonSerializer.Deserialize<ShapeOrNull>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
shapeOrNull = JsonSerializer.Deserialize<ShapeOrNull>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "shapes":
shapes = JsonSerializer.Deserialize<List<Shape>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
shapes = JsonSerializer.Deserialize<List<Shape>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "nullableShape":
nullableShape = JsonSerializer.Deserialize<NullableShape>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
nullableShape = JsonSerializer.Deserialize<NullableShape>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -236,7 +236,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "array_enum":
arrayEnum = JsonSerializer.Deserialize<List<EnumArrays.ArrayEnumEnum>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
arrayEnum = JsonSerializer.Deserialize<List<EnumArrays.ArrayEnumEnum>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "just_symbol":
string justSymbolRawValue = utf8JsonReader.GetString();
@@ -484,13 +484,25 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "enum_integer":
enumInteger = (EnumTest.EnumIntegerEnum) utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{
utf8JsonReader.TryGetInt32(out int enumIntegerResult);
enumInteger = (EnumTest.EnumIntegerEnum)enumIntegerResult;
}
break;
case "enum_integer_only":
enumIntegerOnly = (EnumTest.EnumIntegerOnlyEnum) utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{
utf8JsonReader.TryGetInt32(out int enumIntegerOnlyResult);
enumIntegerOnly = (EnumTest.EnumIntegerOnlyEnum)enumIntegerOnlyResult;
}
break;
case "enum_number":
enumNumber = (EnumTest.EnumNumberEnum) utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{
utf8JsonReader.TryGetInt32(out int enumNumberResult);
enumNumber = (EnumTest.EnumNumberEnum)enumNumberResult;
}
break;
case "enum_string":
string enumStringRawValue = utf8JsonReader.GetString();
@@ -136,10 +136,12 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "file":
file = JsonSerializer.Deserialize<File>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
file = JsonSerializer.Deserialize<File>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "files":
files = JsonSerializer.Deserialize<List<File>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
files = JsonSerializer.Deserialize<List<File>>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -123,7 +123,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "string":
stringProperty = JsonSerializer.Deserialize<Foo>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
stringProperty = JsonSerializer.Deserialize<Foo>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -464,37 +464,51 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "binary":
binary = JsonSerializer.Deserialize<System.IO.Stream>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
binary = JsonSerializer.Deserialize<System.IO.Stream>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "byte":
byteProperty = JsonSerializer.Deserialize<byte[]>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
byteProperty = JsonSerializer.Deserialize<byte[]>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "date":
date = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
date = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "dateTime":
dateTime = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
dateTime = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "decimal":
decimalProperty = JsonSerializer.Deserialize<decimal>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
decimalProperty = JsonSerializer.Deserialize<decimal>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "double":
doubleProperty = utf8JsonReader.GetDouble();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetDouble(out doubleProperty);
break;
case "float":
floatProperty = (float)utf8JsonReader.GetDouble();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{
utf8JsonReader.TryGetDouble(out double floatPropertyResult);
floatProperty = (float)floatPropertyResult;
}
break;
case "int32":
int32 = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt32(out int32);
break;
case "int64":
int64 = utf8JsonReader.GetInt64();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt64(out int64);
break;
case "integer":
integer = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt32(out integer);
break;
case "number":
number = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetDecimal(out number);
break;
case "password":
password = utf8JsonReader.GetString();
@@ -509,13 +523,16 @@ namespace Org.OpenAPITools.Model
stringProperty = utf8JsonReader.GetString();
break;
case "unsigned_integer":
unsignedInteger = utf8JsonReader.GetUInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetUInt32(out unsignedInteger);
break;
case "unsigned_long":
unsignedLong = utf8JsonReader.GetUInt64();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetUInt64(out unsignedLong);
break;
case "uuid":
uuid = utf8JsonReader.GetGuid();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetGuid(out uuid);
break;
default:
break;
@@ -212,16 +212,20 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "direct_map":
directMap = JsonSerializer.Deserialize<Dictionary<string, bool>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
directMap = JsonSerializer.Deserialize<Dictionary<string, bool>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "indirect_map":
indirectMap = JsonSerializer.Deserialize<Dictionary<string, bool>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
indirectMap = JsonSerializer.Deserialize<Dictionary<string, bool>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "map_map_of_string":
mapMapOfString = JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapMapOfString = JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "map_of_enum_string":
mapOfEnumString = JsonSerializer.Deserialize<Dictionary<string, MapTest.InnerEnum>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapOfEnumString = JsonSerializer.Deserialize<Dictionary<string, MapTest.InnerEnum>>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -174,16 +174,20 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "dateTime":
dateTime = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
dateTime = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "map":
map = JsonSerializer.Deserialize<Dictionary<string, Animal>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
map = JsonSerializer.Deserialize<Dictionary<string, Animal>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "uuid":
uuid = utf8JsonReader.GetGuid();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetGuid(out uuid);
break;
case "uuid_with_pattern":
uuidWithPattern = utf8JsonReader.GetGuid();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetGuid(out uuidWithPattern);
break;
default:
break;
@@ -139,7 +139,8 @@ namespace Org.OpenAPITools.Model
classProperty = utf8JsonReader.GetString();
break;
case "name":
name = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt32(out name);
break;
default:
break;
@@ -199,16 +199,19 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "name":
nameProperty = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt32(out nameProperty);
break;
case "property":
property = utf8JsonReader.GetString();
break;
case "snake_case":
snakeCase = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt32(out snakeCase);
break;
case "123Number":
_123number = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt32(out _123number);
break;
default:
break;
@@ -240,39 +240,54 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "array_items_nullable":
arrayItemsNullable = JsonSerializer.Deserialize<List<Object>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
arrayItemsNullable = JsonSerializer.Deserialize<List<Object>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "object_items_nullable":
objectItemsNullable = JsonSerializer.Deserialize<Dictionary<string, Object>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
objectItemsNullable = JsonSerializer.Deserialize<Dictionary<string, Object>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "array_and_items_nullable_prop":
arrayAndItemsNullableProp = JsonSerializer.Deserialize<List<Object>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
arrayAndItemsNullableProp = JsonSerializer.Deserialize<List<Object>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "array_nullable_prop":
arrayNullableProp = JsonSerializer.Deserialize<List<Object>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
arrayNullableProp = JsonSerializer.Deserialize<List<Object>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "boolean_prop":
booleanProp = utf8JsonReader.GetBoolean();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
booleanProp = utf8JsonReader.GetBoolean();
break;
case "date_prop":
dateProp = JsonSerializer.Deserialize<DateTime?>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
dateProp = JsonSerializer.Deserialize<DateTime?>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "datetime_prop":
datetimeProp = JsonSerializer.Deserialize<DateTime?>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
datetimeProp = JsonSerializer.Deserialize<DateTime?>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "integer_prop":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
integerProp = utf8JsonReader.GetInt32();
{
utf8JsonReader.TryGetInt32(out int integerPropResult);
integerProp = integerPropResult;
}
break;
case "number_prop":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
numberProp = utf8JsonReader.GetInt32();
{
utf8JsonReader.TryGetInt32(out int numberPropResult);
numberProp = numberPropResult;
}
break;
case "object_and_items_nullable_prop":
objectAndItemsNullableProp = JsonSerializer.Deserialize<Dictionary<string, Object>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
objectAndItemsNullableProp = JsonSerializer.Deserialize<Dictionary<string, Object>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "object_nullable_prop":
objectNullableProp = JsonSerializer.Deserialize<Dictionary<string, Object>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
objectNullableProp = JsonSerializer.Deserialize<Dictionary<string, Object>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "string_prop":
stringProp = utf8JsonReader.GetString();
@@ -115,7 +115,11 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "uuid":
uuid = utf8JsonReader.GetGuid();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{
utf8JsonReader.TryGetGuid(out Guid uuidResult);
uuid = uuidResult;
}
break;
default:
break;
@@ -123,7 +123,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "JustNumber":
justNumber = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetDecimal(out justNumber);
break;
default:
break;
@@ -165,13 +165,16 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "bars":
bars = JsonSerializer.Deserialize<List<string>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
bars = JsonSerializer.Deserialize<List<string>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "deprecatedRef":
deprecatedRef = JsonSerializer.Deserialize<DeprecatedObject>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
deprecatedRef = JsonSerializer.Deserialize<DeprecatedObject>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "id":
id = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetDecimal(out id);
break;
case "uuid":
uuid = utf8JsonReader.GetString();
@@ -257,23 +257,28 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "id":
id = utf8JsonReader.GetInt64();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt64(out id);
break;
case "petId":
petId = utf8JsonReader.GetInt64();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt64(out petId);
break;
case "quantity":
quantity = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt32(out quantity);
break;
case "shipDate":
shipDate = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
shipDate = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "status":
string statusRawValue = utf8JsonReader.GetString();
status = Order.StatusEnumFromString(statusRawValue);
break;
case "complete":
complete = utf8JsonReader.GetBoolean();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
complete = utf8JsonReader.GetBoolean();
break;
default:
break;
@@ -149,10 +149,12 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "my_boolean":
myBoolean = utf8JsonReader.GetBoolean();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
myBoolean = utf8JsonReader.GetBoolean();
break;
case "my_number":
myNumber = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetDecimal(out myNumber);
break;
case "my_string":
myString = utf8JsonReader.GetString();
@@ -252,23 +252,27 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "category":
category = JsonSerializer.Deserialize<Category>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
category = JsonSerializer.Deserialize<Category>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "id":
id = utf8JsonReader.GetInt64();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt64(out id);
break;
case "name":
name = utf8JsonReader.GetString();
break;
case "photoUrls":
photoUrls = JsonSerializer.Deserialize<List<string>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
photoUrls = JsonSerializer.Deserialize<List<string>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "status":
string statusRawValue = utf8JsonReader.GetString();
status = Pet.StatusEnumFromString(statusRawValue);
break;
case "tags":
tags = JsonSerializer.Deserialize<List<Tag>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
tags = JsonSerializer.Deserialize<List<Tag>>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -123,7 +123,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "return":
returnProperty = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt32(out returnProperty);
break;
default:
break;
@@ -139,7 +139,8 @@ namespace Org.OpenAPITools.Model
specialModelNameProperty = utf8JsonReader.GetString();
break;
case "$special[property.name]":
specialPropertyName = utf8JsonReader.GetInt64();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt64(out specialPropertyName);
break;
default:
break;
@@ -136,7 +136,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "id":
id = utf8JsonReader.GetInt64();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt64(out id);
break;
case "name":
name = utf8JsonReader.GetString();
@@ -268,13 +268,15 @@ namespace Org.OpenAPITools.Model
firstName = utf8JsonReader.GetString();
break;
case "id":
id = utf8JsonReader.GetInt64();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt64(out id);
break;
case "lastName":
lastName = utf8JsonReader.GetString();
break;
case "objectWithNoDeclaredProps":
objectWithNoDeclaredProps = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
objectWithNoDeclaredProps = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "password":
password = utf8JsonReader.GetString();
@@ -283,19 +285,23 @@ namespace Org.OpenAPITools.Model
phone = utf8JsonReader.GetString();
break;
case "userStatus":
userStatus = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt32(out userStatus);
break;
case "username":
username = utf8JsonReader.GetString();
break;
case "anyTypeProp":
anyTypeProp = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
anyTypeProp = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "anyTypePropNullable":
anyTypePropNullable = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
anyTypePropNullable = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "objectWithNoDeclaredPropsNullable":
objectWithNoDeclaredPropsNullable = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
objectWithNoDeclaredPropsNullable = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -152,10 +152,12 @@ namespace Org.OpenAPITools.Model
className = utf8JsonReader.GetString();
break;
case "hasBaleen":
hasBaleen = utf8JsonReader.GetBoolean();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
hasBaleen = utf8JsonReader.GetBoolean();
break;
case "hasTeeth":
hasTeeth = utf8JsonReader.GetBoolean();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
hasTeeth = utf8JsonReader.GetBoolean();
break;
default:
break;
@@ -125,7 +125,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "children":
children = JsonSerializer.Deserialize<List<Child>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
children = JsonSerializer.Deserialize<List<Child>>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -126,7 +126,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "boosterSeat":
boosterSeat = utf8JsonReader.GetBoolean();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
boosterSeat = utf8JsonReader.GetBoolean();
break;
case "firstName":
firstName = utf8JsonReader.GetString();
@@ -125,7 +125,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "age":
age = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt32(out age);
break;
default:
break;
@@ -125,7 +125,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "count":
count = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetDecimal(out count);
break;
default:
break;
@@ -125,7 +125,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "count":
count = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetDecimal(out count);
break;
default:
break;
@@ -123,7 +123,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "activity_outputs":
activityOutputs = JsonSerializer.Deserialize<Dictionary<string, List<ActivityOutputElementRepresentation>>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
activityOutputs = JsonSerializer.Deserialize<Dictionary<string, List<ActivityOutputElementRepresentation>>>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -139,7 +139,8 @@ namespace Org.OpenAPITools.Model
prop1 = utf8JsonReader.GetString();
break;
case "prop2":
prop2 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
prop2 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -212,28 +212,36 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "empty_map":
emptyMap = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
emptyMap = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "map_of_map_property":
mapOfMapProperty = JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapOfMapProperty = JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "map_property":
mapProperty = JsonSerializer.Deserialize<Dictionary<string, string>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapProperty = JsonSerializer.Deserialize<Dictionary<string, string>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "map_with_undeclared_properties_anytype_1":
mapWithUndeclaredPropertiesAnytype1 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapWithUndeclaredPropertiesAnytype1 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "map_with_undeclared_properties_anytype_2":
mapWithUndeclaredPropertiesAnytype2 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapWithUndeclaredPropertiesAnytype2 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "map_with_undeclared_properties_anytype_3":
mapWithUndeclaredPropertiesAnytype3 = JsonSerializer.Deserialize<Dictionary<string, Object>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapWithUndeclaredPropertiesAnytype3 = JsonSerializer.Deserialize<Dictionary<string, Object>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "map_with_undeclared_properties_string":
mapWithUndeclaredPropertiesString = JsonSerializer.Deserialize<Dictionary<string, string>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapWithUndeclaredPropertiesString = JsonSerializer.Deserialize<Dictionary<string, string>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "anytype_1":
anytype1 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
anytype1 = JsonSerializer.Deserialize<Object>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -149,7 +149,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "code":
code = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt32(out code);
break;
case "message":
message = utf8JsonReader.GetString();
@@ -132,7 +132,8 @@ namespace Org.OpenAPITools.Model
cultivar = utf8JsonReader.GetString();
break;
case "mealy":
mealy = utf8JsonReader.GetBoolean();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mealy = utf8JsonReader.GetBoolean();
break;
default:
break;
@@ -123,7 +123,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "ArrayArrayNumber":
arrayArrayNumber = JsonSerializer.Deserialize<List<List<decimal>>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
arrayArrayNumber = JsonSerializer.Deserialize<List<List<decimal>>>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -123,7 +123,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "ArrayNumber":
arrayNumber = JsonSerializer.Deserialize<List<decimal>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
arrayNumber = JsonSerializer.Deserialize<List<decimal>>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -149,13 +149,16 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "array_array_of_integer":
arrayArrayOfInteger = JsonSerializer.Deserialize<List<List<long>>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
arrayArrayOfInteger = JsonSerializer.Deserialize<List<List<long>>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "array_array_of_model":
arrayArrayOfModel = JsonSerializer.Deserialize<List<List<ReadOnlyFirst>>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
arrayArrayOfModel = JsonSerializer.Deserialize<List<List<ReadOnlyFirst>>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "array_of_string":
arrayOfString = JsonSerializer.Deserialize<List<string>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
arrayOfString = JsonSerializer.Deserialize<List<string>>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -123,7 +123,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "lengthCm":
lengthCm = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetDecimal(out lengthCm);
break;
default:
break;
@@ -129,10 +129,12 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "lengthCm":
lengthCm = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetDecimal(out lengthCm);
break;
case "sweet":
sweet = utf8JsonReader.GetBoolean();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
sweet = utf8JsonReader.GetBoolean();
break;
default:
break;
@@ -123,7 +123,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "declawed":
declawed = utf8JsonReader.GetBoolean();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
declawed = utf8JsonReader.GetBoolean();
break;
default:
break;
@@ -136,7 +136,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "id":
id = utf8JsonReader.GetInt64();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt64(out id);
break;
case "name":
name = utf8JsonReader.GetString();
@@ -129,7 +129,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "dateOnlyProperty":
dateOnlyProperty = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
dateOnlyProperty = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -153,16 +153,20 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "mainShape":
mainShape = JsonSerializer.Deserialize<Shape>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mainShape = JsonSerializer.Deserialize<Shape>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "shapeOrNull":
shapeOrNull = JsonSerializer.Deserialize<ShapeOrNull>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
shapeOrNull = JsonSerializer.Deserialize<ShapeOrNull>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "shapes":
shapes = JsonSerializer.Deserialize<List<Shape>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
shapes = JsonSerializer.Deserialize<List<Shape>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "nullableShape":
nullableShape = JsonSerializer.Deserialize<NullableShape>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
nullableShape = JsonSerializer.Deserialize<NullableShape>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -236,7 +236,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "array_enum":
arrayEnum = JsonSerializer.Deserialize<List<EnumArrays.ArrayEnumEnum>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
arrayEnum = JsonSerializer.Deserialize<List<EnumArrays.ArrayEnumEnum>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "just_symbol":
string justSymbolRawValue = utf8JsonReader.GetString();
@@ -484,13 +484,25 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "enum_integer":
enumInteger = (EnumTest.EnumIntegerEnum) utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{
utf8JsonReader.TryGetInt32(out int enumIntegerResult);
enumInteger = (EnumTest.EnumIntegerEnum)enumIntegerResult;
}
break;
case "enum_integer_only":
enumIntegerOnly = (EnumTest.EnumIntegerOnlyEnum) utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{
utf8JsonReader.TryGetInt32(out int enumIntegerOnlyResult);
enumIntegerOnly = (EnumTest.EnumIntegerOnlyEnum)enumIntegerOnlyResult;
}
break;
case "enum_number":
enumNumber = (EnumTest.EnumNumberEnum) utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{
utf8JsonReader.TryGetInt32(out int enumNumberResult);
enumNumber = (EnumTest.EnumNumberEnum)enumNumberResult;
}
break;
case "enum_string":
string enumStringRawValue = utf8JsonReader.GetString();
@@ -136,10 +136,12 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "file":
file = JsonSerializer.Deserialize<File>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
file = JsonSerializer.Deserialize<File>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "files":
files = JsonSerializer.Deserialize<List<File>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
files = JsonSerializer.Deserialize<List<File>>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -123,7 +123,8 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "string":
stringProperty = JsonSerializer.Deserialize<Foo>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
stringProperty = JsonSerializer.Deserialize<Foo>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -464,37 +464,51 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "binary":
binary = JsonSerializer.Deserialize<System.IO.Stream>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
binary = JsonSerializer.Deserialize<System.IO.Stream>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "byte":
byteProperty = JsonSerializer.Deserialize<byte[]>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
byteProperty = JsonSerializer.Deserialize<byte[]>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "date":
date = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
date = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "dateTime":
dateTime = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
dateTime = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "decimal":
decimalProperty = JsonSerializer.Deserialize<decimal>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
decimalProperty = JsonSerializer.Deserialize<decimal>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "double":
doubleProperty = utf8JsonReader.GetDouble();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetDouble(out doubleProperty);
break;
case "float":
floatProperty = (float)utf8JsonReader.GetDouble();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
{
utf8JsonReader.TryGetDouble(out double floatPropertyResult);
floatProperty = (float)floatPropertyResult;
}
break;
case "int32":
int32 = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt32(out int32);
break;
case "int64":
int64 = utf8JsonReader.GetInt64();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt64(out int64);
break;
case "integer":
integer = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt32(out integer);
break;
case "number":
number = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetDecimal(out number);
break;
case "password":
password = utf8JsonReader.GetString();
@@ -509,13 +523,16 @@ namespace Org.OpenAPITools.Model
stringProperty = utf8JsonReader.GetString();
break;
case "unsigned_integer":
unsignedInteger = utf8JsonReader.GetUInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetUInt32(out unsignedInteger);
break;
case "unsigned_long":
unsignedLong = utf8JsonReader.GetUInt64();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetUInt64(out unsignedLong);
break;
case "uuid":
uuid = utf8JsonReader.GetGuid();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetGuid(out uuid);
break;
default:
break;
@@ -212,16 +212,20 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "direct_map":
directMap = JsonSerializer.Deserialize<Dictionary<string, bool>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
directMap = JsonSerializer.Deserialize<Dictionary<string, bool>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "indirect_map":
indirectMap = JsonSerializer.Deserialize<Dictionary<string, bool>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
indirectMap = JsonSerializer.Deserialize<Dictionary<string, bool>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "map_map_of_string":
mapMapOfString = JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapMapOfString = JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "map_of_enum_string":
mapOfEnumString = JsonSerializer.Deserialize<Dictionary<string, MapTest.InnerEnum>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
mapOfEnumString = JsonSerializer.Deserialize<Dictionary<string, MapTest.InnerEnum>>(ref utf8JsonReader, jsonSerializerOptions);
break;
default:
break;
@@ -174,16 +174,20 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "dateTime":
dateTime = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
dateTime = JsonSerializer.Deserialize<DateTime>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "map":
map = JsonSerializer.Deserialize<Dictionary<string, Animal>>(ref utf8JsonReader, jsonSerializerOptions);
if (utf8JsonReader.TokenType != JsonTokenType.Null)
map = JsonSerializer.Deserialize<Dictionary<string, Animal>>(ref utf8JsonReader, jsonSerializerOptions);
break;
case "uuid":
uuid = utf8JsonReader.GetGuid();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetGuid(out uuid);
break;
case "uuid_with_pattern":
uuidWithPattern = utf8JsonReader.GetGuid();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetGuid(out uuidWithPattern);
break;
default:
break;
@@ -139,7 +139,8 @@ namespace Org.OpenAPITools.Model
classProperty = utf8JsonReader.GetString();
break;
case "name":
name = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt32(out name);
break;
default:
break;
@@ -199,16 +199,19 @@ namespace Org.OpenAPITools.Model
switch (propertyName)
{
case "name":
nameProperty = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt32(out nameProperty);
break;
case "property":
property = utf8JsonReader.GetString();
break;
case "snake_case":
snakeCase = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt32(out snakeCase);
break;
case "123Number":
_123number = utf8JsonReader.GetInt32();
if (utf8JsonReader.TokenType != JsonTokenType.Null)
utf8JsonReader.TryGetInt32(out _123number);
break;
default:
break;

Some files were not shown because too many files have changed in this diff Show More