diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/JsonConverter.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/JsonConverter.mustache index 0ff2753e33a..2328f9ce1f2 100644 --- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/JsonConverter.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/JsonConverter.mustache @@ -185,33 +185,27 @@ {{/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}} @@ -219,18 +213,15 @@ {{/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(ref utf8JsonReader, jsonSerializerOptions)); + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}JsonSerializer.Deserialize(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(); @@ -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}} @@ -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}} diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Adult.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Adult.cs index 30d6ca1fc47..f25596215be 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Adult.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Adult.cs @@ -115,8 +115,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "children": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - children = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + children = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "firstName": firstName = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Child.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Child.cs index 8eaaa8256ee..c6f78d43c42 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Child.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Child.cs @@ -132,8 +132,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "age": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - age = new Option(utf8JsonReader.GetInt32()); + age = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "firstName": firstName = new Option(utf8JsonReader.GetString()); @@ -145,8 +144,7 @@ namespace Org.OpenAPITools.Model type = new Option(utf8JsonReader.GetString()); break; case "boosterSeat": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - boosterSeat = new Option(utf8JsonReader.GetBoolean()); + boosterSeat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Model/Banana.cs index 15899a012af..edf36db227d 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Model/Banana.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "count": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - count = new Option(utf8JsonReader.GetDecimal()); + count = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Model/Banana.cs index bdb8dcaba25..2cf5830c69f 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Model/Banana.cs @@ -125,8 +125,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "count": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - count = new Option(utf8JsonReader.GetDecimal()); + count = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Activity.cs index a5e4bd35e9b..4562d4ceb72 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Activity.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "activity_outputs": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - activityOutputs = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + activityOutputs = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index d7b4374e6a7..db832150ed9 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -146,8 +146,7 @@ namespace Org.OpenAPITools.Model prop1 = new Option(utf8JsonReader.GetString()); break; case "prop2": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index ec17222fbc8..f70c7a4c5fc 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -246,36 +246,28 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "anytype_1": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "empty_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_of_map_property": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapOfMapProperty = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + mapOfMapProperty = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_property": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapProperty = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapProperty = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_anytype_1": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_anytype_2": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_anytype_3": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype3 = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesAnytype3 = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ApiResponse.cs index 77ec0bd5ed2..74dbae3c6ba 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -160,8 +160,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "code": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - code = new Option(utf8JsonReader.GetInt32()); + code = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "message": message = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/AppleReq.cs index 1cc72ecd59d..1a839ecb01b 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/AppleReq.cs @@ -132,8 +132,7 @@ namespace Org.OpenAPITools.Model cultivar = new Option(utf8JsonReader.GetString()); break; case "mealy": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mealy = new Option(utf8JsonReader.GetBoolean()); + mealy = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index d2398a452ee..cea3f5a4ba5 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "ArrayArrayNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayNumber = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + arrayArrayNumber = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index cce8d5d564b..47bac6ba97c 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "ArrayNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayNumber = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayNumber = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ArrayTest.cs index 3fbc72e2f5a..1992bf9e932 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -160,16 +160,13 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_array_of_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayOfInteger = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + arrayArrayOfInteger = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_array_of_model": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayOfModel = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + arrayArrayOfModel = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Banana.cs index d92ba4ae6ae..d7b7e8188f7 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Banana.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "lengthCm": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lengthCm = new Option(utf8JsonReader.GetDecimal()); + lengthCm = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/BananaReq.cs index c9734cbe380..8aa8da44cae 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/BananaReq.cs @@ -129,12 +129,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "lengthCm": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lengthCm = new Option(utf8JsonReader.GetDecimal()); + lengthCm = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "sweet": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - sweet = new Option(utf8JsonReader.GetBoolean()); + sweet = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Cat.cs index 780c28a972a..9ed61c34f66 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Cat.cs @@ -119,8 +119,7 @@ namespace Org.OpenAPITools.Model color = new Option(utf8JsonReader.GetString()); break; case "declawed": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - declawed = new Option(utf8JsonReader.GetBoolean()); + declawed = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Category.cs index f483d87f36c..7db5ba3129f 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Category.cs @@ -136,8 +136,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "name": name = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/DateOnlyClass.cs index 1c478cf336d..62ae935e456 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -132,8 +132,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "dateOnlyProperty": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Drawing.cs index a853b96144e..e83b9530376 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Drawing.cs @@ -177,20 +177,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "mainShape": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "nullableShape": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "shapeOrNull": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "shapes": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shapes = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + shapes = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EnumArrays.cs index 6520bebabc0..007eba77a35 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -143,8 +143,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_enum": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayEnum = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayEnum = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "just_symbol": string justSymbolRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index f9d9d9f7a7b..76db6338890 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -143,12 +143,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "file": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "files": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - files = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + files = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index c7d04366611..285e193a7e1 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs index 86d63c7ac5f..a4410d55b34 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs @@ -665,71 +665,55 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "byte": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "date": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - number = new Option(utf8JsonReader.GetDecimal()); + number = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "password": password = new Option(utf8JsonReader.GetString()); break; case "binary": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "dateTime": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "decimal": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "double": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varDouble = new Option(utf8JsonReader.GetDouble()); + varDouble = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); break; case "float": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varFloat = new Option((float)utf8JsonReader.GetDouble()); + varFloat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble()); break; case "int32": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int32 = new Option(utf8JsonReader.GetInt32()); + int32 = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int32Range": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int32Range = new Option(utf8JsonReader.GetInt32()); + int32Range = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64 = new Option(utf8JsonReader.GetInt64()); + int64 = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "int64Negative": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64Negative = new Option(utf8JsonReader.GetInt32()); + int64Negative = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64NegativeExclusive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64NegativeExclusive = new Option(utf8JsonReader.GetInt32()); + int64NegativeExclusive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64Positive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64Positive = new Option(utf8JsonReader.GetInt32()); + int64Positive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64PositiveExclusive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64PositiveExclusive = new Option(utf8JsonReader.GetInt32()); + int64PositiveExclusive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - integer = new Option(utf8JsonReader.GetInt32()); + integer = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "pattern_with_backslash": patternWithBackslash = new Option(utf8JsonReader.GetString()); @@ -744,16 +728,13 @@ namespace Org.OpenAPITools.Model varString = new Option(utf8JsonReader.GetString()); break; case "unsigned_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - unsignedInteger = new Option(utf8JsonReader.GetUInt32()); + unsignedInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (uint?)null : utf8JsonReader.GetUInt32()); break; case "unsigned_long": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - unsignedLong = new Option(utf8JsonReader.GetUInt64()); + unsignedLong = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (ulong?)null : utf8JsonReader.GetUInt64()); break; case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MapTest.cs index 120a8fb0dd5..7331b5d3f61 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MapTest.cs @@ -177,20 +177,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "direct_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - directMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + directMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "indirect_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - indirectMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + indirectMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_map_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapMapOfString = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + mapMapOfString = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_of_enum_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapOfEnumString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapOfEnumString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedAnyOf.cs index c81de3d2f67..3a559f83119 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedAnyOf.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedAnyOf.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "content": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedOneOf.cs index 32515bc0440..5e238e0f7b3 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedOneOf.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedOneOf.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "content": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 3cef3330300..e0462d7c8a2 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -189,20 +189,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "dateTime": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - map = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + map = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "uuid_with_pattern": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuidWithPattern = new Option(utf8JsonReader.GetGuid()); + uuidWithPattern = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Model200Response.cs index bf37307ad96..882bf7ccda4 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Model200Response.cs @@ -146,8 +146,7 @@ namespace Org.OpenAPITools.Model varClass = new Option(utf8JsonReader.GetString()); break; case "name": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - name = new Option(utf8JsonReader.GetInt32()); + name = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Name.cs index b322aaf568c..dba5779e547 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Name.cs @@ -211,19 +211,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "name": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varName = new Option(utf8JsonReader.GetInt32()); + varName = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "property": property = new Option(utf8JsonReader.GetString()); break; case "snake_case": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - snakeCase = new Option(utf8JsonReader.GetInt32()); + snakeCase = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "123Number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - var123Number = new Option(utf8JsonReader.GetInt32()); + var123Number = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs index ea8abdda0d7..9da49219005 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs @@ -129,12 +129,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "a_objVariableobject": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - aObjVariableobject = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + aObjVariableobject = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "pkiNotificationtestID": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - pkiNotificationtestID = new Option(utf8JsonReader.GetInt32()); + pkiNotificationtestID = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NullableClass.cs index 42533f9c7eb..397f12bffbb 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NullableClass.cs @@ -323,48 +323,37 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_and_items_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_items_nullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - booleanProp = new Option(utf8JsonReader.GetBoolean()); + booleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - integerProp = new Option(utf8JsonReader.GetInt32()); + integerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "number_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - numberProp = new Option(utf8JsonReader.GetDecimal()); + numberProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "object_and_items_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "object_items_nullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "object_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "string_prop": stringProp = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NullableGuidClass.cs index 286d13258dc..6efbeef44dc 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -127,8 +127,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NumberOnly.cs index 29f5a80e646..55ab016ac3d 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "JustNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - justNumber = new Option(utf8JsonReader.GetDecimal()); + justNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 83f513bc63b..541a621953a 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -180,16 +180,13 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "bars": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - bars = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + bars = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "deprecatedRef": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetDecimal()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "uuid": uuid = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Order.cs index 3dbb629ecf9..8af5defaed7 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Order.cs @@ -217,24 +217,19 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "complete": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - complete = new Option(utf8JsonReader.GetBoolean()); + complete = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "petId": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - petId = new Option(utf8JsonReader.GetInt64()); + petId = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "quantity": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - quantity = new Option(utf8JsonReader.GetInt32()); + quantity = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "shipDate": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "status": string statusRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/OuterComposite.cs index 92ec1939d1a..d366c24ec24 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -160,12 +160,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "my_boolean": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - myBoolean = new Option(utf8JsonReader.GetBoolean()); + myBoolean = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "my_number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - myNumber = new Option(utf8JsonReader.GetDecimal()); + myNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "my_string": myString = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Pet.cs index e4049df78c0..6e741c362d6 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Pet.cs @@ -201,16 +201,13 @@ namespace Org.OpenAPITools.Model name = new Option(utf8JsonReader.GetString()); break; case "photoUrls": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - photoUrls = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + photoUrls = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "category": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "status": string statusRawValue = utf8JsonReader.GetString(); @@ -218,8 +215,7 @@ namespace Org.OpenAPITools.Model status = new Option(PetStatusValueConverter.FromStringOrDefault(statusRawValue)); break; case "tags": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - tags = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + tags = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RequiredClass.cs index 4eb4f6acc58..f7422f86f55 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RequiredClass.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RequiredClass.cs @@ -747,20 +747,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "required_not_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + requiredNotnullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "required_notnullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_enum_integer": string requiredNotnullableEnumIntegerRawValue = utf8JsonReader.GetString(); @@ -786,40 +782,31 @@ namespace Org.OpenAPITools.Model requiredNotnullableStringProp = new Option(utf8JsonReader.GetString()); break; case "required_notnullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + requiredNotnullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "required_notnullableinteger_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + requiredNotnullableintegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "not_required_notnullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "not_required_notnullableinteger_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + notRequiredNotnullableintegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "not_required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "not_required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + notRequiredNullableIntegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_notnullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "notrequired_notnullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_notnullable_enum_integer": string notrequiredNotnullableEnumIntegerRawValue = utf8JsonReader.GetString(); @@ -845,20 +832,16 @@ namespace Org.OpenAPITools.Model notrequiredNotnullableStringProp = new Option(utf8JsonReader.GetString()); break; case "notrequired_notnullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + notrequiredNotnullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "notrequired_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + notrequiredNullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "notrequired_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_nullable_enum_integer": string notrequiredNullableEnumIntegerRawValue = utf8JsonReader.GetString(); @@ -884,24 +867,19 @@ namespace Org.OpenAPITools.Model notrequiredNullableStringProp = new Option(utf8JsonReader.GetString()); break; case "notrequired_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + notrequiredNullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "required_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + requiredNullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_enum_integer": string requiredNullableEnumIntegerRawValue = utf8JsonReader.GetString(); @@ -919,8 +897,7 @@ namespace Org.OpenAPITools.Model requiredNullableEnumString = new Option(RequiredClassRequiredNullableEnumStringValueConverter.FromStringOrDefault(requiredNullableEnumStringRawValue)); break; case "required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + requiredNullableIntegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "required_nullable_outerEnumDefaultValue": string requiredNullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); @@ -931,8 +908,7 @@ namespace Org.OpenAPITools.Model requiredNullableStringProp = new Option(utf8JsonReader.GetString()); break; case "required_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + requiredNullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Return.cs index 6a2c4c85eb4..81211e0ce4a 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Return.cs @@ -169,8 +169,7 @@ namespace Org.OpenAPITools.Model varAbstract = new Option(utf8JsonReader.GetString()); break; case "return": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varReturn = new Option(utf8JsonReader.GetInt32()); + varReturn = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "unsafe": varUnsafe = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RolesReportsHash.cs index 46625cb093a..5b7a88bd659 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RolesReportsHash.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -143,12 +143,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "role": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "role_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - roleUuid = new Option(utf8JsonReader.GetGuid()); + roleUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/SpecialModelName.cs index 7ec3c110c2a..f30e2a11997 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -146,8 +146,7 @@ namespace Org.OpenAPITools.Model varSpecialModelName = new Option(utf8JsonReader.GetString()); break; case "$special[property.name]": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - specialPropertyName = new Option(utf8JsonReader.GetInt64()); + specialPropertyName = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Tag.cs index 4290e8270ff..6b9d5082405 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Tag.cs @@ -143,8 +143,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "name": name = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs index 04d04337aa4..7328caf1ead 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "TestCollectionEndingWithWordList": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - testCollectionEndingWithWordList = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + testCollectionEndingWithWordList = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/User.cs index e89d5845732..a85e556bb9e 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/User.cs @@ -318,12 +318,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "anyTypeProp": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "anyTypePropNullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "email": email = new Option(utf8JsonReader.GetString()); @@ -332,19 +330,16 @@ namespace Org.OpenAPITools.Model firstName = new Option(utf8JsonReader.GetString()); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "lastName": lastName = new Option(utf8JsonReader.GetString()); break; case "objectWithNoDeclaredProps": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "objectWithNoDeclaredPropsNullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "password": password = new Option(utf8JsonReader.GetString()); @@ -353,8 +348,7 @@ namespace Org.OpenAPITools.Model phone = new Option(utf8JsonReader.GetString()); break; case "userStatus": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - userStatus = new Option(utf8JsonReader.GetInt32()); + userStatus = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "username": username = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Whale.cs index 834e6957c67..56da6f6db3c 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/Whale.cs @@ -156,12 +156,10 @@ namespace Org.OpenAPITools.Model className = new Option(utf8JsonReader.GetString()); break; case "hasBaleen": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - hasBaleen = new Option(utf8JsonReader.GetBoolean()); + hasBaleen = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "hasTeeth": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - hasTeeth = new Option(utf8JsonReader.GetBoolean()); + hasTeeth = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Model/Banana.cs index 15899a012af..edf36db227d 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Model/Banana.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "count": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - count = new Option(utf8JsonReader.GetDecimal()); + count = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Activity.cs index a5e4bd35e9b..4562d4ceb72 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Activity.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "activity_outputs": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - activityOutputs = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + activityOutputs = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index d7b4374e6a7..db832150ed9 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -146,8 +146,7 @@ namespace Org.OpenAPITools.Model prop1 = new Option(utf8JsonReader.GetString()); break; case "prop2": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index ec17222fbc8..f70c7a4c5fc 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -246,36 +246,28 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "anytype_1": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "empty_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_of_map_property": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapOfMapProperty = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + mapOfMapProperty = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_property": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapProperty = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapProperty = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_anytype_1": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_anytype_2": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_anytype_3": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype3 = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesAnytype3 = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs index 77ec0bd5ed2..74dbae3c6ba 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -160,8 +160,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "code": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - code = new Option(utf8JsonReader.GetInt32()); + code = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "message": message = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs index 1cc72ecd59d..1a839ecb01b 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs @@ -132,8 +132,7 @@ namespace Org.OpenAPITools.Model cultivar = new Option(utf8JsonReader.GetString()); break; case "mealy": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mealy = new Option(utf8JsonReader.GetBoolean()); + mealy = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index d2398a452ee..cea3f5a4ba5 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "ArrayArrayNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayNumber = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + arrayArrayNumber = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index cce8d5d564b..47bac6ba97c 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "ArrayNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayNumber = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayNumber = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs index 3fbc72e2f5a..1992bf9e932 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -160,16 +160,13 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_array_of_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayOfInteger = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + arrayArrayOfInteger = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_array_of_model": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayOfModel = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + arrayArrayOfModel = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Banana.cs index d92ba4ae6ae..d7b7e8188f7 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Banana.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "lengthCm": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lengthCm = new Option(utf8JsonReader.GetDecimal()); + lengthCm = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs index c9734cbe380..8aa8da44cae 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs @@ -129,12 +129,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "lengthCm": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lengthCm = new Option(utf8JsonReader.GetDecimal()); + lengthCm = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "sweet": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - sweet = new Option(utf8JsonReader.GetBoolean()); + sweet = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Cat.cs index 780c28a972a..9ed61c34f66 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Cat.cs @@ -119,8 +119,7 @@ namespace Org.OpenAPITools.Model color = new Option(utf8JsonReader.GetString()); break; case "declawed": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - declawed = new Option(utf8JsonReader.GetBoolean()); + declawed = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Category.cs index f483d87f36c..7db5ba3129f 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Category.cs @@ -136,8 +136,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "name": name = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs index 1c478cf336d..62ae935e456 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -132,8 +132,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "dateOnlyProperty": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Drawing.cs index a853b96144e..e83b9530376 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Drawing.cs @@ -177,20 +177,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "mainShape": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "nullableShape": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "shapeOrNull": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "shapes": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shapes = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + shapes = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs index b6716a58e53..c107741e961 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -275,8 +275,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_enum": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayEnum = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayEnum = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "just_symbol": string justSymbolRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs index 08e96129872..40d5e275363 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs @@ -744,16 +744,13 @@ namespace Org.OpenAPITools.Model enumStringRequired = new Option(EnumTest.EnumStringRequiredEnumFromStringOrDefault(enumStringRequiredRawValue)); break; case "enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enumInteger = new Option((EnumTest.EnumIntegerEnum)utf8JsonReader.GetInt32()); + enumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (EnumTest.EnumIntegerEnum?)null : (EnumTest.EnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enumIntegerOnly = new Option((EnumTest.EnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + enumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (EnumTest.EnumIntegerOnlyEnum?)null : (EnumTest.EnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "enum_number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enumNumber = new Option((EnumTest.EnumNumberEnum)utf8JsonReader.GetInt32()); + enumNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (EnumTest.EnumNumberEnum?)null : (EnumTest.EnumNumberEnum)utf8JsonReader.GetInt32()); break; case "enum_string": string enumStringRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index f9d9d9f7a7b..76db6338890 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -143,12 +143,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "file": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "files": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - files = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + files = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index c7d04366611..285e193a7e1 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs index 86d63c7ac5f..a4410d55b34 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -665,71 +665,55 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "byte": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "date": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - number = new Option(utf8JsonReader.GetDecimal()); + number = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "password": password = new Option(utf8JsonReader.GetString()); break; case "binary": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "dateTime": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "decimal": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "double": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varDouble = new Option(utf8JsonReader.GetDouble()); + varDouble = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); break; case "float": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varFloat = new Option((float)utf8JsonReader.GetDouble()); + varFloat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble()); break; case "int32": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int32 = new Option(utf8JsonReader.GetInt32()); + int32 = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int32Range": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int32Range = new Option(utf8JsonReader.GetInt32()); + int32Range = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64 = new Option(utf8JsonReader.GetInt64()); + int64 = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "int64Negative": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64Negative = new Option(utf8JsonReader.GetInt32()); + int64Negative = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64NegativeExclusive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64NegativeExclusive = new Option(utf8JsonReader.GetInt32()); + int64NegativeExclusive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64Positive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64Positive = new Option(utf8JsonReader.GetInt32()); + int64Positive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64PositiveExclusive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64PositiveExclusive = new Option(utf8JsonReader.GetInt32()); + int64PositiveExclusive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - integer = new Option(utf8JsonReader.GetInt32()); + integer = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "pattern_with_backslash": patternWithBackslash = new Option(utf8JsonReader.GetString()); @@ -744,16 +728,13 @@ namespace Org.OpenAPITools.Model varString = new Option(utf8JsonReader.GetString()); break; case "unsigned_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - unsignedInteger = new Option(utf8JsonReader.GetUInt32()); + unsignedInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (uint?)null : utf8JsonReader.GetUInt32()); break; case "unsigned_long": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - unsignedLong = new Option(utf8JsonReader.GetUInt64()); + unsignedLong = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (ulong?)null : utf8JsonReader.GetUInt64()); break; case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MapTest.cs index 97588d56888..0af46ec34e4 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MapTest.cs @@ -243,20 +243,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "direct_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - directMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + directMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "indirect_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - indirectMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + indirectMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_map_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapMapOfString = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + mapMapOfString = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_of_enum_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapOfEnumString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapOfEnumString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs index c81de3d2f67..3a559f83119 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "content": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs index 32515bc0440..5e238e0f7b3 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "content": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 3cef3330300..e0462d7c8a2 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -189,20 +189,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "dateTime": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - map = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + map = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "uuid_with_pattern": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuidWithPattern = new Option(utf8JsonReader.GetGuid()); + uuidWithPattern = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs index bf37307ad96..882bf7ccda4 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs @@ -146,8 +146,7 @@ namespace Org.OpenAPITools.Model varClass = new Option(utf8JsonReader.GetString()); break; case "name": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - name = new Option(utf8JsonReader.GetInt32()); + name = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Name.cs index b322aaf568c..dba5779e547 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Name.cs @@ -211,19 +211,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "name": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varName = new Option(utf8JsonReader.GetInt32()); + varName = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "property": property = new Option(utf8JsonReader.GetString()); break; case "snake_case": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - snakeCase = new Option(utf8JsonReader.GetInt32()); + snakeCase = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "123Number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - var123Number = new Option(utf8JsonReader.GetInt32()); + var123Number = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs index ea8abdda0d7..9da49219005 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs @@ -129,12 +129,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "a_objVariableobject": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - aObjVariableobject = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + aObjVariableobject = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "pkiNotificationtestID": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - pkiNotificationtestID = new Option(utf8JsonReader.GetInt32()); + pkiNotificationtestID = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs index 42533f9c7eb..397f12bffbb 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs @@ -323,48 +323,37 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_and_items_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_items_nullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - booleanProp = new Option(utf8JsonReader.GetBoolean()); + booleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - integerProp = new Option(utf8JsonReader.GetInt32()); + integerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "number_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - numberProp = new Option(utf8JsonReader.GetDecimal()); + numberProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "object_and_items_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "object_items_nullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "object_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "string_prop": stringProp = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs index 286d13258dc..6efbeef44dc 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -127,8 +127,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs index 29f5a80e646..55ab016ac3d 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "JustNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - justNumber = new Option(utf8JsonReader.GetDecimal()); + justNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 83f513bc63b..541a621953a 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -180,16 +180,13 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "bars": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - bars = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + bars = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "deprecatedRef": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetDecimal()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "uuid": uuid = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Order.cs index 580ef432ecf..ad31eb6ad14 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Order.cs @@ -299,24 +299,19 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "complete": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - complete = new Option(utf8JsonReader.GetBoolean()); + complete = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "petId": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - petId = new Option(utf8JsonReader.GetInt64()); + petId = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "quantity": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - quantity = new Option(utf8JsonReader.GetInt32()); + quantity = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "shipDate": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "status": string statusRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs index 92ec1939d1a..d366c24ec24 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -160,12 +160,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "my_boolean": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - myBoolean = new Option(utf8JsonReader.GetBoolean()); + myBoolean = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "my_number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - myNumber = new Option(utf8JsonReader.GetDecimal()); + myNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "my_string": myString = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Pet.cs index 81d80e33de7..e8e661445a1 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Pet.cs @@ -283,16 +283,13 @@ namespace Org.OpenAPITools.Model name = new Option(utf8JsonReader.GetString()); break; case "photoUrls": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - photoUrls = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + photoUrls = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "category": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "status": string statusRawValue = utf8JsonReader.GetString(); @@ -300,8 +297,7 @@ namespace Org.OpenAPITools.Model status = new Option(Pet.StatusEnumFromStringOrDefault(statusRawValue)); break; case "tags": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - tags = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + tags = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs index 0990c0ab7a4..fee9ba7f296 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs @@ -1825,28 +1825,22 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "required_not_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + requiredNotnullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "required_notnullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableEnumInteger = new Option((RequiredClass.RequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + requiredNotnullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNotnullableEnumIntegerEnum?)null : (RequiredClass.RequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "required_notnullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableEnumIntegerOnly = new Option((RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + requiredNotnullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum?)null : (RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "required_notnullable_enum_string": string requiredNotnullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1862,48 +1856,37 @@ namespace Org.OpenAPITools.Model requiredNotnullableStringProp = new Option(utf8JsonReader.GetString()); break; case "required_notnullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + requiredNotnullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "required_notnullableinteger_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + requiredNotnullableintegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "not_required_notnullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "not_required_notnullableinteger_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + notRequiredNotnullableintegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "not_required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "not_required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + notRequiredNullableIntegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_notnullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "notrequired_notnullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_notnullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableEnumInteger = new Option((RequiredClass.NotrequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + notrequiredNotnullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNotnullableEnumIntegerEnum?)null : (RequiredClass.NotrequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableEnumIntegerOnly = new Option((RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + notrequiredNotnullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum?)null : (RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_enum_string": string notrequiredNotnullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1919,28 +1902,22 @@ namespace Org.OpenAPITools.Model notrequiredNotnullableStringProp = new Option(utf8JsonReader.GetString()); break; case "notrequired_notnullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + notrequiredNotnullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "notrequired_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + notrequiredNullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "notrequired_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_nullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableEnumInteger = new Option((RequiredClass.NotrequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + notrequiredNullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNullableEnumIntegerEnum?)null : (RequiredClass.NotrequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "notrequired_nullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableEnumIntegerOnly = new Option((RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + notrequiredNullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum?)null : (RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "notrequired_nullable_enum_string": string notrequiredNullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1956,32 +1933,25 @@ namespace Org.OpenAPITools.Model notrequiredNullableStringProp = new Option(utf8JsonReader.GetString()); break; case "notrequired_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + notrequiredNullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "required_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + requiredNullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableEnumInteger = new Option((RequiredClass.RequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + requiredNullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNullableEnumIntegerEnum?)null : (RequiredClass.RequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "required_nullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableEnumIntegerOnly = new Option((RequiredClass.RequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + requiredNullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNullableEnumIntegerOnlyEnum?)null : (RequiredClass.RequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "required_nullable_enum_string": string requiredNullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1989,8 +1959,7 @@ namespace Org.OpenAPITools.Model requiredNullableEnumString = new Option(RequiredClass.RequiredNullableEnumStringEnumFromStringOrDefault(requiredNullableEnumStringRawValue)); break; case "required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + requiredNullableIntegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "required_nullable_outerEnumDefaultValue": string requiredNullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); @@ -2001,8 +1970,7 @@ namespace Org.OpenAPITools.Model requiredNullableStringProp = new Option(utf8JsonReader.GetString()); break; case "required_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + requiredNullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Return.cs index 6a2c4c85eb4..81211e0ce4a 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Return.cs @@ -169,8 +169,7 @@ namespace Org.OpenAPITools.Model varAbstract = new Option(utf8JsonReader.GetString()); break; case "return": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varReturn = new Option(utf8JsonReader.GetInt32()); + varReturn = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "unsafe": varUnsafe = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs index 46625cb093a..5b7a88bd659 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -143,12 +143,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "role": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "role_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - roleUuid = new Option(utf8JsonReader.GetGuid()); + roleUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs index 7ec3c110c2a..f30e2a11997 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -146,8 +146,7 @@ namespace Org.OpenAPITools.Model varSpecialModelName = new Option(utf8JsonReader.GetString()); break; case "$special[property.name]": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - specialPropertyName = new Option(utf8JsonReader.GetInt64()); + specialPropertyName = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Tag.cs index 4290e8270ff..6b9d5082405 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Tag.cs @@ -143,8 +143,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "name": name = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs index 04d04337aa4..7328caf1ead 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "TestCollectionEndingWithWordList": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - testCollectionEndingWithWordList = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + testCollectionEndingWithWordList = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/User.cs index e89d5845732..a85e556bb9e 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/User.cs @@ -318,12 +318,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "anyTypeProp": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "anyTypePropNullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "email": email = new Option(utf8JsonReader.GetString()); @@ -332,19 +330,16 @@ namespace Org.OpenAPITools.Model firstName = new Option(utf8JsonReader.GetString()); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "lastName": lastName = new Option(utf8JsonReader.GetString()); break; case "objectWithNoDeclaredProps": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "objectWithNoDeclaredPropsNullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "password": password = new Option(utf8JsonReader.GetString()); @@ -353,8 +348,7 @@ namespace Org.OpenAPITools.Model phone = new Option(utf8JsonReader.GetString()); break; case "userStatus": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - userStatus = new Option(utf8JsonReader.GetInt32()); + userStatus = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "username": username = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Whale.cs index 834e6957c67..56da6f6db3c 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/Whale.cs @@ -156,12 +156,10 @@ namespace Org.OpenAPITools.Model className = new Option(utf8JsonReader.GetString()); break; case "hasBaleen": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - hasBaleen = new Option(utf8JsonReader.GetBoolean()); + hasBaleen = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "hasTeeth": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - hasTeeth = new Option(utf8JsonReader.GetBoolean()); + hasTeeth = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs index 504c2976b3f..1858ede45ba 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs @@ -145,12 +145,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "now": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - now = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + now = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "today": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - today = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + today = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Model/Adult.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Model/Adult.cs index 30d6ca1fc47..f25596215be 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Model/Adult.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Model/Adult.cs @@ -115,8 +115,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "children": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - children = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + children = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "firstName": firstName = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Model/Child.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Model/Child.cs index 8eaaa8256ee..c6f78d43c42 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Model/Child.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Model/Child.cs @@ -132,8 +132,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "age": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - age = new Option(utf8JsonReader.GetInt32()); + age = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "firstName": firstName = new Option(utf8JsonReader.GetString()); @@ -145,8 +144,7 @@ namespace Org.OpenAPITools.Model type = new Option(utf8JsonReader.GetString()); break; case "boosterSeat": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - boosterSeat = new Option(utf8JsonReader.GetBoolean()); + boosterSeat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Model/Banana.cs index 15899a012af..edf36db227d 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Model/Banana.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "count": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - count = new Option(utf8JsonReader.GetDecimal()); + count = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Model/Banana.cs index bdb8dcaba25..2cf5830c69f 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Model/Banana.cs @@ -125,8 +125,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "count": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - count = new Option(utf8JsonReader.GetDecimal()); + count = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Activity.cs index a5e4bd35e9b..4562d4ceb72 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Activity.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "activity_outputs": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - activityOutputs = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + activityOutputs = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index d7b4374e6a7..db832150ed9 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -146,8 +146,7 @@ namespace Org.OpenAPITools.Model prop1 = new Option(utf8JsonReader.GetString()); break; case "prop2": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index ec17222fbc8..f70c7a4c5fc 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -246,36 +246,28 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "anytype_1": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "empty_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_of_map_property": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapOfMapProperty = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + mapOfMapProperty = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_property": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapProperty = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapProperty = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_anytype_1": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_anytype_2": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_anytype_3": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype3 = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesAnytype3 = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ApiResponse.cs index 77ec0bd5ed2..74dbae3c6ba 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -160,8 +160,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "code": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - code = new Option(utf8JsonReader.GetInt32()); + code = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "message": message = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/AppleReq.cs index 1cc72ecd59d..1a839ecb01b 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/AppleReq.cs @@ -132,8 +132,7 @@ namespace Org.OpenAPITools.Model cultivar = new Option(utf8JsonReader.GetString()); break; case "mealy": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mealy = new Option(utf8JsonReader.GetBoolean()); + mealy = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index d2398a452ee..cea3f5a4ba5 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "ArrayArrayNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayNumber = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + arrayArrayNumber = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index cce8d5d564b..47bac6ba97c 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "ArrayNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayNumber = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayNumber = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ArrayTest.cs index 3fbc72e2f5a..1992bf9e932 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -160,16 +160,13 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_array_of_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayOfInteger = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + arrayArrayOfInteger = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_array_of_model": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayOfModel = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + arrayArrayOfModel = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Banana.cs index d92ba4ae6ae..d7b7e8188f7 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Banana.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "lengthCm": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lengthCm = new Option(utf8JsonReader.GetDecimal()); + lengthCm = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/BananaReq.cs index c9734cbe380..8aa8da44cae 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/BananaReq.cs @@ -129,12 +129,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "lengthCm": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lengthCm = new Option(utf8JsonReader.GetDecimal()); + lengthCm = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "sweet": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - sweet = new Option(utf8JsonReader.GetBoolean()); + sweet = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Cat.cs index 780c28a972a..9ed61c34f66 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Cat.cs @@ -119,8 +119,7 @@ namespace Org.OpenAPITools.Model color = new Option(utf8JsonReader.GetString()); break; case "declawed": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - declawed = new Option(utf8JsonReader.GetBoolean()); + declawed = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Category.cs index f483d87f36c..7db5ba3129f 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Category.cs @@ -136,8 +136,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "name": name = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/DateOnlyClass.cs index 1c478cf336d..62ae935e456 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -132,8 +132,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "dateOnlyProperty": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Drawing.cs index a853b96144e..e83b9530376 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Drawing.cs @@ -177,20 +177,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "mainShape": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "nullableShape": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "shapeOrNull": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "shapes": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shapes = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + shapes = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EnumArrays.cs index 6520bebabc0..007eba77a35 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -143,8 +143,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_enum": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayEnum = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayEnum = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "just_symbol": string justSymbolRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index f9d9d9f7a7b..76db6338890 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -143,12 +143,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "file": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "files": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - files = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + files = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index c7d04366611..285e193a7e1 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs index 86d63c7ac5f..a4410d55b34 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs @@ -665,71 +665,55 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "byte": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "date": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - number = new Option(utf8JsonReader.GetDecimal()); + number = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "password": password = new Option(utf8JsonReader.GetString()); break; case "binary": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "dateTime": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "decimal": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "double": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varDouble = new Option(utf8JsonReader.GetDouble()); + varDouble = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); break; case "float": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varFloat = new Option((float)utf8JsonReader.GetDouble()); + varFloat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble()); break; case "int32": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int32 = new Option(utf8JsonReader.GetInt32()); + int32 = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int32Range": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int32Range = new Option(utf8JsonReader.GetInt32()); + int32Range = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64 = new Option(utf8JsonReader.GetInt64()); + int64 = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "int64Negative": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64Negative = new Option(utf8JsonReader.GetInt32()); + int64Negative = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64NegativeExclusive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64NegativeExclusive = new Option(utf8JsonReader.GetInt32()); + int64NegativeExclusive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64Positive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64Positive = new Option(utf8JsonReader.GetInt32()); + int64Positive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64PositiveExclusive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64PositiveExclusive = new Option(utf8JsonReader.GetInt32()); + int64PositiveExclusive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - integer = new Option(utf8JsonReader.GetInt32()); + integer = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "pattern_with_backslash": patternWithBackslash = new Option(utf8JsonReader.GetString()); @@ -744,16 +728,13 @@ namespace Org.OpenAPITools.Model varString = new Option(utf8JsonReader.GetString()); break; case "unsigned_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - unsignedInteger = new Option(utf8JsonReader.GetUInt32()); + unsignedInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (uint?)null : utf8JsonReader.GetUInt32()); break; case "unsigned_long": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - unsignedLong = new Option(utf8JsonReader.GetUInt64()); + unsignedLong = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (ulong?)null : utf8JsonReader.GetUInt64()); break; case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MapTest.cs index 120a8fb0dd5..7331b5d3f61 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MapTest.cs @@ -177,20 +177,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "direct_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - directMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + directMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "indirect_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - indirectMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + indirectMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_map_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapMapOfString = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + mapMapOfString = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_of_enum_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapOfEnumString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapOfEnumString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedAnyOf.cs index c81de3d2f67..3a559f83119 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedAnyOf.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedAnyOf.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "content": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedOneOf.cs index 32515bc0440..5e238e0f7b3 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedOneOf.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedOneOf.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "content": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 3cef3330300..e0462d7c8a2 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -189,20 +189,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "dateTime": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - map = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + map = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "uuid_with_pattern": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuidWithPattern = new Option(utf8JsonReader.GetGuid()); + uuidWithPattern = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Model200Response.cs index bf37307ad96..882bf7ccda4 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Model200Response.cs @@ -146,8 +146,7 @@ namespace Org.OpenAPITools.Model varClass = new Option(utf8JsonReader.GetString()); break; case "name": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - name = new Option(utf8JsonReader.GetInt32()); + name = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Name.cs index b322aaf568c..dba5779e547 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Name.cs @@ -211,19 +211,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "name": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varName = new Option(utf8JsonReader.GetInt32()); + varName = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "property": property = new Option(utf8JsonReader.GetString()); break; case "snake_case": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - snakeCase = new Option(utf8JsonReader.GetInt32()); + snakeCase = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "123Number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - var123Number = new Option(utf8JsonReader.GetInt32()); + var123Number = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs index ea8abdda0d7..9da49219005 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs @@ -129,12 +129,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "a_objVariableobject": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - aObjVariableobject = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + aObjVariableobject = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "pkiNotificationtestID": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - pkiNotificationtestID = new Option(utf8JsonReader.GetInt32()); + pkiNotificationtestID = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NullableClass.cs index 42533f9c7eb..397f12bffbb 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NullableClass.cs @@ -323,48 +323,37 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_and_items_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_items_nullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - booleanProp = new Option(utf8JsonReader.GetBoolean()); + booleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - integerProp = new Option(utf8JsonReader.GetInt32()); + integerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "number_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - numberProp = new Option(utf8JsonReader.GetDecimal()); + numberProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "object_and_items_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "object_items_nullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "object_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "string_prop": stringProp = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NullableGuidClass.cs index 286d13258dc..6efbeef44dc 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -127,8 +127,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NumberOnly.cs index 29f5a80e646..55ab016ac3d 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "JustNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - justNumber = new Option(utf8JsonReader.GetDecimal()); + justNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 83f513bc63b..541a621953a 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -180,16 +180,13 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "bars": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - bars = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + bars = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "deprecatedRef": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetDecimal()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "uuid": uuid = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Order.cs index 3dbb629ecf9..8af5defaed7 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Order.cs @@ -217,24 +217,19 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "complete": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - complete = new Option(utf8JsonReader.GetBoolean()); + complete = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "petId": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - petId = new Option(utf8JsonReader.GetInt64()); + petId = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "quantity": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - quantity = new Option(utf8JsonReader.GetInt32()); + quantity = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "shipDate": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "status": string statusRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/OuterComposite.cs index 92ec1939d1a..d366c24ec24 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -160,12 +160,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "my_boolean": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - myBoolean = new Option(utf8JsonReader.GetBoolean()); + myBoolean = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "my_number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - myNumber = new Option(utf8JsonReader.GetDecimal()); + myNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "my_string": myString = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Pet.cs index e4049df78c0..6e741c362d6 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Pet.cs @@ -201,16 +201,13 @@ namespace Org.OpenAPITools.Model name = new Option(utf8JsonReader.GetString()); break; case "photoUrls": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - photoUrls = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + photoUrls = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "category": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "status": string statusRawValue = utf8JsonReader.GetString(); @@ -218,8 +215,7 @@ namespace Org.OpenAPITools.Model status = new Option(PetStatusValueConverter.FromStringOrDefault(statusRawValue)); break; case "tags": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - tags = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + tags = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RequiredClass.cs index 4eb4f6acc58..f7422f86f55 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RequiredClass.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RequiredClass.cs @@ -747,20 +747,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "required_not_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + requiredNotnullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "required_notnullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_enum_integer": string requiredNotnullableEnumIntegerRawValue = utf8JsonReader.GetString(); @@ -786,40 +782,31 @@ namespace Org.OpenAPITools.Model requiredNotnullableStringProp = new Option(utf8JsonReader.GetString()); break; case "required_notnullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + requiredNotnullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "required_notnullableinteger_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + requiredNotnullableintegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "not_required_notnullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "not_required_notnullableinteger_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + notRequiredNotnullableintegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "not_required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "not_required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + notRequiredNullableIntegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_notnullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "notrequired_notnullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_notnullable_enum_integer": string notrequiredNotnullableEnumIntegerRawValue = utf8JsonReader.GetString(); @@ -845,20 +832,16 @@ namespace Org.OpenAPITools.Model notrequiredNotnullableStringProp = new Option(utf8JsonReader.GetString()); break; case "notrequired_notnullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + notrequiredNotnullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "notrequired_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + notrequiredNullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "notrequired_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_nullable_enum_integer": string notrequiredNullableEnumIntegerRawValue = utf8JsonReader.GetString(); @@ -884,24 +867,19 @@ namespace Org.OpenAPITools.Model notrequiredNullableStringProp = new Option(utf8JsonReader.GetString()); break; case "notrequired_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + notrequiredNullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "required_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + requiredNullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_enum_integer": string requiredNullableEnumIntegerRawValue = utf8JsonReader.GetString(); @@ -919,8 +897,7 @@ namespace Org.OpenAPITools.Model requiredNullableEnumString = new Option(RequiredClassRequiredNullableEnumStringValueConverter.FromStringOrDefault(requiredNullableEnumStringRawValue)); break; case "required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + requiredNullableIntegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "required_nullable_outerEnumDefaultValue": string requiredNullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); @@ -931,8 +908,7 @@ namespace Org.OpenAPITools.Model requiredNullableStringProp = new Option(utf8JsonReader.GetString()); break; case "required_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + requiredNullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Return.cs index 6a2c4c85eb4..81211e0ce4a 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Return.cs @@ -169,8 +169,7 @@ namespace Org.OpenAPITools.Model varAbstract = new Option(utf8JsonReader.GetString()); break; case "return": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varReturn = new Option(utf8JsonReader.GetInt32()); + varReturn = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "unsafe": varUnsafe = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RolesReportsHash.cs index 46625cb093a..5b7a88bd659 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RolesReportsHash.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -143,12 +143,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "role": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "role_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - roleUuid = new Option(utf8JsonReader.GetGuid()); + roleUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/SpecialModelName.cs index 7ec3c110c2a..f30e2a11997 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -146,8 +146,7 @@ namespace Org.OpenAPITools.Model varSpecialModelName = new Option(utf8JsonReader.GetString()); break; case "$special[property.name]": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - specialPropertyName = new Option(utf8JsonReader.GetInt64()); + specialPropertyName = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Tag.cs index 4290e8270ff..6b9d5082405 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Tag.cs @@ -143,8 +143,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "name": name = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs index 04d04337aa4..7328caf1ead 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "TestCollectionEndingWithWordList": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - testCollectionEndingWithWordList = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + testCollectionEndingWithWordList = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/User.cs index e89d5845732..a85e556bb9e 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/User.cs @@ -318,12 +318,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "anyTypeProp": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "anyTypePropNullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "email": email = new Option(utf8JsonReader.GetString()); @@ -332,19 +330,16 @@ namespace Org.OpenAPITools.Model firstName = new Option(utf8JsonReader.GetString()); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "lastName": lastName = new Option(utf8JsonReader.GetString()); break; case "objectWithNoDeclaredProps": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "objectWithNoDeclaredPropsNullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "password": password = new Option(utf8JsonReader.GetString()); @@ -353,8 +348,7 @@ namespace Org.OpenAPITools.Model phone = new Option(utf8JsonReader.GetString()); break; case "userStatus": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - userStatus = new Option(utf8JsonReader.GetInt32()); + userStatus = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "username": username = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Whale.cs index 834e6957c67..56da6f6db3c 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/Whale.cs @@ -156,12 +156,10 @@ namespace Org.OpenAPITools.Model className = new Option(utf8JsonReader.GetString()); break; case "hasBaleen": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - hasBaleen = new Option(utf8JsonReader.GetBoolean()); + hasBaleen = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "hasTeeth": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - hasTeeth = new Option(utf8JsonReader.GetBoolean()); + hasTeeth = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Model/Banana.cs index 15899a012af..edf36db227d 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Model/Banana.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "count": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - count = new Option(utf8JsonReader.GetDecimal()); + count = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Activity.cs index a5e4bd35e9b..4562d4ceb72 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Activity.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "activity_outputs": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - activityOutputs = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + activityOutputs = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index d7b4374e6a7..db832150ed9 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -146,8 +146,7 @@ namespace Org.OpenAPITools.Model prop1 = new Option(utf8JsonReader.GetString()); break; case "prop2": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index ec17222fbc8..f70c7a4c5fc 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -246,36 +246,28 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "anytype_1": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "empty_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_of_map_property": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapOfMapProperty = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + mapOfMapProperty = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_property": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapProperty = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapProperty = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_anytype_1": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_anytype_2": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_anytype_3": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype3 = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesAnytype3 = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs index 77ec0bd5ed2..74dbae3c6ba 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -160,8 +160,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "code": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - code = new Option(utf8JsonReader.GetInt32()); + code = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "message": message = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs index 1cc72ecd59d..1a839ecb01b 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs @@ -132,8 +132,7 @@ namespace Org.OpenAPITools.Model cultivar = new Option(utf8JsonReader.GetString()); break; case "mealy": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mealy = new Option(utf8JsonReader.GetBoolean()); + mealy = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index d2398a452ee..cea3f5a4ba5 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "ArrayArrayNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayNumber = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + arrayArrayNumber = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index cce8d5d564b..47bac6ba97c 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "ArrayNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayNumber = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayNumber = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs index 3fbc72e2f5a..1992bf9e932 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -160,16 +160,13 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_array_of_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayOfInteger = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + arrayArrayOfInteger = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_array_of_model": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayOfModel = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + arrayArrayOfModel = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Banana.cs index d92ba4ae6ae..d7b7e8188f7 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Banana.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "lengthCm": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lengthCm = new Option(utf8JsonReader.GetDecimal()); + lengthCm = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs index c9734cbe380..8aa8da44cae 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs @@ -129,12 +129,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "lengthCm": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lengthCm = new Option(utf8JsonReader.GetDecimal()); + lengthCm = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "sweet": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - sweet = new Option(utf8JsonReader.GetBoolean()); + sweet = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Cat.cs index 780c28a972a..9ed61c34f66 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Cat.cs @@ -119,8 +119,7 @@ namespace Org.OpenAPITools.Model color = new Option(utf8JsonReader.GetString()); break; case "declawed": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - declawed = new Option(utf8JsonReader.GetBoolean()); + declawed = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Category.cs index f483d87f36c..7db5ba3129f 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Category.cs @@ -136,8 +136,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "name": name = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs index 1c478cf336d..62ae935e456 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -132,8 +132,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "dateOnlyProperty": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Drawing.cs index a853b96144e..e83b9530376 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Drawing.cs @@ -177,20 +177,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "mainShape": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "nullableShape": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "shapeOrNull": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "shapes": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shapes = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + shapes = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs index b6716a58e53..c107741e961 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -275,8 +275,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_enum": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayEnum = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayEnum = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "just_symbol": string justSymbolRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs index 08e96129872..40d5e275363 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs @@ -744,16 +744,13 @@ namespace Org.OpenAPITools.Model enumStringRequired = new Option(EnumTest.EnumStringRequiredEnumFromStringOrDefault(enumStringRequiredRawValue)); break; case "enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enumInteger = new Option((EnumTest.EnumIntegerEnum)utf8JsonReader.GetInt32()); + enumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (EnumTest.EnumIntegerEnum?)null : (EnumTest.EnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enumIntegerOnly = new Option((EnumTest.EnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + enumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (EnumTest.EnumIntegerOnlyEnum?)null : (EnumTest.EnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "enum_number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enumNumber = new Option((EnumTest.EnumNumberEnum)utf8JsonReader.GetInt32()); + enumNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (EnumTest.EnumNumberEnum?)null : (EnumTest.EnumNumberEnum)utf8JsonReader.GetInt32()); break; case "enum_string": string enumStringRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index f9d9d9f7a7b..76db6338890 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -143,12 +143,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "file": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "files": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - files = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + files = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index c7d04366611..285e193a7e1 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs index 86d63c7ac5f..a4410d55b34 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -665,71 +665,55 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "byte": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "date": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - number = new Option(utf8JsonReader.GetDecimal()); + number = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "password": password = new Option(utf8JsonReader.GetString()); break; case "binary": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "dateTime": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "decimal": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "double": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varDouble = new Option(utf8JsonReader.GetDouble()); + varDouble = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); break; case "float": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varFloat = new Option((float)utf8JsonReader.GetDouble()); + varFloat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble()); break; case "int32": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int32 = new Option(utf8JsonReader.GetInt32()); + int32 = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int32Range": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int32Range = new Option(utf8JsonReader.GetInt32()); + int32Range = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64 = new Option(utf8JsonReader.GetInt64()); + int64 = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "int64Negative": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64Negative = new Option(utf8JsonReader.GetInt32()); + int64Negative = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64NegativeExclusive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64NegativeExclusive = new Option(utf8JsonReader.GetInt32()); + int64NegativeExclusive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64Positive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64Positive = new Option(utf8JsonReader.GetInt32()); + int64Positive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64PositiveExclusive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64PositiveExclusive = new Option(utf8JsonReader.GetInt32()); + int64PositiveExclusive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - integer = new Option(utf8JsonReader.GetInt32()); + integer = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "pattern_with_backslash": patternWithBackslash = new Option(utf8JsonReader.GetString()); @@ -744,16 +728,13 @@ namespace Org.OpenAPITools.Model varString = new Option(utf8JsonReader.GetString()); break; case "unsigned_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - unsignedInteger = new Option(utf8JsonReader.GetUInt32()); + unsignedInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (uint?)null : utf8JsonReader.GetUInt32()); break; case "unsigned_long": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - unsignedLong = new Option(utf8JsonReader.GetUInt64()); + unsignedLong = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (ulong?)null : utf8JsonReader.GetUInt64()); break; case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MapTest.cs index 97588d56888..0af46ec34e4 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MapTest.cs @@ -243,20 +243,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "direct_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - directMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + directMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "indirect_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - indirectMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + indirectMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_map_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapMapOfString = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + mapMapOfString = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_of_enum_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapOfEnumString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapOfEnumString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs index c81de3d2f67..3a559f83119 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "content": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs index 32515bc0440..5e238e0f7b3 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "content": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 3cef3330300..e0462d7c8a2 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -189,20 +189,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "dateTime": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - map = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + map = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "uuid_with_pattern": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuidWithPattern = new Option(utf8JsonReader.GetGuid()); + uuidWithPattern = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs index bf37307ad96..882bf7ccda4 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs @@ -146,8 +146,7 @@ namespace Org.OpenAPITools.Model varClass = new Option(utf8JsonReader.GetString()); break; case "name": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - name = new Option(utf8JsonReader.GetInt32()); + name = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Name.cs index b322aaf568c..dba5779e547 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Name.cs @@ -211,19 +211,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "name": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varName = new Option(utf8JsonReader.GetInt32()); + varName = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "property": property = new Option(utf8JsonReader.GetString()); break; case "snake_case": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - snakeCase = new Option(utf8JsonReader.GetInt32()); + snakeCase = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "123Number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - var123Number = new Option(utf8JsonReader.GetInt32()); + var123Number = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs index ea8abdda0d7..9da49219005 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs @@ -129,12 +129,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "a_objVariableobject": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - aObjVariableobject = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + aObjVariableobject = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "pkiNotificationtestID": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - pkiNotificationtestID = new Option(utf8JsonReader.GetInt32()); + pkiNotificationtestID = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs index 42533f9c7eb..397f12bffbb 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs @@ -323,48 +323,37 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_and_items_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_items_nullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - booleanProp = new Option(utf8JsonReader.GetBoolean()); + booleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - integerProp = new Option(utf8JsonReader.GetInt32()); + integerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "number_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - numberProp = new Option(utf8JsonReader.GetDecimal()); + numberProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "object_and_items_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "object_items_nullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "object_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "string_prop": stringProp = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs index 286d13258dc..6efbeef44dc 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -127,8 +127,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs index 29f5a80e646..55ab016ac3d 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "JustNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - justNumber = new Option(utf8JsonReader.GetDecimal()); + justNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 83f513bc63b..541a621953a 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -180,16 +180,13 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "bars": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - bars = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + bars = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "deprecatedRef": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetDecimal()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "uuid": uuid = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Order.cs index 580ef432ecf..ad31eb6ad14 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Order.cs @@ -299,24 +299,19 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "complete": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - complete = new Option(utf8JsonReader.GetBoolean()); + complete = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "petId": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - petId = new Option(utf8JsonReader.GetInt64()); + petId = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "quantity": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - quantity = new Option(utf8JsonReader.GetInt32()); + quantity = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "shipDate": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "status": string statusRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs index 92ec1939d1a..d366c24ec24 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -160,12 +160,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "my_boolean": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - myBoolean = new Option(utf8JsonReader.GetBoolean()); + myBoolean = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "my_number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - myNumber = new Option(utf8JsonReader.GetDecimal()); + myNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "my_string": myString = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Pet.cs index 81d80e33de7..e8e661445a1 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Pet.cs @@ -283,16 +283,13 @@ namespace Org.OpenAPITools.Model name = new Option(utf8JsonReader.GetString()); break; case "photoUrls": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - photoUrls = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + photoUrls = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "category": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "status": string statusRawValue = utf8JsonReader.GetString(); @@ -300,8 +297,7 @@ namespace Org.OpenAPITools.Model status = new Option(Pet.StatusEnumFromStringOrDefault(statusRawValue)); break; case "tags": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - tags = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + tags = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs index 0990c0ab7a4..fee9ba7f296 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs @@ -1825,28 +1825,22 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "required_not_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + requiredNotnullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "required_notnullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableEnumInteger = new Option((RequiredClass.RequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + requiredNotnullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNotnullableEnumIntegerEnum?)null : (RequiredClass.RequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "required_notnullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableEnumIntegerOnly = new Option((RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + requiredNotnullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum?)null : (RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "required_notnullable_enum_string": string requiredNotnullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1862,48 +1856,37 @@ namespace Org.OpenAPITools.Model requiredNotnullableStringProp = new Option(utf8JsonReader.GetString()); break; case "required_notnullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + requiredNotnullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "required_notnullableinteger_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + requiredNotnullableintegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "not_required_notnullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "not_required_notnullableinteger_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + notRequiredNotnullableintegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "not_required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "not_required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + notRequiredNullableIntegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_notnullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "notrequired_notnullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_notnullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableEnumInteger = new Option((RequiredClass.NotrequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + notrequiredNotnullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNotnullableEnumIntegerEnum?)null : (RequiredClass.NotrequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableEnumIntegerOnly = new Option((RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + notrequiredNotnullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum?)null : (RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_enum_string": string notrequiredNotnullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1919,28 +1902,22 @@ namespace Org.OpenAPITools.Model notrequiredNotnullableStringProp = new Option(utf8JsonReader.GetString()); break; case "notrequired_notnullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + notrequiredNotnullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "notrequired_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + notrequiredNullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "notrequired_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_nullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableEnumInteger = new Option((RequiredClass.NotrequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + notrequiredNullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNullableEnumIntegerEnum?)null : (RequiredClass.NotrequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "notrequired_nullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableEnumIntegerOnly = new Option((RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + notrequiredNullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum?)null : (RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "notrequired_nullable_enum_string": string notrequiredNullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1956,32 +1933,25 @@ namespace Org.OpenAPITools.Model notrequiredNullableStringProp = new Option(utf8JsonReader.GetString()); break; case "notrequired_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + notrequiredNullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "required_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + requiredNullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableEnumInteger = new Option((RequiredClass.RequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + requiredNullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNullableEnumIntegerEnum?)null : (RequiredClass.RequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "required_nullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableEnumIntegerOnly = new Option((RequiredClass.RequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + requiredNullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNullableEnumIntegerOnlyEnum?)null : (RequiredClass.RequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "required_nullable_enum_string": string requiredNullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1989,8 +1959,7 @@ namespace Org.OpenAPITools.Model requiredNullableEnumString = new Option(RequiredClass.RequiredNullableEnumStringEnumFromStringOrDefault(requiredNullableEnumStringRawValue)); break; case "required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + requiredNullableIntegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "required_nullable_outerEnumDefaultValue": string requiredNullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); @@ -2001,8 +1970,7 @@ namespace Org.OpenAPITools.Model requiredNullableStringProp = new Option(utf8JsonReader.GetString()); break; case "required_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + requiredNullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Return.cs index 6a2c4c85eb4..81211e0ce4a 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Return.cs @@ -169,8 +169,7 @@ namespace Org.OpenAPITools.Model varAbstract = new Option(utf8JsonReader.GetString()); break; case "return": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varReturn = new Option(utf8JsonReader.GetInt32()); + varReturn = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "unsafe": varUnsafe = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs index 46625cb093a..5b7a88bd659 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -143,12 +143,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "role": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "role_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - roleUuid = new Option(utf8JsonReader.GetGuid()); + roleUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs index 7ec3c110c2a..f30e2a11997 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -146,8 +146,7 @@ namespace Org.OpenAPITools.Model varSpecialModelName = new Option(utf8JsonReader.GetString()); break; case "$special[property.name]": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - specialPropertyName = new Option(utf8JsonReader.GetInt64()); + specialPropertyName = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Tag.cs index 4290e8270ff..6b9d5082405 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Tag.cs @@ -143,8 +143,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "name": name = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs index 04d04337aa4..7328caf1ead 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "TestCollectionEndingWithWordList": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - testCollectionEndingWithWordList = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + testCollectionEndingWithWordList = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/User.cs index e89d5845732..a85e556bb9e 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/User.cs @@ -318,12 +318,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "anyTypeProp": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "anyTypePropNullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "email": email = new Option(utf8JsonReader.GetString()); @@ -332,19 +330,16 @@ namespace Org.OpenAPITools.Model firstName = new Option(utf8JsonReader.GetString()); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "lastName": lastName = new Option(utf8JsonReader.GetString()); break; case "objectWithNoDeclaredProps": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "objectWithNoDeclaredPropsNullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "password": password = new Option(utf8JsonReader.GetString()); @@ -353,8 +348,7 @@ namespace Org.OpenAPITools.Model phone = new Option(utf8JsonReader.GetString()); break; case "userStatus": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - userStatus = new Option(utf8JsonReader.GetInt32()); + userStatus = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "username": username = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Whale.cs index 834e6957c67..56da6f6db3c 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/Whale.cs @@ -156,12 +156,10 @@ namespace Org.OpenAPITools.Model className = new Option(utf8JsonReader.GetString()); break; case "hasBaleen": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - hasBaleen = new Option(utf8JsonReader.GetBoolean()); + hasBaleen = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "hasTeeth": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - hasTeeth = new Option(utf8JsonReader.GetBoolean()); + hasTeeth = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs index 504c2976b3f..1858ede45ba 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs @@ -145,12 +145,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "now": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - now = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + now = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "today": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - today = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + today = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Model/Adult.cs b/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Model/Adult.cs index 88a0bc9e8ae..e5c016d2627 100644 --- a/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Model/Adult.cs +++ b/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Model/Adult.cs @@ -117,8 +117,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "children": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - children = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + children = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "firstName": firstName = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Model/Child.cs b/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Model/Child.cs index b174729f470..25e989718a6 100644 --- a/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Model/Child.cs +++ b/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Model/Child.cs @@ -134,8 +134,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "age": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - age = new Option(utf8JsonReader.GetInt32()); + age = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "firstName": firstName = new Option(utf8JsonReader.GetString()!); @@ -147,8 +146,7 @@ namespace Org.OpenAPITools.Model type = new Option(utf8JsonReader.GetString()!); break; case "boosterSeat": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - boosterSeat = new Option(utf8JsonReader.GetBoolean()); + boosterSeat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Model/Banana.cs index 66a33723aeb..170ad4b54da 100644 --- a/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Model/Banana.cs @@ -128,8 +128,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "count": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - count = new Option(utf8JsonReader.GetDecimal()); + count = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Model/Banana.cs index 36e0ac854e6..93897bf0b56 100644 --- a/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Model/Banana.cs @@ -127,8 +127,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "count": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - count = new Option(utf8JsonReader.GetDecimal()); + count = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Activity.cs index f9d2680b0ad..aabac63ce19 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Activity.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "activity_outputs": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - activityOutputs = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + activityOutputs = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index f5bcaf71203..1da19734a2d 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -146,8 +146,7 @@ namespace Org.OpenAPITools.Model prop1 = new Option(utf8JsonReader.GetString()); break; case "prop2": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 8d4153d5302..5fa49b8033d 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -246,36 +246,28 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "anytype_1": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "empty_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_of_map_property": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapOfMapProperty = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + mapOfMapProperty = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_property": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapProperty = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapProperty = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_anytype_1": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_anytype_2": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_anytype_3": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype3 = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesAnytype3 = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ApiResponse.cs index 3b185247e44..78ce72e4286 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -160,8 +160,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "code": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - code = new Option(utf8JsonReader.GetInt32()); + code = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "message": message = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/AppleReq.cs index 942640761b2..f9d8cb0178a 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/AppleReq.cs @@ -132,8 +132,7 @@ namespace Org.OpenAPITools.Model cultivar = new Option(utf8JsonReader.GetString()); break; case "mealy": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mealy = new Option(utf8JsonReader.GetBoolean()); + mealy = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index debcff217b9..6bd3d13aec0 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "ArrayArrayNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayNumber = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + arrayArrayNumber = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index ded293438a4..c1fc28e5e87 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "ArrayNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayNumber = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayNumber = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ArrayTest.cs index ee7b94f08bd..24f40349480 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -160,16 +160,13 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_array_of_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayOfInteger = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + arrayArrayOfInteger = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_array_of_model": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayOfModel = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + arrayArrayOfModel = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Banana.cs index 476a1c25352..e0176c9c103 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Banana.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "lengthCm": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lengthCm = new Option(utf8JsonReader.GetDecimal()); + lengthCm = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/BananaReq.cs index a3a0a15428b..dd211ecc28a 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/BananaReq.cs @@ -129,12 +129,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "lengthCm": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lengthCm = new Option(utf8JsonReader.GetDecimal()); + lengthCm = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "sweet": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - sweet = new Option(utf8JsonReader.GetBoolean()); + sweet = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Cat.cs index f424f8ef9d8..6b4b1efcac3 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Cat.cs @@ -119,8 +119,7 @@ namespace Org.OpenAPITools.Model color = new Option(utf8JsonReader.GetString()); break; case "declawed": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - declawed = new Option(utf8JsonReader.GetBoolean()); + declawed = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Category.cs index 9bd38764607..406cff32fdf 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Category.cs @@ -136,8 +136,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "name": name = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/DateOnlyClass.cs index 1f3a3bb8a98..921b1038899 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -132,8 +132,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "dateOnlyProperty": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Drawing.cs index 72e59c9baf4..50db6285888 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Drawing.cs @@ -177,20 +177,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "mainShape": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "nullableShape": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "shapeOrNull": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "shapes": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shapes = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + shapes = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/EnumArrays.cs index 516c952c207..afdb3342ce2 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -143,8 +143,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_enum": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayEnum = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayEnum = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "just_symbol": string justSymbolRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index b4307b69a3b..601c8e99866 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -143,12 +143,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "file": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "files": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - files = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + files = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index 1540483527a..db1b090fa3e 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs index 96902abd13a..7c9c96b05c0 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs @@ -665,71 +665,55 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "byte": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "date": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - number = new Option(utf8JsonReader.GetDecimal()); + number = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "password": password = new Option(utf8JsonReader.GetString()); break; case "binary": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "dateTime": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "decimal": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "double": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varDouble = new Option(utf8JsonReader.GetDouble()); + varDouble = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); break; case "float": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varFloat = new Option((float)utf8JsonReader.GetDouble()); + varFloat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble()); break; case "int32": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int32 = new Option(utf8JsonReader.GetInt32()); + int32 = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int32Range": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int32Range = new Option(utf8JsonReader.GetInt32()); + int32Range = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64 = new Option(utf8JsonReader.GetInt64()); + int64 = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "int64Negative": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64Negative = new Option(utf8JsonReader.GetInt32()); + int64Negative = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64NegativeExclusive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64NegativeExclusive = new Option(utf8JsonReader.GetInt32()); + int64NegativeExclusive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64Positive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64Positive = new Option(utf8JsonReader.GetInt32()); + int64Positive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64PositiveExclusive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64PositiveExclusive = new Option(utf8JsonReader.GetInt32()); + int64PositiveExclusive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - integer = new Option(utf8JsonReader.GetInt32()); + integer = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "pattern_with_backslash": patternWithBackslash = new Option(utf8JsonReader.GetString()); @@ -744,16 +728,13 @@ namespace Org.OpenAPITools.Model varString = new Option(utf8JsonReader.GetString()); break; case "unsigned_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - unsignedInteger = new Option(utf8JsonReader.GetUInt32()); + unsignedInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (uint?)null : utf8JsonReader.GetUInt32()); break; case "unsigned_long": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - unsignedLong = new Option(utf8JsonReader.GetUInt64()); + unsignedLong = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (ulong?)null : utf8JsonReader.GetUInt64()); break; case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MapTest.cs index 101cfb09d2a..d2f562dc62c 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MapTest.cs @@ -177,20 +177,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "direct_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - directMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + directMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "indirect_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - indirectMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + indirectMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_map_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapMapOfString = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + mapMapOfString = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_of_enum_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapOfEnumString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapOfEnumString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedAnyOf.cs index 67435838030..88c96f83b3a 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedAnyOf.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedAnyOf.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "content": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedOneOf.cs index 2467daa6e2b..6049305ccc0 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedOneOf.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedOneOf.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "content": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 808a4b66c6f..2b9dab1b761 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -189,20 +189,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "dateTime": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - map = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + map = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "uuid_with_pattern": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuidWithPattern = new Option(utf8JsonReader.GetGuid()); + uuidWithPattern = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Model200Response.cs index 8e865d8efae..d74cab9a645 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Model200Response.cs @@ -146,8 +146,7 @@ namespace Org.OpenAPITools.Model varClass = new Option(utf8JsonReader.GetString()); break; case "name": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - name = new Option(utf8JsonReader.GetInt32()); + name = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Name.cs index db407f5e355..1ced7be525f 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Name.cs @@ -211,19 +211,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "name": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varName = new Option(utf8JsonReader.GetInt32()); + varName = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "property": property = new Option(utf8JsonReader.GetString()); break; case "snake_case": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - snakeCase = new Option(utf8JsonReader.GetInt32()); + snakeCase = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "123Number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - var123Number = new Option(utf8JsonReader.GetInt32()); + var123Number = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs index ea8abdda0d7..9da49219005 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs @@ -129,12 +129,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "a_objVariableobject": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - aObjVariableobject = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + aObjVariableobject = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "pkiNotificationtestID": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - pkiNotificationtestID = new Option(utf8JsonReader.GetInt32()); + pkiNotificationtestID = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NullableClass.cs index 3b9f00ed666..47b7b40607a 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NullableClass.cs @@ -323,48 +323,37 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_and_items_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_items_nullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - booleanProp = new Option(utf8JsonReader.GetBoolean()); + booleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - integerProp = new Option(utf8JsonReader.GetInt32()); + integerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "number_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - numberProp = new Option(utf8JsonReader.GetDecimal()); + numberProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "object_and_items_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "object_items_nullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "object_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "string_prop": stringProp = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NullableGuidClass.cs index 5f369537bb2..bbc9459f436 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -127,8 +127,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NumberOnly.cs index f720208fafe..55e6045dc21 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "JustNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - justNumber = new Option(utf8JsonReader.GetDecimal()); + justNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 50ad5aef5a1..dc0e8da1083 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -180,16 +180,13 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "bars": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - bars = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + bars = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "deprecatedRef": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetDecimal()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "uuid": uuid = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Order.cs index c9c24d32fc4..0f70b6ee763 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Order.cs @@ -217,24 +217,19 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "complete": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - complete = new Option(utf8JsonReader.GetBoolean()); + complete = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "petId": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - petId = new Option(utf8JsonReader.GetInt64()); + petId = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "quantity": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - quantity = new Option(utf8JsonReader.GetInt32()); + quantity = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "shipDate": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "status": string statusRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/OuterComposite.cs index 5a072449fae..abcca493d7d 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -160,12 +160,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "my_boolean": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - myBoolean = new Option(utf8JsonReader.GetBoolean()); + myBoolean = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "my_number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - myNumber = new Option(utf8JsonReader.GetDecimal()); + myNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "my_string": myString = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Pet.cs index 6b354389b24..294770c56df 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Pet.cs @@ -201,16 +201,13 @@ namespace Org.OpenAPITools.Model name = new Option(utf8JsonReader.GetString()); break; case "photoUrls": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - photoUrls = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + photoUrls = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "category": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "status": string statusRawValue = utf8JsonReader.GetString(); @@ -218,8 +215,7 @@ namespace Org.OpenAPITools.Model status = new Option(PetStatusValueConverter.FromStringOrDefault(statusRawValue)); break; case "tags": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - tags = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + tags = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/RequiredClass.cs index 6465301de4d..8a2fc39d76b 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/RequiredClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/RequiredClass.cs @@ -747,20 +747,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "required_not_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + requiredNotnullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "required_notnullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_enum_integer": string requiredNotnullableEnumIntegerRawValue = utf8JsonReader.GetString(); @@ -786,40 +782,31 @@ namespace Org.OpenAPITools.Model requiredNotnullableStringProp = new Option(utf8JsonReader.GetString()); break; case "required_notnullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + requiredNotnullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "required_notnullableinteger_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + requiredNotnullableintegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "not_required_notnullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "not_required_notnullableinteger_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + notRequiredNotnullableintegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "not_required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "not_required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + notRequiredNullableIntegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_notnullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "notrequired_notnullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_notnullable_enum_integer": string notrequiredNotnullableEnumIntegerRawValue = utf8JsonReader.GetString(); @@ -845,20 +832,16 @@ namespace Org.OpenAPITools.Model notrequiredNotnullableStringProp = new Option(utf8JsonReader.GetString()); break; case "notrequired_notnullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + notrequiredNotnullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "notrequired_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + notrequiredNullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "notrequired_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_nullable_enum_integer": string notrequiredNullableEnumIntegerRawValue = utf8JsonReader.GetString(); @@ -884,24 +867,19 @@ namespace Org.OpenAPITools.Model notrequiredNullableStringProp = new Option(utf8JsonReader.GetString()); break; case "notrequired_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + notrequiredNullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "required_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + requiredNullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_enum_integer": string requiredNullableEnumIntegerRawValue = utf8JsonReader.GetString(); @@ -919,8 +897,7 @@ namespace Org.OpenAPITools.Model requiredNullableEnumString = new Option(RequiredClassRequiredNullableEnumStringValueConverter.FromStringOrDefault(requiredNullableEnumStringRawValue)); break; case "required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + requiredNullableIntegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "required_nullable_outerEnumDefaultValue": string requiredNullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); @@ -931,8 +908,7 @@ namespace Org.OpenAPITools.Model requiredNullableStringProp = new Option(utf8JsonReader.GetString()); break; case "required_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + requiredNullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Return.cs index 9d1fbcfd0f6..fcf8e483d79 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Return.cs @@ -169,8 +169,7 @@ namespace Org.OpenAPITools.Model varAbstract = new Option(utf8JsonReader.GetString()); break; case "return": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varReturn = new Option(utf8JsonReader.GetInt32()); + varReturn = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "unsafe": varUnsafe = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/RolesReportsHash.cs index 749507fe8e0..b9a4a5f9c95 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/RolesReportsHash.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -143,12 +143,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "role": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "role_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - roleUuid = new Option(utf8JsonReader.GetGuid()); + roleUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/SpecialModelName.cs index 08b9d580d9f..25d27479cb9 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -146,8 +146,7 @@ namespace Org.OpenAPITools.Model varSpecialModelName = new Option(utf8JsonReader.GetString()); break; case "$special[property.name]": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - specialPropertyName = new Option(utf8JsonReader.GetInt64()); + specialPropertyName = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Tag.cs index d5fb2f5610a..3ebb619596e 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Tag.cs @@ -143,8 +143,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "name": name = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs index 1936341f8ba..54cbe89d95a 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "TestCollectionEndingWithWordList": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - testCollectionEndingWithWordList = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + testCollectionEndingWithWordList = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/User.cs index 0c2e096925e..62f5b0736d6 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/User.cs @@ -318,12 +318,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "anyTypeProp": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "anyTypePropNullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "email": email = new Option(utf8JsonReader.GetString()); @@ -332,19 +330,16 @@ namespace Org.OpenAPITools.Model firstName = new Option(utf8JsonReader.GetString()); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "lastName": lastName = new Option(utf8JsonReader.GetString()); break; case "objectWithNoDeclaredProps": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "objectWithNoDeclaredPropsNullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "password": password = new Option(utf8JsonReader.GetString()); @@ -353,8 +348,7 @@ namespace Org.OpenAPITools.Model phone = new Option(utf8JsonReader.GetString()); break; case "userStatus": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - userStatus = new Option(utf8JsonReader.GetInt32()); + userStatus = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "username": username = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Whale.cs index a445c5ac182..012c650e4f1 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/Whale.cs @@ -156,12 +156,10 @@ namespace Org.OpenAPITools.Model className = new Option(utf8JsonReader.GetString()); break; case "hasBaleen": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - hasBaleen = new Option(utf8JsonReader.GetBoolean()); + hasBaleen = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "hasTeeth": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - hasTeeth = new Option(utf8JsonReader.GetBoolean()); + hasTeeth = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Activity.cs index 87bc3578658..fd37515f54a 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Activity.cs @@ -128,8 +128,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "activity_outputs": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - activityOutputs = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); + activityOutputs = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index 546931023bb..80ab5ec04b8 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -148,8 +148,7 @@ namespace Org.OpenAPITools.Model prop1 = new Option(utf8JsonReader.GetString()!); break; case "prop2": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 20b8444349b..de2cf7f8484 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -248,36 +248,28 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "anytype_1": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "empty_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_of_map_property": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapOfMapProperty = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); + mapOfMapProperty = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_property": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapProperty = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + mapProperty = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_with_undeclared_properties_anytype_1": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_with_undeclared_properties_anytype_2": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_with_undeclared_properties_anytype_3": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype3 = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + mapWithUndeclaredPropertiesAnytype3 = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_with_undeclared_properties_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + mapWithUndeclaredPropertiesString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ApiResponse.cs index cd20dcc6f2a..c7fa501c3c5 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -162,8 +162,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "code": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - code = new Option(utf8JsonReader.GetInt32()); + code = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "message": message = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/AppleReq.cs index e4d0962e9ef..fdef147cb38 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/AppleReq.cs @@ -134,8 +134,7 @@ namespace Org.OpenAPITools.Model cultivar = new Option(utf8JsonReader.GetString()!); break; case "mealy": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mealy = new Option(utf8JsonReader.GetBoolean()); + mealy = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 9b23c016665..a09872cef81 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -128,8 +128,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "ArrayArrayNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayNumber = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); + arrayArrayNumber = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index cfe30e6ce66..c338f29efc9 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -128,8 +128,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "ArrayNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayNumber = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + arrayNumber = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayTest.cs index 0899aecaee6..04609b24536 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -162,16 +162,13 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_array_of_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayOfInteger = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); + arrayArrayOfInteger = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "array_array_of_model": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayOfModel = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); + arrayArrayOfModel = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + arrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Banana.cs index 308d4078b7f..cf0ee9cdb1a 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Banana.cs @@ -128,8 +128,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "lengthCm": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lengthCm = new Option(utf8JsonReader.GetDecimal()); + lengthCm = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/BananaReq.cs index 46e11565b53..10375771f80 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/BananaReq.cs @@ -131,12 +131,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "lengthCm": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lengthCm = new Option(utf8JsonReader.GetDecimal()); + lengthCm = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "sweet": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - sweet = new Option(utf8JsonReader.GetBoolean()); + sweet = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Cat.cs index 0a879915fc7..4887c6c7aff 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Cat.cs @@ -121,8 +121,7 @@ namespace Org.OpenAPITools.Model color = new Option(utf8JsonReader.GetString()!); break; case "declawed": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - declawed = new Option(utf8JsonReader.GetBoolean()); + declawed = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Category.cs index 96854b6b0e4..936d8dc8b22 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Category.cs @@ -138,8 +138,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "name": name = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/DateOnlyClass.cs index a84805aa801..d908fed19a3 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -134,8 +134,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "dateOnlyProperty": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Drawing.cs index 837b5ef56bf..1668434a783 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Drawing.cs @@ -179,20 +179,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "mainShape": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "nullableShape": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "shapeOrNull": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "shapes": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shapes = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + shapes = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/EnumArrays.cs index 83efec82813..9a6f097e92c 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -277,8 +277,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_enum": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayEnum = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + arrayEnum = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "just_symbol": string? justSymbolRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/EnumTest.cs index 204a7a95d7e..ea7a5bd2698 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/EnumTest.cs @@ -746,16 +746,13 @@ namespace Org.OpenAPITools.Model enumStringRequired = new Option(EnumTest.EnumStringRequiredEnumFromStringOrDefault(enumStringRequiredRawValue)); break; case "enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enumInteger = new Option((EnumTest.EnumIntegerEnum)utf8JsonReader.GetInt32()); + enumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (EnumTest.EnumIntegerEnum?)null : (EnumTest.EnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enumIntegerOnly = new Option((EnumTest.EnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + enumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (EnumTest.EnumIntegerOnlyEnum?)null : (EnumTest.EnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "enum_number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enumNumber = new Option((EnumTest.EnumNumberEnum)utf8JsonReader.GetInt32()); + enumNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (EnumTest.EnumNumberEnum?)null : (EnumTest.EnumNumberEnum)utf8JsonReader.GetInt32()); break; case "enum_string": string? enumStringRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index 7b9bfd4fbeb..971a81e9c8c 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -145,12 +145,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "file": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "files": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - files = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + files = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index 3c5e2512bb0..f4e54444c7e 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -128,8 +128,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FormatTest.cs index 5244065820e..5564d0d3843 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FormatTest.cs @@ -667,71 +667,55 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "byte": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "date": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - number = new Option(utf8JsonReader.GetDecimal()); + number = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "password": password = new Option(utf8JsonReader.GetString()!); break; case "binary": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "dateTime": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "decimal": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "double": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varDouble = new Option(utf8JsonReader.GetDouble()); + varDouble = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); break; case "float": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varFloat = new Option((float)utf8JsonReader.GetDouble()); + varFloat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble()); break; case "int32": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int32 = new Option(utf8JsonReader.GetInt32()); + int32 = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int32Range": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int32Range = new Option(utf8JsonReader.GetInt32()); + int32Range = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64 = new Option(utf8JsonReader.GetInt64()); + int64 = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "int64Negative": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64Negative = new Option(utf8JsonReader.GetInt32()); + int64Negative = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64NegativeExclusive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64NegativeExclusive = new Option(utf8JsonReader.GetInt32()); + int64NegativeExclusive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64Positive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64Positive = new Option(utf8JsonReader.GetInt32()); + int64Positive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64PositiveExclusive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64PositiveExclusive = new Option(utf8JsonReader.GetInt32()); + int64PositiveExclusive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - integer = new Option(utf8JsonReader.GetInt32()); + integer = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "pattern_with_backslash": patternWithBackslash = new Option(utf8JsonReader.GetString()!); @@ -746,16 +730,13 @@ namespace Org.OpenAPITools.Model varString = new Option(utf8JsonReader.GetString()!); break; case "unsigned_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - unsignedInteger = new Option(utf8JsonReader.GetUInt32()); + unsignedInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (uint?)null : utf8JsonReader.GetUInt32()); break; case "unsigned_long": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - unsignedLong = new Option(utf8JsonReader.GetUInt64()); + unsignedLong = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (ulong?)null : utf8JsonReader.GetUInt64()); break; case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MapTest.cs index bba52b3ffbc..06668cf7893 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MapTest.cs @@ -245,20 +245,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "direct_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - directMap = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + directMap = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "indirect_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - indirectMap = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + indirectMap = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_map_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapMapOfString = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); + mapMapOfString = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_of_enum_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapOfEnumString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + mapOfEnumString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedAnyOf.cs index ac4b562eb3e..266cbf7f9d2 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedAnyOf.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedAnyOf.cs @@ -128,8 +128,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "content": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedOneOf.cs index 7a8da4dbed1..4d5b2c6d94c 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedOneOf.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedOneOf.cs @@ -128,8 +128,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "content": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 17ee15eb2f4..968a6476290 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -191,20 +191,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "dateTime": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - map = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + map = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "uuid_with_pattern": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuidWithPattern = new Option(utf8JsonReader.GetGuid()); + uuidWithPattern = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Model200Response.cs index bb28841a9e5..76bffb1856b 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Model200Response.cs @@ -148,8 +148,7 @@ namespace Org.OpenAPITools.Model varClass = new Option(utf8JsonReader.GetString()!); break; case "name": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - name = new Option(utf8JsonReader.GetInt32()); + name = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Name.cs index fb877759c60..100ccfa20e5 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Name.cs @@ -213,19 +213,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "name": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varName = new Option(utf8JsonReader.GetInt32()); + varName = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "property": property = new Option(utf8JsonReader.GetString()!); break; case "snake_case": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - snakeCase = new Option(utf8JsonReader.GetInt32()); + snakeCase = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "123Number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - var123Number = new Option(utf8JsonReader.GetInt32()); + var123Number = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs index f7e59fb345a..fdf9064400f 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs @@ -131,12 +131,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "a_objVariableobject": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - aObjVariableobject = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); + aObjVariableobject = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "pkiNotificationtestID": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - pkiNotificationtestID = new Option(utf8JsonReader.GetInt32()); + pkiNotificationtestID = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NullableClass.cs index 91695a8649d..db7eaa8f675 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NullableClass.cs @@ -325,48 +325,37 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_and_items_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayAndItemsNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayAndItemsNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_items_nullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayItemsNullable = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + arrayItemsNullable = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "array_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - booleanProp = new Option(utf8JsonReader.GetBoolean()); + booleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - integerProp = new Option(utf8JsonReader.GetInt32()); + integerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "number_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - numberProp = new Option(utf8JsonReader.GetDecimal()); + numberProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "object_and_items_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectAndItemsNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectAndItemsNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "object_items_nullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectItemsNullable = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + objectItemsNullable = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "object_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "string_prop": stringProp = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NullableGuidClass.cs index 83619d03114..47db90bf352 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -129,8 +129,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NumberOnly.cs index b52b1cc177f..f7ae912c05e 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -128,8 +128,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "JustNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - justNumber = new Option(utf8JsonReader.GetDecimal()); + justNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index ec6905ea3a7..fa4f88b3ecd 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -182,16 +182,13 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "bars": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - bars = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + bars = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "deprecatedRef": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetDecimal()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "uuid": uuid = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Order.cs index a3e3679fe3d..c4c43309bec 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Order.cs @@ -301,24 +301,19 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "complete": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - complete = new Option(utf8JsonReader.GetBoolean()); + complete = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "petId": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - petId = new Option(utf8JsonReader.GetInt64()); + petId = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "quantity": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - quantity = new Option(utf8JsonReader.GetInt32()); + quantity = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "shipDate": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "status": string? statusRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/OuterComposite.cs index 01d4f3844eb..4428479e048 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -162,12 +162,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "my_boolean": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - myBoolean = new Option(utf8JsonReader.GetBoolean()); + myBoolean = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "my_number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - myNumber = new Option(utf8JsonReader.GetDecimal()); + myNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "my_string": myString = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Pet.cs index 55df1e0579f..56b981a0e2a 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Pet.cs @@ -285,16 +285,13 @@ namespace Org.OpenAPITools.Model name = new Option(utf8JsonReader.GetString()!); break; case "photoUrls": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - photoUrls = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + photoUrls = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "category": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "status": string? statusRawValue = utf8JsonReader.GetString(); @@ -302,8 +299,7 @@ namespace Org.OpenAPITools.Model status = new Option(Pet.StatusEnumFromStringOrDefault(statusRawValue)); break; case "tags": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - tags = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + tags = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/RequiredClass.cs index 15688d958f0..0c7dc7eab56 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/RequiredClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/RequiredClass.cs @@ -1827,28 +1827,22 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "required_not_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + requiredNotnullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "required_notnullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + requiredNotnullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "required_notnullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableEnumInteger = new Option((RequiredClass.RequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + requiredNotnullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNotnullableEnumIntegerEnum?)null : (RequiredClass.RequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "required_notnullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableEnumIntegerOnly = new Option((RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + requiredNotnullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum?)null : (RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "required_notnullable_enum_string": string? requiredNotnullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1864,48 +1858,37 @@ namespace Org.OpenAPITools.Model requiredNotnullableStringProp = new Option(utf8JsonReader.GetString()!); break; case "required_notnullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + requiredNotnullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "required_notnullableinteger_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + requiredNotnullableintegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "not_required_notnullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "not_required_notnullableinteger_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + notRequiredNotnullableintegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "not_required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "not_required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + notRequiredNullableIntegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + notrequiredNotnullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "notrequired_notnullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "notrequired_notnullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_notnullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableEnumInteger = new Option((RequiredClass.NotrequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + notrequiredNotnullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNotnullableEnumIntegerEnum?)null : (RequiredClass.NotrequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableEnumIntegerOnly = new Option((RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + notrequiredNotnullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum?)null : (RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_enum_string": string? notrequiredNotnullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1921,28 +1904,22 @@ namespace Org.OpenAPITools.Model notrequiredNotnullableStringProp = new Option(utf8JsonReader.GetString()!); break; case "notrequired_notnullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + notrequiredNotnullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "notrequired_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + notrequiredNullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "notrequired_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_nullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableEnumInteger = new Option((RequiredClass.NotrequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + notrequiredNullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNullableEnumIntegerEnum?)null : (RequiredClass.NotrequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "notrequired_nullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableEnumIntegerOnly = new Option((RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + notrequiredNullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum?)null : (RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "notrequired_nullable_enum_string": string? notrequiredNullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1958,32 +1935,25 @@ namespace Org.OpenAPITools.Model notrequiredNullableStringProp = new Option(utf8JsonReader.GetString()); break; case "notrequired_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + notrequiredNullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "required_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + requiredNullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableEnumInteger = new Option((RequiredClass.RequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + requiredNullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNullableEnumIntegerEnum?)null : (RequiredClass.RequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "required_nullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableEnumIntegerOnly = new Option((RequiredClass.RequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + requiredNullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNullableEnumIntegerOnlyEnum?)null : (RequiredClass.RequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "required_nullable_enum_string": string? requiredNullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1991,8 +1961,7 @@ namespace Org.OpenAPITools.Model requiredNullableEnumString = new Option(RequiredClass.RequiredNullableEnumStringEnumFromStringOrDefault(requiredNullableEnumStringRawValue)); break; case "required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + requiredNullableIntegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "required_nullable_outerEnumDefaultValue": string? requiredNullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); @@ -2003,8 +1972,7 @@ namespace Org.OpenAPITools.Model requiredNullableStringProp = new Option(utf8JsonReader.GetString()); break; case "required_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + requiredNullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Return.cs index 0d9fe3516e6..6276a3a8c8a 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Return.cs @@ -171,8 +171,7 @@ namespace Org.OpenAPITools.Model varAbstract = new Option(utf8JsonReader.GetString()); break; case "return": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varReturn = new Option(utf8JsonReader.GetInt32()); + varReturn = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "unsafe": varUnsafe = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/RolesReportsHash.cs index d520cfcc9a9..245ea1053e5 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/RolesReportsHash.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -145,12 +145,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "role": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "role_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - roleUuid = new Option(utf8JsonReader.GetGuid()); + roleUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/SpecialModelName.cs index d66e2a9e732..1fce10cd782 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -148,8 +148,7 @@ namespace Org.OpenAPITools.Model varSpecialModelName = new Option(utf8JsonReader.GetString()!); break; case "$special[property.name]": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - specialPropertyName = new Option(utf8JsonReader.GetInt64()); + specialPropertyName = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Tag.cs index 92de05e2d75..a6c404c940b 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Tag.cs @@ -145,8 +145,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "name": name = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs index ed3d3f74081..5cbf9d28f57 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -128,8 +128,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "TestCollectionEndingWithWordList": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - testCollectionEndingWithWordList = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + testCollectionEndingWithWordList = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/User.cs index 7b55e2baf5b..d02f765752f 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/User.cs @@ -320,12 +320,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "anyTypeProp": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "anyTypePropNullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "email": email = new Option(utf8JsonReader.GetString()!); @@ -334,19 +332,16 @@ namespace Org.OpenAPITools.Model firstName = new Option(utf8JsonReader.GetString()!); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "lastName": lastName = new Option(utf8JsonReader.GetString()!); break; case "objectWithNoDeclaredProps": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "objectWithNoDeclaredPropsNullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "password": password = new Option(utf8JsonReader.GetString()!); @@ -355,8 +350,7 @@ namespace Org.OpenAPITools.Model phone = new Option(utf8JsonReader.GetString()!); break; case "userStatus": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - userStatus = new Option(utf8JsonReader.GetInt32()); + userStatus = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "username": username = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Whale.cs index a655c0d30e9..3d5ad4a7d67 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/Whale.cs @@ -158,12 +158,10 @@ namespace Org.OpenAPITools.Model className = new Option(utf8JsonReader.GetString()!); break; case "hasBaleen": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - hasBaleen = new Option(utf8JsonReader.GetBoolean()); + hasBaleen = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "hasTeeth": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - hasTeeth = new Option(utf8JsonReader.GetBoolean()); + hasTeeth = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Model/Banana.cs index 66a33723aeb..170ad4b54da 100644 --- a/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Model/Banana.cs @@ -128,8 +128,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "count": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - count = new Option(utf8JsonReader.GetDecimal()); + count = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Activity.cs index f9d2680b0ad..aabac63ce19 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Activity.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "activity_outputs": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - activityOutputs = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + activityOutputs = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index f5bcaf71203..1da19734a2d 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -146,8 +146,7 @@ namespace Org.OpenAPITools.Model prop1 = new Option(utf8JsonReader.GetString()); break; case "prop2": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 8d4153d5302..5fa49b8033d 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -246,36 +246,28 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "anytype_1": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "empty_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_of_map_property": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapOfMapProperty = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + mapOfMapProperty = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_property": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapProperty = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapProperty = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_anytype_1": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_anytype_2": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_anytype_3": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype3 = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesAnytype3 = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs index 3b185247e44..78ce72e4286 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -160,8 +160,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "code": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - code = new Option(utf8JsonReader.GetInt32()); + code = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "message": message = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs index 942640761b2..f9d8cb0178a 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs @@ -132,8 +132,7 @@ namespace Org.OpenAPITools.Model cultivar = new Option(utf8JsonReader.GetString()); break; case "mealy": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mealy = new Option(utf8JsonReader.GetBoolean()); + mealy = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index debcff217b9..6bd3d13aec0 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "ArrayArrayNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayNumber = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + arrayArrayNumber = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index ded293438a4..c1fc28e5e87 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "ArrayNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayNumber = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayNumber = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs index ee7b94f08bd..24f40349480 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -160,16 +160,13 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_array_of_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayOfInteger = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + arrayArrayOfInteger = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_array_of_model": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayOfModel = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + arrayArrayOfModel = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Banana.cs index 476a1c25352..e0176c9c103 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Banana.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "lengthCm": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lengthCm = new Option(utf8JsonReader.GetDecimal()); + lengthCm = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs index a3a0a15428b..dd211ecc28a 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs @@ -129,12 +129,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "lengthCm": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lengthCm = new Option(utf8JsonReader.GetDecimal()); + lengthCm = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "sweet": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - sweet = new Option(utf8JsonReader.GetBoolean()); + sweet = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Cat.cs index f424f8ef9d8..6b4b1efcac3 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Cat.cs @@ -119,8 +119,7 @@ namespace Org.OpenAPITools.Model color = new Option(utf8JsonReader.GetString()); break; case "declawed": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - declawed = new Option(utf8JsonReader.GetBoolean()); + declawed = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Category.cs index 9bd38764607..406cff32fdf 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Category.cs @@ -136,8 +136,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "name": name = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs index 1f3a3bb8a98..921b1038899 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -132,8 +132,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "dateOnlyProperty": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Drawing.cs index 72e59c9baf4..50db6285888 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Drawing.cs @@ -177,20 +177,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "mainShape": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "nullableShape": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "shapeOrNull": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "shapes": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shapes = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + shapes = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs index 4eb9365b1f5..2a7d6a8a5f4 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -275,8 +275,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_enum": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayEnum = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayEnum = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "just_symbol": string justSymbolRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs index f7a3a20b1b1..b44f96171f5 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs @@ -744,16 +744,13 @@ namespace Org.OpenAPITools.Model enumStringRequired = new Option(EnumTest.EnumStringRequiredEnumFromStringOrDefault(enumStringRequiredRawValue)); break; case "enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enumInteger = new Option((EnumTest.EnumIntegerEnum)utf8JsonReader.GetInt32()); + enumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (EnumTest.EnumIntegerEnum?)null : (EnumTest.EnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enumIntegerOnly = new Option((EnumTest.EnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + enumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (EnumTest.EnumIntegerOnlyEnum?)null : (EnumTest.EnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "enum_number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enumNumber = new Option((EnumTest.EnumNumberEnum)utf8JsonReader.GetInt32()); + enumNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (EnumTest.EnumNumberEnum?)null : (EnumTest.EnumNumberEnum)utf8JsonReader.GetInt32()); break; case "enum_string": string enumStringRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index b4307b69a3b..601c8e99866 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -143,12 +143,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "file": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "files": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - files = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + files = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index 1540483527a..db1b090fa3e 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs index 96902abd13a..7c9c96b05c0 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -665,71 +665,55 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "byte": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "date": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - number = new Option(utf8JsonReader.GetDecimal()); + number = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "password": password = new Option(utf8JsonReader.GetString()); break; case "binary": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "dateTime": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "decimal": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "double": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varDouble = new Option(utf8JsonReader.GetDouble()); + varDouble = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); break; case "float": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varFloat = new Option((float)utf8JsonReader.GetDouble()); + varFloat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble()); break; case "int32": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int32 = new Option(utf8JsonReader.GetInt32()); + int32 = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int32Range": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int32Range = new Option(utf8JsonReader.GetInt32()); + int32Range = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64 = new Option(utf8JsonReader.GetInt64()); + int64 = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "int64Negative": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64Negative = new Option(utf8JsonReader.GetInt32()); + int64Negative = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64NegativeExclusive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64NegativeExclusive = new Option(utf8JsonReader.GetInt32()); + int64NegativeExclusive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64Positive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64Positive = new Option(utf8JsonReader.GetInt32()); + int64Positive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64PositiveExclusive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64PositiveExclusive = new Option(utf8JsonReader.GetInt32()); + int64PositiveExclusive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - integer = new Option(utf8JsonReader.GetInt32()); + integer = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "pattern_with_backslash": patternWithBackslash = new Option(utf8JsonReader.GetString()); @@ -744,16 +728,13 @@ namespace Org.OpenAPITools.Model varString = new Option(utf8JsonReader.GetString()); break; case "unsigned_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - unsignedInteger = new Option(utf8JsonReader.GetUInt32()); + unsignedInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (uint?)null : utf8JsonReader.GetUInt32()); break; case "unsigned_long": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - unsignedLong = new Option(utf8JsonReader.GetUInt64()); + unsignedLong = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (ulong?)null : utf8JsonReader.GetUInt64()); break; case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MapTest.cs index 938d01fec44..796232e12c5 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MapTest.cs @@ -243,20 +243,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "direct_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - directMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + directMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "indirect_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - indirectMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + indirectMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_map_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapMapOfString = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + mapMapOfString = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_of_enum_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapOfEnumString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapOfEnumString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs index 67435838030..88c96f83b3a 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "content": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs index 2467daa6e2b..6049305ccc0 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "content": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 808a4b66c6f..2b9dab1b761 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -189,20 +189,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "dateTime": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - map = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + map = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "uuid_with_pattern": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuidWithPattern = new Option(utf8JsonReader.GetGuid()); + uuidWithPattern = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs index 8e865d8efae..d74cab9a645 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs @@ -146,8 +146,7 @@ namespace Org.OpenAPITools.Model varClass = new Option(utf8JsonReader.GetString()); break; case "name": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - name = new Option(utf8JsonReader.GetInt32()); + name = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Name.cs index db407f5e355..1ced7be525f 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Name.cs @@ -211,19 +211,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "name": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varName = new Option(utf8JsonReader.GetInt32()); + varName = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "property": property = new Option(utf8JsonReader.GetString()); break; case "snake_case": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - snakeCase = new Option(utf8JsonReader.GetInt32()); + snakeCase = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "123Number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - var123Number = new Option(utf8JsonReader.GetInt32()); + var123Number = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs index ea8abdda0d7..9da49219005 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs @@ -129,12 +129,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "a_objVariableobject": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - aObjVariableobject = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + aObjVariableobject = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "pkiNotificationtestID": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - pkiNotificationtestID = new Option(utf8JsonReader.GetInt32()); + pkiNotificationtestID = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs index 3b9f00ed666..47b7b40607a 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs @@ -323,48 +323,37 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_and_items_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_items_nullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - booleanProp = new Option(utf8JsonReader.GetBoolean()); + booleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - integerProp = new Option(utf8JsonReader.GetInt32()); + integerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "number_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - numberProp = new Option(utf8JsonReader.GetDecimal()); + numberProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "object_and_items_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "object_items_nullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "object_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "string_prop": stringProp = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs index 5f369537bb2..bbc9459f436 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -127,8 +127,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs index f720208fafe..55e6045dc21 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "JustNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - justNumber = new Option(utf8JsonReader.GetDecimal()); + justNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 50ad5aef5a1..dc0e8da1083 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -180,16 +180,13 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "bars": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - bars = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + bars = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "deprecatedRef": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetDecimal()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "uuid": uuid = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Order.cs index ee5777aabe7..094096b6350 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Order.cs @@ -299,24 +299,19 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "complete": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - complete = new Option(utf8JsonReader.GetBoolean()); + complete = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "petId": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - petId = new Option(utf8JsonReader.GetInt64()); + petId = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "quantity": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - quantity = new Option(utf8JsonReader.GetInt32()); + quantity = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "shipDate": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "status": string statusRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs index 5a072449fae..abcca493d7d 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -160,12 +160,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "my_boolean": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - myBoolean = new Option(utf8JsonReader.GetBoolean()); + myBoolean = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "my_number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - myNumber = new Option(utf8JsonReader.GetDecimal()); + myNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "my_string": myString = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Pet.cs index 8e7b548b39f..7e8a3d34957 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Pet.cs @@ -283,16 +283,13 @@ namespace Org.OpenAPITools.Model name = new Option(utf8JsonReader.GetString()); break; case "photoUrls": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - photoUrls = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + photoUrls = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "category": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "status": string statusRawValue = utf8JsonReader.GetString(); @@ -300,8 +297,7 @@ namespace Org.OpenAPITools.Model status = new Option(Pet.StatusEnumFromStringOrDefault(statusRawValue)); break; case "tags": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - tags = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + tags = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs index f1483ce9939..6217ae6e679 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs @@ -1825,28 +1825,22 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "required_not_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + requiredNotnullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "required_notnullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableEnumInteger = new Option((RequiredClass.RequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + requiredNotnullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNotnullableEnumIntegerEnum?)null : (RequiredClass.RequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "required_notnullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableEnumIntegerOnly = new Option((RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + requiredNotnullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum?)null : (RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "required_notnullable_enum_string": string requiredNotnullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1862,48 +1856,37 @@ namespace Org.OpenAPITools.Model requiredNotnullableStringProp = new Option(utf8JsonReader.GetString()); break; case "required_notnullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + requiredNotnullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "required_notnullableinteger_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + requiredNotnullableintegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "not_required_notnullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "not_required_notnullableinteger_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + notRequiredNotnullableintegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "not_required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "not_required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + notRequiredNullableIntegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_notnullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "notrequired_notnullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_notnullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableEnumInteger = new Option((RequiredClass.NotrequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + notrequiredNotnullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNotnullableEnumIntegerEnum?)null : (RequiredClass.NotrequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableEnumIntegerOnly = new Option((RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + notrequiredNotnullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum?)null : (RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_enum_string": string notrequiredNotnullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1919,28 +1902,22 @@ namespace Org.OpenAPITools.Model notrequiredNotnullableStringProp = new Option(utf8JsonReader.GetString()); break; case "notrequired_notnullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + notrequiredNotnullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "notrequired_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + notrequiredNullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "notrequired_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_nullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableEnumInteger = new Option((RequiredClass.NotrequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + notrequiredNullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNullableEnumIntegerEnum?)null : (RequiredClass.NotrequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "notrequired_nullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableEnumIntegerOnly = new Option((RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + notrequiredNullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum?)null : (RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "notrequired_nullable_enum_string": string notrequiredNullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1956,32 +1933,25 @@ namespace Org.OpenAPITools.Model notrequiredNullableStringProp = new Option(utf8JsonReader.GetString()); break; case "notrequired_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + notrequiredNullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "required_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + requiredNullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableEnumInteger = new Option((RequiredClass.RequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + requiredNullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNullableEnumIntegerEnum?)null : (RequiredClass.RequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "required_nullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableEnumIntegerOnly = new Option((RequiredClass.RequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + requiredNullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNullableEnumIntegerOnlyEnum?)null : (RequiredClass.RequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "required_nullable_enum_string": string requiredNullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1989,8 +1959,7 @@ namespace Org.OpenAPITools.Model requiredNullableEnumString = new Option(RequiredClass.RequiredNullableEnumStringEnumFromStringOrDefault(requiredNullableEnumStringRawValue)); break; case "required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + requiredNullableIntegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "required_nullable_outerEnumDefaultValue": string requiredNullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); @@ -2001,8 +1970,7 @@ namespace Org.OpenAPITools.Model requiredNullableStringProp = new Option(utf8JsonReader.GetString()); break; case "required_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + requiredNullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Return.cs index 9d1fbcfd0f6..fcf8e483d79 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Return.cs @@ -169,8 +169,7 @@ namespace Org.OpenAPITools.Model varAbstract = new Option(utf8JsonReader.GetString()); break; case "return": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varReturn = new Option(utf8JsonReader.GetInt32()); + varReturn = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "unsafe": varUnsafe = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs index 749507fe8e0..b9a4a5f9c95 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -143,12 +143,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "role": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "role_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - roleUuid = new Option(utf8JsonReader.GetGuid()); + roleUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs index 08b9d580d9f..25d27479cb9 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -146,8 +146,7 @@ namespace Org.OpenAPITools.Model varSpecialModelName = new Option(utf8JsonReader.GetString()); break; case "$special[property.name]": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - specialPropertyName = new Option(utf8JsonReader.GetInt64()); + specialPropertyName = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Tag.cs index d5fb2f5610a..3ebb619596e 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Tag.cs @@ -143,8 +143,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "name": name = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs index 1936341f8ba..54cbe89d95a 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "TestCollectionEndingWithWordList": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - testCollectionEndingWithWordList = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + testCollectionEndingWithWordList = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/User.cs index 0c2e096925e..62f5b0736d6 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/User.cs @@ -318,12 +318,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "anyTypeProp": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "anyTypePropNullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "email": email = new Option(utf8JsonReader.GetString()); @@ -332,19 +330,16 @@ namespace Org.OpenAPITools.Model firstName = new Option(utf8JsonReader.GetString()); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "lastName": lastName = new Option(utf8JsonReader.GetString()); break; case "objectWithNoDeclaredProps": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "objectWithNoDeclaredPropsNullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "password": password = new Option(utf8JsonReader.GetString()); @@ -353,8 +348,7 @@ namespace Org.OpenAPITools.Model phone = new Option(utf8JsonReader.GetString()); break; case "userStatus": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - userStatus = new Option(utf8JsonReader.GetInt32()); + userStatus = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "username": username = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Whale.cs index a445c5ac182..012c650e4f1 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/Whale.cs @@ -156,12 +156,10 @@ namespace Org.OpenAPITools.Model className = new Option(utf8JsonReader.GetString()); break; case "hasBaleen": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - hasBaleen = new Option(utf8JsonReader.GetBoolean()); + hasBaleen = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "hasTeeth": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - hasTeeth = new Option(utf8JsonReader.GetBoolean()); + hasTeeth = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Activity.cs index 97aaf78dd30..65645b2e482 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Activity.cs @@ -129,8 +129,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "activity_outputs": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - activityOutputs = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); + activityOutputs = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index 993b2a750ce..728bbb0c349 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -149,8 +149,7 @@ namespace Org.OpenAPITools.Model prop1 = new Option(utf8JsonReader.GetString()!); break; case "prop2": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index fe4e050f537..9fa35476f70 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -249,36 +249,28 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "anytype_1": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "empty_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_of_map_property": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapOfMapProperty = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); + mapOfMapProperty = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_property": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapProperty = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + mapProperty = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_with_undeclared_properties_anytype_1": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_with_undeclared_properties_anytype_2": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_with_undeclared_properties_anytype_3": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype3 = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + mapWithUndeclaredPropertiesAnytype3 = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_with_undeclared_properties_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + mapWithUndeclaredPropertiesString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ApiResponse.cs index 4ae5d07dcfe..bf92565f9a2 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -163,8 +163,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "code": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - code = new Option(utf8JsonReader.GetInt32()); + code = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "message": message = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/AppleReq.cs index 840e615e228..cbb5ea8f084 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/AppleReq.cs @@ -135,8 +135,7 @@ namespace Org.OpenAPITools.Model cultivar = new Option(utf8JsonReader.GetString()!); break; case "mealy": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mealy = new Option(utf8JsonReader.GetBoolean()); + mealy = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index d27c45fdcd1..cd3309a5900 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -129,8 +129,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "ArrayArrayNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayNumber = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); + arrayArrayNumber = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 72dc6b5327f..90b6e4a8bd1 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -129,8 +129,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "ArrayNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayNumber = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + arrayNumber = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ArrayTest.cs index 947e074e139..6be410aad46 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -163,16 +163,13 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_array_of_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayOfInteger = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); + arrayArrayOfInteger = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "array_array_of_model": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayOfModel = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); + arrayArrayOfModel = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + arrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Banana.cs index 06208194730..1352e54c409 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Banana.cs @@ -129,8 +129,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "lengthCm": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lengthCm = new Option(utf8JsonReader.GetDecimal()); + lengthCm = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/BananaReq.cs index c145e62672f..584505890fd 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/BananaReq.cs @@ -132,12 +132,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "lengthCm": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lengthCm = new Option(utf8JsonReader.GetDecimal()); + lengthCm = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "sweet": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - sweet = new Option(utf8JsonReader.GetBoolean()); + sweet = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Cat.cs index 33e8935a249..00b32d995aa 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Cat.cs @@ -122,8 +122,7 @@ namespace Org.OpenAPITools.Model color = new Option(utf8JsonReader.GetString()!); break; case "declawed": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - declawed = new Option(utf8JsonReader.GetBoolean()); + declawed = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Category.cs index 286d8b6464b..0369f8f37e9 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Category.cs @@ -139,8 +139,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "name": name = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/DateOnlyClass.cs index dfa0a603bb6..8981331c9e1 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -135,8 +135,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "dateOnlyProperty": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Drawing.cs index 1f8cc546232..b6400a09e80 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Drawing.cs @@ -180,20 +180,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "mainShape": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "nullableShape": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "shapeOrNull": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "shapes": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shapes = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + shapes = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/EnumArrays.cs index 809acadd522..5c9774abc41 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -278,8 +278,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_enum": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayEnum = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + arrayEnum = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "just_symbol": string? justSymbolRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/EnumTest.cs index 65adf54ea34..897a9bd24ef 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/EnumTest.cs @@ -747,16 +747,13 @@ namespace Org.OpenAPITools.Model enumStringRequired = new Option(EnumTest.EnumStringRequiredEnumFromStringOrDefault(enumStringRequiredRawValue)); break; case "enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enumInteger = new Option((EnumTest.EnumIntegerEnum)utf8JsonReader.GetInt32()); + enumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (EnumTest.EnumIntegerEnum?)null : (EnumTest.EnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enumIntegerOnly = new Option((EnumTest.EnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + enumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (EnumTest.EnumIntegerOnlyEnum?)null : (EnumTest.EnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "enum_number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enumNumber = new Option((EnumTest.EnumNumberEnum)utf8JsonReader.GetInt32()); + enumNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (EnumTest.EnumNumberEnum?)null : (EnumTest.EnumNumberEnum)utf8JsonReader.GetInt32()); break; case "enum_string": string? enumStringRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index d713d6a161e..d7c977f2fe4 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -146,12 +146,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "file": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "files": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - files = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + files = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index d1d691a8dd2..9f57f4d6318 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -129,8 +129,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FormatTest.cs index d9011f3dbd6..57b32c67f7b 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FormatTest.cs @@ -668,71 +668,55 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "byte": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "date": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - number = new Option(utf8JsonReader.GetDecimal()); + number = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "password": password = new Option(utf8JsonReader.GetString()!); break; case "binary": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "dateTime": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "decimal": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "double": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varDouble = new Option(utf8JsonReader.GetDouble()); + varDouble = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); break; case "float": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varFloat = new Option((float)utf8JsonReader.GetDouble()); + varFloat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble()); break; case "int32": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int32 = new Option(utf8JsonReader.GetInt32()); + int32 = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int32Range": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int32Range = new Option(utf8JsonReader.GetInt32()); + int32Range = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64 = new Option(utf8JsonReader.GetInt64()); + int64 = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "int64Negative": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64Negative = new Option(utf8JsonReader.GetInt32()); + int64Negative = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64NegativeExclusive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64NegativeExclusive = new Option(utf8JsonReader.GetInt32()); + int64NegativeExclusive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64Positive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64Positive = new Option(utf8JsonReader.GetInt32()); + int64Positive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64PositiveExclusive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64PositiveExclusive = new Option(utf8JsonReader.GetInt32()); + int64PositiveExclusive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - integer = new Option(utf8JsonReader.GetInt32()); + integer = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "pattern_with_backslash": patternWithBackslash = new Option(utf8JsonReader.GetString()!); @@ -747,16 +731,13 @@ namespace Org.OpenAPITools.Model varString = new Option(utf8JsonReader.GetString()!); break; case "unsigned_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - unsignedInteger = new Option(utf8JsonReader.GetUInt32()); + unsignedInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (uint?)null : utf8JsonReader.GetUInt32()); break; case "unsigned_long": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - unsignedLong = new Option(utf8JsonReader.GetUInt64()); + unsignedLong = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (ulong?)null : utf8JsonReader.GetUInt64()); break; case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MapTest.cs index cf14472204d..40dee3f1556 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MapTest.cs @@ -246,20 +246,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "direct_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - directMap = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + directMap = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "indirect_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - indirectMap = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + indirectMap = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_map_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapMapOfString = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); + mapMapOfString = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_of_enum_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapOfEnumString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + mapOfEnumString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedAnyOf.cs index cb6c05a7c77..cdac03c3bcf 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedAnyOf.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedAnyOf.cs @@ -129,8 +129,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "content": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedOneOf.cs index 2f8ac2dc1d5..e9f36662dd8 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedOneOf.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedOneOf.cs @@ -129,8 +129,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "content": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index a9e28c2f3e8..3629d644571 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -192,20 +192,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "dateTime": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - map = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + map = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "uuid_with_pattern": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuidWithPattern = new Option(utf8JsonReader.GetGuid()); + uuidWithPattern = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Model200Response.cs index a6022a5f9cc..4b3f421263d 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Model200Response.cs @@ -149,8 +149,7 @@ namespace Org.OpenAPITools.Model varClass = new Option(utf8JsonReader.GetString()!); break; case "name": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - name = new Option(utf8JsonReader.GetInt32()); + name = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Name.cs index 2632fefd0fa..72938274943 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Name.cs @@ -214,19 +214,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "name": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varName = new Option(utf8JsonReader.GetInt32()); + varName = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "property": property = new Option(utf8JsonReader.GetString()!); break; case "snake_case": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - snakeCase = new Option(utf8JsonReader.GetInt32()); + snakeCase = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "123Number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - var123Number = new Option(utf8JsonReader.GetInt32()); + var123Number = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs index e3a042f07ea..212b80559b9 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs @@ -132,12 +132,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "a_objVariableobject": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - aObjVariableobject = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); + aObjVariableobject = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "pkiNotificationtestID": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - pkiNotificationtestID = new Option(utf8JsonReader.GetInt32()); + pkiNotificationtestID = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NullableClass.cs index 97697787aa3..aa2baca6ee3 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NullableClass.cs @@ -326,48 +326,37 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_and_items_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayAndItemsNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayAndItemsNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_items_nullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayItemsNullable = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + arrayItemsNullable = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "array_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - booleanProp = new Option(utf8JsonReader.GetBoolean()); + booleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - integerProp = new Option(utf8JsonReader.GetInt32()); + integerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "number_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - numberProp = new Option(utf8JsonReader.GetDecimal()); + numberProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "object_and_items_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectAndItemsNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectAndItemsNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "object_items_nullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectItemsNullable = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + objectItemsNullable = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "object_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "string_prop": stringProp = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NullableGuidClass.cs index 7db4f508852..d0c107c1a21 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -130,8 +130,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NumberOnly.cs index b33930dee1b..3662647e656 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -129,8 +129,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "JustNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - justNumber = new Option(utf8JsonReader.GetDecimal()); + justNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 72d8feb0ba0..b2fced87757 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -183,16 +183,13 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "bars": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - bars = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + bars = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "deprecatedRef": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetDecimal()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "uuid": uuid = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Order.cs index ad8a7fe42d0..fff55dc03b4 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Order.cs @@ -302,24 +302,19 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "complete": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - complete = new Option(utf8JsonReader.GetBoolean()); + complete = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "petId": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - petId = new Option(utf8JsonReader.GetInt64()); + petId = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "quantity": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - quantity = new Option(utf8JsonReader.GetInt32()); + quantity = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "shipDate": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "status": string? statusRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/OuterComposite.cs index 9e354ba3108..834a7f3516f 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -163,12 +163,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "my_boolean": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - myBoolean = new Option(utf8JsonReader.GetBoolean()); + myBoolean = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "my_number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - myNumber = new Option(utf8JsonReader.GetDecimal()); + myNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "my_string": myString = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Pet.cs index f055e78da6e..fc68eb27a17 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Pet.cs @@ -286,16 +286,13 @@ namespace Org.OpenAPITools.Model name = new Option(utf8JsonReader.GetString()!); break; case "photoUrls": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - photoUrls = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + photoUrls = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "category": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "status": string? statusRawValue = utf8JsonReader.GetString(); @@ -303,8 +300,7 @@ namespace Org.OpenAPITools.Model status = new Option(Pet.StatusEnumFromStringOrDefault(statusRawValue)); break; case "tags": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - tags = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + tags = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/RequiredClass.cs index f8095975d33..074d0e77ee3 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/RequiredClass.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/RequiredClass.cs @@ -1828,28 +1828,22 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "required_not_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + requiredNotnullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "required_notnullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + requiredNotnullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "required_notnullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableEnumInteger = new Option((RequiredClass.RequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + requiredNotnullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNotnullableEnumIntegerEnum?)null : (RequiredClass.RequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "required_notnullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableEnumIntegerOnly = new Option((RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + requiredNotnullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum?)null : (RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "required_notnullable_enum_string": string? requiredNotnullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1865,48 +1859,37 @@ namespace Org.OpenAPITools.Model requiredNotnullableStringProp = new Option(utf8JsonReader.GetString()!); break; case "required_notnullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + requiredNotnullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "required_notnullableinteger_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + requiredNotnullableintegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "not_required_notnullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "not_required_notnullableinteger_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + notRequiredNotnullableintegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "not_required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "not_required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + notRequiredNullableIntegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + notrequiredNotnullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "notrequired_notnullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "notrequired_notnullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_notnullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableEnumInteger = new Option((RequiredClass.NotrequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + notrequiredNotnullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNotnullableEnumIntegerEnum?)null : (RequiredClass.NotrequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableEnumIntegerOnly = new Option((RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + notrequiredNotnullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum?)null : (RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_enum_string": string? notrequiredNotnullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1922,28 +1905,22 @@ namespace Org.OpenAPITools.Model notrequiredNotnullableStringProp = new Option(utf8JsonReader.GetString()!); break; case "notrequired_notnullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + notrequiredNotnullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "notrequired_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + notrequiredNullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "notrequired_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_nullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableEnumInteger = new Option((RequiredClass.NotrequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + notrequiredNullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNullableEnumIntegerEnum?)null : (RequiredClass.NotrequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "notrequired_nullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableEnumIntegerOnly = new Option((RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + notrequiredNullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum?)null : (RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "notrequired_nullable_enum_string": string? notrequiredNullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1959,32 +1936,25 @@ namespace Org.OpenAPITools.Model notrequiredNullableStringProp = new Option(utf8JsonReader.GetString()); break; case "notrequired_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + notrequiredNullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "required_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + requiredNullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableEnumInteger = new Option((RequiredClass.RequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + requiredNullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNullableEnumIntegerEnum?)null : (RequiredClass.RequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "required_nullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableEnumIntegerOnly = new Option((RequiredClass.RequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + requiredNullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNullableEnumIntegerOnlyEnum?)null : (RequiredClass.RequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "required_nullable_enum_string": string? requiredNullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1992,8 +1962,7 @@ namespace Org.OpenAPITools.Model requiredNullableEnumString = new Option(RequiredClass.RequiredNullableEnumStringEnumFromStringOrDefault(requiredNullableEnumStringRawValue)); break; case "required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + requiredNullableIntegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "required_nullable_outerEnumDefaultValue": string? requiredNullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); @@ -2004,8 +1973,7 @@ namespace Org.OpenAPITools.Model requiredNullableStringProp = new Option(utf8JsonReader.GetString()); break; case "required_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + requiredNullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Return.cs index 14b4548c610..1544a23710c 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Return.cs @@ -172,8 +172,7 @@ namespace Org.OpenAPITools.Model varAbstract = new Option(utf8JsonReader.GetString()); break; case "return": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varReturn = new Option(utf8JsonReader.GetInt32()); + varReturn = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "unsafe": varUnsafe = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/RolesReportsHash.cs index 8df9de9ae71..28b65b24ecf 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/RolesReportsHash.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -146,12 +146,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "role": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "role_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - roleUuid = new Option(utf8JsonReader.GetGuid()); + roleUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/SpecialModelName.cs index c72f3539283..0cf9332983f 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -149,8 +149,7 @@ namespace Org.OpenAPITools.Model varSpecialModelName = new Option(utf8JsonReader.GetString()!); break; case "$special[property.name]": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - specialPropertyName = new Option(utf8JsonReader.GetInt64()); + specialPropertyName = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Tag.cs index 9ac29533f72..a350814f2c8 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Tag.cs @@ -146,8 +146,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "name": name = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs index bfc3a14472d..37acae1c88d 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -129,8 +129,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "TestCollectionEndingWithWordList": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - testCollectionEndingWithWordList = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + testCollectionEndingWithWordList = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/User.cs index 6692b4f2509..6af3ab9df35 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/User.cs @@ -321,12 +321,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "anyTypeProp": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "anyTypePropNullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "email": email = new Option(utf8JsonReader.GetString()!); @@ -335,19 +333,16 @@ namespace Org.OpenAPITools.Model firstName = new Option(utf8JsonReader.GetString()!); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "lastName": lastName = new Option(utf8JsonReader.GetString()!); break; case "objectWithNoDeclaredProps": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "objectWithNoDeclaredPropsNullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "password": password = new Option(utf8JsonReader.GetString()!); @@ -356,8 +351,7 @@ namespace Org.OpenAPITools.Model phone = new Option(utf8JsonReader.GetString()!); break; case "userStatus": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - userStatus = new Option(utf8JsonReader.GetInt32()); + userStatus = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "username": username = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Whale.cs index f3f3e60766d..080a4f80402 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/Whale.cs @@ -159,12 +159,10 @@ namespace Org.OpenAPITools.Model className = new Option(utf8JsonReader.GetString()!); break; case "hasBaleen": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - hasBaleen = new Option(utf8JsonReader.GetBoolean()); + hasBaleen = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "hasTeeth": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - hasTeeth = new Option(utf8JsonReader.GetBoolean()); + hasTeeth = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs b/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs index d07559ec527..d81a3689e6e 100644 --- a/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs +++ b/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs @@ -147,12 +147,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "now": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - now = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + now = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "today": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - today = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + today = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/AllOf/src/Org.OpenAPITools/Model/Adult.cs b/samples/client/petstore/csharp/generichost/net9/AllOf/src/Org.OpenAPITools/Model/Adult.cs index 88a0bc9e8ae..e5c016d2627 100644 --- a/samples/client/petstore/csharp/generichost/net9/AllOf/src/Org.OpenAPITools/Model/Adult.cs +++ b/samples/client/petstore/csharp/generichost/net9/AllOf/src/Org.OpenAPITools/Model/Adult.cs @@ -117,8 +117,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "children": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - children = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + children = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "firstName": firstName = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net9/AllOf/src/Org.OpenAPITools/Model/Child.cs b/samples/client/petstore/csharp/generichost/net9/AllOf/src/Org.OpenAPITools/Model/Child.cs index b174729f470..25e989718a6 100644 --- a/samples/client/petstore/csharp/generichost/net9/AllOf/src/Org.OpenAPITools/Model/Child.cs +++ b/samples/client/petstore/csharp/generichost/net9/AllOf/src/Org.OpenAPITools/Model/Child.cs @@ -134,8 +134,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "age": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - age = new Option(utf8JsonReader.GetInt32()); + age = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "firstName": firstName = new Option(utf8JsonReader.GetString()!); @@ -147,8 +146,7 @@ namespace Org.OpenAPITools.Model type = new Option(utf8JsonReader.GetString()!); break; case "boosterSeat": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - boosterSeat = new Option(utf8JsonReader.GetBoolean()); + boosterSeat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/AnyOf/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net9/AnyOf/src/Org.OpenAPITools/Model/Banana.cs index 66a33723aeb..170ad4b54da 100644 --- a/samples/client/petstore/csharp/generichost/net9/AnyOf/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net9/AnyOf/src/Org.OpenAPITools/Model/Banana.cs @@ -128,8 +128,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "count": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - count = new Option(utf8JsonReader.GetDecimal()); + count = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare/src/Org.OpenAPITools/Model/Banana.cs index 36e0ac854e6..93897bf0b56 100644 --- a/samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare/src/Org.OpenAPITools/Model/Banana.cs @@ -127,8 +127,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "count": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - count = new Option(utf8JsonReader.GetDecimal()); + count = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Activity.cs index f9d2680b0ad..aabac63ce19 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Activity.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "activity_outputs": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - activityOutputs = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + activityOutputs = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index f5bcaf71203..1da19734a2d 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -146,8 +146,7 @@ namespace Org.OpenAPITools.Model prop1 = new Option(utf8JsonReader.GetString()); break; case "prop2": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 8d4153d5302..5fa49b8033d 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -246,36 +246,28 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "anytype_1": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "empty_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_of_map_property": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapOfMapProperty = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + mapOfMapProperty = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_property": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapProperty = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapProperty = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_anytype_1": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_anytype_2": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_anytype_3": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype3 = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesAnytype3 = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/ApiResponse.cs index 3b185247e44..78ce72e4286 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -160,8 +160,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "code": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - code = new Option(utf8JsonReader.GetInt32()); + code = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "message": message = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/AppleReq.cs index 942640761b2..f9d8cb0178a 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/AppleReq.cs @@ -132,8 +132,7 @@ namespace Org.OpenAPITools.Model cultivar = new Option(utf8JsonReader.GetString()); break; case "mealy": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mealy = new Option(utf8JsonReader.GetBoolean()); + mealy = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index debcff217b9..6bd3d13aec0 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "ArrayArrayNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayNumber = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + arrayArrayNumber = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index ded293438a4..c1fc28e5e87 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "ArrayNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayNumber = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayNumber = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/ArrayTest.cs index ee7b94f08bd..24f40349480 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -160,16 +160,13 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_array_of_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayOfInteger = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + arrayArrayOfInteger = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_array_of_model": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayOfModel = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + arrayArrayOfModel = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Banana.cs index 476a1c25352..e0176c9c103 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Banana.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "lengthCm": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lengthCm = new Option(utf8JsonReader.GetDecimal()); + lengthCm = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/BananaReq.cs index a3a0a15428b..dd211ecc28a 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/BananaReq.cs @@ -129,12 +129,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "lengthCm": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lengthCm = new Option(utf8JsonReader.GetDecimal()); + lengthCm = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "sweet": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - sweet = new Option(utf8JsonReader.GetBoolean()); + sweet = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Cat.cs index f424f8ef9d8..6b4b1efcac3 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Cat.cs @@ -119,8 +119,7 @@ namespace Org.OpenAPITools.Model color = new Option(utf8JsonReader.GetString()); break; case "declawed": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - declawed = new Option(utf8JsonReader.GetBoolean()); + declawed = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Category.cs index 9bd38764607..406cff32fdf 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Category.cs @@ -136,8 +136,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "name": name = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/DateOnlyClass.cs index 1f3a3bb8a98..921b1038899 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -132,8 +132,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "dateOnlyProperty": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Drawing.cs index 72e59c9baf4..50db6285888 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Drawing.cs @@ -177,20 +177,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "mainShape": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "nullableShape": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "shapeOrNull": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "shapes": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shapes = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + shapes = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/EnumArrays.cs index 516c952c207..afdb3342ce2 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -143,8 +143,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_enum": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayEnum = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayEnum = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "just_symbol": string justSymbolRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index b4307b69a3b..601c8e99866 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -143,12 +143,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "file": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "files": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - files = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + files = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index 1540483527a..db1b090fa3e 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs index 96902abd13a..7c9c96b05c0 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs @@ -665,71 +665,55 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "byte": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "date": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - number = new Option(utf8JsonReader.GetDecimal()); + number = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "password": password = new Option(utf8JsonReader.GetString()); break; case "binary": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "dateTime": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "decimal": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "double": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varDouble = new Option(utf8JsonReader.GetDouble()); + varDouble = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); break; case "float": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varFloat = new Option((float)utf8JsonReader.GetDouble()); + varFloat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble()); break; case "int32": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int32 = new Option(utf8JsonReader.GetInt32()); + int32 = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int32Range": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int32Range = new Option(utf8JsonReader.GetInt32()); + int32Range = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64 = new Option(utf8JsonReader.GetInt64()); + int64 = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "int64Negative": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64Negative = new Option(utf8JsonReader.GetInt32()); + int64Negative = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64NegativeExclusive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64NegativeExclusive = new Option(utf8JsonReader.GetInt32()); + int64NegativeExclusive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64Positive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64Positive = new Option(utf8JsonReader.GetInt32()); + int64Positive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64PositiveExclusive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64PositiveExclusive = new Option(utf8JsonReader.GetInt32()); + int64PositiveExclusive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - integer = new Option(utf8JsonReader.GetInt32()); + integer = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "pattern_with_backslash": patternWithBackslash = new Option(utf8JsonReader.GetString()); @@ -744,16 +728,13 @@ namespace Org.OpenAPITools.Model varString = new Option(utf8JsonReader.GetString()); break; case "unsigned_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - unsignedInteger = new Option(utf8JsonReader.GetUInt32()); + unsignedInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (uint?)null : utf8JsonReader.GetUInt32()); break; case "unsigned_long": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - unsignedLong = new Option(utf8JsonReader.GetUInt64()); + unsignedLong = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (ulong?)null : utf8JsonReader.GetUInt64()); break; case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/MapTest.cs index 101cfb09d2a..d2f562dc62c 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/MapTest.cs @@ -177,20 +177,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "direct_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - directMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + directMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "indirect_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - indirectMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + indirectMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_map_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapMapOfString = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + mapMapOfString = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_of_enum_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapOfEnumString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapOfEnumString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/MixedAnyOf.cs index 67435838030..88c96f83b3a 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/MixedAnyOf.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/MixedAnyOf.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "content": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/MixedOneOf.cs index 2467daa6e2b..6049305ccc0 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/MixedOneOf.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/MixedOneOf.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "content": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 808a4b66c6f..2b9dab1b761 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -189,20 +189,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "dateTime": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - map = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + map = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "uuid_with_pattern": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuidWithPattern = new Option(utf8JsonReader.GetGuid()); + uuidWithPattern = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Model200Response.cs index 8e865d8efae..d74cab9a645 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Model200Response.cs @@ -146,8 +146,7 @@ namespace Org.OpenAPITools.Model varClass = new Option(utf8JsonReader.GetString()); break; case "name": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - name = new Option(utf8JsonReader.GetInt32()); + name = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Name.cs index db407f5e355..1ced7be525f 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Name.cs @@ -211,19 +211,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "name": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varName = new Option(utf8JsonReader.GetInt32()); + varName = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "property": property = new Option(utf8JsonReader.GetString()); break; case "snake_case": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - snakeCase = new Option(utf8JsonReader.GetInt32()); + snakeCase = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "123Number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - var123Number = new Option(utf8JsonReader.GetInt32()); + var123Number = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs index ea8abdda0d7..9da49219005 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs @@ -129,12 +129,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "a_objVariableobject": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - aObjVariableobject = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + aObjVariableobject = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "pkiNotificationtestID": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - pkiNotificationtestID = new Option(utf8JsonReader.GetInt32()); + pkiNotificationtestID = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/NullableClass.cs index 3b9f00ed666..47b7b40607a 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/NullableClass.cs @@ -323,48 +323,37 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_and_items_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_items_nullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - booleanProp = new Option(utf8JsonReader.GetBoolean()); + booleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - integerProp = new Option(utf8JsonReader.GetInt32()); + integerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "number_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - numberProp = new Option(utf8JsonReader.GetDecimal()); + numberProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "object_and_items_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "object_items_nullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "object_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "string_prop": stringProp = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/NullableGuidClass.cs index 5f369537bb2..bbc9459f436 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -127,8 +127,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/NumberOnly.cs index f720208fafe..55e6045dc21 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "JustNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - justNumber = new Option(utf8JsonReader.GetDecimal()); + justNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 50ad5aef5a1..dc0e8da1083 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -180,16 +180,13 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "bars": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - bars = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + bars = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "deprecatedRef": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetDecimal()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "uuid": uuid = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Order.cs index c9c24d32fc4..0f70b6ee763 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Order.cs @@ -217,24 +217,19 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "complete": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - complete = new Option(utf8JsonReader.GetBoolean()); + complete = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "petId": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - petId = new Option(utf8JsonReader.GetInt64()); + petId = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "quantity": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - quantity = new Option(utf8JsonReader.GetInt32()); + quantity = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "shipDate": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "status": string statusRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/OuterComposite.cs index 5a072449fae..abcca493d7d 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -160,12 +160,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "my_boolean": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - myBoolean = new Option(utf8JsonReader.GetBoolean()); + myBoolean = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "my_number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - myNumber = new Option(utf8JsonReader.GetDecimal()); + myNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "my_string": myString = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Pet.cs index 6b354389b24..294770c56df 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Pet.cs @@ -201,16 +201,13 @@ namespace Org.OpenAPITools.Model name = new Option(utf8JsonReader.GetString()); break; case "photoUrls": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - photoUrls = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + photoUrls = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "category": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "status": string statusRawValue = utf8JsonReader.GetString(); @@ -218,8 +215,7 @@ namespace Org.OpenAPITools.Model status = new Option(PetStatusValueConverter.FromStringOrDefault(statusRawValue)); break; case "tags": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - tags = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + tags = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/RequiredClass.cs index 6465301de4d..8a2fc39d76b 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/RequiredClass.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/RequiredClass.cs @@ -747,20 +747,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "required_not_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + requiredNotnullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "required_notnullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_enum_integer": string requiredNotnullableEnumIntegerRawValue = utf8JsonReader.GetString(); @@ -786,40 +782,31 @@ namespace Org.OpenAPITools.Model requiredNotnullableStringProp = new Option(utf8JsonReader.GetString()); break; case "required_notnullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + requiredNotnullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "required_notnullableinteger_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + requiredNotnullableintegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "not_required_notnullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "not_required_notnullableinteger_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + notRequiredNotnullableintegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "not_required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "not_required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + notRequiredNullableIntegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_notnullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "notrequired_notnullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_notnullable_enum_integer": string notrequiredNotnullableEnumIntegerRawValue = utf8JsonReader.GetString(); @@ -845,20 +832,16 @@ namespace Org.OpenAPITools.Model notrequiredNotnullableStringProp = new Option(utf8JsonReader.GetString()); break; case "notrequired_notnullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + notrequiredNotnullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "notrequired_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + notrequiredNullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "notrequired_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_nullable_enum_integer": string notrequiredNullableEnumIntegerRawValue = utf8JsonReader.GetString(); @@ -884,24 +867,19 @@ namespace Org.OpenAPITools.Model notrequiredNullableStringProp = new Option(utf8JsonReader.GetString()); break; case "notrequired_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + notrequiredNullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "required_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + requiredNullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_enum_integer": string requiredNullableEnumIntegerRawValue = utf8JsonReader.GetString(); @@ -919,8 +897,7 @@ namespace Org.OpenAPITools.Model requiredNullableEnumString = new Option(RequiredClassRequiredNullableEnumStringValueConverter.FromStringOrDefault(requiredNullableEnumStringRawValue)); break; case "required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + requiredNullableIntegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "required_nullable_outerEnumDefaultValue": string requiredNullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); @@ -931,8 +908,7 @@ namespace Org.OpenAPITools.Model requiredNullableStringProp = new Option(utf8JsonReader.GetString()); break; case "required_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + requiredNullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Return.cs index 9d1fbcfd0f6..fcf8e483d79 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Return.cs @@ -169,8 +169,7 @@ namespace Org.OpenAPITools.Model varAbstract = new Option(utf8JsonReader.GetString()); break; case "return": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varReturn = new Option(utf8JsonReader.GetInt32()); + varReturn = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "unsafe": varUnsafe = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/RolesReportsHash.cs index 749507fe8e0..b9a4a5f9c95 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/RolesReportsHash.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -143,12 +143,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "role": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "role_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - roleUuid = new Option(utf8JsonReader.GetGuid()); + roleUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/SpecialModelName.cs index 08b9d580d9f..25d27479cb9 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -146,8 +146,7 @@ namespace Org.OpenAPITools.Model varSpecialModelName = new Option(utf8JsonReader.GetString()); break; case "$special[property.name]": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - specialPropertyName = new Option(utf8JsonReader.GetInt64()); + specialPropertyName = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Tag.cs index d5fb2f5610a..3ebb619596e 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Tag.cs @@ -143,8 +143,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "name": name = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs index 1936341f8ba..54cbe89d95a 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "TestCollectionEndingWithWordList": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - testCollectionEndingWithWordList = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + testCollectionEndingWithWordList = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/User.cs index 0c2e096925e..62f5b0736d6 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/User.cs @@ -318,12 +318,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "anyTypeProp": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "anyTypePropNullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "email": email = new Option(utf8JsonReader.GetString()); @@ -332,19 +330,16 @@ namespace Org.OpenAPITools.Model firstName = new Option(utf8JsonReader.GetString()); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "lastName": lastName = new Option(utf8JsonReader.GetString()); break; case "objectWithNoDeclaredProps": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "objectWithNoDeclaredPropsNullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "password": password = new Option(utf8JsonReader.GetString()); @@ -353,8 +348,7 @@ namespace Org.OpenAPITools.Model phone = new Option(utf8JsonReader.GetString()); break; case "userStatus": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - userStatus = new Option(utf8JsonReader.GetInt32()); + userStatus = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "username": username = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Whale.cs index a445c5ac182..012c650e4f1 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/Whale.cs @@ -156,12 +156,10 @@ namespace Org.OpenAPITools.Model className = new Option(utf8JsonReader.GetString()); break; case "hasBaleen": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - hasBaleen = new Option(utf8JsonReader.GetBoolean()); + hasBaleen = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "hasTeeth": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - hasTeeth = new Option(utf8JsonReader.GetBoolean()); + hasTeeth = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Activity.cs index 87bc3578658..fd37515f54a 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Activity.cs @@ -128,8 +128,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "activity_outputs": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - activityOutputs = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); + activityOutputs = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index 546931023bb..80ab5ec04b8 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -148,8 +148,7 @@ namespace Org.OpenAPITools.Model prop1 = new Option(utf8JsonReader.GetString()!); break; case "prop2": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 20b8444349b..de2cf7f8484 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -248,36 +248,28 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "anytype_1": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "empty_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_of_map_property": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapOfMapProperty = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); + mapOfMapProperty = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_property": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapProperty = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + mapProperty = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_with_undeclared_properties_anytype_1": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_with_undeclared_properties_anytype_2": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_with_undeclared_properties_anytype_3": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype3 = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + mapWithUndeclaredPropertiesAnytype3 = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_with_undeclared_properties_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + mapWithUndeclaredPropertiesString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/ApiResponse.cs index cd20dcc6f2a..c7fa501c3c5 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -162,8 +162,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "code": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - code = new Option(utf8JsonReader.GetInt32()); + code = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "message": message = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/AppleReq.cs index e4d0962e9ef..fdef147cb38 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/AppleReq.cs @@ -134,8 +134,7 @@ namespace Org.OpenAPITools.Model cultivar = new Option(utf8JsonReader.GetString()!); break; case "mealy": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mealy = new Option(utf8JsonReader.GetBoolean()); + mealy = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 9b23c016665..a09872cef81 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -128,8 +128,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "ArrayArrayNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayNumber = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); + arrayArrayNumber = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index cfe30e6ce66..c338f29efc9 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -128,8 +128,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "ArrayNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayNumber = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + arrayNumber = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayTest.cs index 0899aecaee6..04609b24536 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -162,16 +162,13 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_array_of_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayOfInteger = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); + arrayArrayOfInteger = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "array_array_of_model": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayOfModel = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); + arrayArrayOfModel = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + arrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Banana.cs index 308d4078b7f..cf0ee9cdb1a 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Banana.cs @@ -128,8 +128,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "lengthCm": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lengthCm = new Option(utf8JsonReader.GetDecimal()); + lengthCm = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/BananaReq.cs index 46e11565b53..10375771f80 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/BananaReq.cs @@ -131,12 +131,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "lengthCm": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lengthCm = new Option(utf8JsonReader.GetDecimal()); + lengthCm = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "sweet": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - sweet = new Option(utf8JsonReader.GetBoolean()); + sweet = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Cat.cs index 0a879915fc7..4887c6c7aff 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Cat.cs @@ -121,8 +121,7 @@ namespace Org.OpenAPITools.Model color = new Option(utf8JsonReader.GetString()!); break; case "declawed": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - declawed = new Option(utf8JsonReader.GetBoolean()); + declawed = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Category.cs index 96854b6b0e4..936d8dc8b22 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Category.cs @@ -138,8 +138,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "name": name = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/DateOnlyClass.cs index a84805aa801..d908fed19a3 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -134,8 +134,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "dateOnlyProperty": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Drawing.cs index 837b5ef56bf..1668434a783 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Drawing.cs @@ -179,20 +179,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "mainShape": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "nullableShape": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "shapeOrNull": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "shapes": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shapes = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + shapes = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/EnumArrays.cs index 83efec82813..9a6f097e92c 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -277,8 +277,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_enum": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayEnum = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + arrayEnum = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "just_symbol": string? justSymbolRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/EnumTest.cs index 204a7a95d7e..ea7a5bd2698 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/EnumTest.cs @@ -746,16 +746,13 @@ namespace Org.OpenAPITools.Model enumStringRequired = new Option(EnumTest.EnumStringRequiredEnumFromStringOrDefault(enumStringRequiredRawValue)); break; case "enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enumInteger = new Option((EnumTest.EnumIntegerEnum)utf8JsonReader.GetInt32()); + enumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (EnumTest.EnumIntegerEnum?)null : (EnumTest.EnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enumIntegerOnly = new Option((EnumTest.EnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + enumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (EnumTest.EnumIntegerOnlyEnum?)null : (EnumTest.EnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "enum_number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enumNumber = new Option((EnumTest.EnumNumberEnum)utf8JsonReader.GetInt32()); + enumNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (EnumTest.EnumNumberEnum?)null : (EnumTest.EnumNumberEnum)utf8JsonReader.GetInt32()); break; case "enum_string": string? enumStringRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index 7b9bfd4fbeb..971a81e9c8c 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -145,12 +145,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "file": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "files": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - files = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + files = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index 3c5e2512bb0..f4e54444c7e 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -128,8 +128,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/FormatTest.cs index 5244065820e..5564d0d3843 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/FormatTest.cs @@ -667,71 +667,55 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "byte": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "date": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - number = new Option(utf8JsonReader.GetDecimal()); + number = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "password": password = new Option(utf8JsonReader.GetString()!); break; case "binary": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "dateTime": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "decimal": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "double": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varDouble = new Option(utf8JsonReader.GetDouble()); + varDouble = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); break; case "float": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varFloat = new Option((float)utf8JsonReader.GetDouble()); + varFloat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble()); break; case "int32": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int32 = new Option(utf8JsonReader.GetInt32()); + int32 = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int32Range": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int32Range = new Option(utf8JsonReader.GetInt32()); + int32Range = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64 = new Option(utf8JsonReader.GetInt64()); + int64 = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "int64Negative": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64Negative = new Option(utf8JsonReader.GetInt32()); + int64Negative = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64NegativeExclusive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64NegativeExclusive = new Option(utf8JsonReader.GetInt32()); + int64NegativeExclusive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64Positive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64Positive = new Option(utf8JsonReader.GetInt32()); + int64Positive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64PositiveExclusive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64PositiveExclusive = new Option(utf8JsonReader.GetInt32()); + int64PositiveExclusive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - integer = new Option(utf8JsonReader.GetInt32()); + integer = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "pattern_with_backslash": patternWithBackslash = new Option(utf8JsonReader.GetString()!); @@ -746,16 +730,13 @@ namespace Org.OpenAPITools.Model varString = new Option(utf8JsonReader.GetString()!); break; case "unsigned_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - unsignedInteger = new Option(utf8JsonReader.GetUInt32()); + unsignedInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (uint?)null : utf8JsonReader.GetUInt32()); break; case "unsigned_long": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - unsignedLong = new Option(utf8JsonReader.GetUInt64()); + unsignedLong = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (ulong?)null : utf8JsonReader.GetUInt64()); break; case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/MapTest.cs index bba52b3ffbc..06668cf7893 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/MapTest.cs @@ -245,20 +245,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "direct_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - directMap = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + directMap = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "indirect_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - indirectMap = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + indirectMap = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_map_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapMapOfString = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); + mapMapOfString = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_of_enum_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapOfEnumString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + mapOfEnumString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedAnyOf.cs index ac4b562eb3e..266cbf7f9d2 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedAnyOf.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedAnyOf.cs @@ -128,8 +128,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "content": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedOneOf.cs index 7a8da4dbed1..4d5b2c6d94c 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedOneOf.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedOneOf.cs @@ -128,8 +128,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "content": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 17ee15eb2f4..968a6476290 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -191,20 +191,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "dateTime": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - map = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + map = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "uuid_with_pattern": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuidWithPattern = new Option(utf8JsonReader.GetGuid()); + uuidWithPattern = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Model200Response.cs index bb28841a9e5..76bffb1856b 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Model200Response.cs @@ -148,8 +148,7 @@ namespace Org.OpenAPITools.Model varClass = new Option(utf8JsonReader.GetString()!); break; case "name": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - name = new Option(utf8JsonReader.GetInt32()); + name = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Name.cs index fb877759c60..100ccfa20e5 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Name.cs @@ -213,19 +213,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "name": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varName = new Option(utf8JsonReader.GetInt32()); + varName = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "property": property = new Option(utf8JsonReader.GetString()!); break; case "snake_case": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - snakeCase = new Option(utf8JsonReader.GetInt32()); + snakeCase = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "123Number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - var123Number = new Option(utf8JsonReader.GetInt32()); + var123Number = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs index f7e59fb345a..fdf9064400f 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs @@ -131,12 +131,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "a_objVariableobject": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - aObjVariableobject = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); + aObjVariableobject = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "pkiNotificationtestID": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - pkiNotificationtestID = new Option(utf8JsonReader.GetInt32()); + pkiNotificationtestID = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/NullableClass.cs index 91695a8649d..db7eaa8f675 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/NullableClass.cs @@ -325,48 +325,37 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_and_items_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayAndItemsNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayAndItemsNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_items_nullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayItemsNullable = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + arrayItemsNullable = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "array_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - booleanProp = new Option(utf8JsonReader.GetBoolean()); + booleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - integerProp = new Option(utf8JsonReader.GetInt32()); + integerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "number_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - numberProp = new Option(utf8JsonReader.GetDecimal()); + numberProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "object_and_items_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectAndItemsNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectAndItemsNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "object_items_nullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectItemsNullable = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + objectItemsNullable = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "object_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "string_prop": stringProp = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/NullableGuidClass.cs index 83619d03114..47db90bf352 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -129,8 +129,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/NumberOnly.cs index b52b1cc177f..f7ae912c05e 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -128,8 +128,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "JustNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - justNumber = new Option(utf8JsonReader.GetDecimal()); + justNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index ec6905ea3a7..fa4f88b3ecd 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -182,16 +182,13 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "bars": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - bars = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + bars = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "deprecatedRef": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetDecimal()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "uuid": uuid = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Order.cs index a3e3679fe3d..c4c43309bec 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Order.cs @@ -301,24 +301,19 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "complete": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - complete = new Option(utf8JsonReader.GetBoolean()); + complete = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "petId": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - petId = new Option(utf8JsonReader.GetInt64()); + petId = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "quantity": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - quantity = new Option(utf8JsonReader.GetInt32()); + quantity = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "shipDate": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "status": string? statusRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/OuterComposite.cs index 01d4f3844eb..4428479e048 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -162,12 +162,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "my_boolean": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - myBoolean = new Option(utf8JsonReader.GetBoolean()); + myBoolean = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "my_number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - myNumber = new Option(utf8JsonReader.GetDecimal()); + myNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "my_string": myString = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Pet.cs index 55df1e0579f..56b981a0e2a 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Pet.cs @@ -285,16 +285,13 @@ namespace Org.OpenAPITools.Model name = new Option(utf8JsonReader.GetString()!); break; case "photoUrls": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - photoUrls = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + photoUrls = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "category": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "status": string? statusRawValue = utf8JsonReader.GetString(); @@ -302,8 +299,7 @@ namespace Org.OpenAPITools.Model status = new Option(Pet.StatusEnumFromStringOrDefault(statusRawValue)); break; case "tags": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - tags = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + tags = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/RequiredClass.cs index 15688d958f0..0c7dc7eab56 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/RequiredClass.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/RequiredClass.cs @@ -1827,28 +1827,22 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "required_not_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + requiredNotnullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "required_notnullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + requiredNotnullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "required_notnullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableEnumInteger = new Option((RequiredClass.RequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + requiredNotnullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNotnullableEnumIntegerEnum?)null : (RequiredClass.RequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "required_notnullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableEnumIntegerOnly = new Option((RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + requiredNotnullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum?)null : (RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "required_notnullable_enum_string": string? requiredNotnullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1864,48 +1858,37 @@ namespace Org.OpenAPITools.Model requiredNotnullableStringProp = new Option(utf8JsonReader.GetString()!); break; case "required_notnullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + requiredNotnullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "required_notnullableinteger_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + requiredNotnullableintegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "not_required_notnullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "not_required_notnullableinteger_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + notRequiredNotnullableintegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "not_required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "not_required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + notRequiredNullableIntegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + notrequiredNotnullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "notrequired_notnullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "notrequired_notnullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_notnullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableEnumInteger = new Option((RequiredClass.NotrequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + notrequiredNotnullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNotnullableEnumIntegerEnum?)null : (RequiredClass.NotrequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableEnumIntegerOnly = new Option((RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + notrequiredNotnullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum?)null : (RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_enum_string": string? notrequiredNotnullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1921,28 +1904,22 @@ namespace Org.OpenAPITools.Model notrequiredNotnullableStringProp = new Option(utf8JsonReader.GetString()!); break; case "notrequired_notnullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + notrequiredNotnullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "notrequired_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + notrequiredNullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "notrequired_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_nullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableEnumInteger = new Option((RequiredClass.NotrequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + notrequiredNullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNullableEnumIntegerEnum?)null : (RequiredClass.NotrequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "notrequired_nullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableEnumIntegerOnly = new Option((RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + notrequiredNullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum?)null : (RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "notrequired_nullable_enum_string": string? notrequiredNullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1958,32 +1935,25 @@ namespace Org.OpenAPITools.Model notrequiredNullableStringProp = new Option(utf8JsonReader.GetString()); break; case "notrequired_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + notrequiredNullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "required_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + requiredNullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableEnumInteger = new Option((RequiredClass.RequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + requiredNullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNullableEnumIntegerEnum?)null : (RequiredClass.RequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "required_nullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableEnumIntegerOnly = new Option((RequiredClass.RequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + requiredNullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNullableEnumIntegerOnlyEnum?)null : (RequiredClass.RequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "required_nullable_enum_string": string? requiredNullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1991,8 +1961,7 @@ namespace Org.OpenAPITools.Model requiredNullableEnumString = new Option(RequiredClass.RequiredNullableEnumStringEnumFromStringOrDefault(requiredNullableEnumStringRawValue)); break; case "required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + requiredNullableIntegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "required_nullable_outerEnumDefaultValue": string? requiredNullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); @@ -2003,8 +1972,7 @@ namespace Org.OpenAPITools.Model requiredNullableStringProp = new Option(utf8JsonReader.GetString()); break; case "required_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + requiredNullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Return.cs index 0d9fe3516e6..6276a3a8c8a 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Return.cs @@ -171,8 +171,7 @@ namespace Org.OpenAPITools.Model varAbstract = new Option(utf8JsonReader.GetString()); break; case "return": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varReturn = new Option(utf8JsonReader.GetInt32()); + varReturn = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "unsafe": varUnsafe = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/RolesReportsHash.cs index d520cfcc9a9..245ea1053e5 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/RolesReportsHash.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -145,12 +145,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "role": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "role_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - roleUuid = new Option(utf8JsonReader.GetGuid()); + roleUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/SpecialModelName.cs index d66e2a9e732..1fce10cd782 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -148,8 +148,7 @@ namespace Org.OpenAPITools.Model varSpecialModelName = new Option(utf8JsonReader.GetString()!); break; case "$special[property.name]": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - specialPropertyName = new Option(utf8JsonReader.GetInt64()); + specialPropertyName = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Tag.cs index 92de05e2d75..a6c404c940b 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Tag.cs @@ -145,8 +145,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "name": name = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs index ed3d3f74081..5cbf9d28f57 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -128,8 +128,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "TestCollectionEndingWithWordList": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - testCollectionEndingWithWordList = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + testCollectionEndingWithWordList = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/User.cs index 7b55e2baf5b..d02f765752f 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/User.cs @@ -320,12 +320,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "anyTypeProp": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "anyTypePropNullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "email": email = new Option(utf8JsonReader.GetString()!); @@ -334,19 +332,16 @@ namespace Org.OpenAPITools.Model firstName = new Option(utf8JsonReader.GetString()!); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "lastName": lastName = new Option(utf8JsonReader.GetString()!); break; case "objectWithNoDeclaredProps": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "objectWithNoDeclaredPropsNullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "password": password = new Option(utf8JsonReader.GetString()!); @@ -355,8 +350,7 @@ namespace Org.OpenAPITools.Model phone = new Option(utf8JsonReader.GetString()!); break; case "userStatus": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - userStatus = new Option(utf8JsonReader.GetInt32()); + userStatus = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "username": username = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Whale.cs index a655c0d30e9..3d5ad4a7d67 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/Whale.cs @@ -158,12 +158,10 @@ namespace Org.OpenAPITools.Model className = new Option(utf8JsonReader.GetString()!); break; case "hasBaleen": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - hasBaleen = new Option(utf8JsonReader.GetBoolean()); + hasBaleen = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "hasTeeth": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - hasTeeth = new Option(utf8JsonReader.GetBoolean()); + hasTeeth = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/OneOf/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net9/OneOf/src/Org.OpenAPITools/Model/Banana.cs index 66a33723aeb..170ad4b54da 100644 --- a/samples/client/petstore/csharp/generichost/net9/OneOf/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net9/OneOf/src/Org.OpenAPITools/Model/Banana.cs @@ -128,8 +128,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "count": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - count = new Option(utf8JsonReader.GetDecimal()); + count = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Activity.cs index f9d2680b0ad..aabac63ce19 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Activity.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "activity_outputs": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - activityOutputs = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + activityOutputs = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index f5bcaf71203..1da19734a2d 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -146,8 +146,7 @@ namespace Org.OpenAPITools.Model prop1 = new Option(utf8JsonReader.GetString()); break; case "prop2": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 8d4153d5302..5fa49b8033d 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -246,36 +246,28 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "anytype_1": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "empty_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_of_map_property": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapOfMapProperty = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + mapOfMapProperty = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_property": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapProperty = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapProperty = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_anytype_1": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_anytype_2": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_anytype_3": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype3 = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesAnytype3 = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs index 3b185247e44..78ce72e4286 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -160,8 +160,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "code": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - code = new Option(utf8JsonReader.GetInt32()); + code = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "message": message = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs index 942640761b2..f9d8cb0178a 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs @@ -132,8 +132,7 @@ namespace Org.OpenAPITools.Model cultivar = new Option(utf8JsonReader.GetString()); break; case "mealy": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mealy = new Option(utf8JsonReader.GetBoolean()); + mealy = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index debcff217b9..6bd3d13aec0 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "ArrayArrayNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayNumber = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + arrayArrayNumber = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index ded293438a4..c1fc28e5e87 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "ArrayNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayNumber = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayNumber = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs index ee7b94f08bd..24f40349480 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -160,16 +160,13 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_array_of_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayOfInteger = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + arrayArrayOfInteger = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_array_of_model": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayOfModel = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + arrayArrayOfModel = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Banana.cs index 476a1c25352..e0176c9c103 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Banana.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "lengthCm": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lengthCm = new Option(utf8JsonReader.GetDecimal()); + lengthCm = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs index a3a0a15428b..dd211ecc28a 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs @@ -129,12 +129,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "lengthCm": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lengthCm = new Option(utf8JsonReader.GetDecimal()); + lengthCm = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "sweet": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - sweet = new Option(utf8JsonReader.GetBoolean()); + sweet = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Cat.cs index f424f8ef9d8..6b4b1efcac3 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Cat.cs @@ -119,8 +119,7 @@ namespace Org.OpenAPITools.Model color = new Option(utf8JsonReader.GetString()); break; case "declawed": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - declawed = new Option(utf8JsonReader.GetBoolean()); + declawed = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Category.cs index 9bd38764607..406cff32fdf 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Category.cs @@ -136,8 +136,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "name": name = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs index 1f3a3bb8a98..921b1038899 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -132,8 +132,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "dateOnlyProperty": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Drawing.cs index 72e59c9baf4..50db6285888 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Drawing.cs @@ -177,20 +177,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "mainShape": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "nullableShape": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "shapeOrNull": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "shapes": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shapes = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + shapes = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs index 4eb9365b1f5..2a7d6a8a5f4 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -275,8 +275,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_enum": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayEnum = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayEnum = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "just_symbol": string justSymbolRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs index f7a3a20b1b1..b44f96171f5 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs @@ -744,16 +744,13 @@ namespace Org.OpenAPITools.Model enumStringRequired = new Option(EnumTest.EnumStringRequiredEnumFromStringOrDefault(enumStringRequiredRawValue)); break; case "enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enumInteger = new Option((EnumTest.EnumIntegerEnum)utf8JsonReader.GetInt32()); + enumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (EnumTest.EnumIntegerEnum?)null : (EnumTest.EnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enumIntegerOnly = new Option((EnumTest.EnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + enumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (EnumTest.EnumIntegerOnlyEnum?)null : (EnumTest.EnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "enum_number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enumNumber = new Option((EnumTest.EnumNumberEnum)utf8JsonReader.GetInt32()); + enumNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (EnumTest.EnumNumberEnum?)null : (EnumTest.EnumNumberEnum)utf8JsonReader.GetInt32()); break; case "enum_string": string enumStringRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index b4307b69a3b..601c8e99866 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -143,12 +143,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "file": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "files": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - files = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + files = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index 1540483527a..db1b090fa3e 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs index 96902abd13a..7c9c96b05c0 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -665,71 +665,55 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "byte": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "date": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - number = new Option(utf8JsonReader.GetDecimal()); + number = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "password": password = new Option(utf8JsonReader.GetString()); break; case "binary": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "dateTime": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "decimal": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "double": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varDouble = new Option(utf8JsonReader.GetDouble()); + varDouble = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); break; case "float": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varFloat = new Option((float)utf8JsonReader.GetDouble()); + varFloat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble()); break; case "int32": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int32 = new Option(utf8JsonReader.GetInt32()); + int32 = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int32Range": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int32Range = new Option(utf8JsonReader.GetInt32()); + int32Range = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64 = new Option(utf8JsonReader.GetInt64()); + int64 = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "int64Negative": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64Negative = new Option(utf8JsonReader.GetInt32()); + int64Negative = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64NegativeExclusive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64NegativeExclusive = new Option(utf8JsonReader.GetInt32()); + int64NegativeExclusive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64Positive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64Positive = new Option(utf8JsonReader.GetInt32()); + int64Positive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64PositiveExclusive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64PositiveExclusive = new Option(utf8JsonReader.GetInt32()); + int64PositiveExclusive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - integer = new Option(utf8JsonReader.GetInt32()); + integer = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "pattern_with_backslash": patternWithBackslash = new Option(utf8JsonReader.GetString()); @@ -744,16 +728,13 @@ namespace Org.OpenAPITools.Model varString = new Option(utf8JsonReader.GetString()); break; case "unsigned_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - unsignedInteger = new Option(utf8JsonReader.GetUInt32()); + unsignedInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (uint?)null : utf8JsonReader.GetUInt32()); break; case "unsigned_long": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - unsignedLong = new Option(utf8JsonReader.GetUInt64()); + unsignedLong = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (ulong?)null : utf8JsonReader.GetUInt64()); break; case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/MapTest.cs index 938d01fec44..796232e12c5 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/MapTest.cs @@ -243,20 +243,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "direct_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - directMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + directMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "indirect_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - indirectMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + indirectMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_map_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapMapOfString = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + mapMapOfString = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_of_enum_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapOfEnumString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapOfEnumString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs index 67435838030..88c96f83b3a 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "content": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs index 2467daa6e2b..6049305ccc0 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "content": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 808a4b66c6f..2b9dab1b761 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -189,20 +189,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "dateTime": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - map = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + map = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "uuid_with_pattern": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuidWithPattern = new Option(utf8JsonReader.GetGuid()); + uuidWithPattern = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs index 8e865d8efae..d74cab9a645 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs @@ -146,8 +146,7 @@ namespace Org.OpenAPITools.Model varClass = new Option(utf8JsonReader.GetString()); break; case "name": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - name = new Option(utf8JsonReader.GetInt32()); + name = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Name.cs index db407f5e355..1ced7be525f 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Name.cs @@ -211,19 +211,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "name": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varName = new Option(utf8JsonReader.GetInt32()); + varName = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "property": property = new Option(utf8JsonReader.GetString()); break; case "snake_case": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - snakeCase = new Option(utf8JsonReader.GetInt32()); + snakeCase = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "123Number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - var123Number = new Option(utf8JsonReader.GetInt32()); + var123Number = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs index ea8abdda0d7..9da49219005 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs @@ -129,12 +129,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "a_objVariableobject": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - aObjVariableobject = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + aObjVariableobject = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "pkiNotificationtestID": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - pkiNotificationtestID = new Option(utf8JsonReader.GetInt32()); + pkiNotificationtestID = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs index 3b9f00ed666..47b7b40607a 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs @@ -323,48 +323,37 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_and_items_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_items_nullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - booleanProp = new Option(utf8JsonReader.GetBoolean()); + booleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - integerProp = new Option(utf8JsonReader.GetInt32()); + integerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "number_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - numberProp = new Option(utf8JsonReader.GetDecimal()); + numberProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "object_and_items_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "object_items_nullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "object_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "string_prop": stringProp = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs index 5f369537bb2..bbc9459f436 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -127,8 +127,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs index f720208fafe..55e6045dc21 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "JustNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - justNumber = new Option(utf8JsonReader.GetDecimal()); + justNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 50ad5aef5a1..dc0e8da1083 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -180,16 +180,13 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "bars": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - bars = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + bars = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "deprecatedRef": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetDecimal()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "uuid": uuid = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Order.cs index ee5777aabe7..094096b6350 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Order.cs @@ -299,24 +299,19 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "complete": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - complete = new Option(utf8JsonReader.GetBoolean()); + complete = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "petId": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - petId = new Option(utf8JsonReader.GetInt64()); + petId = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "quantity": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - quantity = new Option(utf8JsonReader.GetInt32()); + quantity = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "shipDate": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "status": string statusRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs index 5a072449fae..abcca493d7d 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -160,12 +160,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "my_boolean": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - myBoolean = new Option(utf8JsonReader.GetBoolean()); + myBoolean = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "my_number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - myNumber = new Option(utf8JsonReader.GetDecimal()); + myNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "my_string": myString = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Pet.cs index 8e7b548b39f..7e8a3d34957 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Pet.cs @@ -283,16 +283,13 @@ namespace Org.OpenAPITools.Model name = new Option(utf8JsonReader.GetString()); break; case "photoUrls": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - photoUrls = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + photoUrls = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "category": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "status": string statusRawValue = utf8JsonReader.GetString(); @@ -300,8 +297,7 @@ namespace Org.OpenAPITools.Model status = new Option(Pet.StatusEnumFromStringOrDefault(statusRawValue)); break; case "tags": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - tags = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + tags = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs index f1483ce9939..6217ae6e679 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs @@ -1825,28 +1825,22 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "required_not_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + requiredNotnullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "required_notnullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableEnumInteger = new Option((RequiredClass.RequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + requiredNotnullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNotnullableEnumIntegerEnum?)null : (RequiredClass.RequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "required_notnullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableEnumIntegerOnly = new Option((RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + requiredNotnullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum?)null : (RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "required_notnullable_enum_string": string requiredNotnullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1862,48 +1856,37 @@ namespace Org.OpenAPITools.Model requiredNotnullableStringProp = new Option(utf8JsonReader.GetString()); break; case "required_notnullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + requiredNotnullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "required_notnullableinteger_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + requiredNotnullableintegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "not_required_notnullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "not_required_notnullableinteger_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + notRequiredNotnullableintegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "not_required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "not_required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + notRequiredNullableIntegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_notnullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "notrequired_notnullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_notnullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableEnumInteger = new Option((RequiredClass.NotrequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + notrequiredNotnullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNotnullableEnumIntegerEnum?)null : (RequiredClass.NotrequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableEnumIntegerOnly = new Option((RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + notrequiredNotnullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum?)null : (RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_enum_string": string notrequiredNotnullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1919,28 +1902,22 @@ namespace Org.OpenAPITools.Model notrequiredNotnullableStringProp = new Option(utf8JsonReader.GetString()); break; case "notrequired_notnullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + notrequiredNotnullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "notrequired_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + notrequiredNullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "notrequired_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_nullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableEnumInteger = new Option((RequiredClass.NotrequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + notrequiredNullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNullableEnumIntegerEnum?)null : (RequiredClass.NotrequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "notrequired_nullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableEnumIntegerOnly = new Option((RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + notrequiredNullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum?)null : (RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "notrequired_nullable_enum_string": string notrequiredNullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1956,32 +1933,25 @@ namespace Org.OpenAPITools.Model notrequiredNullableStringProp = new Option(utf8JsonReader.GetString()); break; case "notrequired_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + notrequiredNullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "required_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + requiredNullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableEnumInteger = new Option((RequiredClass.RequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + requiredNullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNullableEnumIntegerEnum?)null : (RequiredClass.RequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "required_nullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableEnumIntegerOnly = new Option((RequiredClass.RequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + requiredNullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNullableEnumIntegerOnlyEnum?)null : (RequiredClass.RequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "required_nullable_enum_string": string requiredNullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1989,8 +1959,7 @@ namespace Org.OpenAPITools.Model requiredNullableEnumString = new Option(RequiredClass.RequiredNullableEnumStringEnumFromStringOrDefault(requiredNullableEnumStringRawValue)); break; case "required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + requiredNullableIntegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "required_nullable_outerEnumDefaultValue": string requiredNullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); @@ -2001,8 +1970,7 @@ namespace Org.OpenAPITools.Model requiredNullableStringProp = new Option(utf8JsonReader.GetString()); break; case "required_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + requiredNullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Return.cs index 9d1fbcfd0f6..fcf8e483d79 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Return.cs @@ -169,8 +169,7 @@ namespace Org.OpenAPITools.Model varAbstract = new Option(utf8JsonReader.GetString()); break; case "return": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varReturn = new Option(utf8JsonReader.GetInt32()); + varReturn = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "unsafe": varUnsafe = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs index 749507fe8e0..b9a4a5f9c95 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -143,12 +143,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "role": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "role_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - roleUuid = new Option(utf8JsonReader.GetGuid()); + roleUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs index 08b9d580d9f..25d27479cb9 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -146,8 +146,7 @@ namespace Org.OpenAPITools.Model varSpecialModelName = new Option(utf8JsonReader.GetString()); break; case "$special[property.name]": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - specialPropertyName = new Option(utf8JsonReader.GetInt64()); + specialPropertyName = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Tag.cs index d5fb2f5610a..3ebb619596e 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Tag.cs @@ -143,8 +143,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "name": name = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs index 1936341f8ba..54cbe89d95a 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "TestCollectionEndingWithWordList": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - testCollectionEndingWithWordList = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + testCollectionEndingWithWordList = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/User.cs index 0c2e096925e..62f5b0736d6 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/User.cs @@ -318,12 +318,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "anyTypeProp": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "anyTypePropNullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "email": email = new Option(utf8JsonReader.GetString()); @@ -332,19 +330,16 @@ namespace Org.OpenAPITools.Model firstName = new Option(utf8JsonReader.GetString()); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "lastName": lastName = new Option(utf8JsonReader.GetString()); break; case "objectWithNoDeclaredProps": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "objectWithNoDeclaredPropsNullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "password": password = new Option(utf8JsonReader.GetString()); @@ -353,8 +348,7 @@ namespace Org.OpenAPITools.Model phone = new Option(utf8JsonReader.GetString()); break; case "userStatus": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - userStatus = new Option(utf8JsonReader.GetInt32()); + userStatus = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "username": username = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Whale.cs index a445c5ac182..012c650e4f1 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/Whale.cs @@ -156,12 +156,10 @@ namespace Org.OpenAPITools.Model className = new Option(utf8JsonReader.GetString()); break; case "hasBaleen": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - hasBaleen = new Option(utf8JsonReader.GetBoolean()); + hasBaleen = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "hasTeeth": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - hasTeeth = new Option(utf8JsonReader.GetBoolean()); + hasTeeth = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Activity.cs index 97aaf78dd30..65645b2e482 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Activity.cs @@ -129,8 +129,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "activity_outputs": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - activityOutputs = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); + activityOutputs = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index 993b2a750ce..728bbb0c349 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -149,8 +149,7 @@ namespace Org.OpenAPITools.Model prop1 = new Option(utf8JsonReader.GetString()!); break; case "prop2": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index fe4e050f537..9fa35476f70 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -249,36 +249,28 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "anytype_1": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "empty_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_of_map_property": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapOfMapProperty = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); + mapOfMapProperty = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_property": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapProperty = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + mapProperty = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_with_undeclared_properties_anytype_1": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_with_undeclared_properties_anytype_2": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_with_undeclared_properties_anytype_3": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype3 = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + mapWithUndeclaredPropertiesAnytype3 = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_with_undeclared_properties_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + mapWithUndeclaredPropertiesString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/ApiResponse.cs index 4ae5d07dcfe..bf92565f9a2 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -163,8 +163,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "code": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - code = new Option(utf8JsonReader.GetInt32()); + code = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "message": message = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/AppleReq.cs index 840e615e228..cbb5ea8f084 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/AppleReq.cs @@ -135,8 +135,7 @@ namespace Org.OpenAPITools.Model cultivar = new Option(utf8JsonReader.GetString()!); break; case "mealy": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mealy = new Option(utf8JsonReader.GetBoolean()); + mealy = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index d27c45fdcd1..cd3309a5900 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -129,8 +129,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "ArrayArrayNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayNumber = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); + arrayArrayNumber = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 72dc6b5327f..90b6e4a8bd1 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -129,8 +129,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "ArrayNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayNumber = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + arrayNumber = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/ArrayTest.cs index 947e074e139..6be410aad46 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -163,16 +163,13 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_array_of_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayOfInteger = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); + arrayArrayOfInteger = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "array_array_of_model": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayOfModel = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); + arrayArrayOfModel = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + arrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Banana.cs index 06208194730..1352e54c409 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Banana.cs @@ -129,8 +129,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "lengthCm": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lengthCm = new Option(utf8JsonReader.GetDecimal()); + lengthCm = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/BananaReq.cs index c145e62672f..584505890fd 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/BananaReq.cs @@ -132,12 +132,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "lengthCm": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lengthCm = new Option(utf8JsonReader.GetDecimal()); + lengthCm = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "sweet": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - sweet = new Option(utf8JsonReader.GetBoolean()); + sweet = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Cat.cs index 33e8935a249..00b32d995aa 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Cat.cs @@ -122,8 +122,7 @@ namespace Org.OpenAPITools.Model color = new Option(utf8JsonReader.GetString()!); break; case "declawed": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - declawed = new Option(utf8JsonReader.GetBoolean()); + declawed = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Category.cs index 286d8b6464b..0369f8f37e9 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Category.cs @@ -139,8 +139,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "name": name = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/DateOnlyClass.cs index dfa0a603bb6..8981331c9e1 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -135,8 +135,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "dateOnlyProperty": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Drawing.cs index 1f8cc546232..b6400a09e80 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Drawing.cs @@ -180,20 +180,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "mainShape": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "nullableShape": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "shapeOrNull": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "shapes": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shapes = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + shapes = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/EnumArrays.cs index 809acadd522..5c9774abc41 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -278,8 +278,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_enum": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayEnum = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + arrayEnum = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "just_symbol": string? justSymbolRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/EnumTest.cs index 65adf54ea34..897a9bd24ef 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/EnumTest.cs @@ -747,16 +747,13 @@ namespace Org.OpenAPITools.Model enumStringRequired = new Option(EnumTest.EnumStringRequiredEnumFromStringOrDefault(enumStringRequiredRawValue)); break; case "enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enumInteger = new Option((EnumTest.EnumIntegerEnum)utf8JsonReader.GetInt32()); + enumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (EnumTest.EnumIntegerEnum?)null : (EnumTest.EnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enumIntegerOnly = new Option((EnumTest.EnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + enumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (EnumTest.EnumIntegerOnlyEnum?)null : (EnumTest.EnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "enum_number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enumNumber = new Option((EnumTest.EnumNumberEnum)utf8JsonReader.GetInt32()); + enumNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (EnumTest.EnumNumberEnum?)null : (EnumTest.EnumNumberEnum)utf8JsonReader.GetInt32()); break; case "enum_string": string? enumStringRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index d713d6a161e..d7c977f2fe4 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -146,12 +146,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "file": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "files": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - files = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + files = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index d1d691a8dd2..9f57f4d6318 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -129,8 +129,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/FormatTest.cs index d9011f3dbd6..57b32c67f7b 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/FormatTest.cs @@ -668,71 +668,55 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "byte": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "date": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - number = new Option(utf8JsonReader.GetDecimal()); + number = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "password": password = new Option(utf8JsonReader.GetString()!); break; case "binary": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "dateTime": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "decimal": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "double": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varDouble = new Option(utf8JsonReader.GetDouble()); + varDouble = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); break; case "float": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varFloat = new Option((float)utf8JsonReader.GetDouble()); + varFloat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble()); break; case "int32": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int32 = new Option(utf8JsonReader.GetInt32()); + int32 = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int32Range": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int32Range = new Option(utf8JsonReader.GetInt32()); + int32Range = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64 = new Option(utf8JsonReader.GetInt64()); + int64 = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "int64Negative": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64Negative = new Option(utf8JsonReader.GetInt32()); + int64Negative = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64NegativeExclusive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64NegativeExclusive = new Option(utf8JsonReader.GetInt32()); + int64NegativeExclusive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64Positive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64Positive = new Option(utf8JsonReader.GetInt32()); + int64Positive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64PositiveExclusive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64PositiveExclusive = new Option(utf8JsonReader.GetInt32()); + int64PositiveExclusive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - integer = new Option(utf8JsonReader.GetInt32()); + integer = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "pattern_with_backslash": patternWithBackslash = new Option(utf8JsonReader.GetString()!); @@ -747,16 +731,13 @@ namespace Org.OpenAPITools.Model varString = new Option(utf8JsonReader.GetString()!); break; case "unsigned_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - unsignedInteger = new Option(utf8JsonReader.GetUInt32()); + unsignedInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (uint?)null : utf8JsonReader.GetUInt32()); break; case "unsigned_long": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - unsignedLong = new Option(utf8JsonReader.GetUInt64()); + unsignedLong = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (ulong?)null : utf8JsonReader.GetUInt64()); break; case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/MapTest.cs index cf14472204d..40dee3f1556 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/MapTest.cs @@ -246,20 +246,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "direct_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - directMap = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + directMap = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "indirect_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - indirectMap = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + indirectMap = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_map_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapMapOfString = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); + mapMapOfString = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "map_of_enum_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapOfEnumString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + mapOfEnumString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/MixedAnyOf.cs index cb6c05a7c77..cdac03c3bcf 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/MixedAnyOf.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/MixedAnyOf.cs @@ -129,8 +129,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "content": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/MixedOneOf.cs index 2f8ac2dc1d5..e9f36662dd8 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/MixedOneOf.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/MixedOneOf.cs @@ -129,8 +129,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "content": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index a9e28c2f3e8..3629d644571 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -192,20 +192,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "dateTime": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - map = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + map = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "uuid_with_pattern": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuidWithPattern = new Option(utf8JsonReader.GetGuid()); + uuidWithPattern = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Model200Response.cs index a6022a5f9cc..4b3f421263d 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Model200Response.cs @@ -149,8 +149,7 @@ namespace Org.OpenAPITools.Model varClass = new Option(utf8JsonReader.GetString()!); break; case "name": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - name = new Option(utf8JsonReader.GetInt32()); + name = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Name.cs index 2632fefd0fa..72938274943 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Name.cs @@ -214,19 +214,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "name": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varName = new Option(utf8JsonReader.GetInt32()); + varName = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "property": property = new Option(utf8JsonReader.GetString()!); break; case "snake_case": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - snakeCase = new Option(utf8JsonReader.GetInt32()); + snakeCase = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "123Number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - var123Number = new Option(utf8JsonReader.GetInt32()); + var123Number = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs index e3a042f07ea..212b80559b9 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs @@ -132,12 +132,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "a_objVariableobject": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - aObjVariableobject = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); + aObjVariableobject = new Option>?>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "pkiNotificationtestID": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - pkiNotificationtestID = new Option(utf8JsonReader.GetInt32()); + pkiNotificationtestID = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/NullableClass.cs index 97697787aa3..aa2baca6ee3 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/NullableClass.cs @@ -326,48 +326,37 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_and_items_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayAndItemsNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayAndItemsNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_items_nullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayItemsNullable = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + arrayItemsNullable = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "array_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - booleanProp = new Option(utf8JsonReader.GetBoolean()); + booleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - integerProp = new Option(utf8JsonReader.GetInt32()); + integerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "number_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - numberProp = new Option(utf8JsonReader.GetDecimal()); + numberProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "object_and_items_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectAndItemsNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectAndItemsNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "object_items_nullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectItemsNullable = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + objectItemsNullable = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "object_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectNullableProp = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "string_prop": stringProp = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/NullableGuidClass.cs index 7db4f508852..d0c107c1a21 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -130,8 +130,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/NumberOnly.cs index b33930dee1b..3662647e656 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -129,8 +129,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "JustNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - justNumber = new Option(utf8JsonReader.GetDecimal()); + justNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 72d8feb0ba0..b2fced87757 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -183,16 +183,13 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "bars": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - bars = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + bars = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "deprecatedRef": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetDecimal()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "uuid": uuid = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Order.cs index ad8a7fe42d0..fff55dc03b4 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Order.cs @@ -302,24 +302,19 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "complete": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - complete = new Option(utf8JsonReader.GetBoolean()); + complete = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "petId": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - petId = new Option(utf8JsonReader.GetInt64()); + petId = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "quantity": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - quantity = new Option(utf8JsonReader.GetInt32()); + quantity = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "shipDate": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "status": string? statusRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/OuterComposite.cs index 9e354ba3108..834a7f3516f 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -163,12 +163,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "my_boolean": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - myBoolean = new Option(utf8JsonReader.GetBoolean()); + myBoolean = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "my_number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - myNumber = new Option(utf8JsonReader.GetDecimal()); + myNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "my_string": myString = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Pet.cs index f055e78da6e..fc68eb27a17 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Pet.cs @@ -286,16 +286,13 @@ namespace Org.OpenAPITools.Model name = new Option(utf8JsonReader.GetString()!); break; case "photoUrls": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - photoUrls = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + photoUrls = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "category": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "status": string? statusRawValue = utf8JsonReader.GetString(); @@ -303,8 +300,7 @@ namespace Org.OpenAPITools.Model status = new Option(Pet.StatusEnumFromStringOrDefault(statusRawValue)); break; case "tags": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - tags = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + tags = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/RequiredClass.cs index f8095975d33..074d0e77ee3 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/RequiredClass.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/RequiredClass.cs @@ -1828,28 +1828,22 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "required_not_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + requiredNotnullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "required_notnullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + requiredNotnullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "required_notnullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableEnumInteger = new Option((RequiredClass.RequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + requiredNotnullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNotnullableEnumIntegerEnum?)null : (RequiredClass.RequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "required_notnullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableEnumIntegerOnly = new Option((RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + requiredNotnullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum?)null : (RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "required_notnullable_enum_string": string? requiredNotnullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1865,48 +1859,37 @@ namespace Org.OpenAPITools.Model requiredNotnullableStringProp = new Option(utf8JsonReader.GetString()!); break; case "required_notnullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + requiredNotnullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "required_notnullableinteger_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + requiredNotnullableintegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "not_required_notnullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "not_required_notnullableinteger_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + notRequiredNotnullableintegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "not_required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "not_required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + notRequiredNullableIntegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + notrequiredNotnullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; case "notrequired_notnullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "notrequired_notnullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_notnullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableEnumInteger = new Option((RequiredClass.NotrequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + notrequiredNotnullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNotnullableEnumIntegerEnum?)null : (RequiredClass.NotrequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableEnumIntegerOnly = new Option((RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + notrequiredNotnullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum?)null : (RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_enum_string": string? notrequiredNotnullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1922,28 +1905,22 @@ namespace Org.OpenAPITools.Model notrequiredNotnullableStringProp = new Option(utf8JsonReader.GetString()!); break; case "notrequired_notnullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + notrequiredNotnullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "notrequired_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + notrequiredNullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "notrequired_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_nullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableEnumInteger = new Option((RequiredClass.NotrequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + notrequiredNullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNullableEnumIntegerEnum?)null : (RequiredClass.NotrequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "notrequired_nullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableEnumIntegerOnly = new Option((RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + notrequiredNullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum?)null : (RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "notrequired_nullable_enum_string": string? notrequiredNullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1959,32 +1936,25 @@ namespace Org.OpenAPITools.Model notrequiredNullableStringProp = new Option(utf8JsonReader.GetString()); break; case "notrequired_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + notrequiredNullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "required_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableArrayOfString = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + requiredNullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableEnumInteger = new Option((RequiredClass.RequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + requiredNullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNullableEnumIntegerEnum?)null : (RequiredClass.RequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "required_nullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableEnumIntegerOnly = new Option((RequiredClass.RequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + requiredNullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNullableEnumIntegerOnlyEnum?)null : (RequiredClass.RequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "required_nullable_enum_string": string? requiredNullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1992,8 +1962,7 @@ namespace Org.OpenAPITools.Model requiredNullableEnumString = new Option(RequiredClass.RequiredNullableEnumStringEnumFromStringOrDefault(requiredNullableEnumStringRawValue)); break; case "required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + requiredNullableIntegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "required_nullable_outerEnumDefaultValue": string? requiredNullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); @@ -2004,8 +1973,7 @@ namespace Org.OpenAPITools.Model requiredNullableStringProp = new Option(utf8JsonReader.GetString()); break; case "required_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + requiredNullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Return.cs index 14b4548c610..1544a23710c 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Return.cs @@ -172,8 +172,7 @@ namespace Org.OpenAPITools.Model varAbstract = new Option(utf8JsonReader.GetString()); break; case "return": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varReturn = new Option(utf8JsonReader.GetInt32()); + varReturn = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "unsafe": varUnsafe = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/RolesReportsHash.cs index 8df9de9ae71..28b65b24ecf 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/RolesReportsHash.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -146,12 +146,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "role": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "role_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - roleUuid = new Option(utf8JsonReader.GetGuid()); + roleUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/SpecialModelName.cs index c72f3539283..0cf9332983f 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -149,8 +149,7 @@ namespace Org.OpenAPITools.Model varSpecialModelName = new Option(utf8JsonReader.GetString()!); break; case "$special[property.name]": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - specialPropertyName = new Option(utf8JsonReader.GetInt64()); + specialPropertyName = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Tag.cs index 9ac29533f72..a350814f2c8 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Tag.cs @@ -146,8 +146,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "name": name = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs index bfc3a14472d..37acae1c88d 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -129,8 +129,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "TestCollectionEndingWithWordList": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - testCollectionEndingWithWordList = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); + testCollectionEndingWithWordList = new Option?>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)!); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/User.cs index 6692b4f2509..6af3ab9df35 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/User.cs @@ -321,12 +321,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "anyTypeProp": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "anyTypePropNullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "email": email = new Option(utf8JsonReader.GetString()!); @@ -335,19 +333,16 @@ namespace Org.OpenAPITools.Model firstName = new Option(utf8JsonReader.GetString()!); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "lastName": lastName = new Option(utf8JsonReader.GetString()!); break; case "objectWithNoDeclaredProps": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); + objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; case "objectWithNoDeclaredPropsNullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "password": password = new Option(utf8JsonReader.GetString()!); @@ -356,8 +351,7 @@ namespace Org.OpenAPITools.Model phone = new Option(utf8JsonReader.GetString()!); break; case "userStatus": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - userStatus = new Option(utf8JsonReader.GetInt32()); + userStatus = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "username": username = new Option(utf8JsonReader.GetString()!); diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Whale.cs index f3f3e60766d..080a4f80402 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/Whale.cs @@ -159,12 +159,10 @@ namespace Org.OpenAPITools.Model className = new Option(utf8JsonReader.GetString()!); break; case "hasBaleen": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - hasBaleen = new Option(utf8JsonReader.GetBoolean()); + hasBaleen = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "hasTeeth": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - hasTeeth = new Option(utf8JsonReader.GetBoolean()); + hasTeeth = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/net9/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs b/samples/client/petstore/csharp/generichost/net9/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs index d07559ec527..d81a3689e6e 100644 --- a/samples/client/petstore/csharp/generichost/net9/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs +++ b/samples/client/petstore/csharp/generichost/net9/UseDateTimeForDate/src/Org.OpenAPITools/Model/NowGet200Response.cs @@ -147,12 +147,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "now": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - now = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + now = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "today": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - today = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + today = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Activity.cs index a5e4bd35e9b..4562d4ceb72 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Activity.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "activity_outputs": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - activityOutputs = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + activityOutputs = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index d7b4374e6a7..db832150ed9 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -146,8 +146,7 @@ namespace Org.OpenAPITools.Model prop1 = new Option(utf8JsonReader.GetString()); break; case "prop2": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + prop2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index ec17222fbc8..f70c7a4c5fc 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -246,36 +246,28 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "anytype_1": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "empty_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + emptyMap = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_of_map_property": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapOfMapProperty = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + mapOfMapProperty = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_property": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapProperty = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapProperty = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_anytype_1": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesAnytype1 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_anytype_2": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesAnytype2 = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_anytype_3": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesAnytype3 = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesAnytype3 = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_with_undeclared_properties_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapWithUndeclaredPropertiesString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapWithUndeclaredPropertiesString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs index 77ec0bd5ed2..74dbae3c6ba 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -160,8 +160,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "code": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - code = new Option(utf8JsonReader.GetInt32()); + code = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "message": message = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs index 1cc72ecd59d..1a839ecb01b 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/AppleReq.cs @@ -132,8 +132,7 @@ namespace Org.OpenAPITools.Model cultivar = new Option(utf8JsonReader.GetString()); break; case "mealy": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mealy = new Option(utf8JsonReader.GetBoolean()); + mealy = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index d2398a452ee..cea3f5a4ba5 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "ArrayArrayNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayNumber = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + arrayArrayNumber = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index cce8d5d564b..47bac6ba97c 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "ArrayNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayNumber = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayNumber = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs index 3fbc72e2f5a..1992bf9e932 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -160,16 +160,13 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_array_of_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayOfInteger = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + arrayArrayOfInteger = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_array_of_model": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayArrayOfModel = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + arrayArrayOfModel = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Banana.cs index d92ba4ae6ae..d7b7e8188f7 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Banana.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "lengthCm": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lengthCm = new Option(utf8JsonReader.GetDecimal()); + lengthCm = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs index c9734cbe380..8aa8da44cae 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/BananaReq.cs @@ -129,12 +129,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "lengthCm": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - lengthCm = new Option(utf8JsonReader.GetDecimal()); + lengthCm = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "sweet": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - sweet = new Option(utf8JsonReader.GetBoolean()); + sweet = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Cat.cs index 780c28a972a..9ed61c34f66 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Cat.cs @@ -119,8 +119,7 @@ namespace Org.OpenAPITools.Model color = new Option(utf8JsonReader.GetString()); break; case "declawed": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - declawed = new Option(utf8JsonReader.GetBoolean()); + declawed = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Category.cs index f483d87f36c..7db5ba3129f 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Category.cs @@ -136,8 +136,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "name": name = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs index 1c478cf336d..62ae935e456 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -132,8 +132,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "dateOnlyProperty": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateOnlyProperty = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Drawing.cs index a853b96144e..e83b9530376 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Drawing.cs @@ -177,20 +177,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "mainShape": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + mainShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "nullableShape": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + nullableShape = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "shapeOrNull": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + shapeOrNull = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "shapes": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shapes = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + shapes = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs index b6716a58e53..c107741e961 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -275,8 +275,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_enum": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayEnum = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayEnum = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "just_symbol": string justSymbolRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs index 08e96129872..40d5e275363 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/EnumTest.cs @@ -744,16 +744,13 @@ namespace Org.OpenAPITools.Model enumStringRequired = new Option(EnumTest.EnumStringRequiredEnumFromStringOrDefault(enumStringRequiredRawValue)); break; case "enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enumInteger = new Option((EnumTest.EnumIntegerEnum)utf8JsonReader.GetInt32()); + enumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (EnumTest.EnumIntegerEnum?)null : (EnumTest.EnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enumIntegerOnly = new Option((EnumTest.EnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + enumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (EnumTest.EnumIntegerOnlyEnum?)null : (EnumTest.EnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "enum_number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - enumNumber = new Option((EnumTest.EnumNumberEnum)utf8JsonReader.GetInt32()); + enumNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (EnumTest.EnumNumberEnum?)null : (EnumTest.EnumNumberEnum)utf8JsonReader.GetInt32()); break; case "enum_string": string enumStringRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index f9d9d9f7a7b..76db6338890 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -143,12 +143,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "file": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + file = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "files": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - files = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + files = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index c7d04366611..285e193a7e1 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + varString = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs index 86d63c7ac5f..a4410d55b34 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -665,71 +665,55 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "byte": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + varByte = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "date": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + date = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - number = new Option(utf8JsonReader.GetDecimal()); + number = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "password": password = new Option(utf8JsonReader.GetString()); break; case "binary": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "dateTime": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "decimal": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + varDecimal = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "double": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varDouble = new Option(utf8JsonReader.GetDouble()); + varDouble = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); break; case "float": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varFloat = new Option((float)utf8JsonReader.GetDouble()); + varFloat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble()); break; case "int32": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int32 = new Option(utf8JsonReader.GetInt32()); + int32 = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int32Range": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int32Range = new Option(utf8JsonReader.GetInt32()); + int32Range = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64 = new Option(utf8JsonReader.GetInt64()); + int64 = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "int64Negative": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64Negative = new Option(utf8JsonReader.GetInt32()); + int64Negative = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64NegativeExclusive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64NegativeExclusive = new Option(utf8JsonReader.GetInt32()); + int64NegativeExclusive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64Positive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64Positive = new Option(utf8JsonReader.GetInt32()); + int64Positive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "int64PositiveExclusive": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - int64PositiveExclusive = new Option(utf8JsonReader.GetInt32()); + int64PositiveExclusive = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - integer = new Option(utf8JsonReader.GetInt32()); + integer = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "pattern_with_backslash": patternWithBackslash = new Option(utf8JsonReader.GetString()); @@ -744,16 +728,13 @@ namespace Org.OpenAPITools.Model varString = new Option(utf8JsonReader.GetString()); break; case "unsigned_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - unsignedInteger = new Option(utf8JsonReader.GetUInt32()); + unsignedInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (uint?)null : utf8JsonReader.GetUInt32()); break; case "unsigned_long": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - unsignedLong = new Option(utf8JsonReader.GetUInt64()); + unsignedLong = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (ulong?)null : utf8JsonReader.GetUInt64()); break; case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MapTest.cs index 97588d56888..0af46ec34e4 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MapTest.cs @@ -243,20 +243,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "direct_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - directMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + directMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "indirect_map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - indirectMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + indirectMap = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_map_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapMapOfString = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + mapMapOfString = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "map_of_enum_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - mapOfEnumString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + mapOfEnumString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs index c81de3d2f67..3a559f83119 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedAnyOf.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "content": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs index 32515bc0440..5e238e0f7b3 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedOneOf.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "content": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + content = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 3cef3330300..e0462d7c8a2 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -189,20 +189,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "dateTime": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateTime = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "map": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - map = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + map = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "uuid_with_pattern": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuidWithPattern = new Option(utf8JsonReader.GetGuid()); + uuidWithPattern = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs index bf37307ad96..882bf7ccda4 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Model200Response.cs @@ -146,8 +146,7 @@ namespace Org.OpenAPITools.Model varClass = new Option(utf8JsonReader.GetString()); break; case "name": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - name = new Option(utf8JsonReader.GetInt32()); + name = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Name.cs index b322aaf568c..dba5779e547 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Name.cs @@ -211,19 +211,16 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "name": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varName = new Option(utf8JsonReader.GetInt32()); + varName = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "property": property = new Option(utf8JsonReader.GetString()); break; case "snake_case": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - snakeCase = new Option(utf8JsonReader.GetInt32()); + snakeCase = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "123Number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - var123Number = new Option(utf8JsonReader.GetInt32()); + var123Number = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs index ea8abdda0d7..9da49219005 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NotificationtestGetElementsV1ResponseMPayload.cs @@ -129,12 +129,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "a_objVariableobject": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - aObjVariableobject = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); + aObjVariableobject = new Option>>(JsonSerializer.Deserialize>>(ref utf8JsonReader, jsonSerializerOptions)); break; case "pkiNotificationtestID": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - pkiNotificationtestID = new Option(utf8JsonReader.GetInt32()); + pkiNotificationtestID = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs index 42533f9c7eb..397f12bffbb 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableClass.cs @@ -323,48 +323,37 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "array_and_items_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_items_nullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "array_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - arrayNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + arrayNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - booleanProp = new Option(utf8JsonReader.GetBoolean()); + booleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + dateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + datetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - integerProp = new Option(utf8JsonReader.GetInt32()); + integerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "number_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - numberProp = new Option(utf8JsonReader.GetDecimal()); + numberProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "object_and_items_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectAndItemsNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "object_items_nullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectItemsNullable = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "object_nullable_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + objectNullableProp = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "string_prop": stringProp = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs index 286d13258dc..6efbeef44dc 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NullableGuidClass.cs @@ -127,8 +127,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - uuid = new Option(utf8JsonReader.GetGuid()); + uuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs index 29f5a80e646..55ab016ac3d 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "JustNumber": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - justNumber = new Option(utf8JsonReader.GetDecimal()); + justNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 83f513bc63b..541a621953a 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -180,16 +180,13 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "bars": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - bars = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + bars = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "deprecatedRef": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + deprecatedRef = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetDecimal()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "uuid": uuid = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Order.cs index 580ef432ecf..ad31eb6ad14 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Order.cs @@ -299,24 +299,19 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "complete": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - complete = new Option(utf8JsonReader.GetBoolean()); + complete = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "petId": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - petId = new Option(utf8JsonReader.GetInt64()); + petId = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "quantity": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - quantity = new Option(utf8JsonReader.GetInt32()); + quantity = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "shipDate": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + shipDate = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "status": string statusRawValue = utf8JsonReader.GetString(); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs index 92ec1939d1a..d366c24ec24 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -160,12 +160,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "my_boolean": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - myBoolean = new Option(utf8JsonReader.GetBoolean()); + myBoolean = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "my_number": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - myNumber = new Option(utf8JsonReader.GetDecimal()); + myNumber = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (decimal?)null : utf8JsonReader.GetDecimal()); break; case "my_string": myString = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pet.cs index 81d80e33de7..e8e661445a1 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Pet.cs @@ -283,16 +283,13 @@ namespace Org.OpenAPITools.Model name = new Option(utf8JsonReader.GetString()); break; case "photoUrls": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - photoUrls = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + photoUrls = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "category": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + category = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "status": string statusRawValue = utf8JsonReader.GetString(); @@ -300,8 +297,7 @@ namespace Org.OpenAPITools.Model status = new Option(Pet.StatusEnumFromStringOrDefault(statusRawValue)); break; case "tags": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - tags = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + tags = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs index 0990c0ab7a4..fee9ba7f296 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/RequiredClass.cs @@ -1825,28 +1825,22 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "required_not_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + requiredNotnullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "required_notnullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_notnullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableEnumInteger = new Option((RequiredClass.RequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + requiredNotnullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNotnullableEnumIntegerEnum?)null : (RequiredClass.RequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "required_notnullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableEnumIntegerOnly = new Option((RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + requiredNotnullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum?)null : (RequiredClass.RequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "required_notnullable_enum_string": string requiredNotnullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1862,48 +1856,37 @@ namespace Org.OpenAPITools.Model requiredNotnullableStringProp = new Option(utf8JsonReader.GetString()); break; case "required_notnullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + requiredNotnullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "required_notnullableinteger_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + requiredNotnullableintegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "not_required_notnullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notRequiredNotnullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "not_required_notnullableinteger_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNotnullableintegerProp = new Option(utf8JsonReader.GetInt32()); + notRequiredNotnullableintegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "not_required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notRequiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "not_required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notRequiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + notRequiredNullableIntegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNotnullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_notnullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + notrequiredNotnullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "notrequired_notnullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNotnullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_notnullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableEnumInteger = new Option((RequiredClass.NotrequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + notrequiredNotnullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNotnullableEnumIntegerEnum?)null : (RequiredClass.NotrequiredNotnullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableEnumIntegerOnly = new Option((RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + notrequiredNotnullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum?)null : (RequiredClass.NotrequiredNotnullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "notrequired_notnullable_enum_string": string notrequiredNotnullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1919,28 +1902,22 @@ namespace Org.OpenAPITools.Model notrequiredNotnullableStringProp = new Option(utf8JsonReader.GetString()); break; case "notrequired_notnullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNotnullableUuid = new Option(utf8JsonReader.GetGuid()); + notrequiredNotnullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "notrequired_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + notrequiredNullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "notrequired_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + notrequiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "notrequired_nullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableEnumInteger = new Option((RequiredClass.NotrequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + notrequiredNullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNullableEnumIntegerEnum?)null : (RequiredClass.NotrequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "notrequired_nullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableEnumIntegerOnly = new Option((RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + notrequiredNullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum?)null : (RequiredClass.NotrequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "notrequired_nullable_enum_string": string notrequiredNullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1956,32 +1933,25 @@ namespace Org.OpenAPITools.Model notrequiredNullableStringProp = new Option(utf8JsonReader.GetString()); break; case "notrequired_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - notrequiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + notrequiredNullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; case "required_nullable_array_of_string": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableArrayOfString = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_boolean_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableBooleanProp = new Option(utf8JsonReader.GetBoolean()); + requiredNullableBooleanProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "required_nullable_date_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableDateProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_datetime_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + requiredNullableDatetimeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "required_nullable_enum_integer": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableEnumInteger = new Option((RequiredClass.RequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); + requiredNullableEnumInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNullableEnumIntegerEnum?)null : (RequiredClass.RequiredNullableEnumIntegerEnum)utf8JsonReader.GetInt32()); break; case "required_nullable_enum_integer_only": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableEnumIntegerOnly = new Option((RequiredClass.RequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); + requiredNullableEnumIntegerOnly = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (RequiredClass.RequiredNullableEnumIntegerOnlyEnum?)null : (RequiredClass.RequiredNullableEnumIntegerOnlyEnum)utf8JsonReader.GetInt32()); break; case "required_nullable_enum_string": string requiredNullableEnumStringRawValue = utf8JsonReader.GetString(); @@ -1989,8 +1959,7 @@ namespace Org.OpenAPITools.Model requiredNullableEnumString = new Option(RequiredClass.RequiredNullableEnumStringEnumFromStringOrDefault(requiredNullableEnumStringRawValue)); break; case "required_nullable_integer_prop": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableIntegerProp = new Option(utf8JsonReader.GetInt32()); + requiredNullableIntegerProp = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "required_nullable_outerEnumDefaultValue": string requiredNullableOuterEnumDefaultValueRawValue = utf8JsonReader.GetString(); @@ -2001,8 +1970,7 @@ namespace Org.OpenAPITools.Model requiredNullableStringProp = new Option(utf8JsonReader.GetString()); break; case "required_nullable_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - requiredNullableUuid = new Option(utf8JsonReader.GetGuid()); + requiredNullableUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Return.cs index 6a2c4c85eb4..81211e0ce4a 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Return.cs @@ -169,8 +169,7 @@ namespace Org.OpenAPITools.Model varAbstract = new Option(utf8JsonReader.GetString()); break; case "return": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - varReturn = new Option(utf8JsonReader.GetInt32()); + varReturn = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "unsafe": varUnsafe = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs index 46625cb093a..5b7a88bd659 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/RolesReportsHash.cs @@ -143,12 +143,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "role": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + role = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "role_uuid": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - roleUuid = new Option(utf8JsonReader.GetGuid()); + roleUuid = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (Guid?)null : utf8JsonReader.GetGuid()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs index 7ec3c110c2a..f30e2a11997 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -146,8 +146,7 @@ namespace Org.OpenAPITools.Model varSpecialModelName = new Option(utf8JsonReader.GetString()); break; case "$special[property.name]": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - specialPropertyName = new Option(utf8JsonReader.GetInt64()); + specialPropertyName = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Tag.cs index 4290e8270ff..6b9d5082405 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Tag.cs @@ -143,8 +143,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "name": name = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs index 04d04337aa4..7328caf1ead 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -126,8 +126,7 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "TestCollectionEndingWithWordList": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - testCollectionEndingWithWordList = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); + testCollectionEndingWithWordList = new Option>(JsonSerializer.Deserialize>(ref utf8JsonReader, jsonSerializerOptions)); break; default: break; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/User.cs index e89d5845732..a85e556bb9e 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/User.cs @@ -318,12 +318,10 @@ namespace Org.OpenAPITools.Model switch (localVarJsonPropertyName) { case "anyTypeProp": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anyTypeProp = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "anyTypePropNullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + anyTypePropNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "email": email = new Option(utf8JsonReader.GetString()); @@ -332,19 +330,16 @@ namespace Org.OpenAPITools.Model firstName = new Option(utf8JsonReader.GetString()); break; case "id": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - id = new Option(utf8JsonReader.GetInt64()); + id = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (long?)null : utf8JsonReader.GetInt64()); break; case "lastName": lastName = new Option(utf8JsonReader.GetString()); break; case "objectWithNoDeclaredProps": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + objectWithNoDeclaredProps = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "objectWithNoDeclaredPropsNullable": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); + objectWithNoDeclaredPropsNullable = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; case "password": password = new Option(utf8JsonReader.GetString()); @@ -353,8 +348,7 @@ namespace Org.OpenAPITools.Model phone = new Option(utf8JsonReader.GetString()); break; case "userStatus": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - userStatus = new Option(utf8JsonReader.GetInt32()); + userStatus = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (int?)null : utf8JsonReader.GetInt32()); break; case "username": username = new Option(utf8JsonReader.GetString()); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Whale.cs index 834e6957c67..56da6f6db3c 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/Whale.cs @@ -156,12 +156,10 @@ namespace Org.OpenAPITools.Model className = new Option(utf8JsonReader.GetString()); break; case "hasBaleen": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - hasBaleen = new Option(utf8JsonReader.GetBoolean()); + hasBaleen = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; case "hasTeeth": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - hasTeeth = new Option(utf8JsonReader.GetBoolean()); + hasTeeth = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (bool?)null : utf8JsonReader.GetBoolean()); break; default: break;