diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/JsonConverter.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/JsonConverter.mustache index 205dee4e7b3..ad83267b87c 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/JsonConverter.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/generichost/JsonConverter.mustache @@ -43,13 +43,6 @@ {{/vendorExtensions.x-duplicated-data-type}} {{/composedSchemas.anyOf}} - {{#composedSchemas.oneOf}} - {{^vendorExtensions.x-duplicated-data-type}} - Utf8JsonReader {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader = utf8JsonReader; - bool {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Deserialized = Client.ClientUtils.TryDeserialize<{{{dataType}}}>(ref {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader, jsonSerializerOptions, out {{{dataType}}}{{^isBoolean}}{{nrt?}}{{/isBoolean}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}); - - {{/vendorExtensions.x-duplicated-data-type}} - {{/composedSchemas.oneOf}} {{#composedSchemas.allOf}} {{^isInherited}} Utf8JsonReader {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader = utf8JsonReader; @@ -59,8 +52,10 @@ {{/composedSchemas.allOf}} {{#allVars}} {{#isInnerEnum}}{{^isMap}}{{classname}}.{{/isMap}}{{/isInnerEnum}}{{#nrt}}{{#lambda.optional}}{{{datatypeWithEnum}}}{{/lambda.optional}}{{/nrt}}{{^nrt}}{{{datatypeWithEnum}}}{{#vendorExtensions.x-csharp-value-type}}?{{/vendorExtensions.x-csharp-value-type}}{{/nrt}} {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = default; - {{/allVars}} + {{#-last}} + {{/-last}} + {{/allVars}} while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -175,23 +170,14 @@ } {{#nonNullableVars}} - {{#-first}} -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - {{/-first}} if ({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} == null) throw new ArgumentNullException(nameof({{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}), "Property is required for class {{classname}}."); - {{#-last}} -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - {{/-last}} {{/nonNullableVars}} {{#composedSchemas.oneOf}} {{^vendorExtensions.x-duplicated-data-type}} - if ({{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Deserialized) + Utf8JsonReader {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize<{{{dataType}}}>(ref {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}Reader, jsonSerializerOptions, out {{{dataType}}}{{^isBoolean}}{{nrt?}}{{/isBoolean}} {{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}})) return new {{classname}}({{#lambda.joinWithComma}}{{#lambda.camelcase_param}}{{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}{{/lambda.camelcase_param}}{{#vendorExtensions.x-csharp-value-type}}.Value{{/vendorExtensions.x-csharp-value-type}} {{#model.composedSchemas.allOf}}{{^isInherited}}{{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}{{/isInherited}}{{/model.composedSchemas.allOf}}{{#model.composedSchemas.anyOf}}{{#lambda.camelcase_param}}{{baseType}}{{#isArray}}{{{dataFormat}}}{{/isArray}}{{/lambda.camelcase_param}}{{#vendorExtensions.x-csharp-value-type}}.Value{{/vendorExtensions.x-csharp-value-type}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{#vendorExtensions.x-csharp-value-type}}.Value{{/vendorExtensions.x-csharp-value-type}} {{/allVars}}{{/lambda.joinWithComma}}); {{/vendorExtensions.x-duplicated-data-type}} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Activity.cs index 817dcb9732d..1ed4c2c954a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Activity.cs @@ -129,15 +129,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (activityOutputs == null) throw new ArgumentNullException(nameof(activityOutputs), "Property is required for class Activity."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Activity(activityOutputs); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index e3c4861b3f4..5982ffdc5d1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -142,18 +142,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (prop1 == null) throw new ArgumentNullException(nameof(prop1), "Property is required for class ActivityOutputElementRepresentation."); if (prop2 == null) throw new ArgumentNullException(nameof(prop2), "Property is required for class ActivityOutputElementRepresentation."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ActivityOutputElementRepresentation(prop1, prop2); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 2d713ffc461..a2431ee625a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -228,9 +228,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (mapProperty == null) throw new ArgumentNullException(nameof(mapProperty), "Property is required for class AdditionalPropertiesClass."); @@ -252,9 +249,6 @@ namespace Org.OpenAPITools.Model if (mapWithUndeclaredPropertiesString == null) throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesString), "Property is required for class AdditionalPropertiesClass."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new AdditionalPropertiesClass(emptyMap, mapOfMapProperty, mapProperty, mapWithUndeclaredPropertiesAnytype1, mapWithUndeclaredPropertiesAnytype2, mapWithUndeclaredPropertiesAnytype3, mapWithUndeclaredPropertiesString, anytype1); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Animal.cs index bb2b7d128d0..3ffc06abbd3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Animal.cs @@ -151,18 +151,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (className == null) throw new ArgumentNullException(nameof(className), "Property is required for class Animal."); if (color == null) throw new ArgumentNullException(nameof(color), "Property is required for class Animal."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Animal(className, color); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ApiResponse.cs index f10a074a7e8..aa650c82c73 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -155,9 +155,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (code == null) throw new ArgumentNullException(nameof(code), "Property is required for class ApiResponse."); @@ -167,9 +164,6 @@ namespace Org.OpenAPITools.Model if (message == null) throw new ArgumentNullException(nameof(message), "Property is required for class ApiResponse."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ApiResponse(code.Value, message, type); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Apple.cs index 6b8f40f4214..7f931d85046 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Apple.cs @@ -155,18 +155,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (cultivar == null) throw new ArgumentNullException(nameof(cultivar), "Property is required for class Apple."); if (origin == null) throw new ArgumentNullException(nameof(origin), "Property is required for class Apple."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Apple(cultivar, origin); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AppleReq.cs index cb8c0dfd7ef..7496b20fb8e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/AppleReq.cs @@ -135,18 +135,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (cultivar == null) throw new ArgumentNullException(nameof(cultivar), "Property is required for class AppleReq."); if (mealy == null) throw new ArgumentNullException(nameof(mealy), "Property is required for class AppleReq."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new AppleReq(cultivar, mealy.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index b9cdaa4fd03..5cd9d30bd84 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -129,15 +129,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (arrayArrayNumber == null) throw new ArgumentNullException(nameof(arrayArrayNumber), "Property is required for class ArrayOfArrayOfNumberOnly."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ArrayOfArrayOfNumberOnly(arrayArrayNumber); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 25d59d920a8..fc3031e4f7f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -129,15 +129,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (arrayNumber == null) throw new ArgumentNullException(nameof(arrayNumber), "Property is required for class ArrayOfNumberOnly."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ArrayOfNumberOnly(arrayNumber); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayTest.cs index 57a3c251862..ecfd9933ac1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -157,9 +157,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (arrayOfString == null) throw new ArgumentNullException(nameof(arrayOfString), "Property is required for class ArrayTest."); @@ -169,9 +166,6 @@ namespace Org.OpenAPITools.Model if (arrayArrayOfModel == null) throw new ArgumentNullException(nameof(arrayArrayOfModel), "Property is required for class ArrayTest."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ArrayTest(arrayArrayOfInteger, arrayArrayOfModel, arrayOfString); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Banana.cs index 1a21163a308..aebb924846b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Banana.cs @@ -129,15 +129,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (lengthCm == null) throw new ArgumentNullException(nameof(lengthCm), "Property is required for class Banana."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Banana(lengthCm.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BananaReq.cs index 263285a1c04..97b0b5869d8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BananaReq.cs @@ -136,18 +136,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (lengthCm == null) throw new ArgumentNullException(nameof(lengthCm), "Property is required for class BananaReq."); if (sweet == null) throw new ArgumentNullException(nameof(sweet), "Property is required for class BananaReq."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new BananaReq(lengthCm.Value, sweet.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BasquePig.cs index 0fd0a7de0bd..f8a8219cace 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/BasquePig.cs @@ -128,15 +128,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (className == null) throw new ArgumentNullException(nameof(className), "Property is required for class BasquePig."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new BasquePig(className); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Capitalization.cs index f8efe97a6f1..3b8e799cf1c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Capitalization.cs @@ -194,9 +194,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (smallCamel == null) throw new ArgumentNullException(nameof(smallCamel), "Property is required for class Capitalization."); @@ -215,9 +212,6 @@ namespace Org.OpenAPITools.Model if (aTTNAME == null) throw new ArgumentNullException(nameof(aTTNAME), "Property is required for class Capitalization."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Capitalization(aTTNAME, capitalCamel, capitalSnake, sCAETHFlowPoints, smallCamel, smallSnake); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/CatAllOf.cs index d7271c1851f..160e38c94dc 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/CatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -129,15 +129,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (declawed == null) throw new ArgumentNullException(nameof(declawed), "Property is required for class CatAllOf."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new CatAllOf(declawed.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Category.cs index 37035c08a63..940a82e6260 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Category.cs @@ -142,18 +142,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (id == null) throw new ArgumentNullException(nameof(id), "Property is required for class Category."); if (name == null) throw new ArgumentNullException(nameof(name), "Property is required for class Category."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Category(id.Value, name); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ChildCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ChildCatAllOf.cs index f64789c9dc6..e57f4e1c6a0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ChildCatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ChildCatAllOf.cs @@ -180,18 +180,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (name == null) throw new ArgumentNullException(nameof(name), "Property is required for class ChildCatAllOf."); if (petType == null) throw new ArgumentNullException(nameof(petType), "Property is required for class ChildCatAllOf."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ChildCatAllOf(name, petType.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ClassModel.cs index e2d77a757dc..184b4362616 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ClassModel.cs @@ -128,15 +128,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (classProperty == null) throw new ArgumentNullException(nameof(classProperty), "Property is required for class ClassModel."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ClassModel(classProperty); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 680c1eb8f7f..d9df9be8df1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -113,7 +113,6 @@ namespace Org.OpenAPITools.Model Utf8JsonReader quadrilateralInterfaceReader = utf8JsonReader; bool quadrilateralInterfaceDeserialized = Client.ClientUtils.TryDeserialize(ref utf8JsonReader, jsonSerializerOptions, out QuadrilateralInterface? quadrilateralInterface); - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DanishPig.cs index f5ca92d388a..f884e2dcf13 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DanishPig.cs @@ -128,15 +128,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (className == null) throw new ArgumentNullException(nameof(className), "Property is required for class DanishPig."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new DanishPig(className); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DateOnlyClass.cs index 429fb738fac..d45ac801b17 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -135,15 +135,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (dateOnlyProperty == null) throw new ArgumentNullException(nameof(dateOnlyProperty), "Property is required for class DateOnlyClass."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new DateOnlyClass(dateOnlyProperty.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DeprecatedObject.cs index c56aeba5df7..79238a1c7e3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -128,15 +128,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (name == null) throw new ArgumentNullException(nameof(name), "Property is required for class DeprecatedObject."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new DeprecatedObject(name); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DogAllOf.cs index 4e7c60fee79..b397ece7142 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DogAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -128,15 +128,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (breed == null) throw new ArgumentNullException(nameof(breed), "Property is required for class DogAllOf."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new DogAllOf(breed); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Drawing.cs index 27d77e3b712..df6ffe6bf86 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Drawing.cs @@ -165,9 +165,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (mainShape == null) throw new ArgumentNullException(nameof(mainShape), "Property is required for class Drawing."); @@ -177,9 +174,6 @@ namespace Org.OpenAPITools.Model if (shapes == null) throw new ArgumentNullException(nameof(shapes), "Property is required for class Drawing."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Drawing(mainShape, shapeOrNull, shapes, nullableShape); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumArrays.cs index 7725cec733c..a280bc4744c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -241,18 +241,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (justSymbol == null) throw new ArgumentNullException(nameof(justSymbol), "Property is required for class EnumArrays."); if (arrayEnum == null) throw new ArgumentNullException(nameof(arrayEnum), "Property is required for class EnumArrays."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new EnumArrays(arrayEnum, justSymbol.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumTest.cs index 4d469be1e82..d8aceb0a95a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EnumTest.cs @@ -496,9 +496,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (enumString == null) throw new ArgumentNullException(nameof(enumString), "Property is required for class EnumTest."); @@ -523,9 +520,6 @@ namespace Org.OpenAPITools.Model if (outerEnumIntegerDefaultValue == null) throw new ArgumentNullException(nameof(outerEnumIntegerDefaultValue), "Property is required for class EnumTest."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new EnumTest(enumInteger.Value, enumIntegerOnly.Value, enumNumber.Value, enumString.Value, enumStringRequired.Value, outerEnumDefaultValue.Value, outerEnumInteger.Value, outerEnumIntegerDefaultValue.Value, outerEnum.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index fbf12c660d7..e83aa7d96e1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -113,7 +113,6 @@ namespace Org.OpenAPITools.Model Utf8JsonReader triangleInterfaceReader = utf8JsonReader; bool triangleInterfaceDeserialized = Client.ClientUtils.TryDeserialize(ref utf8JsonReader, jsonSerializerOptions, out TriangleInterface? triangleInterface); - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/File.cs index 59ec4e77149..c9102df461c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/File.cs @@ -129,15 +129,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (sourceURI == null) throw new ArgumentNullException(nameof(sourceURI), "Property is required for class File."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new File(sourceURI); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index 9a975b56e99..fdedc92730f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -143,18 +143,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (file == null) throw new ArgumentNullException(nameof(file), "Property is required for class FileSchemaTestClass."); if (files == null) throw new ArgumentNullException(nameof(files), "Property is required for class FileSchemaTestClass."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new FileSchemaTestClass(file, files); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Foo.cs index 8c0d186162c..6772dbe8c9d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Foo.cs @@ -128,15 +128,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (bar == null) throw new ArgumentNullException(nameof(bar), "Property is required for class Foo."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Foo(bar); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index 70f778d2304..0846df3e535 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -129,15 +129,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (stringProperty == null) throw new ArgumentNullException(nameof(stringProperty), "Property is required for class FooGetDefaultResponse."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new FooGetDefaultResponse(stringProperty); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FormatTest.cs index b2b5b5e93a1..42d3ed828d0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FormatTest.cs @@ -504,9 +504,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (integer == null) throw new ArgumentNullException(nameof(integer), "Property is required for class FormatTest."); @@ -564,9 +561,6 @@ namespace Org.OpenAPITools.Model if (patternWithBackslash == null) throw new ArgumentNullException(nameof(patternWithBackslash), "Property is required for class FormatTest."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new FormatTest(binary, byteProperty, date.Value, dateTime.Value, decimalProperty.Value, doubleProperty.Value, floatProperty.Value, int32.Value, int64.Value, integer.Value, number.Value, password, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, stringProperty, unsignedInteger.Value, unsignedLong.Value, uuid.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Fruit.cs index 208ccdce272..b50d410a84c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Fruit.cs @@ -120,12 +120,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader appleReader = utf8JsonReader; - bool appleDeserialized = Client.ClientUtils.TryDeserialize(ref appleReader, jsonSerializerOptions, out Apple? apple); - - Utf8JsonReader bananaReader = utf8JsonReader; - bool bananaDeserialized = Client.ClientUtils.TryDeserialize(ref bananaReader, jsonSerializerOptions, out Banana? banana); - string? color = default; while (utf8JsonReader.Read()) @@ -152,19 +146,15 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (color == null) throw new ArgumentNullException(nameof(color), "Property is required for class Fruit."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (appleDeserialized) + Utf8JsonReader appleReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref appleReader, jsonSerializerOptions, out Apple? apple)) return new Fruit(apple, color); - if (bananaDeserialized) + Utf8JsonReader bananaReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref bananaReader, jsonSerializerOptions, out Banana? banana)) return new Fruit(banana, color); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FruitReq.cs index 0301201b3b0..8cdbb85d373 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FruitReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/FruitReq.cs @@ -109,13 +109,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader appleReqReader = utf8JsonReader; - bool appleReqDeserialized = Client.ClientUtils.TryDeserialize(ref appleReqReader, jsonSerializerOptions, out AppleReq? appleReq); - - Utf8JsonReader bananaReqReader = utf8JsonReader; - bool bananaReqDeserialized = Client.ClientUtils.TryDeserialize(ref bananaReqReader, jsonSerializerOptions, out BananaReq? bananaReq); - - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -137,10 +130,12 @@ namespace Org.OpenAPITools.Model } } - if (appleReqDeserialized) + Utf8JsonReader appleReqReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref appleReqReader, jsonSerializerOptions, out AppleReq? appleReq)) return new FruitReq(appleReq); - if (bananaReqDeserialized) + Utf8JsonReader bananaReqReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref bananaReqReader, jsonSerializerOptions, out BananaReq? bananaReq)) return new FruitReq(bananaReq); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/GmFruit.cs index 8572d03fda1..d5cc65b6506 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/GmFruit.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/GmFruit.cs @@ -141,15 +141,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (color == null) throw new ArgumentNullException(nameof(color), "Property is required for class GmFruit."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new GmFruit(apple, banana, color); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index 553eb9674b6..7d9aaa6947b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -138,15 +138,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (petType == null) throw new ArgumentNullException(nameof(petType), "Property is required for class GrandparentAnimal."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new GrandparentAnimal(petType); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index a5e99de244f..6f43523bc61 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -178,18 +178,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (bar == null) throw new ArgumentNullException(nameof(bar), "Property is required for class HasOnlyReadOnly."); if (foo == null) throw new ArgumentNullException(nameof(foo), "Property is required for class HasOnlyReadOnly."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new HasOnlyReadOnly(bar, foo); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index dacbbbfe786..31e6499b7fa 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -106,7 +106,6 @@ namespace Org.OpenAPITools.Model Utf8JsonReader triangleInterfaceReader = utf8JsonReader; bool triangleInterfaceDeserialized = Client.ClientUtils.TryDeserialize(ref utf8JsonReader, jsonSerializerOptions, out TriangleInterface? triangleInterface); - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/List.cs index 2119f4f88a4..f98dfcfa2e1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/List.cs @@ -128,15 +128,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (_123list == null) throw new ArgumentNullException(nameof(_123list), "Property is required for class List."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new List(_123list); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/LiteralStringClass.cs index de2b72f2b60..5adcacd8d53 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/LiteralStringClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -141,18 +141,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (escapedLiteralString == null) throw new ArgumentNullException(nameof(escapedLiteralString), "Property is required for class LiteralStringClass."); if (unescapedLiteralString == null) throw new ArgumentNullException(nameof(unescapedLiteralString), "Property is required for class LiteralStringClass."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new LiteralStringClass(escapedLiteralString, unescapedLiteralString); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Mammal.cs index 4b5ecc5daa8..7bd0dcacad9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Mammal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Mammal.cs @@ -142,16 +142,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader whaleReader = utf8JsonReader; - bool whaleDeserialized = Client.ClientUtils.TryDeserialize(ref whaleReader, jsonSerializerOptions, out Whale? whale); - - Utf8JsonReader zebraReader = utf8JsonReader; - bool zebraDeserialized = Client.ClientUtils.TryDeserialize(ref zebraReader, jsonSerializerOptions, out Zebra? zebra); - - Utf8JsonReader pigReader = utf8JsonReader; - bool pigDeserialized = Client.ClientUtils.TryDeserialize(ref pigReader, jsonSerializerOptions, out Pig? pig); - - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -173,13 +163,16 @@ namespace Org.OpenAPITools.Model } } - if (whaleDeserialized) + Utf8JsonReader whaleReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref whaleReader, jsonSerializerOptions, out Whale? whale)) return new Mammal(whale); - if (zebraDeserialized) + Utf8JsonReader zebraReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref zebraReader, jsonSerializerOptions, out Zebra? zebra)) return new Mammal(zebra); - if (pigDeserialized) + Utf8JsonReader pigReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref pigReader, jsonSerializerOptions, out Pig? pig)) return new Mammal(pig); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MapTest.cs index ca4a85db714..30b022d7cd8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MapTest.cs @@ -220,9 +220,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (mapMapOfString == null) throw new ArgumentNullException(nameof(mapMapOfString), "Property is required for class MapTest."); @@ -235,9 +232,6 @@ namespace Org.OpenAPITools.Model if (indirectMap == null) throw new ArgumentNullException(nameof(indirectMap), "Property is required for class MapTest."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new MapTest(directMap, indirectMap, mapMapOfString, mapOfEnumString); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index bbb23293899..8a9d80f2e19 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -183,9 +183,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (uuidWithPattern == null) throw new ArgumentNullException(nameof(uuidWithPattern), "Property is required for class MixedPropertiesAndAdditionalPropertiesClass."); @@ -198,9 +195,6 @@ namespace Org.OpenAPITools.Model if (map == null) throw new ArgumentNullException(nameof(map), "Property is required for class MixedPropertiesAndAdditionalPropertiesClass."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new MixedPropertiesAndAdditionalPropertiesClass(dateTime.Value, map, uuid.Value, uuidWithPattern.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Model200Response.cs index 9cd1b5b3791..850a20e9c1e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Model200Response.cs @@ -142,18 +142,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (name == null) throw new ArgumentNullException(nameof(name), "Property is required for class Model200Response."); if (classProperty == null) throw new ArgumentNullException(nameof(classProperty), "Property is required for class Model200Response."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Model200Response(classProperty, name.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ModelClient.cs index a0678b011ed..4c04b1f91e1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ModelClient.cs @@ -128,15 +128,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (clientProperty == null) throw new ArgumentNullException(nameof(clientProperty), "Property is required for class ModelClient."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ModelClient(clientProperty); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Name.cs index ad8d2e6fca7..1b2df1b7f9c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Name.cs @@ -207,9 +207,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (nameProperty == null) throw new ArgumentNullException(nameof(nameProperty), "Property is required for class Name."); @@ -222,9 +219,6 @@ namespace Org.OpenAPITools.Model if (_123number == null) throw new ArgumentNullException(nameof(_123number), "Property is required for class Name."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Name(nameProperty.Value, property, snakeCase.Value, _123number.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableClass.cs index 0e4d231b6d0..056b527ef3a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableClass.cs @@ -286,18 +286,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (arrayItemsNullable == null) throw new ArgumentNullException(nameof(arrayItemsNullable), "Property is required for class NullableClass."); if (objectItemsNullable == null) throw new ArgumentNullException(nameof(objectItemsNullable), "Property is required for class NullableClass."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new NullableClass(arrayItemsNullable, objectItemsNullable, arrayAndItemsNullableProp, arrayNullableProp, booleanProp, dateProp, datetimeProp, integerProp, numberProp, objectAndItemsNullableProp, objectNullableProp, stringProp); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableShape.cs index fe7962fdc03..bd6cfcd9aec 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableShape.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NullableShape.cs @@ -126,13 +126,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader triangleReader = utf8JsonReader; - bool triangleDeserialized = Client.ClientUtils.TryDeserialize(ref triangleReader, jsonSerializerOptions, out Triangle? triangle); - - Utf8JsonReader quadrilateralReader = utf8JsonReader; - bool quadrilateralDeserialized = Client.ClientUtils.TryDeserialize(ref quadrilateralReader, jsonSerializerOptions, out Quadrilateral? quadrilateral); - - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -154,10 +147,12 @@ namespace Org.OpenAPITools.Model } } - if (triangleDeserialized) + Utf8JsonReader triangleReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref triangleReader, jsonSerializerOptions, out Triangle? triangle)) return new NullableShape(triangle); - if (quadrilateralDeserialized) + Utf8JsonReader quadrilateralReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref quadrilateralReader, jsonSerializerOptions, out Quadrilateral? quadrilateral)) return new NullableShape(quadrilateral); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NumberOnly.cs index 3d0c5c93eb3..34c018c84e8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -129,15 +129,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (justNumber == null) throw new ArgumentNullException(nameof(justNumber), "Property is required for class NumberOnly."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new NumberOnly(justNumber.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 62e338f4190..444644b6d48 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -173,9 +173,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (uuid == null) throw new ArgumentNullException(nameof(uuid), "Property is required for class ObjectWithDeprecatedFields."); @@ -188,9 +185,6 @@ namespace Org.OpenAPITools.Model if (bars == null) throw new ArgumentNullException(nameof(bars), "Property is required for class ObjectWithDeprecatedFields."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ObjectWithDeprecatedFields(bars, deprecatedRef, id.Value, uuid); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OneOfString.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OneOfString.cs index e7153dc761b..c215236bfdc 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OneOfString.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OneOfString.cs @@ -100,10 +100,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader _stringReader = utf8JsonReader; - bool _stringDeserialized = Client.ClientUtils.TryDeserialize(ref _stringReader, jsonSerializerOptions, out string? _string); - - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -125,7 +121,8 @@ namespace Org.OpenAPITools.Model } } - if (_stringDeserialized) + Utf8JsonReader _stringReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref _stringReader, jsonSerializerOptions, out string? _string)) return new OneOfString(_string); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Order.cs index 2d0204b826f..aa002e09409 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Order.cs @@ -267,9 +267,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (id == null) throw new ArgumentNullException(nameof(id), "Property is required for class Order."); @@ -288,9 +285,6 @@ namespace Org.OpenAPITools.Model if (complete == null) throw new ArgumentNullException(nameof(complete), "Property is required for class Order."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Order(id.Value, petId.Value, quantity.Value, shipDate.Value, status.Value, complete.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterComposite.cs index 58311f07f4f..1713706750c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -156,9 +156,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (myNumber == null) throw new ArgumentNullException(nameof(myNumber), "Property is required for class OuterComposite."); @@ -168,9 +165,6 @@ namespace Org.OpenAPITools.Model if (myBoolean == null) throw new ArgumentNullException(nameof(myBoolean), "Property is required for class OuterComposite."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new OuterComposite(myBoolean.Value, myNumber.Value, myString); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Pet.cs index 940b8cba3f1..75d7b893dc5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Pet.cs @@ -261,9 +261,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (id == null) throw new ArgumentNullException(nameof(id), "Property is required for class Pet."); @@ -282,9 +279,6 @@ namespace Org.OpenAPITools.Model if (status == null) throw new ArgumentNullException(nameof(status), "Property is required for class Pet."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Pet(category, id.Value, name, photoUrls, status.Value, tags); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Pig.cs index fa961c4bb55..770621b50fd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Pig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Pig.cs @@ -126,13 +126,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader basquePigReader = utf8JsonReader; - bool basquePigDeserialized = Client.ClientUtils.TryDeserialize(ref basquePigReader, jsonSerializerOptions, out BasquePig? basquePig); - - Utf8JsonReader danishPigReader = utf8JsonReader; - bool danishPigDeserialized = Client.ClientUtils.TryDeserialize(ref danishPigReader, jsonSerializerOptions, out DanishPig? danishPig); - - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -154,10 +147,12 @@ namespace Org.OpenAPITools.Model } } - if (basquePigDeserialized) + Utf8JsonReader basquePigReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref basquePigReader, jsonSerializerOptions, out BasquePig? basquePig)) return new Pig(basquePig); - if (danishPigDeserialized) + Utf8JsonReader danishPigReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref danishPigReader, jsonSerializerOptions, out DanishPig? danishPig)) return new Pig(danishPig); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/PolymorphicProperty.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/PolymorphicProperty.cs index 5ac3a0b16ea..892925c754a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/PolymorphicProperty.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/PolymorphicProperty.cs @@ -148,19 +148,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader _boolReader = utf8JsonReader; - bool _boolDeserialized = Client.ClientUtils.TryDeserialize(ref _boolReader, jsonSerializerOptions, out bool _bool); - - Utf8JsonReader _stringReader = utf8JsonReader; - bool _stringDeserialized = Client.ClientUtils.TryDeserialize(ref _stringReader, jsonSerializerOptions, out string? _string); - - Utf8JsonReader _objectReader = utf8JsonReader; - bool _objectDeserialized = Client.ClientUtils.TryDeserialize(ref _objectReader, jsonSerializerOptions, out Object? _object); - - Utf8JsonReader liststringReader = utf8JsonReader; - bool liststringDeserialized = Client.ClientUtils.TryDeserialize>(ref liststringReader, jsonSerializerOptions, out List? liststring); - - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -182,16 +169,20 @@ namespace Org.OpenAPITools.Model } } - if (_boolDeserialized) + Utf8JsonReader _boolReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref _boolReader, jsonSerializerOptions, out bool _bool)) return new PolymorphicProperty(_bool); - if (_stringDeserialized) + Utf8JsonReader _stringReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref _stringReader, jsonSerializerOptions, out string? _string)) return new PolymorphicProperty(_string); - if (_objectDeserialized) + Utf8JsonReader _objectReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref _objectReader, jsonSerializerOptions, out Object? _object)) return new PolymorphicProperty(_object); - if (liststringDeserialized) + Utf8JsonReader liststringReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize>(ref liststringReader, jsonSerializerOptions, out List? liststring)) return new PolymorphicProperty(liststring); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Quadrilateral.cs index 84c0544664e..53d4c65e3c3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Quadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -126,13 +126,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader simpleQuadrilateralReader = utf8JsonReader; - bool simpleQuadrilateralDeserialized = Client.ClientUtils.TryDeserialize(ref simpleQuadrilateralReader, jsonSerializerOptions, out SimpleQuadrilateral? simpleQuadrilateral); - - Utf8JsonReader complexQuadrilateralReader = utf8JsonReader; - bool complexQuadrilateralDeserialized = Client.ClientUtils.TryDeserialize(ref complexQuadrilateralReader, jsonSerializerOptions, out ComplexQuadrilateral? complexQuadrilateral); - - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -154,10 +147,12 @@ namespace Org.OpenAPITools.Model } } - if (simpleQuadrilateralDeserialized) + Utf8JsonReader simpleQuadrilateralReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref simpleQuadrilateralReader, jsonSerializerOptions, out SimpleQuadrilateral? simpleQuadrilateral)) return new Quadrilateral(simpleQuadrilateral); - if (complexQuadrilateralDeserialized) + Utf8JsonReader complexQuadrilateralReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref complexQuadrilateralReader, jsonSerializerOptions, out ComplexQuadrilateral? complexQuadrilateral)) return new Quadrilateral(complexQuadrilateral); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index 5d19ac7cec4..7f6ff60f19e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -128,15 +128,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (quadrilateralType == null) throw new ArgumentNullException(nameof(quadrilateralType), "Property is required for class QuadrilateralInterface."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new QuadrilateralInterface(quadrilateralType); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index 234201d7d7a..119e203be95 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -177,18 +177,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (bar == null) throw new ArgumentNullException(nameof(bar), "Property is required for class ReadOnlyFirst."); if (baz == null) throw new ArgumentNullException(nameof(baz), "Property is required for class ReadOnlyFirst."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ReadOnlyFirst(bar, baz); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Return.cs index 20a6cf353fa..624e1fc2b80 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Return.cs @@ -129,15 +129,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (returnProperty == null) throw new ArgumentNullException(nameof(returnProperty), "Property is required for class Return."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Return(returnProperty.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index fa5119961ca..2ba0f586797 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -113,7 +113,6 @@ namespace Org.OpenAPITools.Model Utf8JsonReader triangleInterfaceReader = utf8JsonReader; bool triangleInterfaceDeserialized = Client.ClientUtils.TryDeserialize(ref utf8JsonReader, jsonSerializerOptions, out TriangleInterface? triangleInterface); - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Shape.cs index 2ae02c59190..d80741ed95e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Shape.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Shape.cs @@ -137,12 +137,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader triangleReader = utf8JsonReader; - bool triangleDeserialized = Client.ClientUtils.TryDeserialize(ref triangleReader, jsonSerializerOptions, out Triangle? triangle); - - Utf8JsonReader quadrilateralReader = utf8JsonReader; - bool quadrilateralDeserialized = Client.ClientUtils.TryDeserialize(ref quadrilateralReader, jsonSerializerOptions, out Quadrilateral? quadrilateral); - string? quadrilateralType = default; while (utf8JsonReader.Read()) @@ -169,19 +163,15 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (quadrilateralType == null) throw new ArgumentNullException(nameof(quadrilateralType), "Property is required for class Shape."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (triangleDeserialized) + Utf8JsonReader triangleReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref triangleReader, jsonSerializerOptions, out Triangle? triangle)) return new Shape(triangle, quadrilateralType); - if (quadrilateralDeserialized) + Utf8JsonReader quadrilateralReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref quadrilateralReader, jsonSerializerOptions, out Quadrilateral? quadrilateral)) return new Shape(quadrilateral, quadrilateralType); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ShapeInterface.cs index 2b33646efe3..df962d1c5de 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -128,15 +128,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (shapeType == null) throw new ArgumentNullException(nameof(shapeType), "Property is required for class ShapeInterface."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ShapeInterface(shapeType); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ShapeOrNull.cs index 77468a2bc83..7c2ff84b8b1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ShapeOrNull.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -137,12 +137,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader triangleReader = utf8JsonReader; - bool triangleDeserialized = Client.ClientUtils.TryDeserialize(ref triangleReader, jsonSerializerOptions, out Triangle? triangle); - - Utf8JsonReader quadrilateralReader = utf8JsonReader; - bool quadrilateralDeserialized = Client.ClientUtils.TryDeserialize(ref quadrilateralReader, jsonSerializerOptions, out Quadrilateral? quadrilateral); - string? quadrilateralType = default; while (utf8JsonReader.Read()) @@ -169,19 +163,15 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (quadrilateralType == null) throw new ArgumentNullException(nameof(quadrilateralType), "Property is required for class ShapeOrNull."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (triangleDeserialized) + Utf8JsonReader triangleReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref triangleReader, jsonSerializerOptions, out Triangle? triangle)) return new ShapeOrNull(triangle, quadrilateralType); - if (quadrilateralDeserialized) + Utf8JsonReader quadrilateralReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref quadrilateralReader, jsonSerializerOptions, out Quadrilateral? quadrilateral)) return new ShapeOrNull(quadrilateral, quadrilateralType); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index 3adeb9b8117..ce9157bda83 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -113,7 +113,6 @@ namespace Org.OpenAPITools.Model Utf8JsonReader quadrilateralInterfaceReader = utf8JsonReader; bool quadrilateralInterfaceDeserialized = Client.ClientUtils.TryDeserialize(ref utf8JsonReader, jsonSerializerOptions, out QuadrilateralInterface? quadrilateralInterface); - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SpecialModelName.cs index 4e7c75cb89e..05931e731b9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -142,18 +142,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (specialPropertyName == null) throw new ArgumentNullException(nameof(specialPropertyName), "Property is required for class SpecialModelName."); if (specialModelNameProperty == null) throw new ArgumentNullException(nameof(specialModelNameProperty), "Property is required for class SpecialModelName."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new SpecialModelName(specialModelNameProperty, specialPropertyName.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Tag.cs index c977668ab33..1ad2603b25b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Tag.cs @@ -142,18 +142,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (id == null) throw new ArgumentNullException(nameof(id), "Property is required for class Tag."); if (name == null) throw new ArgumentNullException(nameof(name), "Property is required for class Tag."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Tag(id.Value, name); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs index 3a336ea35eb..eebfdc6e18f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -128,15 +128,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (value == null) throw new ArgumentNullException(nameof(value), "Property is required for class TestCollectionEndingWithWordList."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new TestCollectionEndingWithWordList(value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs index ebdcf12ab84..a90c3ad226c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -129,15 +129,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (testCollectionEndingWithWordList == null) throw new ArgumentNullException(nameof(testCollectionEndingWithWordList), "Property is required for class TestCollectionEndingWithWordListObject."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new TestCollectionEndingWithWordListObject(testCollectionEndingWithWordList); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Triangle.cs index 752c07d66e6..2e2981c93b3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Triangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Triangle.cs @@ -168,15 +168,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader equilateralTriangleReader = utf8JsonReader; - bool equilateralTriangleDeserialized = Client.ClientUtils.TryDeserialize(ref equilateralTriangleReader, jsonSerializerOptions, out EquilateralTriangle? equilateralTriangle); - - Utf8JsonReader isoscelesTriangleReader = utf8JsonReader; - bool isoscelesTriangleDeserialized = Client.ClientUtils.TryDeserialize(ref isoscelesTriangleReader, jsonSerializerOptions, out IsoscelesTriangle? isoscelesTriangle); - - Utf8JsonReader scaleneTriangleReader = utf8JsonReader; - bool scaleneTriangleDeserialized = Client.ClientUtils.TryDeserialize(ref scaleneTriangleReader, jsonSerializerOptions, out ScaleneTriangle? scaleneTriangle); - string? shapeType = default; string? triangleType = default; @@ -207,25 +198,22 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (shapeType == null) throw new ArgumentNullException(nameof(shapeType), "Property is required for class Triangle."); if (triangleType == null) throw new ArgumentNullException(nameof(triangleType), "Property is required for class Triangle."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (equilateralTriangleDeserialized) + Utf8JsonReader equilateralTriangleReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref equilateralTriangleReader, jsonSerializerOptions, out EquilateralTriangle? equilateralTriangle)) return new Triangle(equilateralTriangle, shapeType, triangleType); - if (isoscelesTriangleDeserialized) + Utf8JsonReader isoscelesTriangleReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref isoscelesTriangleReader, jsonSerializerOptions, out IsoscelesTriangle? isoscelesTriangle)) return new Triangle(isoscelesTriangle, shapeType, triangleType); - if (scaleneTriangleDeserialized) + Utf8JsonReader scaleneTriangleReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref scaleneTriangleReader, jsonSerializerOptions, out ScaleneTriangle? scaleneTriangle)) return new Triangle(scaleneTriangle, shapeType, triangleType); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TriangleInterface.cs index 2afce81b29e..2a89da9051f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -128,15 +128,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (triangleType == null) throw new ArgumentNullException(nameof(triangleType), "Property is required for class TriangleInterface."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new TriangleInterface(triangleType); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/User.cs index 40ccfb2b043..e7fefa3a249 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/User.cs @@ -282,9 +282,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (id == null) throw new ArgumentNullException(nameof(id), "Property is required for class User."); @@ -312,9 +309,6 @@ namespace Org.OpenAPITools.Model if (objectWithNoDeclaredProps == null) throw new ArgumentNullException(nameof(objectWithNoDeclaredProps), "Property is required for class User."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new User(email, firstName, id.Value, lastName, objectWithNoDeclaredProps, password, phone, userStatus.Value, username, anyTypeProp, anyTypePropNullable, objectWithNoDeclaredPropsNullable); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Whale.cs index 25a9967fe0a..a001439ef33 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Whale.cs @@ -156,9 +156,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (hasBaleen == null) throw new ArgumentNullException(nameof(hasBaleen), "Property is required for class Whale."); @@ -168,9 +165,6 @@ namespace Org.OpenAPITools.Model if (className == null) throw new ArgumentNullException(nameof(className), "Property is required for class Whale."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Whale(className, hasBaleen.Value, hasTeeth.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Zebra.cs index 0c765356b76..f1e5522bad9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/Zebra.cs @@ -203,18 +203,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (type == null) throw new ArgumentNullException(nameof(type), "Property is required for class Zebra."); if (className == null) throw new ArgumentNullException(nameof(className), "Property is required for class Zebra."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Zebra(className, type.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs index 4b334fc87f3..d48d86be04f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs @@ -178,15 +178,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (zeroBasedEnum == null) throw new ArgumentNullException(nameof(zeroBasedEnum), "Property is required for class ZeroBasedEnumClass."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ZeroBasedEnumClass(zeroBasedEnum.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Activity.cs index dac0f99da36..3020fab76b2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Activity.cs @@ -127,15 +127,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (activityOutputs == null) throw new ArgumentNullException(nameof(activityOutputs), "Property is required for class Activity."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Activity(activityOutputs); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index 565366e561d..d4fabef9afc 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -140,18 +140,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (prop1 == null) throw new ArgumentNullException(nameof(prop1), "Property is required for class ActivityOutputElementRepresentation."); if (prop2 == null) throw new ArgumentNullException(nameof(prop2), "Property is required for class ActivityOutputElementRepresentation."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ActivityOutputElementRepresentation(prop1, prop2); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index f55751b3753..61ea13598ae 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -226,9 +226,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (mapProperty == null) throw new ArgumentNullException(nameof(mapProperty), "Property is required for class AdditionalPropertiesClass."); @@ -250,9 +247,6 @@ namespace Org.OpenAPITools.Model if (mapWithUndeclaredPropertiesString == null) throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesString), "Property is required for class AdditionalPropertiesClass."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new AdditionalPropertiesClass(emptyMap, mapOfMapProperty, mapProperty, mapWithUndeclaredPropertiesAnytype1, mapWithUndeclaredPropertiesAnytype2, mapWithUndeclaredPropertiesAnytype3, mapWithUndeclaredPropertiesString, anytype1); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Animal.cs index 7d3d25b94ca..92ab1823b43 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Animal.cs @@ -149,18 +149,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (className == null) throw new ArgumentNullException(nameof(className), "Property is required for class Animal."); if (color == null) throw new ArgumentNullException(nameof(color), "Property is required for class Animal."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Animal(className, color); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ApiResponse.cs index e1c238e04d0..838ba328079 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -153,9 +153,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (code == null) throw new ArgumentNullException(nameof(code), "Property is required for class ApiResponse."); @@ -165,9 +162,6 @@ namespace Org.OpenAPITools.Model if (message == null) throw new ArgumentNullException(nameof(message), "Property is required for class ApiResponse."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ApiResponse(code.Value, message, type); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Apple.cs index 7e26845f6e3..f78829773db 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Apple.cs @@ -153,18 +153,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (cultivar == null) throw new ArgumentNullException(nameof(cultivar), "Property is required for class Apple."); if (origin == null) throw new ArgumentNullException(nameof(origin), "Property is required for class Apple."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Apple(cultivar, origin); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AppleReq.cs index 82e9e18c299..8bf8d926046 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/AppleReq.cs @@ -133,18 +133,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (cultivar == null) throw new ArgumentNullException(nameof(cultivar), "Property is required for class AppleReq."); if (mealy == null) throw new ArgumentNullException(nameof(mealy), "Property is required for class AppleReq."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new AppleReq(cultivar, mealy.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 1eba7ca7c1f..9e502a3045e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -127,15 +127,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (arrayArrayNumber == null) throw new ArgumentNullException(nameof(arrayArrayNumber), "Property is required for class ArrayOfArrayOfNumberOnly."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ArrayOfArrayOfNumberOnly(arrayArrayNumber); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 8550a0e401e..01380bb354a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -127,15 +127,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (arrayNumber == null) throw new ArgumentNullException(nameof(arrayNumber), "Property is required for class ArrayOfNumberOnly."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ArrayOfNumberOnly(arrayNumber); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayTest.cs index a565d699d23..a6e44c07679 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -155,9 +155,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (arrayOfString == null) throw new ArgumentNullException(nameof(arrayOfString), "Property is required for class ArrayTest."); @@ -167,9 +164,6 @@ namespace Org.OpenAPITools.Model if (arrayArrayOfModel == null) throw new ArgumentNullException(nameof(arrayArrayOfModel), "Property is required for class ArrayTest."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ArrayTest(arrayArrayOfInteger, arrayArrayOfModel, arrayOfString); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Banana.cs index 2e737ffc9e6..684785197d7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Banana.cs @@ -127,15 +127,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (lengthCm == null) throw new ArgumentNullException(nameof(lengthCm), "Property is required for class Banana."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Banana(lengthCm.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BananaReq.cs index 5feeb1b2b49..bdd9b39fa30 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BananaReq.cs @@ -134,18 +134,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (lengthCm == null) throw new ArgumentNullException(nameof(lengthCm), "Property is required for class BananaReq."); if (sweet == null) throw new ArgumentNullException(nameof(sweet), "Property is required for class BananaReq."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new BananaReq(lengthCm.Value, sweet.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BasquePig.cs index 17c0651c644..a3fb00eafb1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/BasquePig.cs @@ -126,15 +126,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (className == null) throw new ArgumentNullException(nameof(className), "Property is required for class BasquePig."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new BasquePig(className); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Capitalization.cs index 9c4576bb3da..c4895878409 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Capitalization.cs @@ -192,9 +192,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (smallCamel == null) throw new ArgumentNullException(nameof(smallCamel), "Property is required for class Capitalization."); @@ -213,9 +210,6 @@ namespace Org.OpenAPITools.Model if (aTTNAME == null) throw new ArgumentNullException(nameof(aTTNAME), "Property is required for class Capitalization."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Capitalization(aTTNAME, capitalCamel, capitalSnake, sCAETHFlowPoints, smallCamel, smallSnake); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/CatAllOf.cs index 6d8a1efa084..1f37570550b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/CatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -127,15 +127,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (declawed == null) throw new ArgumentNullException(nameof(declawed), "Property is required for class CatAllOf."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new CatAllOf(declawed.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Category.cs index 323cc4b9661..873ce330a89 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Category.cs @@ -140,18 +140,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (id == null) throw new ArgumentNullException(nameof(id), "Property is required for class Category."); if (name == null) throw new ArgumentNullException(nameof(name), "Property is required for class Category."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Category(id.Value, name); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs index 36009d64af2..ff8d70d22bd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs @@ -178,18 +178,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (name == null) throw new ArgumentNullException(nameof(name), "Property is required for class ChildCatAllOf."); if (petType == null) throw new ArgumentNullException(nameof(petType), "Property is required for class ChildCatAllOf."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ChildCatAllOf(name, petType.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ClassModel.cs index 989edc34434..e3a146864d1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ClassModel.cs @@ -126,15 +126,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (classProperty == null) throw new ArgumentNullException(nameof(classProperty), "Property is required for class ClassModel."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ClassModel(classProperty); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 44cd2fe8732..553d7d9af50 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -111,7 +111,6 @@ namespace Org.OpenAPITools.Model Utf8JsonReader quadrilateralInterfaceReader = utf8JsonReader; bool quadrilateralInterfaceDeserialized = Client.ClientUtils.TryDeserialize(ref utf8JsonReader, jsonSerializerOptions, out QuadrilateralInterface quadrilateralInterface); - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DanishPig.cs index da2e08b3bb6..d7062249a76 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DanishPig.cs @@ -126,15 +126,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (className == null) throw new ArgumentNullException(nameof(className), "Property is required for class DanishPig."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new DanishPig(className); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DateOnlyClass.cs index ba7cbca6299..d54208370c1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -133,15 +133,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (dateOnlyProperty == null) throw new ArgumentNullException(nameof(dateOnlyProperty), "Property is required for class DateOnlyClass."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new DateOnlyClass(dateOnlyProperty.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs index b0017e429e7..72d508f4b92 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -126,15 +126,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (name == null) throw new ArgumentNullException(nameof(name), "Property is required for class DeprecatedObject."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new DeprecatedObject(name); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DogAllOf.cs index f45a8268ffc..2705b3d959f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DogAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -126,15 +126,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (breed == null) throw new ArgumentNullException(nameof(breed), "Property is required for class DogAllOf."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new DogAllOf(breed); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Drawing.cs index 7766e34af10..97422ed4f8d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Drawing.cs @@ -163,9 +163,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (mainShape == null) throw new ArgumentNullException(nameof(mainShape), "Property is required for class Drawing."); @@ -175,9 +172,6 @@ namespace Org.OpenAPITools.Model if (shapes == null) throw new ArgumentNullException(nameof(shapes), "Property is required for class Drawing."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Drawing(mainShape, shapeOrNull, shapes, nullableShape); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumArrays.cs index 810c2488dc0..7004134e68b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -239,18 +239,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (justSymbol == null) throw new ArgumentNullException(nameof(justSymbol), "Property is required for class EnumArrays."); if (arrayEnum == null) throw new ArgumentNullException(nameof(arrayEnum), "Property is required for class EnumArrays."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new EnumArrays(arrayEnum, justSymbol.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumTest.cs index b2f81f79071..937aa9595a0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EnumTest.cs @@ -494,9 +494,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (enumString == null) throw new ArgumentNullException(nameof(enumString), "Property is required for class EnumTest."); @@ -521,9 +518,6 @@ namespace Org.OpenAPITools.Model if (outerEnumIntegerDefaultValue == null) throw new ArgumentNullException(nameof(outerEnumIntegerDefaultValue), "Property is required for class EnumTest."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new EnumTest(enumInteger.Value, enumIntegerOnly.Value, enumNumber.Value, enumString.Value, enumStringRequired.Value, outerEnumDefaultValue.Value, outerEnumInteger.Value, outerEnumIntegerDefaultValue.Value, outerEnum.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index 2046f15222b..0a40c44fffc 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -111,7 +111,6 @@ namespace Org.OpenAPITools.Model Utf8JsonReader triangleInterfaceReader = utf8JsonReader; bool triangleInterfaceDeserialized = Client.ClientUtils.TryDeserialize(ref utf8JsonReader, jsonSerializerOptions, out TriangleInterface triangleInterface); - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/File.cs index d7d907d8686..a9b60ad8ca0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/File.cs @@ -127,15 +127,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (sourceURI == null) throw new ArgumentNullException(nameof(sourceURI), "Property is required for class File."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new File(sourceURI); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index 101e5918ba9..7bad1ccf2bf 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -141,18 +141,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (file == null) throw new ArgumentNullException(nameof(file), "Property is required for class FileSchemaTestClass."); if (files == null) throw new ArgumentNullException(nameof(files), "Property is required for class FileSchemaTestClass."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new FileSchemaTestClass(file, files); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Foo.cs index d9d0aeeaebf..b34c9fd24f3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Foo.cs @@ -126,15 +126,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (bar == null) throw new ArgumentNullException(nameof(bar), "Property is required for class Foo."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Foo(bar); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index 4d4073061bd..a04de35840d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -127,15 +127,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (stringProperty == null) throw new ArgumentNullException(nameof(stringProperty), "Property is required for class FooGetDefaultResponse."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new FooGetDefaultResponse(stringProperty); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FormatTest.cs index bc1f8031562..5d2551a1bbe 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FormatTest.cs @@ -502,9 +502,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (integer == null) throw new ArgumentNullException(nameof(integer), "Property is required for class FormatTest."); @@ -562,9 +559,6 @@ namespace Org.OpenAPITools.Model if (patternWithBackslash == null) throw new ArgumentNullException(nameof(patternWithBackslash), "Property is required for class FormatTest."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new FormatTest(binary, byteProperty, date.Value, dateTime.Value, decimalProperty.Value, doubleProperty.Value, floatProperty.Value, int32.Value, int64.Value, integer.Value, number.Value, password, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, stringProperty, unsignedInteger.Value, unsignedLong.Value, uuid.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Fruit.cs index 78a2e9c1fb2..6768f9b0937 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Fruit.cs @@ -118,12 +118,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader appleReader = utf8JsonReader; - bool appleDeserialized = Client.ClientUtils.TryDeserialize(ref appleReader, jsonSerializerOptions, out Apple apple); - - Utf8JsonReader bananaReader = utf8JsonReader; - bool bananaDeserialized = Client.ClientUtils.TryDeserialize(ref bananaReader, jsonSerializerOptions, out Banana banana); - string color = default; while (utf8JsonReader.Read()) @@ -150,19 +144,15 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (color == null) throw new ArgumentNullException(nameof(color), "Property is required for class Fruit."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (appleDeserialized) + Utf8JsonReader appleReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref appleReader, jsonSerializerOptions, out Apple apple)) return new Fruit(apple, color); - if (bananaDeserialized) + Utf8JsonReader bananaReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref bananaReader, jsonSerializerOptions, out Banana banana)) return new Fruit(banana, color); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FruitReq.cs index 641f2de4ea2..f90d281a2d2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FruitReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/FruitReq.cs @@ -107,13 +107,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader appleReqReader = utf8JsonReader; - bool appleReqDeserialized = Client.ClientUtils.TryDeserialize(ref appleReqReader, jsonSerializerOptions, out AppleReq appleReq); - - Utf8JsonReader bananaReqReader = utf8JsonReader; - bool bananaReqDeserialized = Client.ClientUtils.TryDeserialize(ref bananaReqReader, jsonSerializerOptions, out BananaReq bananaReq); - - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -135,10 +128,12 @@ namespace Org.OpenAPITools.Model } } - if (appleReqDeserialized) + Utf8JsonReader appleReqReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref appleReqReader, jsonSerializerOptions, out AppleReq appleReq)) return new FruitReq(appleReq); - if (bananaReqDeserialized) + Utf8JsonReader bananaReqReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref bananaReqReader, jsonSerializerOptions, out BananaReq bananaReq)) return new FruitReq(bananaReq); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/GmFruit.cs index 91eed1b98e9..9f59259d0db 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/GmFruit.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/GmFruit.cs @@ -139,15 +139,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (color == null) throw new ArgumentNullException(nameof(color), "Property is required for class GmFruit."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new GmFruit(apple, banana, color); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index a38f927e4c6..8fe518006f6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -136,15 +136,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (petType == null) throw new ArgumentNullException(nameof(petType), "Property is required for class GrandparentAnimal."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new GrandparentAnimal(petType); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index 22b4a6b287a..1789f7dc3fb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -176,18 +176,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (bar == null) throw new ArgumentNullException(nameof(bar), "Property is required for class HasOnlyReadOnly."); if (foo == null) throw new ArgumentNullException(nameof(foo), "Property is required for class HasOnlyReadOnly."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new HasOnlyReadOnly(bar, foo); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index 87b9008aec5..8d4dcb47be1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -104,7 +104,6 @@ namespace Org.OpenAPITools.Model Utf8JsonReader triangleInterfaceReader = utf8JsonReader; bool triangleInterfaceDeserialized = Client.ClientUtils.TryDeserialize(ref utf8JsonReader, jsonSerializerOptions, out TriangleInterface triangleInterface); - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/List.cs index 1fec7939b46..e0a1bebc78a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/List.cs @@ -126,15 +126,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (_123list == null) throw new ArgumentNullException(nameof(_123list), "Property is required for class List."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new List(_123list); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/LiteralStringClass.cs index c6d53c018cc..39cbb0d5182 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/LiteralStringClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -139,18 +139,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (escapedLiteralString == null) throw new ArgumentNullException(nameof(escapedLiteralString), "Property is required for class LiteralStringClass."); if (unescapedLiteralString == null) throw new ArgumentNullException(nameof(unescapedLiteralString), "Property is required for class LiteralStringClass."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new LiteralStringClass(escapedLiteralString, unescapedLiteralString); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Mammal.cs index 98602ea3747..1ed504e6363 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Mammal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Mammal.cs @@ -140,16 +140,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader whaleReader = utf8JsonReader; - bool whaleDeserialized = Client.ClientUtils.TryDeserialize(ref whaleReader, jsonSerializerOptions, out Whale whale); - - Utf8JsonReader zebraReader = utf8JsonReader; - bool zebraDeserialized = Client.ClientUtils.TryDeserialize(ref zebraReader, jsonSerializerOptions, out Zebra zebra); - - Utf8JsonReader pigReader = utf8JsonReader; - bool pigDeserialized = Client.ClientUtils.TryDeserialize(ref pigReader, jsonSerializerOptions, out Pig pig); - - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -171,13 +161,16 @@ namespace Org.OpenAPITools.Model } } - if (whaleDeserialized) + Utf8JsonReader whaleReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref whaleReader, jsonSerializerOptions, out Whale whale)) return new Mammal(whale); - if (zebraDeserialized) + Utf8JsonReader zebraReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref zebraReader, jsonSerializerOptions, out Zebra zebra)) return new Mammal(zebra); - if (pigDeserialized) + Utf8JsonReader pigReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref pigReader, jsonSerializerOptions, out Pig pig)) return new Mammal(pig); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MapTest.cs index 6969b3b7415..f30beffd779 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MapTest.cs @@ -218,9 +218,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (mapMapOfString == null) throw new ArgumentNullException(nameof(mapMapOfString), "Property is required for class MapTest."); @@ -233,9 +230,6 @@ namespace Org.OpenAPITools.Model if (indirectMap == null) throw new ArgumentNullException(nameof(indirectMap), "Property is required for class MapTest."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new MapTest(directMap, indirectMap, mapMapOfString, mapOfEnumString); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 8c36f9556b0..42f0b186313 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -181,9 +181,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (uuidWithPattern == null) throw new ArgumentNullException(nameof(uuidWithPattern), "Property is required for class MixedPropertiesAndAdditionalPropertiesClass."); @@ -196,9 +193,6 @@ namespace Org.OpenAPITools.Model if (map == null) throw new ArgumentNullException(nameof(map), "Property is required for class MixedPropertiesAndAdditionalPropertiesClass."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new MixedPropertiesAndAdditionalPropertiesClass(dateTime.Value, map, uuid.Value, uuidWithPattern.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Model200Response.cs index df9cc94292e..f0206c1a01b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Model200Response.cs @@ -140,18 +140,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (name == null) throw new ArgumentNullException(nameof(name), "Property is required for class Model200Response."); if (classProperty == null) throw new ArgumentNullException(nameof(classProperty), "Property is required for class Model200Response."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Model200Response(classProperty, name.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ModelClient.cs index 16dcbc8cb9b..49336cff7a5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ModelClient.cs @@ -126,15 +126,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (clientProperty == null) throw new ArgumentNullException(nameof(clientProperty), "Property is required for class ModelClient."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ModelClient(clientProperty); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Name.cs index 1ab31f1d5ee..e84d1732fec 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Name.cs @@ -205,9 +205,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (nameProperty == null) throw new ArgumentNullException(nameof(nameProperty), "Property is required for class Name."); @@ -220,9 +217,6 @@ namespace Org.OpenAPITools.Model if (_123number == null) throw new ArgumentNullException(nameof(_123number), "Property is required for class Name."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Name(nameProperty.Value, property, snakeCase.Value, _123number.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableClass.cs index 01b319519e7..fadeea483db 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableClass.cs @@ -284,18 +284,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (arrayItemsNullable == null) throw new ArgumentNullException(nameof(arrayItemsNullable), "Property is required for class NullableClass."); if (objectItemsNullable == null) throw new ArgumentNullException(nameof(objectItemsNullable), "Property is required for class NullableClass."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new NullableClass(arrayItemsNullable, objectItemsNullable, arrayAndItemsNullableProp, arrayNullableProp, booleanProp, dateProp, datetimeProp, integerProp, numberProp, objectAndItemsNullableProp, objectNullableProp, stringProp); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableShape.cs index 4c3393931c4..d4e8320c498 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableShape.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NullableShape.cs @@ -124,13 +124,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader triangleReader = utf8JsonReader; - bool triangleDeserialized = Client.ClientUtils.TryDeserialize(ref triangleReader, jsonSerializerOptions, out Triangle triangle); - - Utf8JsonReader quadrilateralReader = utf8JsonReader; - bool quadrilateralDeserialized = Client.ClientUtils.TryDeserialize(ref quadrilateralReader, jsonSerializerOptions, out Quadrilateral quadrilateral); - - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -152,10 +145,12 @@ namespace Org.OpenAPITools.Model } } - if (triangleDeserialized) + Utf8JsonReader triangleReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref triangleReader, jsonSerializerOptions, out Triangle triangle)) return new NullableShape(triangle); - if (quadrilateralDeserialized) + Utf8JsonReader quadrilateralReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref quadrilateralReader, jsonSerializerOptions, out Quadrilateral quadrilateral)) return new NullableShape(quadrilateral); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NumberOnly.cs index bb85b6ebef7..63e443184f0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -127,15 +127,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (justNumber == null) throw new ArgumentNullException(nameof(justNumber), "Property is required for class NumberOnly."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new NumberOnly(justNumber.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 912d061c1dc..ef3619483d1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -171,9 +171,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (uuid == null) throw new ArgumentNullException(nameof(uuid), "Property is required for class ObjectWithDeprecatedFields."); @@ -186,9 +183,6 @@ namespace Org.OpenAPITools.Model if (bars == null) throw new ArgumentNullException(nameof(bars), "Property is required for class ObjectWithDeprecatedFields."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ObjectWithDeprecatedFields(bars, deprecatedRef, id.Value, uuid); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OneOfString.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OneOfString.cs index 01a202174aa..c6bd77e4252 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OneOfString.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OneOfString.cs @@ -98,10 +98,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader _stringReader = utf8JsonReader; - bool _stringDeserialized = Client.ClientUtils.TryDeserialize(ref _stringReader, jsonSerializerOptions, out string _string); - - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -123,7 +119,8 @@ namespace Org.OpenAPITools.Model } } - if (_stringDeserialized) + Utf8JsonReader _stringReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref _stringReader, jsonSerializerOptions, out string _string)) return new OneOfString(_string); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Order.cs index d3ceff37553..160c426f5a6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Order.cs @@ -265,9 +265,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (id == null) throw new ArgumentNullException(nameof(id), "Property is required for class Order."); @@ -286,9 +283,6 @@ namespace Org.OpenAPITools.Model if (complete == null) throw new ArgumentNullException(nameof(complete), "Property is required for class Order."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Order(id.Value, petId.Value, quantity.Value, shipDate.Value, status.Value, complete.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterComposite.cs index a874a122213..75a248beddb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -154,9 +154,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (myNumber == null) throw new ArgumentNullException(nameof(myNumber), "Property is required for class OuterComposite."); @@ -166,9 +163,6 @@ namespace Org.OpenAPITools.Model if (myBoolean == null) throw new ArgumentNullException(nameof(myBoolean), "Property is required for class OuterComposite."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new OuterComposite(myBoolean.Value, myNumber.Value, myString); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Pet.cs index 61b435aa846..059afffbf5d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Pet.cs @@ -259,9 +259,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (id == null) throw new ArgumentNullException(nameof(id), "Property is required for class Pet."); @@ -280,9 +277,6 @@ namespace Org.OpenAPITools.Model if (status == null) throw new ArgumentNullException(nameof(status), "Property is required for class Pet."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Pet(category, id.Value, name, photoUrls, status.Value, tags); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Pig.cs index d00d60678a0..b659f226b88 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Pig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Pig.cs @@ -124,13 +124,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader basquePigReader = utf8JsonReader; - bool basquePigDeserialized = Client.ClientUtils.TryDeserialize(ref basquePigReader, jsonSerializerOptions, out BasquePig basquePig); - - Utf8JsonReader danishPigReader = utf8JsonReader; - bool danishPigDeserialized = Client.ClientUtils.TryDeserialize(ref danishPigReader, jsonSerializerOptions, out DanishPig danishPig); - - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -152,10 +145,12 @@ namespace Org.OpenAPITools.Model } } - if (basquePigDeserialized) + Utf8JsonReader basquePigReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref basquePigReader, jsonSerializerOptions, out BasquePig basquePig)) return new Pig(basquePig); - if (danishPigDeserialized) + Utf8JsonReader danishPigReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref danishPigReader, jsonSerializerOptions, out DanishPig danishPig)) return new Pig(danishPig); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/PolymorphicProperty.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/PolymorphicProperty.cs index 55cb46421b6..1cd630cff76 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/PolymorphicProperty.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/PolymorphicProperty.cs @@ -146,19 +146,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader _boolReader = utf8JsonReader; - bool _boolDeserialized = Client.ClientUtils.TryDeserialize(ref _boolReader, jsonSerializerOptions, out bool _bool); - - Utf8JsonReader _stringReader = utf8JsonReader; - bool _stringDeserialized = Client.ClientUtils.TryDeserialize(ref _stringReader, jsonSerializerOptions, out string _string); - - Utf8JsonReader _objectReader = utf8JsonReader; - bool _objectDeserialized = Client.ClientUtils.TryDeserialize(ref _objectReader, jsonSerializerOptions, out Object _object); - - Utf8JsonReader liststringReader = utf8JsonReader; - bool liststringDeserialized = Client.ClientUtils.TryDeserialize>(ref liststringReader, jsonSerializerOptions, out List liststring); - - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -180,16 +167,20 @@ namespace Org.OpenAPITools.Model } } - if (_boolDeserialized) + Utf8JsonReader _boolReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref _boolReader, jsonSerializerOptions, out bool _bool)) return new PolymorphicProperty(_bool); - if (_stringDeserialized) + Utf8JsonReader _stringReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref _stringReader, jsonSerializerOptions, out string _string)) return new PolymorphicProperty(_string); - if (_objectDeserialized) + Utf8JsonReader _objectReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref _objectReader, jsonSerializerOptions, out Object _object)) return new PolymorphicProperty(_object); - if (liststringDeserialized) + Utf8JsonReader liststringReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize>(ref liststringReader, jsonSerializerOptions, out List liststring)) return new PolymorphicProperty(liststring); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Quadrilateral.cs index 39a442372c9..2dffe5fbc7e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Quadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -124,13 +124,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader simpleQuadrilateralReader = utf8JsonReader; - bool simpleQuadrilateralDeserialized = Client.ClientUtils.TryDeserialize(ref simpleQuadrilateralReader, jsonSerializerOptions, out SimpleQuadrilateral simpleQuadrilateral); - - Utf8JsonReader complexQuadrilateralReader = utf8JsonReader; - bool complexQuadrilateralDeserialized = Client.ClientUtils.TryDeserialize(ref complexQuadrilateralReader, jsonSerializerOptions, out ComplexQuadrilateral complexQuadrilateral); - - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -152,10 +145,12 @@ namespace Org.OpenAPITools.Model } } - if (simpleQuadrilateralDeserialized) + Utf8JsonReader simpleQuadrilateralReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref simpleQuadrilateralReader, jsonSerializerOptions, out SimpleQuadrilateral simpleQuadrilateral)) return new Quadrilateral(simpleQuadrilateral); - if (complexQuadrilateralDeserialized) + Utf8JsonReader complexQuadrilateralReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref complexQuadrilateralReader, jsonSerializerOptions, out ComplexQuadrilateral complexQuadrilateral)) return new Quadrilateral(complexQuadrilateral); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index d74d41b497a..e079cb6b4e7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -126,15 +126,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (quadrilateralType == null) throw new ArgumentNullException(nameof(quadrilateralType), "Property is required for class QuadrilateralInterface."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new QuadrilateralInterface(quadrilateralType); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index 1694bdc90b4..9a5d0c05228 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -175,18 +175,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (bar == null) throw new ArgumentNullException(nameof(bar), "Property is required for class ReadOnlyFirst."); if (baz == null) throw new ArgumentNullException(nameof(baz), "Property is required for class ReadOnlyFirst."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ReadOnlyFirst(bar, baz); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Return.cs index ffb0fce2e46..076d3a3b569 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Return.cs @@ -127,15 +127,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (returnProperty == null) throw new ArgumentNullException(nameof(returnProperty), "Property is required for class Return."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Return(returnProperty.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index 4f4da675fb6..3968093b6ec 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -111,7 +111,6 @@ namespace Org.OpenAPITools.Model Utf8JsonReader triangleInterfaceReader = utf8JsonReader; bool triangleInterfaceDeserialized = Client.ClientUtils.TryDeserialize(ref utf8JsonReader, jsonSerializerOptions, out TriangleInterface triangleInterface); - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Shape.cs index 61c35d97a25..bfc7c8af649 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Shape.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Shape.cs @@ -135,12 +135,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader triangleReader = utf8JsonReader; - bool triangleDeserialized = Client.ClientUtils.TryDeserialize(ref triangleReader, jsonSerializerOptions, out Triangle triangle); - - Utf8JsonReader quadrilateralReader = utf8JsonReader; - bool quadrilateralDeserialized = Client.ClientUtils.TryDeserialize(ref quadrilateralReader, jsonSerializerOptions, out Quadrilateral quadrilateral); - string quadrilateralType = default; while (utf8JsonReader.Read()) @@ -167,19 +161,15 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (quadrilateralType == null) throw new ArgumentNullException(nameof(quadrilateralType), "Property is required for class Shape."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (triangleDeserialized) + Utf8JsonReader triangleReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref triangleReader, jsonSerializerOptions, out Triangle triangle)) return new Shape(triangle, quadrilateralType); - if (quadrilateralDeserialized) + Utf8JsonReader quadrilateralReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref quadrilateralReader, jsonSerializerOptions, out Quadrilateral quadrilateral)) return new Shape(quadrilateral, quadrilateralType); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ShapeInterface.cs index 74c4c7eabcb..9c3d9aaee1a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -126,15 +126,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (shapeType == null) throw new ArgumentNullException(nameof(shapeType), "Property is required for class ShapeInterface."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ShapeInterface(shapeType); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ShapeOrNull.cs index 1eee2ffdabb..c2f1d3a86b4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ShapeOrNull.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -135,12 +135,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader triangleReader = utf8JsonReader; - bool triangleDeserialized = Client.ClientUtils.TryDeserialize(ref triangleReader, jsonSerializerOptions, out Triangle triangle); - - Utf8JsonReader quadrilateralReader = utf8JsonReader; - bool quadrilateralDeserialized = Client.ClientUtils.TryDeserialize(ref quadrilateralReader, jsonSerializerOptions, out Quadrilateral quadrilateral); - string quadrilateralType = default; while (utf8JsonReader.Read()) @@ -167,19 +161,15 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (quadrilateralType == null) throw new ArgumentNullException(nameof(quadrilateralType), "Property is required for class ShapeOrNull."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (triangleDeserialized) + Utf8JsonReader triangleReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref triangleReader, jsonSerializerOptions, out Triangle triangle)) return new ShapeOrNull(triangle, quadrilateralType); - if (quadrilateralDeserialized) + Utf8JsonReader quadrilateralReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref quadrilateralReader, jsonSerializerOptions, out Quadrilateral quadrilateral)) return new ShapeOrNull(quadrilateral, quadrilateralType); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index bb1f464b9c2..9b3db311f7d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -111,7 +111,6 @@ namespace Org.OpenAPITools.Model Utf8JsonReader quadrilateralInterfaceReader = utf8JsonReader; bool quadrilateralInterfaceDeserialized = Client.ClientUtils.TryDeserialize(ref utf8JsonReader, jsonSerializerOptions, out QuadrilateralInterface quadrilateralInterface); - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SpecialModelName.cs index f5c8c24df68..13d870a94fd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -140,18 +140,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (specialPropertyName == null) throw new ArgumentNullException(nameof(specialPropertyName), "Property is required for class SpecialModelName."); if (specialModelNameProperty == null) throw new ArgumentNullException(nameof(specialModelNameProperty), "Property is required for class SpecialModelName."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new SpecialModelName(specialModelNameProperty, specialPropertyName.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Tag.cs index 4178322dc20..c5f56da79d5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Tag.cs @@ -140,18 +140,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (id == null) throw new ArgumentNullException(nameof(id), "Property is required for class Tag."); if (name == null) throw new ArgumentNullException(nameof(name), "Property is required for class Tag."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Tag(id.Value, name); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs index f0656707451..d4b2d10520e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -126,15 +126,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (value == null) throw new ArgumentNullException(nameof(value), "Property is required for class TestCollectionEndingWithWordList."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new TestCollectionEndingWithWordList(value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs index ac76595dc3f..4f23a08f5fe 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -127,15 +127,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (testCollectionEndingWithWordList == null) throw new ArgumentNullException(nameof(testCollectionEndingWithWordList), "Property is required for class TestCollectionEndingWithWordListObject."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new TestCollectionEndingWithWordListObject(testCollectionEndingWithWordList); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Triangle.cs index 064dae2401b..88a29b1e3ce 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Triangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Triangle.cs @@ -166,15 +166,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader equilateralTriangleReader = utf8JsonReader; - bool equilateralTriangleDeserialized = Client.ClientUtils.TryDeserialize(ref equilateralTriangleReader, jsonSerializerOptions, out EquilateralTriangle equilateralTriangle); - - Utf8JsonReader isoscelesTriangleReader = utf8JsonReader; - bool isoscelesTriangleDeserialized = Client.ClientUtils.TryDeserialize(ref isoscelesTriangleReader, jsonSerializerOptions, out IsoscelesTriangle isoscelesTriangle); - - Utf8JsonReader scaleneTriangleReader = utf8JsonReader; - bool scaleneTriangleDeserialized = Client.ClientUtils.TryDeserialize(ref scaleneTriangleReader, jsonSerializerOptions, out ScaleneTriangle scaleneTriangle); - string shapeType = default; string triangleType = default; @@ -205,25 +196,22 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (shapeType == null) throw new ArgumentNullException(nameof(shapeType), "Property is required for class Triangle."); if (triangleType == null) throw new ArgumentNullException(nameof(triangleType), "Property is required for class Triangle."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (equilateralTriangleDeserialized) + Utf8JsonReader equilateralTriangleReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref equilateralTriangleReader, jsonSerializerOptions, out EquilateralTriangle equilateralTriangle)) return new Triangle(equilateralTriangle, shapeType, triangleType); - if (isoscelesTriangleDeserialized) + Utf8JsonReader isoscelesTriangleReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref isoscelesTriangleReader, jsonSerializerOptions, out IsoscelesTriangle isoscelesTriangle)) return new Triangle(isoscelesTriangle, shapeType, triangleType); - if (scaleneTriangleDeserialized) + Utf8JsonReader scaleneTriangleReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref scaleneTriangleReader, jsonSerializerOptions, out ScaleneTriangle scaleneTriangle)) return new Triangle(scaleneTriangle, shapeType, triangleType); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TriangleInterface.cs index a0c62a82a2e..5e70d717168 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -126,15 +126,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (triangleType == null) throw new ArgumentNullException(nameof(triangleType), "Property is required for class TriangleInterface."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new TriangleInterface(triangleType); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/User.cs index 4a695ca4502..c2c70e1318e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/User.cs @@ -280,9 +280,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (id == null) throw new ArgumentNullException(nameof(id), "Property is required for class User."); @@ -310,9 +307,6 @@ namespace Org.OpenAPITools.Model if (objectWithNoDeclaredProps == null) throw new ArgumentNullException(nameof(objectWithNoDeclaredProps), "Property is required for class User."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new User(email, firstName, id.Value, lastName, objectWithNoDeclaredProps, password, phone, userStatus.Value, username, anyTypeProp, anyTypePropNullable, objectWithNoDeclaredPropsNullable); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Whale.cs index 4d35765e396..2cf3d80ac18 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Whale.cs @@ -154,9 +154,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (hasBaleen == null) throw new ArgumentNullException(nameof(hasBaleen), "Property is required for class Whale."); @@ -166,9 +163,6 @@ namespace Org.OpenAPITools.Model if (className == null) throw new ArgumentNullException(nameof(className), "Property is required for class Whale."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Whale(className, hasBaleen.Value, hasTeeth.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Zebra.cs index dfddcde7411..afee2e9035e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/Zebra.cs @@ -201,18 +201,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (type == null) throw new ArgumentNullException(nameof(type), "Property is required for class Zebra."); if (className == null) throw new ArgumentNullException(nameof(className), "Property is required for class Zebra."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Zebra(className, type.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs index ac541b3b1e9..5eb9bbecf45 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs @@ -176,15 +176,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (zeroBasedEnum == null) throw new ArgumentNullException(nameof(zeroBasedEnum), "Property is required for class ZeroBasedEnumClass."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ZeroBasedEnumClass(zeroBasedEnum.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/AdultAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/AdultAllOf.cs index ac3cdc57f8a..8dbfdb18ce2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/AdultAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/AdultAllOf.cs @@ -129,15 +129,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (children == null) throw new ArgumentNullException(nameof(children), "Property is required for class AdultAllOf."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new AdultAllOf(children); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/Child.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/Child.cs index ace339b29fc..6b15f8afe89 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/Child.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/Child.cs @@ -138,15 +138,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (boosterSeat == null) throw new ArgumentNullException(nameof(boosterSeat), "Property is required for class Child."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Child(childAllOf, boosterSeat.Value, firstName, lastName, type); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/ChildAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/ChildAllOf.cs index bccce993b7c..43b43f351fa 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/ChildAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/ChildAllOf.cs @@ -129,15 +129,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (age == null) throw new ArgumentNullException(nameof(age), "Property is required for class ChildAllOf."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ChildAllOf(age.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/Person.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/Person.cs index 6c779186995..660a6555da0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/Person.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-allOf/src/Org.OpenAPITools/Model/Person.cs @@ -164,9 +164,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (type == null) throw new ArgumentNullException(nameof(type), "Property is required for class Person."); @@ -176,9 +173,6 @@ namespace Org.OpenAPITools.Model if (firstName == null) throw new ArgumentNullException(nameof(firstName), "Property is required for class Person."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Person(firstName, lastName, type); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Model/Apple.cs index 135ae433743..041976e3b5f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Model/Apple.cs @@ -128,15 +128,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (kind == null) throw new ArgumentNullException(nameof(kind), "Property is required for class Apple."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Apple(kind); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Model/Banana.cs index 993b9470b86..a811b4e3677 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Model/Banana.cs @@ -129,15 +129,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (count == null) throw new ArgumentNullException(nameof(count), "Property is required for class Banana."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Banana(count.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Model/Fruit.cs index 21df84998a5..435cb44d55c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-anyOf/src/Org.OpenAPITools/Model/Fruit.cs @@ -148,15 +148,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (color == null) throw new ArgumentNullException(nameof(color), "Property is required for class Fruit."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Fruit(apple, banana, color); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Model/Apple.cs index 135ae433743..041976e3b5f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Model/Apple.cs @@ -128,15 +128,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (kind == null) throw new ArgumentNullException(nameof(kind), "Property is required for class Apple."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Apple(kind); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Model/Banana.cs index 993b9470b86..a811b4e3677 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Model/Banana.cs @@ -129,15 +129,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (count == null) throw new ArgumentNullException(nameof(count), "Property is required for class Banana."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Banana(count.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Model/Fruit.cs index cb968dc62cc..4eb410ea59f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore-latest-oneOf/src/Org.OpenAPITools/Model/Fruit.cs @@ -127,12 +127,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader appleReader = utf8JsonReader; - bool appleDeserialized = Client.ClientUtils.TryDeserialize(ref appleReader, jsonSerializerOptions, out Apple? apple); - - Utf8JsonReader bananaReader = utf8JsonReader; - bool bananaDeserialized = Client.ClientUtils.TryDeserialize(ref bananaReader, jsonSerializerOptions, out Banana? banana); - string? color = default; while (utf8JsonReader.Read()) @@ -159,19 +153,15 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (color == null) throw new ArgumentNullException(nameof(color), "Property is required for class Fruit."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (appleDeserialized) + Utf8JsonReader appleReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref appleReader, jsonSerializerOptions, out Apple? apple)) return new Fruit(apple, color); - if (bananaDeserialized) + Utf8JsonReader bananaReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref bananaReader, jsonSerializerOptions, out Banana? banana)) return new Fruit(banana, color); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Activity.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Activity.cs index dac0f99da36..3020fab76b2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Activity.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Activity.cs @@ -127,15 +127,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (activityOutputs == null) throw new ArgumentNullException(nameof(activityOutputs), "Property is required for class Activity."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Activity(activityOutputs); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs index 565366e561d..d4fabef9afc 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ActivityOutputElementRepresentation.cs @@ -140,18 +140,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (prop1 == null) throw new ArgumentNullException(nameof(prop1), "Property is required for class ActivityOutputElementRepresentation."); if (prop2 == null) throw new ArgumentNullException(nameof(prop2), "Property is required for class ActivityOutputElementRepresentation."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ActivityOutputElementRepresentation(prop1, prop2); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index f55751b3753..61ea13598ae 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -226,9 +226,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (mapProperty == null) throw new ArgumentNullException(nameof(mapProperty), "Property is required for class AdditionalPropertiesClass."); @@ -250,9 +247,6 @@ namespace Org.OpenAPITools.Model if (mapWithUndeclaredPropertiesString == null) throw new ArgumentNullException(nameof(mapWithUndeclaredPropertiesString), "Property is required for class AdditionalPropertiesClass."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new AdditionalPropertiesClass(emptyMap, mapOfMapProperty, mapProperty, mapWithUndeclaredPropertiesAnytype1, mapWithUndeclaredPropertiesAnytype2, mapWithUndeclaredPropertiesAnytype3, mapWithUndeclaredPropertiesString, anytype1); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Animal.cs index 7d3d25b94ca..92ab1823b43 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Animal.cs @@ -149,18 +149,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (className == null) throw new ArgumentNullException(nameof(className), "Property is required for class Animal."); if (color == null) throw new ArgumentNullException(nameof(color), "Property is required for class Animal."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Animal(className, color); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ApiResponse.cs index e1c238e04d0..838ba328079 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -153,9 +153,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (code == null) throw new ArgumentNullException(nameof(code), "Property is required for class ApiResponse."); @@ -165,9 +162,6 @@ namespace Org.OpenAPITools.Model if (message == null) throw new ArgumentNullException(nameof(message), "Property is required for class ApiResponse."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ApiResponse(code.Value, message, type); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Apple.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Apple.cs index 7e26845f6e3..f78829773db 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Apple.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Apple.cs @@ -153,18 +153,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (cultivar == null) throw new ArgumentNullException(nameof(cultivar), "Property is required for class Apple."); if (origin == null) throw new ArgumentNullException(nameof(origin), "Property is required for class Apple."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Apple(cultivar, origin); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AppleReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AppleReq.cs index 82e9e18c299..8bf8d926046 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AppleReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/AppleReq.cs @@ -133,18 +133,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (cultivar == null) throw new ArgumentNullException(nameof(cultivar), "Property is required for class AppleReq."); if (mealy == null) throw new ArgumentNullException(nameof(mealy), "Property is required for class AppleReq."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new AppleReq(cultivar, mealy.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index 1eba7ca7c1f..9e502a3045e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -127,15 +127,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (arrayArrayNumber == null) throw new ArgumentNullException(nameof(arrayArrayNumber), "Property is required for class ArrayOfArrayOfNumberOnly."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ArrayOfArrayOfNumberOnly(arrayArrayNumber); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index 8550a0e401e..01380bb354a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -127,15 +127,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (arrayNumber == null) throw new ArgumentNullException(nameof(arrayNumber), "Property is required for class ArrayOfNumberOnly."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ArrayOfNumberOnly(arrayNumber); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayTest.cs index a565d699d23..a6e44c07679 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -155,9 +155,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (arrayOfString == null) throw new ArgumentNullException(nameof(arrayOfString), "Property is required for class ArrayTest."); @@ -167,9 +164,6 @@ namespace Org.OpenAPITools.Model if (arrayArrayOfModel == null) throw new ArgumentNullException(nameof(arrayArrayOfModel), "Property is required for class ArrayTest."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ArrayTest(arrayArrayOfInteger, arrayArrayOfModel, arrayOfString); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Banana.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Banana.cs index 2e737ffc9e6..684785197d7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Banana.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Banana.cs @@ -127,15 +127,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (lengthCm == null) throw new ArgumentNullException(nameof(lengthCm), "Property is required for class Banana."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Banana(lengthCm.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BananaReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BananaReq.cs index 5feeb1b2b49..bdd9b39fa30 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BananaReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BananaReq.cs @@ -134,18 +134,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (lengthCm == null) throw new ArgumentNullException(nameof(lengthCm), "Property is required for class BananaReq."); if (sweet == null) throw new ArgumentNullException(nameof(sweet), "Property is required for class BananaReq."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new BananaReq(lengthCm.Value, sweet.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BasquePig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BasquePig.cs index 17c0651c644..a3fb00eafb1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BasquePig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/BasquePig.cs @@ -126,15 +126,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (className == null) throw new ArgumentNullException(nameof(className), "Property is required for class BasquePig."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new BasquePig(className); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Capitalization.cs index 9c4576bb3da..c4895878409 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Capitalization.cs @@ -192,9 +192,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (smallCamel == null) throw new ArgumentNullException(nameof(smallCamel), "Property is required for class Capitalization."); @@ -213,9 +210,6 @@ namespace Org.OpenAPITools.Model if (aTTNAME == null) throw new ArgumentNullException(nameof(aTTNAME), "Property is required for class Capitalization."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Capitalization(aTTNAME, capitalCamel, capitalSnake, sCAETHFlowPoints, smallCamel, smallSnake); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/CatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/CatAllOf.cs index 6d8a1efa084..1f37570550b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/CatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/CatAllOf.cs @@ -127,15 +127,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (declawed == null) throw new ArgumentNullException(nameof(declawed), "Property is required for class CatAllOf."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new CatAllOf(declawed.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Category.cs index 323cc4b9661..873ce330a89 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Category.cs @@ -140,18 +140,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (id == null) throw new ArgumentNullException(nameof(id), "Property is required for class Category."); if (name == null) throw new ArgumentNullException(nameof(name), "Property is required for class Category."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Category(id.Value, name); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs index 36009d64af2..ff8d70d22bd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ChildCatAllOf.cs @@ -178,18 +178,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (name == null) throw new ArgumentNullException(nameof(name), "Property is required for class ChildCatAllOf."); if (petType == null) throw new ArgumentNullException(nameof(petType), "Property is required for class ChildCatAllOf."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ChildCatAllOf(name, petType.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ClassModel.cs index 989edc34434..e3a146864d1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ClassModel.cs @@ -126,15 +126,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (classProperty == null) throw new ArgumentNullException(nameof(classProperty), "Property is required for class ClassModel."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ClassModel(classProperty); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs index 44cd2fe8732..553d7d9af50 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ComplexQuadrilateral.cs @@ -111,7 +111,6 @@ namespace Org.OpenAPITools.Model Utf8JsonReader quadrilateralInterfaceReader = utf8JsonReader; bool quadrilateralInterfaceDeserialized = Client.ClientUtils.TryDeserialize(ref utf8JsonReader, jsonSerializerOptions, out QuadrilateralInterface quadrilateralInterface); - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DanishPig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DanishPig.cs index da2e08b3bb6..d7062249a76 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DanishPig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DanishPig.cs @@ -126,15 +126,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (className == null) throw new ArgumentNullException(nameof(className), "Property is required for class DanishPig."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new DanishPig(className); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DateOnlyClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DateOnlyClass.cs index ba7cbca6299..d54208370c1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DateOnlyClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DateOnlyClass.cs @@ -133,15 +133,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (dateOnlyProperty == null) throw new ArgumentNullException(nameof(dateOnlyProperty), "Property is required for class DateOnlyClass."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new DateOnlyClass(dateOnlyProperty.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs index b0017e429e7..72d508f4b92 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DeprecatedObject.cs @@ -126,15 +126,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (name == null) throw new ArgumentNullException(nameof(name), "Property is required for class DeprecatedObject."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new DeprecatedObject(name); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DogAllOf.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DogAllOf.cs index f45a8268ffc..2705b3d959f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DogAllOf.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/DogAllOf.cs @@ -126,15 +126,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (breed == null) throw new ArgumentNullException(nameof(breed), "Property is required for class DogAllOf."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new DogAllOf(breed); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Drawing.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Drawing.cs index 7766e34af10..97422ed4f8d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Drawing.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Drawing.cs @@ -163,9 +163,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (mainShape == null) throw new ArgumentNullException(nameof(mainShape), "Property is required for class Drawing."); @@ -175,9 +172,6 @@ namespace Org.OpenAPITools.Model if (shapes == null) throw new ArgumentNullException(nameof(shapes), "Property is required for class Drawing."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Drawing(mainShape, shapeOrNull, shapes, nullableShape); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumArrays.cs index 810c2488dc0..7004134e68b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -239,18 +239,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (justSymbol == null) throw new ArgumentNullException(nameof(justSymbol), "Property is required for class EnumArrays."); if (arrayEnum == null) throw new ArgumentNullException(nameof(arrayEnum), "Property is required for class EnumArrays."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new EnumArrays(arrayEnum, justSymbol.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumTest.cs index b2f81f79071..937aa9595a0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EnumTest.cs @@ -494,9 +494,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (enumString == null) throw new ArgumentNullException(nameof(enumString), "Property is required for class EnumTest."); @@ -521,9 +518,6 @@ namespace Org.OpenAPITools.Model if (outerEnumIntegerDefaultValue == null) throw new ArgumentNullException(nameof(outerEnumIntegerDefaultValue), "Property is required for class EnumTest."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new EnumTest(enumInteger.Value, enumIntegerOnly.Value, enumNumber.Value, enumString.Value, enumStringRequired.Value, outerEnumDefaultValue.Value, outerEnumInteger.Value, outerEnumIntegerDefaultValue.Value, outerEnum.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs index 2046f15222b..0a40c44fffc 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/EquilateralTriangle.cs @@ -111,7 +111,6 @@ namespace Org.OpenAPITools.Model Utf8JsonReader triangleInterfaceReader = utf8JsonReader; bool triangleInterfaceDeserialized = Client.ClientUtils.TryDeserialize(ref utf8JsonReader, jsonSerializerOptions, out TriangleInterface triangleInterface); - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/File.cs index d7d907d8686..a9b60ad8ca0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/File.cs @@ -127,15 +127,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (sourceURI == null) throw new ArgumentNullException(nameof(sourceURI), "Property is required for class File."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new File(sourceURI); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index 101e5918ba9..7bad1ccf2bf 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -141,18 +141,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (file == null) throw new ArgumentNullException(nameof(file), "Property is required for class FileSchemaTestClass."); if (files == null) throw new ArgumentNullException(nameof(files), "Property is required for class FileSchemaTestClass."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new FileSchemaTestClass(file, files); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Foo.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Foo.cs index d9d0aeeaebf..b34c9fd24f3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Foo.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Foo.cs @@ -126,15 +126,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (bar == null) throw new ArgumentNullException(nameof(bar), "Property is required for class Foo."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Foo(bar); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs index 4d4073061bd..a04de35840d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FooGetDefaultResponse.cs @@ -127,15 +127,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (stringProperty == null) throw new ArgumentNullException(nameof(stringProperty), "Property is required for class FooGetDefaultResponse."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new FooGetDefaultResponse(stringProperty); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FormatTest.cs index bc1f8031562..5d2551a1bbe 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FormatTest.cs @@ -502,9 +502,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (integer == null) throw new ArgumentNullException(nameof(integer), "Property is required for class FormatTest."); @@ -562,9 +559,6 @@ namespace Org.OpenAPITools.Model if (patternWithBackslash == null) throw new ArgumentNullException(nameof(patternWithBackslash), "Property is required for class FormatTest."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new FormatTest(binary, byteProperty, date.Value, dateTime.Value, decimalProperty.Value, doubleProperty.Value, floatProperty.Value, int32.Value, int64.Value, integer.Value, number.Value, password, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, stringProperty, unsignedInteger.Value, unsignedLong.Value, uuid.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Fruit.cs index 78a2e9c1fb2..6768f9b0937 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Fruit.cs @@ -118,12 +118,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader appleReader = utf8JsonReader; - bool appleDeserialized = Client.ClientUtils.TryDeserialize(ref appleReader, jsonSerializerOptions, out Apple apple); - - Utf8JsonReader bananaReader = utf8JsonReader; - bool bananaDeserialized = Client.ClientUtils.TryDeserialize(ref bananaReader, jsonSerializerOptions, out Banana banana); - string color = default; while (utf8JsonReader.Read()) @@ -150,19 +144,15 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (color == null) throw new ArgumentNullException(nameof(color), "Property is required for class Fruit."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (appleDeserialized) + Utf8JsonReader appleReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref appleReader, jsonSerializerOptions, out Apple apple)) return new Fruit(apple, color); - if (bananaDeserialized) + Utf8JsonReader bananaReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref bananaReader, jsonSerializerOptions, out Banana banana)) return new Fruit(banana, color); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FruitReq.cs index 641f2de4ea2..f90d281a2d2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FruitReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/FruitReq.cs @@ -107,13 +107,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader appleReqReader = utf8JsonReader; - bool appleReqDeserialized = Client.ClientUtils.TryDeserialize(ref appleReqReader, jsonSerializerOptions, out AppleReq appleReq); - - Utf8JsonReader bananaReqReader = utf8JsonReader; - bool bananaReqDeserialized = Client.ClientUtils.TryDeserialize(ref bananaReqReader, jsonSerializerOptions, out BananaReq bananaReq); - - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -135,10 +128,12 @@ namespace Org.OpenAPITools.Model } } - if (appleReqDeserialized) + Utf8JsonReader appleReqReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref appleReqReader, jsonSerializerOptions, out AppleReq appleReq)) return new FruitReq(appleReq); - if (bananaReqDeserialized) + Utf8JsonReader bananaReqReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref bananaReqReader, jsonSerializerOptions, out BananaReq bananaReq)) return new FruitReq(bananaReq); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/GmFruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/GmFruit.cs index 91eed1b98e9..9f59259d0db 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/GmFruit.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/GmFruit.cs @@ -139,15 +139,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (color == null) throw new ArgumentNullException(nameof(color), "Property is required for class GmFruit."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new GmFruit(apple, banana, color); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs index a38f927e4c6..8fe518006f6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/GrandparentAnimal.cs @@ -136,15 +136,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (petType == null) throw new ArgumentNullException(nameof(petType), "Property is required for class GrandparentAnimal."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new GrandparentAnimal(petType); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index 22b4a6b287a..1789f7dc3fb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -176,18 +176,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (bar == null) throw new ArgumentNullException(nameof(bar), "Property is required for class HasOnlyReadOnly."); if (foo == null) throw new ArgumentNullException(nameof(foo), "Property is required for class HasOnlyReadOnly."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new HasOnlyReadOnly(bar, foo); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs index 87b9008aec5..8d4dcb47be1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/IsoscelesTriangle.cs @@ -104,7 +104,6 @@ namespace Org.OpenAPITools.Model Utf8JsonReader triangleInterfaceReader = utf8JsonReader; bool triangleInterfaceDeserialized = Client.ClientUtils.TryDeserialize(ref utf8JsonReader, jsonSerializerOptions, out TriangleInterface triangleInterface); - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/List.cs index 1fec7939b46..e0a1bebc78a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/List.cs @@ -126,15 +126,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (_123list == null) throw new ArgumentNullException(nameof(_123list), "Property is required for class List."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new List(_123list); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/LiteralStringClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/LiteralStringClass.cs index c6d53c018cc..39cbb0d5182 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/LiteralStringClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/LiteralStringClass.cs @@ -139,18 +139,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (escapedLiteralString == null) throw new ArgumentNullException(nameof(escapedLiteralString), "Property is required for class LiteralStringClass."); if (unescapedLiteralString == null) throw new ArgumentNullException(nameof(unescapedLiteralString), "Property is required for class LiteralStringClass."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new LiteralStringClass(escapedLiteralString, unescapedLiteralString); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Mammal.cs index 98602ea3747..1ed504e6363 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Mammal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Mammal.cs @@ -140,16 +140,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader whaleReader = utf8JsonReader; - bool whaleDeserialized = Client.ClientUtils.TryDeserialize(ref whaleReader, jsonSerializerOptions, out Whale whale); - - Utf8JsonReader zebraReader = utf8JsonReader; - bool zebraDeserialized = Client.ClientUtils.TryDeserialize(ref zebraReader, jsonSerializerOptions, out Zebra zebra); - - Utf8JsonReader pigReader = utf8JsonReader; - bool pigDeserialized = Client.ClientUtils.TryDeserialize(ref pigReader, jsonSerializerOptions, out Pig pig); - - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -171,13 +161,16 @@ namespace Org.OpenAPITools.Model } } - if (whaleDeserialized) + Utf8JsonReader whaleReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref whaleReader, jsonSerializerOptions, out Whale whale)) return new Mammal(whale); - if (zebraDeserialized) + Utf8JsonReader zebraReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref zebraReader, jsonSerializerOptions, out Zebra zebra)) return new Mammal(zebra); - if (pigDeserialized) + Utf8JsonReader pigReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref pigReader, jsonSerializerOptions, out Pig pig)) return new Mammal(pig); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MapTest.cs index 6969b3b7415..f30beffd779 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MapTest.cs @@ -218,9 +218,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (mapMapOfString == null) throw new ArgumentNullException(nameof(mapMapOfString), "Property is required for class MapTest."); @@ -233,9 +230,6 @@ namespace Org.OpenAPITools.Model if (indirectMap == null) throw new ArgumentNullException(nameof(indirectMap), "Property is required for class MapTest."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new MapTest(directMap, indirectMap, mapMapOfString, mapOfEnumString); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 8c36f9556b0..42f0b186313 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -181,9 +181,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (uuidWithPattern == null) throw new ArgumentNullException(nameof(uuidWithPattern), "Property is required for class MixedPropertiesAndAdditionalPropertiesClass."); @@ -196,9 +193,6 @@ namespace Org.OpenAPITools.Model if (map == null) throw new ArgumentNullException(nameof(map), "Property is required for class MixedPropertiesAndAdditionalPropertiesClass."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new MixedPropertiesAndAdditionalPropertiesClass(dateTime.Value, map, uuid.Value, uuidWithPattern.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Model200Response.cs index df9cc94292e..f0206c1a01b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Model200Response.cs @@ -140,18 +140,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (name == null) throw new ArgumentNullException(nameof(name), "Property is required for class Model200Response."); if (classProperty == null) throw new ArgumentNullException(nameof(classProperty), "Property is required for class Model200Response."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Model200Response(classProperty, name.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ModelClient.cs index 16dcbc8cb9b..49336cff7a5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ModelClient.cs @@ -126,15 +126,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (clientProperty == null) throw new ArgumentNullException(nameof(clientProperty), "Property is required for class ModelClient."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ModelClient(clientProperty); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Name.cs index 1ab31f1d5ee..e84d1732fec 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Name.cs @@ -205,9 +205,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (nameProperty == null) throw new ArgumentNullException(nameof(nameProperty), "Property is required for class Name."); @@ -220,9 +217,6 @@ namespace Org.OpenAPITools.Model if (_123number == null) throw new ArgumentNullException(nameof(_123number), "Property is required for class Name."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Name(nameProperty.Value, property, snakeCase.Value, _123number.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableClass.cs index 01b319519e7..fadeea483db 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableClass.cs @@ -284,18 +284,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (arrayItemsNullable == null) throw new ArgumentNullException(nameof(arrayItemsNullable), "Property is required for class NullableClass."); if (objectItemsNullable == null) throw new ArgumentNullException(nameof(objectItemsNullable), "Property is required for class NullableClass."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new NullableClass(arrayItemsNullable, objectItemsNullable, arrayAndItemsNullableProp, arrayNullableProp, booleanProp, dateProp, datetimeProp, integerProp, numberProp, objectAndItemsNullableProp, objectNullableProp, stringProp); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableShape.cs index 4c3393931c4..d4e8320c498 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableShape.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NullableShape.cs @@ -124,13 +124,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader triangleReader = utf8JsonReader; - bool triangleDeserialized = Client.ClientUtils.TryDeserialize(ref triangleReader, jsonSerializerOptions, out Triangle triangle); - - Utf8JsonReader quadrilateralReader = utf8JsonReader; - bool quadrilateralDeserialized = Client.ClientUtils.TryDeserialize(ref quadrilateralReader, jsonSerializerOptions, out Quadrilateral quadrilateral); - - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -152,10 +145,12 @@ namespace Org.OpenAPITools.Model } } - if (triangleDeserialized) + Utf8JsonReader triangleReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref triangleReader, jsonSerializerOptions, out Triangle triangle)) return new NullableShape(triangle); - if (quadrilateralDeserialized) + Utf8JsonReader quadrilateralReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref quadrilateralReader, jsonSerializerOptions, out Quadrilateral quadrilateral)) return new NullableShape(quadrilateral); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NumberOnly.cs index bb85b6ebef7..63e443184f0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -127,15 +127,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (justNumber == null) throw new ArgumentNullException(nameof(justNumber), "Property is required for class NumberOnly."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new NumberOnly(justNumber.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs index 912d061c1dc..ef3619483d1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs @@ -171,9 +171,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (uuid == null) throw new ArgumentNullException(nameof(uuid), "Property is required for class ObjectWithDeprecatedFields."); @@ -186,9 +183,6 @@ namespace Org.OpenAPITools.Model if (bars == null) throw new ArgumentNullException(nameof(bars), "Property is required for class ObjectWithDeprecatedFields."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ObjectWithDeprecatedFields(bars, deprecatedRef, id.Value, uuid); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OneOfString.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OneOfString.cs index 01a202174aa..c6bd77e4252 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OneOfString.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OneOfString.cs @@ -98,10 +98,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader _stringReader = utf8JsonReader; - bool _stringDeserialized = Client.ClientUtils.TryDeserialize(ref _stringReader, jsonSerializerOptions, out string _string); - - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -123,7 +119,8 @@ namespace Org.OpenAPITools.Model } } - if (_stringDeserialized) + Utf8JsonReader _stringReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref _stringReader, jsonSerializerOptions, out string _string)) return new OneOfString(_string); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Order.cs index d3ceff37553..160c426f5a6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Order.cs @@ -265,9 +265,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (id == null) throw new ArgumentNullException(nameof(id), "Property is required for class Order."); @@ -286,9 +283,6 @@ namespace Org.OpenAPITools.Model if (complete == null) throw new ArgumentNullException(nameof(complete), "Property is required for class Order."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Order(id.Value, petId.Value, quantity.Value, shipDate.Value, status.Value, complete.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterComposite.cs index a874a122213..75a248beddb 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -154,9 +154,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (myNumber == null) throw new ArgumentNullException(nameof(myNumber), "Property is required for class OuterComposite."); @@ -166,9 +163,6 @@ namespace Org.OpenAPITools.Model if (myBoolean == null) throw new ArgumentNullException(nameof(myBoolean), "Property is required for class OuterComposite."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new OuterComposite(myBoolean.Value, myNumber.Value, myString); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Pet.cs index 61b435aa846..059afffbf5d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Pet.cs @@ -259,9 +259,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (id == null) throw new ArgumentNullException(nameof(id), "Property is required for class Pet."); @@ -280,9 +277,6 @@ namespace Org.OpenAPITools.Model if (status == null) throw new ArgumentNullException(nameof(status), "Property is required for class Pet."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Pet(category, id.Value, name, photoUrls, status.Value, tags); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Pig.cs index d00d60678a0..b659f226b88 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Pig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Pig.cs @@ -124,13 +124,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader basquePigReader = utf8JsonReader; - bool basquePigDeserialized = Client.ClientUtils.TryDeserialize(ref basquePigReader, jsonSerializerOptions, out BasquePig basquePig); - - Utf8JsonReader danishPigReader = utf8JsonReader; - bool danishPigDeserialized = Client.ClientUtils.TryDeserialize(ref danishPigReader, jsonSerializerOptions, out DanishPig danishPig); - - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -152,10 +145,12 @@ namespace Org.OpenAPITools.Model } } - if (basquePigDeserialized) + Utf8JsonReader basquePigReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref basquePigReader, jsonSerializerOptions, out BasquePig basquePig)) return new Pig(basquePig); - if (danishPigDeserialized) + Utf8JsonReader danishPigReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref danishPigReader, jsonSerializerOptions, out DanishPig danishPig)) return new Pig(danishPig); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/PolymorphicProperty.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/PolymorphicProperty.cs index 55cb46421b6..1cd630cff76 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/PolymorphicProperty.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/PolymorphicProperty.cs @@ -146,19 +146,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader _boolReader = utf8JsonReader; - bool _boolDeserialized = Client.ClientUtils.TryDeserialize(ref _boolReader, jsonSerializerOptions, out bool _bool); - - Utf8JsonReader _stringReader = utf8JsonReader; - bool _stringDeserialized = Client.ClientUtils.TryDeserialize(ref _stringReader, jsonSerializerOptions, out string _string); - - Utf8JsonReader _objectReader = utf8JsonReader; - bool _objectDeserialized = Client.ClientUtils.TryDeserialize(ref _objectReader, jsonSerializerOptions, out Object _object); - - Utf8JsonReader liststringReader = utf8JsonReader; - bool liststringDeserialized = Client.ClientUtils.TryDeserialize>(ref liststringReader, jsonSerializerOptions, out List liststring); - - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -180,16 +167,20 @@ namespace Org.OpenAPITools.Model } } - if (_boolDeserialized) + Utf8JsonReader _boolReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref _boolReader, jsonSerializerOptions, out bool _bool)) return new PolymorphicProperty(_bool); - if (_stringDeserialized) + Utf8JsonReader _stringReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref _stringReader, jsonSerializerOptions, out string _string)) return new PolymorphicProperty(_string); - if (_objectDeserialized) + Utf8JsonReader _objectReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref _objectReader, jsonSerializerOptions, out Object _object)) return new PolymorphicProperty(_object); - if (liststringDeserialized) + Utf8JsonReader liststringReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize>(ref liststringReader, jsonSerializerOptions, out List liststring)) return new PolymorphicProperty(liststring); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Quadrilateral.cs index 39a442372c9..2dffe5fbc7e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Quadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -124,13 +124,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader simpleQuadrilateralReader = utf8JsonReader; - bool simpleQuadrilateralDeserialized = Client.ClientUtils.TryDeserialize(ref simpleQuadrilateralReader, jsonSerializerOptions, out SimpleQuadrilateral simpleQuadrilateral); - - Utf8JsonReader complexQuadrilateralReader = utf8JsonReader; - bool complexQuadrilateralDeserialized = Client.ClientUtils.TryDeserialize(ref complexQuadrilateralReader, jsonSerializerOptions, out ComplexQuadrilateral complexQuadrilateral); - - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) @@ -152,10 +145,12 @@ namespace Org.OpenAPITools.Model } } - if (simpleQuadrilateralDeserialized) + Utf8JsonReader simpleQuadrilateralReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref simpleQuadrilateralReader, jsonSerializerOptions, out SimpleQuadrilateral simpleQuadrilateral)) return new Quadrilateral(simpleQuadrilateral); - if (complexQuadrilateralDeserialized) + Utf8JsonReader complexQuadrilateralReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref complexQuadrilateralReader, jsonSerializerOptions, out ComplexQuadrilateral complexQuadrilateral)) return new Quadrilateral(complexQuadrilateral); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs index d74d41b497a..e079cb6b4e7 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/QuadrilateralInterface.cs @@ -126,15 +126,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (quadrilateralType == null) throw new ArgumentNullException(nameof(quadrilateralType), "Property is required for class QuadrilateralInterface."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new QuadrilateralInterface(quadrilateralType); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index 1694bdc90b4..9a5d0c05228 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -175,18 +175,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (bar == null) throw new ArgumentNullException(nameof(bar), "Property is required for class ReadOnlyFirst."); if (baz == null) throw new ArgumentNullException(nameof(baz), "Property is required for class ReadOnlyFirst."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ReadOnlyFirst(bar, baz); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Return.cs index ffb0fce2e46..076d3a3b569 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Return.cs @@ -127,15 +127,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (returnProperty == null) throw new ArgumentNullException(nameof(returnProperty), "Property is required for class Return."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Return(returnProperty.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs index 4f4da675fb6..3968093b6ec 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ScaleneTriangle.cs @@ -111,7 +111,6 @@ namespace Org.OpenAPITools.Model Utf8JsonReader triangleInterfaceReader = utf8JsonReader; bool triangleInterfaceDeserialized = Client.ClientUtils.TryDeserialize(ref utf8JsonReader, jsonSerializerOptions, out TriangleInterface triangleInterface); - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Shape.cs index 61c35d97a25..bfc7c8af649 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Shape.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Shape.cs @@ -135,12 +135,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader triangleReader = utf8JsonReader; - bool triangleDeserialized = Client.ClientUtils.TryDeserialize(ref triangleReader, jsonSerializerOptions, out Triangle triangle); - - Utf8JsonReader quadrilateralReader = utf8JsonReader; - bool quadrilateralDeserialized = Client.ClientUtils.TryDeserialize(ref quadrilateralReader, jsonSerializerOptions, out Quadrilateral quadrilateral); - string quadrilateralType = default; while (utf8JsonReader.Read()) @@ -167,19 +161,15 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (quadrilateralType == null) throw new ArgumentNullException(nameof(quadrilateralType), "Property is required for class Shape."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (triangleDeserialized) + Utf8JsonReader triangleReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref triangleReader, jsonSerializerOptions, out Triangle triangle)) return new Shape(triangle, quadrilateralType); - if (quadrilateralDeserialized) + Utf8JsonReader quadrilateralReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref quadrilateralReader, jsonSerializerOptions, out Quadrilateral quadrilateral)) return new Shape(quadrilateral, quadrilateralType); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ShapeInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ShapeInterface.cs index 74c4c7eabcb..9c3d9aaee1a 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ShapeInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ShapeInterface.cs @@ -126,15 +126,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (shapeType == null) throw new ArgumentNullException(nameof(shapeType), "Property is required for class ShapeInterface."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ShapeInterface(shapeType); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ShapeOrNull.cs index 1eee2ffdabb..c2f1d3a86b4 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ShapeOrNull.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -135,12 +135,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader triangleReader = utf8JsonReader; - bool triangleDeserialized = Client.ClientUtils.TryDeserialize(ref triangleReader, jsonSerializerOptions, out Triangle triangle); - - Utf8JsonReader quadrilateralReader = utf8JsonReader; - bool quadrilateralDeserialized = Client.ClientUtils.TryDeserialize(ref quadrilateralReader, jsonSerializerOptions, out Quadrilateral quadrilateral); - string quadrilateralType = default; while (utf8JsonReader.Read()) @@ -167,19 +161,15 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (quadrilateralType == null) throw new ArgumentNullException(nameof(quadrilateralType), "Property is required for class ShapeOrNull."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (triangleDeserialized) + Utf8JsonReader triangleReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref triangleReader, jsonSerializerOptions, out Triangle triangle)) return new ShapeOrNull(triangle, quadrilateralType); - if (quadrilateralDeserialized) + Utf8JsonReader quadrilateralReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref quadrilateralReader, jsonSerializerOptions, out Quadrilateral quadrilateral)) return new ShapeOrNull(quadrilateral, quadrilateralType); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs index bb1f464b9c2..9b3db311f7d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SimpleQuadrilateral.cs @@ -111,7 +111,6 @@ namespace Org.OpenAPITools.Model Utf8JsonReader quadrilateralInterfaceReader = utf8JsonReader; bool quadrilateralInterfaceDeserialized = Client.ClientUtils.TryDeserialize(ref utf8JsonReader, jsonSerializerOptions, out QuadrilateralInterface quadrilateralInterface); - while (utf8JsonReader.Read()) { if (startingTokenType == JsonTokenType.StartObject && utf8JsonReader.TokenType == JsonTokenType.EndObject && currentDepth == utf8JsonReader.CurrentDepth) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SpecialModelName.cs index f5c8c24df68..13d870a94fd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -140,18 +140,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (specialPropertyName == null) throw new ArgumentNullException(nameof(specialPropertyName), "Property is required for class SpecialModelName."); if (specialModelNameProperty == null) throw new ArgumentNullException(nameof(specialModelNameProperty), "Property is required for class SpecialModelName."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new SpecialModelName(specialModelNameProperty, specialPropertyName.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Tag.cs index 4178322dc20..c5f56da79d5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Tag.cs @@ -140,18 +140,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (id == null) throw new ArgumentNullException(nameof(id), "Property is required for class Tag."); if (name == null) throw new ArgumentNullException(nameof(name), "Property is required for class Tag."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Tag(id.Value, name); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs index f0656707451..d4b2d10520e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs @@ -126,15 +126,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (value == null) throw new ArgumentNullException(nameof(value), "Property is required for class TestCollectionEndingWithWordList."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new TestCollectionEndingWithWordList(value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs index ac76595dc3f..4f23a08f5fe 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs @@ -127,15 +127,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (testCollectionEndingWithWordList == null) throw new ArgumentNullException(nameof(testCollectionEndingWithWordList), "Property is required for class TestCollectionEndingWithWordListObject."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new TestCollectionEndingWithWordListObject(testCollectionEndingWithWordList); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Triangle.cs index 064dae2401b..88a29b1e3ce 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Triangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Triangle.cs @@ -166,15 +166,6 @@ namespace Org.OpenAPITools.Model JsonTokenType startingTokenType = utf8JsonReader.TokenType; - Utf8JsonReader equilateralTriangleReader = utf8JsonReader; - bool equilateralTriangleDeserialized = Client.ClientUtils.TryDeserialize(ref equilateralTriangleReader, jsonSerializerOptions, out EquilateralTriangle equilateralTriangle); - - Utf8JsonReader isoscelesTriangleReader = utf8JsonReader; - bool isoscelesTriangleDeserialized = Client.ClientUtils.TryDeserialize(ref isoscelesTriangleReader, jsonSerializerOptions, out IsoscelesTriangle isoscelesTriangle); - - Utf8JsonReader scaleneTriangleReader = utf8JsonReader; - bool scaleneTriangleDeserialized = Client.ClientUtils.TryDeserialize(ref scaleneTriangleReader, jsonSerializerOptions, out ScaleneTriangle scaleneTriangle); - string shapeType = default; string triangleType = default; @@ -205,25 +196,22 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (shapeType == null) throw new ArgumentNullException(nameof(shapeType), "Property is required for class Triangle."); if (triangleType == null) throw new ArgumentNullException(nameof(triangleType), "Property is required for class Triangle."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - - if (equilateralTriangleDeserialized) + Utf8JsonReader equilateralTriangleReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref equilateralTriangleReader, jsonSerializerOptions, out EquilateralTriangle equilateralTriangle)) return new Triangle(equilateralTriangle, shapeType, triangleType); - if (isoscelesTriangleDeserialized) + Utf8JsonReader isoscelesTriangleReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref isoscelesTriangleReader, jsonSerializerOptions, out IsoscelesTriangle isoscelesTriangle)) return new Triangle(isoscelesTriangle, shapeType, triangleType); - if (scaleneTriangleDeserialized) + Utf8JsonReader scaleneTriangleReader = utf8JsonReader; + if (Client.ClientUtils.TryDeserialize(ref scaleneTriangleReader, jsonSerializerOptions, out ScaleneTriangle scaleneTriangle)) return new Triangle(scaleneTriangle, shapeType, triangleType); throw new JsonException(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TriangleInterface.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TriangleInterface.cs index a0c62a82a2e..5e70d717168 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TriangleInterface.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/TriangleInterface.cs @@ -126,15 +126,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (triangleType == null) throw new ArgumentNullException(nameof(triangleType), "Property is required for class TriangleInterface."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new TriangleInterface(triangleType); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/User.cs index 4a695ca4502..c2c70e1318e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/User.cs @@ -280,9 +280,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (id == null) throw new ArgumentNullException(nameof(id), "Property is required for class User."); @@ -310,9 +307,6 @@ namespace Org.OpenAPITools.Model if (objectWithNoDeclaredProps == null) throw new ArgumentNullException(nameof(objectWithNoDeclaredProps), "Property is required for class User."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new User(email, firstName, id.Value, lastName, objectWithNoDeclaredProps, password, phone, userStatus.Value, username, anyTypeProp, anyTypePropNullable, objectWithNoDeclaredPropsNullable); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Whale.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Whale.cs index 4d35765e396..2cf3d80ac18 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Whale.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Whale.cs @@ -154,9 +154,6 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (hasBaleen == null) throw new ArgumentNullException(nameof(hasBaleen), "Property is required for class Whale."); @@ -166,9 +163,6 @@ namespace Org.OpenAPITools.Model if (className == null) throw new ArgumentNullException(nameof(className), "Property is required for class Whale."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Whale(className, hasBaleen.Value, hasTeeth.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Zebra.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Zebra.cs index dfddcde7411..afee2e9035e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Zebra.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/Zebra.cs @@ -201,18 +201,12 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (type == null) throw new ArgumentNullException(nameof(type), "Property is required for class Zebra."); if (className == null) throw new ArgumentNullException(nameof(className), "Property is required for class Zebra."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new Zebra(className, type.Value); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs index ac541b3b1e9..5eb9bbecf45 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/ZeroBasedEnumClass.cs @@ -176,15 +176,9 @@ namespace Org.OpenAPITools.Model } } -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - if (zeroBasedEnum == null) throw new ArgumentNullException(nameof(zeroBasedEnum), "Property is required for class ZeroBasedEnumClass."); -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' -#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' - return new ZeroBasedEnumClass(zeroBasedEnum.Value); }