diff --git a/bin/csharp-refactor-petstore.sh b/bin/csharp-refactor-petstore.sh index e9c662a6327..6c5d0ca8b98 100755 --- a/bin/csharp-refactor-petstore.sh +++ b/bin/csharp-refactor-petstore.sh @@ -27,7 +27,7 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/csharp-refactor/ -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp-refactor -o samples/client/petstore/csharp-refactor/OpenAPIClient --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C} $@" +ags="generate -t modules/openapi-generator/src/main/resources/csharp-refactor/ -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp-refactor -o samples/client/petstore/csharp-refactor/OpenAPIClient --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C},useCompareNetObjects=true $@" java $JAVA_OPTS -jar $executable $ags diff --git a/docs/generators/csharp.md b/docs/generators/csharp.md index 4cf223a515e..ce06d6eff4e 100644 --- a/docs/generators/csharp.md +++ b/docs/generators/csharp.md @@ -69,4 +69,7 @@ CONFIG OPTIONS for csharp validatable Generates self-validatable models. (Default: true) + useCompareNetObjects + Use KellermanSoftware.CompareNetObjects for deep recursive object comparison. WARNING: this option incurs potential performance impact. (Default: false) + Back to the [generators list](README.md) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java index c66cce4b4f6..7de5eb75a25 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java @@ -283,4 +283,7 @@ public class CodegenConstants { public static final String ENABLE_POST_PROCESS_FILE_DESC = "Enable post-processing file using environment variables."; public static final String OPEN_API_SPEC_NAME = "openAPISpecName"; + + public static final String USE_COMPARE_NET_OBJECTS = "useCompareNetObjects"; + public static final String USE_COMPARE_NET_OBJECTS_DESC = "Use KellermanSoftware.CompareNetObjects for deep recursive object comparison. WARNING: this option incurs potential performance impact."; } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java index d672320d1d9..cf074dd100a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java @@ -83,6 +83,9 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { // By default, generated code is considered public protected boolean nonPublicApi = Boolean.FALSE; + // use KellermanSoftware.CompareNetObjects for deep recursive object comparision + protected boolean useCompareNetObjects = Boolean.FALSE; + public CSharpClientCodegen() { super(); supportsInheritance = true; @@ -196,6 +199,10 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { CodegenConstants.VALIDATABLE_DESC, this.validatable); + addSwitch(CodegenConstants.USE_COMPARE_NET_OBJECTS, + CodegenConstants.USE_COMPARE_NET_OBJECTS_DESC, + this.useCompareNetObjects); + regexModifiers = new HashMap(); regexModifiers.put('i', "IgnoreCase"); regexModifiers.put('m', "Multiline"); @@ -798,6 +805,10 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { this.generatePropertyChanged = generatePropertyChanged; } + public void setUseCompareNetObjects(final Boolean useCompareNetObjects) { + this.useCompareNetObjects = useCompareNetObjects; + } + public boolean isNonPublicApi() { return nonPublicApi; } diff --git a/modules/openapi-generator/src/main/resources/csharp-refactor/ClientUtils.mustache b/modules/openapi-generator/src/main/resources/csharp-refactor/ClientUtils.mustache index 8bc909e4f34..b569ade0d66 100755 --- a/modules/openapi-generator/src/main/resources/csharp-refactor/ClientUtils.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-refactor/ClientUtils.mustache @@ -9,6 +9,9 @@ using System.Net; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; +{{#useCompareNetObjects}} +using KellermanSoftware.CompareNetObjects; +{{/useCompareNetObjects}} namespace {{packageName}}.Client { @@ -17,6 +20,21 @@ namespace {{packageName}}.Client /// public static class ClientUtils { + {{#useCompareNetObjects}} + /// + /// An instance of CompareLogic. + /// + public static CompareLogic compareLogic; + + /// + /// Static contstructor to initialise compareLogic. + /// + static ClientUtils() + { + compareLogic = new CompareLogic(); + } + + {{/useCompareNetObjects}} /// /// Sanitize filename by removing the path /// diff --git a/modules/openapi-generator/src/main/resources/csharp-refactor/Project.mustache b/modules/openapi-generator/src/main/resources/csharp-refactor/Project.mustache index 2d0288ce420..a10f4ee3a45 100644 --- a/modules/openapi-generator/src/main/resources/csharp-refactor/Project.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-refactor/Project.mustache @@ -84,6 +84,14 @@ ..\..\packages\RestSharp.106.5.4\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\RestSharp.dll {{binRelativePath}}\RestSharp.106.5.4\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\RestSharp.dll + {{#useCompareNetObjects}} + + $(SolutionDir)\packages\CompareNETObjects.4.57.0\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\KellermanSoftware.Compare-NET-Objects.dll + ..\packages\CompareNETObjects.4.57.0\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\KellermanSoftware.Compare-NET-Objects.dll + ..\..\packages\CompareNETObjects.4.57.0\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\KellermanSoftware.Compare-NET-Objects.dll + {{binRelativePath}}\CompareNETObjects.4.57.0\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\KellermanSoftware.Compare-NET-Objects.dll + + {{/useCompareNetObjects}} {{#generatePropertyChanged}} ..\..\packages\PropertyChanged.Fody.1.51.3\Lib\portable-net4+sl4+wp8+win8+wpa81+MonoAndroid16+MonoTouch40\PropertyChanged.dll diff --git a/modules/openapi-generator/src/main/resources/csharp-refactor/compile-mono.sh.mustache b/modules/openapi-generator/src/main/resources/csharp-refactor/compile-mono.sh.mustache index 0218d7ee092..c575f9f4ff9 100644 --- a/modules/openapi-generator/src/main/resources/csharp-refactor/compile-mono.sh.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-refactor/compile-mono.sh.mustache @@ -44,6 +44,9 @@ ${nuget_cmd} install src/{{packageName}}/packages.config -o packages; echo "[INFO] Copy DLLs to the 'bin' folder" mkdir -p bin; +{{#useCompareNetObjects}} +cp packages/CompareNETObjects.4.57.0/lib/{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}/KellermanSoftware.Compare-NET-Objects.dll bin/KellermanSoftware.Compare-NET-Objects.dll; +{{/useCompareNetObjects}} cp packages/Newtonsoft.Json.12.0.1/lib/{{targetFrameworkNuget}}/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll; cp packages/RestSharp.106.5.4/lib/{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}/RestSharp.dll bin/RestSharp.dll; cp packages/JsonSubTypes.1.5.1/lib/{{targetFrameworkNuget}}/JsonSubTypes.dll bin/JsonSubTypes.dll @@ -60,6 +63,9 @@ bin/Fody.dll,\ bin/PropertyChanged.Fody.dll,\ bin/PropertyChanged.dll,\ {{/generatePropertyChanged}} +{{#useCompareNetObjects}} +bin/KellermanSoftware.Compare-NET-Objects.dll,\ +{{/useCompareNetObjects}} bin/RestSharp.dll,\ System.ComponentModel.DataAnnotations.dll,\ System.Runtime.Serialization.dll \ diff --git a/modules/openapi-generator/src/main/resources/csharp-refactor/compile.mustache b/modules/openapi-generator/src/main/resources/csharp-refactor/compile.mustache index 25358119d3f..9b3b4a5e385 100644 --- a/modules/openapi-generator/src/main/resources/csharp-refactor/compile.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-refactor/compile.mustache @@ -14,7 +14,9 @@ if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient .\nuget.exe install src\{{packageName}}\packages.config -o packages if not exist ".\bin" mkdir bin - +{{#CompareNetObjects}} +copy packages\CompareNETObjects.4.57.0\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\KellermanSoftware.Compare-NET-Objects.dll bin\KellermanSoftware.Compare-NET-Objects.dll +{{/CompareNetObjects}} copy packages\Newtonsoft.Json.12.0.1\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll copy packages\JsonSubTypes.1.5.1\lib\{{targetFrameworkNuget}}\JsonSubTypes.dll bin\JsonSubTypes.dll copy packages\RestSharp.106.5.4\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{#isNet452}}net452{{/isNet452}}{{^isNet452}}{{targetFrameworkNuget}}{{/isNet452}}{{/isNet40}}\RestSharp.dll bin\RestSharp.dll @@ -23,5 +25,5 @@ copy packages\Fody.1.29.4\Fody.dll bin\Fody.dll copy packages\PropertyChanged.Fody.1.51.3\PropertyChanged.Fody.dll bin\PropertyChanged.Fody.dll copy packages\PropertyChanged.Fody.1.51.3\Lib\dotnet\PropertyChanged.dll bin\PropertyChanged.dll {{/generatePropertyChanged}} -%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\JsonSubTypes.dll;bin\RestSharp.dll;System.ComponentModel.DataAnnotations.dll {{#generatePropertyChanged}}/r:bin\Fody.dll;bin\PropertyChanged.Fody.dll;bin\PropertyChanged.dll{{/generatePropertyChanged}} /target:library /out:bin\{{packageName}}.dll /recurse:src\{{packageName}}\*.cs /doc:bin\{{packageName}}.xml +%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\JsonSubTypes.dll;bin\RestSharp.dll;{{#CompareNetObjects}}bin\KellermanSoftware.Compare-NET-Objects.dll;{{/CompareNetObjects}}System.ComponentModel.DataAnnotations.dll {{#generatePropertyChanged}}/r:bin\Fody.dll;bin\PropertyChanged.Fody.dll;bin\PropertyChanged.dll{{/generatePropertyChanged}} /target:library /out:bin\{{packageName}}.dll /recurse:src\{{packageName}}\*.cs /doc:bin\{{packageName}}.xml diff --git a/modules/openapi-generator/src/main/resources/csharp-refactor/model.mustache b/modules/openapi-generator/src/main/resources/csharp-refactor/model.mustache index 99011ebc621..41580d6d0ac 100644 --- a/modules/openapi-generator/src/main/resources/csharp-refactor/model.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-refactor/model.mustache @@ -28,6 +28,9 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations; {{/netStandard}} using OpenAPIDateConverter = {{packageName}}.Client.OpenAPIDateConverter; +{{#useCompareNetObjects}} +using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils; +{{/useCompareNetObjects}} {{#models}} {{#model}} diff --git a/modules/openapi-generator/src/main/resources/csharp-refactor/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/csharp-refactor/modelGeneric.mustache index 1144e5338e3..6b5e19c745b 100644 --- a/modules/openapi-generator/src/main/resources/csharp-refactor/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-refactor/modelGeneric.mustache @@ -149,7 +149,12 @@ /// Boolean public override bool Equals(object input) { + {{#useCompareNetObjects}} + return OpenAPIClientUtils.compareLogic.Compare(this, input as {{classname}}).AreEqual; + {{/useCompareNetObjects}} + {{^useCompareNetObjects}} return this.Equals(input as {{classname}}); + {{/useCompareNetObjects}} } /// @@ -159,6 +164,10 @@ /// Boolean public bool Equals({{classname}} input) { + {{#useCompareNetObjects}} + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; + {{/useCompareNetObjects}} + {{^useCompareNetObjects}} if (input == null) return false; @@ -178,6 +187,7 @@ this.{{name}} != null && this.{{name}}.SequenceEqual(input.{{name}}) ){{#hasMore}} && {{/hasMore}}{{/isContainer}}{{/vars}}{{^vars}}{{#parent}}base.Equals(input){{/parent}}{{^parent}}false{{/parent}}{{/vars}}; + {{/useCompareNetObjects}} } /// diff --git a/modules/openapi-generator/src/main/resources/csharp-refactor/packages.config.mustache b/modules/openapi-generator/src/main/resources/csharp-refactor/packages.config.mustache index 00c9d25e9f8..247758248d2 100644 --- a/modules/openapi-generator/src/main/resources/csharp-refactor/packages.config.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-refactor/packages.config.mustache @@ -1,10 +1,13 @@ + {{#useCompareNetObjects}} + + {{/useCompareNetObjects}} - - + + {{#generatePropertyChanged}} - - + + {{/generatePropertyChanged}} diff --git a/modules/openapi-generator/src/main/resources/csharp-refactor/project.json.mustache b/modules/openapi-generator/src/main/resources/csharp-refactor/project.json.mustache index 85d66557509..0feb8e86af4 100644 --- a/modules/openapi-generator/src/main/resources/csharp-refactor/project.json.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-refactor/project.json.mustache @@ -4,6 +4,9 @@ "FubarCoder.RestSharp.Portable.Core": "4.0.7", "FubarCoder.RestSharp.Portable.HttpClient": "4.0.7", "Newtonsoft.Json": "12.0.1", + {{#useCompareNetObjects}} + "KellermanSoftware.Compare-NET-Objects": "4.57.0", + {{/useCompareNetObjects}} "JsonSubTypes": "1.5.1" }, "frameworks": { diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/.vs/Org.OpenAPITools/xs/UserPrefs.xml b/samples/client/petstore/csharp-refactor/OpenAPIClient/.vs/Org.OpenAPITools/xs/UserPrefs.xml index 17cd1344750..a8f79ac3611 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/.vs/Org.OpenAPITools/xs/UserPrefs.xml +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/.vs/Org.OpenAPITools/xs/UserPrefs.xml @@ -1,12 +1,15 @@  - + - - - - - + + + + + + + + diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/.vs/Org.OpenAPITools/xs/sqlite3/storage.ide b/samples/client/petstore/csharp-refactor/OpenAPIClient/.vs/Org.OpenAPITools/xs/sqlite3/storage.ide index 0babd47c503..1271dcd581e 100644 Binary files a/samples/client/petstore/csharp-refactor/OpenAPIClient/.vs/Org.OpenAPITools/xs/sqlite3/storage.ide and b/samples/client/petstore/csharp-refactor/OpenAPIClient/.vs/Org.OpenAPITools/xs/sqlite3/storage.ide differ diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/.vs/Org.OpenAPITools/xs/sqlite3/storage.ide-shm b/samples/client/petstore/csharp-refactor/OpenAPIClient/.vs/Org.OpenAPITools/xs/sqlite3/storage.ide-shm index d201b6e46de..f7321213a2f 100644 Binary files a/samples/client/petstore/csharp-refactor/OpenAPIClient/.vs/Org.OpenAPITools/xs/sqlite3/storage.ide-shm and b/samples/client/petstore/csharp-refactor/OpenAPIClient/.vs/Org.OpenAPITools/xs/sqlite3/storage.ide-shm differ diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/.vs/Org.OpenAPITools/xs/sqlite3/storage.ide-wal b/samples/client/petstore/csharp-refactor/OpenAPIClient/.vs/Org.OpenAPITools/xs/sqlite3/storage.ide-wal index a2da96fcb69..dbbb3aefb43 100644 Binary files a/samples/client/petstore/csharp-refactor/OpenAPIClient/.vs/Org.OpenAPITools/xs/sqlite3/storage.ide-wal and b/samples/client/petstore/csharp-refactor/OpenAPIClient/.vs/Org.OpenAPITools/xs/sqlite3/storage.ide-wal differ diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/README.md b/samples/client/petstore/csharp-refactor/OpenAPIClient/README.md index 7e3207c5638..d557503f1af 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/README.md +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/README.md @@ -71,12 +71,12 @@ namespace Example { var apiInstance = new AnotherFakeApi(); - var modelClient = new ModelClient(); // ModelClient | client model + var body = new ModelClient(); // ModelClient | client model try { // To test special tags - ModelClient result = apiInstance.Call123TestSpecialTags(modelClient); + ModelClient result = apiInstance.Call123TestSpecialTags(body); Debug.WriteLine(result); } catch (Exception e) diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/build.bat b/samples/client/petstore/csharp-refactor/OpenAPIClient/build.bat index ee4fdbe2be7..14c1b86cd44 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/build.bat +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/build.bat @@ -9,7 +9,6 @@ if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient .\nuget.exe install src\Org.OpenAPITools\packages.config -o packages if not exist ".\bin" mkdir bin - copy packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll copy packages\JsonSubTypes.1.5.1\lib\net45\JsonSubTypes.dll bin\JsonSubTypes.dll copy packages\RestSharp.106.5.4\lib\net452\RestSharp.dll bin\RestSharp.dll diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/build.sh b/samples/client/petstore/csharp-refactor/OpenAPIClient/build.sh index 801130181a2..65dd35fa148 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/build.sh +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/build.sh @@ -44,12 +44,14 @@ ${nuget_cmd} install src/Org.OpenAPITools/packages.config -o packages; echo "[INFO] Copy DLLs to the 'bin' folder" mkdir -p bin; +cp packages/CompareNETObjects.4.57.0/lib/net452/KellermanSoftware.Compare-NET-Objects.dll bin/KellermanSoftware.Compare-NET-Objects.dll; cp packages/Newtonsoft.Json.12.0.1/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll; cp packages/RestSharp.106.5.4/lib/net452/RestSharp.dll bin/RestSharp.dll; cp packages/JsonSubTypes.1.5.1/lib/net45/JsonSubTypes.dll bin/JsonSubTypes.dll echo "[INFO] Run 'mcs' to build bin/Org.OpenAPITools.dll" mcs -langversion:${langversion} -sdk:${sdk} -r:bin/Newtonsoft.Json.dll,bin/JsonSubTypes.dll,\ +bin/KellermanSoftware.Compare-NET-Objects.dll,\ bin/RestSharp.dll,\ System.ComponentModel.DataAnnotations.dll,\ System.Runtime.Serialization.dll \ diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/docs/AnotherFakeApi.md b/samples/client/petstore/csharp-refactor/OpenAPIClient/docs/AnotherFakeApi.md index 81cc3106d64..612293b48bb 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/docs/AnotherFakeApi.md +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/docs/AnotherFakeApi.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **Call123TestSpecialTags** -> ModelClient Call123TestSpecialTags (ModelClient modelClient) +> ModelClient Call123TestSpecialTags (ModelClient body) To test special tags @@ -30,12 +30,12 @@ namespace Example public void main() { var apiInstance = new AnotherFakeApi(); - var modelClient = new ModelClient(); // ModelClient | client model + var body = new ModelClient(); // ModelClient | client model try { // To test special tags - ModelClient result = apiInstance.Call123TestSpecialTags(modelClient); + ModelClient result = apiInstance.Call123TestSpecialTags(body); Debug.WriteLine(result); } catch (Exception e) @@ -51,7 +51,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **modelClient** | [**ModelClient**](ModelClient.md)| client model | + **body** | [**ModelClient**](ModelClient.md)| client model | ### Return type diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/docs/FakeApi.md b/samples/client/petstore/csharp-refactor/OpenAPIClient/docs/FakeApi.md index f76d88e36d6..392061b6e45 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/docs/FakeApi.md +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/docs/FakeApi.md @@ -80,7 +80,7 @@ No authorization required # **FakeOuterCompositeSerialize** -> OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null) +> OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null) @@ -101,11 +101,11 @@ namespace Example public void main() { var apiInstance = new FakeApi(); - var outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body (optional) + var body = new OuterComposite(); // OuterComposite | Input composite as post body (optional) try { - OuterComposite result = apiInstance.FakeOuterCompositeSerialize(outerComposite); + OuterComposite result = apiInstance.FakeOuterCompositeSerialize(body); Debug.WriteLine(result); } catch (Exception e) @@ -121,7 +121,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type @@ -260,7 +260,7 @@ No authorization required # **TestBodyWithFileSchema** -> void TestBodyWithFileSchema (FileSchemaTestClass fileSchemaTestClass) +> void TestBodyWithFileSchema (FileSchemaTestClass body) @@ -281,11 +281,11 @@ namespace Example public void main() { var apiInstance = new FakeApi(); - var fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | + var body = new FileSchemaTestClass(); // FileSchemaTestClass | try { - apiInstance.TestBodyWithFileSchema(fileSchemaTestClass); + apiInstance.TestBodyWithFileSchema(body); } catch (Exception e) { @@ -300,7 +300,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | ### Return type @@ -319,7 +319,7 @@ No authorization required # **TestBodyWithQueryParams** -> void TestBodyWithQueryParams (string query, User user) +> void TestBodyWithQueryParams (string query, User body) @@ -339,11 +339,11 @@ namespace Example { var apiInstance = new FakeApi(); var query = query_example; // string | - var user = new User(); // User | + var body = new User(); // User | try { - apiInstance.TestBodyWithQueryParams(query, user); + apiInstance.TestBodyWithQueryParams(query, body); } catch (Exception e) { @@ -359,7 +359,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **query** | **string**| | - **user** | [**User**](User.md)| | + **body** | [**User**](User.md)| | ### Return type @@ -378,7 +378,7 @@ No authorization required # **TestClientModel** -> ModelClient TestClientModel (ModelClient modelClient) +> ModelClient TestClientModel (ModelClient body) To test \"client\" model @@ -399,12 +399,12 @@ namespace Example public void main() { var apiInstance = new FakeApi(); - var modelClient = new ModelClient(); // ModelClient | client model + var body = new ModelClient(); // ModelClient | client model try { // To test \"client\" model - ModelClient result = apiInstance.TestClientModel(modelClient); + ModelClient result = apiInstance.TestClientModel(body); Debug.WriteLine(result); } catch (Exception e) @@ -420,7 +420,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **modelClient** | [**ModelClient**](ModelClient.md)| client model | + **body** | [**ModelClient**](ModelClient.md)| client model | ### Return type @@ -673,7 +673,7 @@ No authorization required # **TestInlineAdditionalProperties** -> void TestInlineAdditionalProperties (Dictionary requestBody) +> void TestInlineAdditionalProperties (Dictionary param) test inline additionalProperties @@ -692,12 +692,12 @@ namespace Example public void main() { var apiInstance = new FakeApi(); - var requestBody = new Dictionary(); // Dictionary | request body + var param = new Dictionary(); // Dictionary | request body try { // test inline additionalProperties - apiInstance.TestInlineAdditionalProperties(requestBody); + apiInstance.TestInlineAdditionalProperties(param); } catch (Exception e) { @@ -712,7 +712,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **requestBody** | [**Dictionary<string, string>**](string.md)| request body | + **param** | [**Dictionary<string, string>**](string.md)| request body | ### Return type diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/docs/FakeClassnameTags123Api.md b/samples/client/petstore/csharp-refactor/OpenAPIClient/docs/FakeClassnameTags123Api.md index f069b098399..abea3cb9977 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/docs/FakeClassnameTags123Api.md @@ -9,7 +9,7 @@ Method | HTTP request | Description # **TestClassname** -> ModelClient TestClassname (ModelClient modelClient) +> ModelClient TestClassname (ModelClient body) To test class name in snake case @@ -35,12 +35,12 @@ namespace Example // Configuration.Default.AddApiKeyPrefix("api_key_query", "Bearer"); var apiInstance = new FakeClassnameTags123Api(); - var modelClient = new ModelClient(); // ModelClient | client model + var body = new ModelClient(); // ModelClient | client model try { // To test class name in snake case - ModelClient result = apiInstance.TestClassname(modelClient); + ModelClient result = apiInstance.TestClassname(body); Debug.WriteLine(result); } catch (Exception e) @@ -56,7 +56,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **modelClient** | [**ModelClient**](ModelClient.md)| client model | + **body** | [**ModelClient**](ModelClient.md)| client model | ### Return type diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/docs/PetApi.md b/samples/client/petstore/csharp-refactor/OpenAPIClient/docs/PetApi.md index 28ba9ebe575..33ba114304a 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/docs/PetApi.md +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/docs/PetApi.md @@ -17,7 +17,7 @@ Method | HTTP request | Description # **AddPet** -> void AddPet (Pet pet) +> void AddPet (Pet body) Add a new pet to the store @@ -39,12 +39,12 @@ namespace Example Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var pet = new Pet(); // Pet | Pet object that needs to be added to the store + var body = new Pet(); // Pet | Pet object that needs to be added to the store try { // Add a new pet to the store - apiInstance.AddPet(pet); + apiInstance.AddPet(body); } catch (Exception e) { @@ -59,7 +59,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -335,7 +335,7 @@ Name | Type | Description | Notes # **UpdatePet** -> void UpdatePet (Pet pet) +> void UpdatePet (Pet body) Update an existing pet @@ -357,12 +357,12 @@ namespace Example Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN"; var apiInstance = new PetApi(); - var pet = new Pet(); // Pet | Pet object that needs to be added to the store + var body = new Pet(); // Pet | Pet object that needs to be added to the store try { // Update an existing pet - apiInstance.UpdatePet(pet); + apiInstance.UpdatePet(body); } catch (Exception e) { @@ -377,7 +377,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/docs/StoreApi.md b/samples/client/petstore/csharp-refactor/OpenAPIClient/docs/StoreApi.md index ff7608854f8..dbcf53db616 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/docs/StoreApi.md +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/docs/StoreApi.md @@ -195,7 +195,7 @@ No authorization required # **PlaceOrder** -> Order PlaceOrder (Order order) +> Order PlaceOrder (Order body) Place an order for a pet @@ -214,12 +214,12 @@ namespace Example public void main() { var apiInstance = new StoreApi(); - var order = new Order(); // Order | order placed for purchasing the pet + var body = new Order(); // Order | order placed for purchasing the pet try { // Place an order for a pet - Order result = apiInstance.PlaceOrder(order); + Order result = apiInstance.PlaceOrder(body); Debug.WriteLine(result); } catch (Exception e) @@ -235,7 +235,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | + **body** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/docs/UserApi.md b/samples/client/petstore/csharp-refactor/OpenAPIClient/docs/UserApi.md index 857ab27084c..9a535e16a82 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/docs/UserApi.md +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/docs/UserApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **CreateUser** -> void CreateUser (User user) +> void CreateUser (User body) Create user @@ -37,12 +37,12 @@ namespace Example public void main() { var apiInstance = new UserApi(); - var user = new User(); // User | Created user object + var body = new User(); // User | Created user object try { // Create user - apiInstance.CreateUser(user); + apiInstance.CreateUser(body); } catch (Exception e) { @@ -57,7 +57,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | + **body** | [**User**](User.md)| Created user object | ### Return type @@ -76,7 +76,7 @@ No authorization required # **CreateUsersWithArrayInput** -> void CreateUsersWithArrayInput (List user) +> void CreateUsersWithArrayInput (List body) Creates list of users with given input array @@ -95,12 +95,12 @@ namespace Example public void main() { var apiInstance = new UserApi(); - var user = new List(); // List | List of user object + var body = new List(); // List | List of user object try { // Creates list of users with given input array - apiInstance.CreateUsersWithArrayInput(user); + apiInstance.CreateUsersWithArrayInput(body); } catch (Exception e) { @@ -115,7 +115,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](List.md)| List of user object | ### Return type @@ -134,7 +134,7 @@ No authorization required # **CreateUsersWithListInput** -> void CreateUsersWithListInput (List user) +> void CreateUsersWithListInput (List body) Creates list of users with given input array @@ -153,12 +153,12 @@ namespace Example public void main() { var apiInstance = new UserApi(); - var user = new List(); // List | List of user object + var body = new List(); // List | List of user object try { // Creates list of users with given input array - apiInstance.CreateUsersWithListInput(user); + apiInstance.CreateUsersWithListInput(body); } catch (Exception e) { @@ -173,7 +173,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](List.md)| List of user object | ### Return type @@ -426,7 +426,7 @@ No authorization required # **UpdateUser** -> void UpdateUser (string username, User user) +> void UpdateUser (string username, User body) Updated user @@ -448,12 +448,12 @@ namespace Example { var apiInstance = new UserApi(); var username = username_example; // string | name that need to be deleted - var user = new User(); // User | Updated user object + var body = new User(); // User | Updated user object try { // Updated user - apiInstance.UpdateUser(username, user); + apiInstance.UpdateUser(username, body); } catch (Exception e) { @@ -469,7 +469,7 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string**| name that need to be deleted | - **user** | [**User**](User.md)| Updated user object | + **body** | [**User**](User.md)| Updated user object | ### Return type diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs index 5eb86a38573..fdf91b422df 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools.Test/Model/ArrayOfArrayOfNumberOnlyTests.cs @@ -72,7 +72,45 @@ namespace Org.OpenAPITools.Test [Test] public void ArrayArrayNumberTest() { - // TODO unit test for the property 'ArrayArrayNumber' + // 1st instance + ArrayOfArrayOfNumberOnly instance1 = new ArrayOfArrayOfNumberOnly(); + List list1 = new List(); + list1.Add(11.1m); + list1.Add(8.9m); + + List> listOfList1 = new List>(); + listOfList1.Add(list1); + + instance1.ArrayArrayNumber = listOfList1; + + // 2nd instance + ArrayOfArrayOfNumberOnly instance2 = new ArrayOfArrayOfNumberOnly(); + List list2 = new List(); + list2.Add(11.1m); + list2.Add(8.9m); + + List> listOfList2 = new List>(); + listOfList2.Add(list2); + + instance2.ArrayArrayNumber = listOfList2; + + Assert.IsTrue(instance1.Equals(instance2)); + + // add one more element to list2 + list2.Add(183.3m); + Assert.IsFalse(instance1.Equals(instance2)); + + // 3rd instance + ArrayOfArrayOfNumberOnly instance3 = new ArrayOfArrayOfNumberOnly(); + List list3 = new List(); + list3.Add(11.1m); + list3.Add(1.1m); // not the same as 8.9 + + List> listOfList3 = new List>(); + instance2.ArrayArrayNumber = listOfList3; + + Assert.IsFalse(instance1.Equals(instance3)); + } } diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools.Test/Model/PetTests.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools.Test/Model/PetTests.cs index 20b3ab12dbb..2bb993ae8ca 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools.Test/Model/PetTests.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools.Test/Model/PetTests.cs @@ -33,9 +33,10 @@ namespace Org.OpenAPITools.Test [TestFixture] public class PetTests { - // TODO uncomment below to declare an instance variable for Pet //private Pet instance; + private long petId = 11088; + /// /// Setup before each test /// @@ -115,6 +116,70 @@ namespace Org.OpenAPITools.Test // TODO unit test for the property 'Status' } + /// + /// Test Equal + /// + [Test()] + public void TestEqual() + { + // create pet + Pet p1 = new Pet(name: "Csharp test", photoUrls: new List { "http://petstore.com/csharp_test" }); + p1.Id = petId; + //p1.Name = "Csharp test"; + p1.Status = Pet.StatusEnum.Available; + // create Category object + Category category1 = new Category(); + category1.Id = 56; + category1.Name = "sample category name2"; + List photoUrls1 = new List(new String[] { "sample photoUrls" }); + // create Tag object + Tag tag1 = new Tag(); + tag1.Id = petId; + tag1.Name = "csharp sample tag name1"; + List tags1 = new List(new Tag[] { tag1 }); + p1.Tags = tags1; + p1.Category = category1; + p1.PhotoUrls = photoUrls1; + + // create pet 2 + Pet p2 = new Pet(name: "Csharp test", photoUrls: new List { "http://petstore.com/csharp_test" }); + p2.Id = petId; + p2.Name = "Csharp test"; + p2.Status = Pet.StatusEnum.Available; + // create Category object + Category category2 = new Category(); + category2.Id = 56; + category2.Name = "sample category name2"; + List photoUrls2 = new List(new String[] { "sample photoUrls" }); + // create Tag object + Tag tag2 = new Tag(); + tag2.Id = petId; + tag2.Name = "csharp sample tag name1"; + List tags2 = new List(new Tag[] { tag2 }); + p2.Tags = tags2; + p2.Category = category2; + p2.PhotoUrls = photoUrls2; + + // p1 and p2 should be equal (both object and attribute level) + Assert.IsTrue(category1.Equals(category2)); + Assert.IsTrue(tags1.SequenceEqual(tags2)); + Assert.IsTrue(p1.PhotoUrls.SequenceEqual(p2.PhotoUrls)); + + Assert.IsTrue(p1.Equals(p2)); + + // update attribute to that p1 and p2 are not equal + category2.Name = "new category name"; + Assert.IsFalse(category1.Equals(category2)); + + tags2 = new List(); + Assert.IsFalse(tags1.SequenceEqual(tags2)); + + // photoUrls has not changed so it should be equal + Assert.IsTrue(p1.PhotoUrls.SequenceEqual(p2.PhotoUrls)); + + Assert.IsFalse(p1.Equals(p2)); + } + } } diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs index aaf6d958bad..5cc2cd7cd37 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Api/AnotherFakeApi.cs @@ -34,9 +34,9 @@ namespace Org.OpenAPITools.Api /// To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - ModelClient Call123TestSpecialTags (ModelClient modelClient); + ModelClient Call123TestSpecialTags (ModelClient body); /// /// To test special tags @@ -45,9 +45,9 @@ namespace Org.OpenAPITools.Api /// To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - ApiResponse Call123TestSpecialTagsWithHttpInfo (ModelClient modelClient); + ApiResponse Call123TestSpecialTagsWithHttpInfo (ModelClient body); #endregion Synchronous Operations } @@ -64,9 +64,9 @@ namespace Org.OpenAPITools.Api /// To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient modelClient); + System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient body); /// /// To test special tags @@ -75,9 +75,9 @@ namespace Org.OpenAPITools.Api /// To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient modelClient); + System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient body); #endregion Asynchronous Operations } @@ -202,11 +202,11 @@ namespace Org.OpenAPITools.Api /// To test special tags To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - public ModelClient Call123TestSpecialTags (ModelClient modelClient) + public ModelClient Call123TestSpecialTags (ModelClient body) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = Call123TestSpecialTagsWithHttpInfo(modelClient); + Org.OpenAPITools.Client.ApiResponse localVarResponse = Call123TestSpecialTagsWithHttpInfo(body); return localVarResponse.Data; } @@ -214,13 +214,13 @@ namespace Org.OpenAPITools.Api /// To test special tags To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - public Org.OpenAPITools.Client.ApiResponse< ModelClient > Call123TestSpecialTagsWithHttpInfo (ModelClient modelClient) + public Org.OpenAPITools.Client.ApiResponse< ModelClient > Call123TestSpecialTagsWithHttpInfo (ModelClient body) { - // verify the required parameter 'modelClient' is set - if (modelClient == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling AnotherFakeApi->Call123TestSpecialTags"); + // verify the required parameter 'body' is set + if (body == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling AnotherFakeApi->Call123TestSpecialTags"); Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -239,7 +239,7 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(@accepts); if (localVarAccept != null) requestOptions.HeaderParameters.Add("Accept", localVarAccept); - requestOptions.Data = modelClient; + requestOptions.Data = body; // make the HTTP request @@ -259,11 +259,11 @@ namespace Org.OpenAPITools.Api /// To test special tags To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - public async System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient modelClient) + public async System.Threading.Tasks.Task Call123TestSpecialTagsAsync (ModelClient body) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await Call123TestSpecialTagsAsyncWithHttpInfo(modelClient); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await Call123TestSpecialTagsAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -272,13 +272,13 @@ namespace Org.OpenAPITools.Api /// To test special tags To test special tags and operation ID starting with number /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - public async System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient modelClient) + public async System.Threading.Tasks.Task> Call123TestSpecialTagsAsyncWithHttpInfo (ModelClient body) { - // verify the required parameter 'modelClient' is set - if (modelClient == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling AnotherFakeApi->Call123TestSpecialTags"); + // verify the required parameter 'body' is set + if (body == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling AnotherFakeApi->Call123TestSpecialTags"); Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -297,7 +297,7 @@ namespace Org.OpenAPITools.Api foreach (var accept in @accepts) requestOptions.HeaderParameters.Add("Accept", accept); - requestOptions.Data = modelClient; + requestOptions.Data = body; // make the HTTP request diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs index 54e776c8860..d969bfee0ed 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs @@ -55,9 +55,9 @@ namespace Org.OpenAPITools.Api /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// OuterComposite - OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null); + OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null); /// /// @@ -66,9 +66,9 @@ namespace Org.OpenAPITools.Api /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// ApiResponse of OuterComposite - ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite outerComposite = null); + ApiResponse FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null); /// /// /// @@ -118,9 +118,9 @@ namespace Org.OpenAPITools.Api /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// /// - void TestBodyWithFileSchema (FileSchemaTestClass fileSchemaTestClass); + void TestBodyWithFileSchema (FileSchemaTestClass body); /// /// @@ -129,9 +129,9 @@ namespace Org.OpenAPITools.Api /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// /// ApiResponse of Object(void) - ApiResponse TestBodyWithFileSchemaWithHttpInfo (FileSchemaTestClass fileSchemaTestClass); + ApiResponse TestBodyWithFileSchemaWithHttpInfo (FileSchemaTestClass body); /// /// /// @@ -140,9 +140,9 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// - /// + /// /// - void TestBodyWithQueryParams (string query, User user); + void TestBodyWithQueryParams (string query, User body); /// /// @@ -152,9 +152,9 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// - /// + /// /// ApiResponse of Object(void) - ApiResponse TestBodyWithQueryParamsWithHttpInfo (string query, User user); + ApiResponse TestBodyWithQueryParamsWithHttpInfo (string query, User body); /// /// To test \"client\" model /// @@ -162,9 +162,9 @@ namespace Org.OpenAPITools.Api /// To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - ModelClient TestClientModel (ModelClient modelClient); + ModelClient TestClientModel (ModelClient body); /// /// To test \"client\" model @@ -173,9 +173,9 @@ namespace Org.OpenAPITools.Api /// To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - ApiResponse TestClientModelWithHttpInfo (ModelClient modelClient); + ApiResponse TestClientModelWithHttpInfo (ModelClient body); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// @@ -296,9 +296,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// request body + /// request body /// - void TestInlineAdditionalProperties (Dictionary requestBody); + void TestInlineAdditionalProperties (Dictionary param); /// /// test inline additionalProperties @@ -307,9 +307,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// request body + /// request body /// ApiResponse of Object(void) - ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Dictionary requestBody); + ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Dictionary param); /// /// test json serialization of form data /// @@ -370,9 +370,9 @@ namespace Org.OpenAPITools.Api /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// Task of OuterComposite - System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite outerComposite = null); + System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = null); /// /// @@ -381,9 +381,9 @@ namespace Org.OpenAPITools.Api /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// Task of ApiResponse (OuterComposite) - System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite outerComposite = null); + System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null); /// /// /// @@ -433,9 +433,9 @@ namespace Org.OpenAPITools.Api /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// /// Task of void - System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass fileSchemaTestClass); + System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass body); /// /// @@ -444,9 +444,9 @@ namespace Org.OpenAPITools.Api /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// /// Task of ApiResponse - System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass fileSchemaTestClass); + System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass body); /// /// /// @@ -455,9 +455,9 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// - /// + /// /// Task of void - System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User user); + System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User body); /// /// @@ -467,9 +467,9 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// - /// + /// /// Task of ApiResponse - System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User user); + System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User body); /// /// To test \"client\" model /// @@ -477,9 +477,9 @@ namespace Org.OpenAPITools.Api /// To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - System.Threading.Tasks.Task TestClientModelAsync (ModelClient modelClient); + System.Threading.Tasks.Task TestClientModelAsync (ModelClient body); /// /// To test \"client\" model @@ -488,9 +488,9 @@ namespace Org.OpenAPITools.Api /// To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient modelClient); + System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body); /// /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 /// @@ -611,9 +611,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// request body + /// request body /// Task of void - System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary requestBody); + System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary param); /// /// test inline additionalProperties @@ -622,9 +622,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// request body + /// request body /// Task of ApiResponse - System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary requestBody); + System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary param); /// /// test json serialization of form data /// @@ -879,11 +879,11 @@ namespace Org.OpenAPITools.Api /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// OuterComposite - public OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null) + public OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = FakeOuterCompositeSerializeWithHttpInfo(outerComposite); + Org.OpenAPITools.Client.ApiResponse localVarResponse = FakeOuterCompositeSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -891,9 +891,9 @@ namespace Org.OpenAPITools.Api /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// ApiResponse of OuterComposite - public Org.OpenAPITools.Client.ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (OuterComposite outerComposite = null) + public Org.OpenAPITools.Client.ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (OuterComposite body = null) { Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -912,7 +912,7 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(@accepts); if (localVarAccept != null) requestOptions.HeaderParameters.Add("Accept", localVarAccept); - requestOptions.Data = outerComposite; + requestOptions.Data = body; // make the HTTP request @@ -932,11 +932,11 @@ namespace Org.OpenAPITools.Api /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// Task of OuterComposite - public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite outerComposite = null) + public async System.Threading.Tasks.Task FakeOuterCompositeSerializeAsync (OuterComposite body = null) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(outerComposite); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterCompositeSerializeAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -945,9 +945,9 @@ namespace Org.OpenAPITools.Api /// Test serialization of object with outer number type /// /// Thrown when fails to make API call - /// Input composite as post body (optional) + /// Input composite as post body (optional) /// Task of ApiResponse (OuterComposite) - public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite outerComposite = null) + public async System.Threading.Tasks.Task> FakeOuterCompositeSerializeAsyncWithHttpInfo (OuterComposite body = null) { Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -966,7 +966,7 @@ namespace Org.OpenAPITools.Api foreach (var accept in @accepts) requestOptions.HeaderParameters.Add("Accept", accept); - requestOptions.Data = outerComposite; + requestOptions.Data = body; // make the HTTP request @@ -1200,24 +1200,24 @@ namespace Org.OpenAPITools.Api /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// /// - public void TestBodyWithFileSchema (FileSchemaTestClass fileSchemaTestClass) + public void TestBodyWithFileSchema (FileSchemaTestClass body) { - TestBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass); + TestBodyWithFileSchemaWithHttpInfo(body); } /// /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// /// ApiResponse of Object(void) - public Org.OpenAPITools.Client.ApiResponse TestBodyWithFileSchemaWithHttpInfo (FileSchemaTestClass fileSchemaTestClass) + public Org.OpenAPITools.Client.ApiResponse TestBodyWithFileSchemaWithHttpInfo (FileSchemaTestClass body) { - // verify the required parameter 'fileSchemaTestClass' is set - if (fileSchemaTestClass == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'fileSchemaTestClass' when calling FakeApi->TestBodyWithFileSchema"); + // verify the required parameter 'body' is set + if (body == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithFileSchema"); Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1235,7 +1235,7 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(@accepts); if (localVarAccept != null) requestOptions.HeaderParameters.Add("Accept", localVarAccept); - requestOptions.Data = fileSchemaTestClass; + requestOptions.Data = body; // make the HTTP request @@ -1255,11 +1255,11 @@ namespace Org.OpenAPITools.Api /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// /// Task of void - public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass fileSchemaTestClass) + public async System.Threading.Tasks.Task TestBodyWithFileSchemaAsync (FileSchemaTestClass body) { - await TestBodyWithFileSchemaAsyncWithHttpInfo(fileSchemaTestClass); + await TestBodyWithFileSchemaAsyncWithHttpInfo(body); } @@ -1267,13 +1267,13 @@ namespace Org.OpenAPITools.Api /// For this test, the body for this request much reference a schema named `File`. /// /// Thrown when fails to make API call - /// + /// /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass fileSchemaTestClass) + public async System.Threading.Tasks.Task> TestBodyWithFileSchemaAsyncWithHttpInfo (FileSchemaTestClass body) { - // verify the required parameter 'fileSchemaTestClass' is set - if (fileSchemaTestClass == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'fileSchemaTestClass' when calling FakeApi->TestBodyWithFileSchema"); + // verify the required parameter 'body' is set + if (body == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithFileSchema"); Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1291,7 +1291,7 @@ namespace Org.OpenAPITools.Api foreach (var accept in @accepts) requestOptions.HeaderParameters.Add("Accept", accept); - requestOptions.Data = fileSchemaTestClass; + requestOptions.Data = body; // make the HTTP request @@ -1312,11 +1312,11 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// - /// + /// /// - public void TestBodyWithQueryParams (string query, User user) + public void TestBodyWithQueryParams (string query, User body) { - TestBodyWithQueryParamsWithHttpInfo(query, user); + TestBodyWithQueryParamsWithHttpInfo(query, body); } /// @@ -1324,16 +1324,16 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// - /// + /// /// ApiResponse of Object(void) - public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHttpInfo (string query, User user) + public Org.OpenAPITools.Client.ApiResponse TestBodyWithQueryParamsWithHttpInfo (string query, User body) { // verify the required parameter 'query' is set if (query == null) throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams"); - // verify the required parameter 'user' is set - if (user == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling FakeApi->TestBodyWithQueryParams"); + // verify the required parameter 'body' is set + if (body == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithQueryParams"); Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1361,7 +1361,7 @@ namespace Org.OpenAPITools.Api } } } - requestOptions.Data = user; + requestOptions.Data = body; // make the HTTP request @@ -1382,11 +1382,11 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// - /// + /// /// Task of void - public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User user) + public async System.Threading.Tasks.Task TestBodyWithQueryParamsAsync (string query, User body) { - await TestBodyWithQueryParamsAsyncWithHttpInfo(query, user); + await TestBodyWithQueryParamsAsyncWithHttpInfo(query, body); } @@ -1395,16 +1395,16 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// - /// + /// /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User user) + public async System.Threading.Tasks.Task> TestBodyWithQueryParamsAsyncWithHttpInfo (string query, User body) { // verify the required parameter 'query' is set if (query == null) throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'query' when calling FakeApi->TestBodyWithQueryParams"); - // verify the required parameter 'user' is set - if (user == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling FakeApi->TestBodyWithQueryParams"); + // verify the required parameter 'body' is set + if (body == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestBodyWithQueryParams"); Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1432,7 +1432,7 @@ namespace Org.OpenAPITools.Api } } } - requestOptions.Data = user; + requestOptions.Data = body; // make the HTTP request @@ -1452,11 +1452,11 @@ namespace Org.OpenAPITools.Api /// To test \"client\" model To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - public ModelClient TestClientModel (ModelClient modelClient) + public ModelClient TestClientModel (ModelClient body) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = TestClientModelWithHttpInfo(modelClient); + Org.OpenAPITools.Client.ApiResponse localVarResponse = TestClientModelWithHttpInfo(body); return localVarResponse.Data; } @@ -1464,13 +1464,13 @@ namespace Org.OpenAPITools.Api /// To test \"client\" model To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - public Org.OpenAPITools.Client.ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient modelClient) + public Org.OpenAPITools.Client.ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient body) { - // verify the required parameter 'modelClient' is set - if (modelClient == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeApi->TestClientModel"); + // verify the required parameter 'body' is set + if (body == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestClientModel"); Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1489,7 +1489,7 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(@accepts); if (localVarAccept != null) requestOptions.HeaderParameters.Add("Accept", localVarAccept); - requestOptions.Data = modelClient; + requestOptions.Data = body; // make the HTTP request @@ -1509,11 +1509,11 @@ namespace Org.OpenAPITools.Api /// To test \"client\" model To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - public async System.Threading.Tasks.Task TestClientModelAsync (ModelClient modelClient) + public async System.Threading.Tasks.Task TestClientModelAsync (ModelClient body) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await TestClientModelAsyncWithHttpInfo(modelClient); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await TestClientModelAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -1522,13 +1522,13 @@ namespace Org.OpenAPITools.Api /// To test \"client\" model To test \"client\" model /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - public async System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient modelClient) + public async System.Threading.Tasks.Task> TestClientModelAsyncWithHttpInfo (ModelClient body) { - // verify the required parameter 'modelClient' is set - if (modelClient == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeApi->TestClientModel"); + // verify the required parameter 'body' is set + if (body == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling FakeApi->TestClientModel"); Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1547,7 +1547,7 @@ namespace Org.OpenAPITools.Api foreach (var accept in @accepts) requestOptions.HeaderParameters.Add("Accept", accept); - requestOptions.Data = modelClient; + requestOptions.Data = body; // make the HTTP request @@ -2332,24 +2332,24 @@ namespace Org.OpenAPITools.Api /// test inline additionalProperties /// /// Thrown when fails to make API call - /// request body + /// request body /// - public void TestInlineAdditionalProperties (Dictionary requestBody) + public void TestInlineAdditionalProperties (Dictionary param) { - TestInlineAdditionalPropertiesWithHttpInfo(requestBody); + TestInlineAdditionalPropertiesWithHttpInfo(param); } /// /// test inline additionalProperties /// /// Thrown when fails to make API call - /// request body + /// request body /// ApiResponse of Object(void) - public Org.OpenAPITools.Client.ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Dictionary requestBody) + public Org.OpenAPITools.Client.ApiResponse TestInlineAdditionalPropertiesWithHttpInfo (Dictionary param) { - // verify the required parameter 'requestBody' is set - if (requestBody == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestInlineAdditionalProperties"); + // verify the required parameter 'param' is set + if (param == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestInlineAdditionalProperties"); Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2367,7 +2367,7 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(@accepts); if (localVarAccept != null) requestOptions.HeaderParameters.Add("Accept", localVarAccept); - requestOptions.Data = requestBody; + requestOptions.Data = param; // make the HTTP request @@ -2387,11 +2387,11 @@ namespace Org.OpenAPITools.Api /// test inline additionalProperties /// /// Thrown when fails to make API call - /// request body + /// request body /// Task of void - public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary requestBody) + public async System.Threading.Tasks.Task TestInlineAdditionalPropertiesAsync (Dictionary param) { - await TestInlineAdditionalPropertiesAsyncWithHttpInfo(requestBody); + await TestInlineAdditionalPropertiesAsyncWithHttpInfo(param); } @@ -2399,13 +2399,13 @@ namespace Org.OpenAPITools.Api /// test inline additionalProperties /// /// Thrown when fails to make API call - /// request body + /// request body /// Task of ApiResponse - public async System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary requestBody) + public async System.Threading.Tasks.Task> TestInlineAdditionalPropertiesAsyncWithHttpInfo (Dictionary param) { - // verify the required parameter 'requestBody' is set - if (requestBody == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requestBody' when calling FakeApi->TestInlineAdditionalProperties"); + // verify the required parameter 'param' is set + if (param == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'param' when calling FakeApi->TestInlineAdditionalProperties"); Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -2423,7 +2423,7 @@ namespace Org.OpenAPITools.Api foreach (var accept in @accepts) requestOptions.HeaderParameters.Add("Accept", accept); - requestOptions.Data = requestBody; + requestOptions.Data = param; // make the HTTP request diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs index 25e2b0055d1..732227a1e3b 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs @@ -34,9 +34,9 @@ namespace Org.OpenAPITools.Api /// To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - ModelClient TestClassname (ModelClient modelClient); + ModelClient TestClassname (ModelClient body); /// /// To test class name in snake case @@ -45,9 +45,9 @@ namespace Org.OpenAPITools.Api /// To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - ApiResponse TestClassnameWithHttpInfo (ModelClient modelClient); + ApiResponse TestClassnameWithHttpInfo (ModelClient body); #endregion Synchronous Operations } @@ -64,9 +64,9 @@ namespace Org.OpenAPITools.Api /// To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - System.Threading.Tasks.Task TestClassnameAsync (ModelClient modelClient); + System.Threading.Tasks.Task TestClassnameAsync (ModelClient body); /// /// To test class name in snake case @@ -75,9 +75,9 @@ namespace Org.OpenAPITools.Api /// To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient modelClient); + System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body); #endregion Asynchronous Operations } @@ -202,11 +202,11 @@ namespace Org.OpenAPITools.Api /// To test class name in snake case To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// ModelClient - public ModelClient TestClassname (ModelClient modelClient) + public ModelClient TestClassname (ModelClient body) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = TestClassnameWithHttpInfo(modelClient); + Org.OpenAPITools.Client.ApiResponse localVarResponse = TestClassnameWithHttpInfo(body); return localVarResponse.Data; } @@ -214,13 +214,13 @@ namespace Org.OpenAPITools.Api /// To test class name in snake case To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// ApiResponse of ModelClient - public Org.OpenAPITools.Client.ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient modelClient) + public Org.OpenAPITools.Client.ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient body) { - // verify the required parameter 'modelClient' is set - if (modelClient == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeClassnameTags123Api->TestClassname"); + // verify the required parameter 'body' is set + if (body == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling FakeClassnameTags123Api->TestClassname"); Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -239,7 +239,7 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(@accepts); if (localVarAccept != null) requestOptions.HeaderParameters.Add("Accept", localVarAccept); - requestOptions.Data = modelClient; + requestOptions.Data = body; // authentication (api_key_query) required if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key_query"))) @@ -270,11 +270,11 @@ namespace Org.OpenAPITools.Api /// To test class name in snake case To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ModelClient - public async System.Threading.Tasks.Task TestClassnameAsync (ModelClient modelClient) + public async System.Threading.Tasks.Task TestClassnameAsync (ModelClient body) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await TestClassnameAsyncWithHttpInfo(modelClient); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await TestClassnameAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -283,13 +283,13 @@ namespace Org.OpenAPITools.Api /// To test class name in snake case To test class name in snake case /// /// Thrown when fails to make API call - /// client model + /// client model /// Task of ApiResponse (ModelClient) - public async System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient modelClient) + public async System.Threading.Tasks.Task> TestClassnameAsyncWithHttpInfo (ModelClient body) { - // verify the required parameter 'modelClient' is set - if (modelClient == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'modelClient' when calling FakeClassnameTags123Api->TestClassname"); + // verify the required parameter 'body' is set + if (body == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling FakeClassnameTags123Api->TestClassname"); Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -308,7 +308,7 @@ namespace Org.OpenAPITools.Api foreach (var accept in @accepts) requestOptions.HeaderParameters.Add("Accept", accept); - requestOptions.Data = modelClient; + requestOptions.Data = body; // authentication (api_key_query) required if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key_query"))) diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs index fb9bf2359af..060be91a272 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Api/PetApi.cs @@ -34,9 +34,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - void AddPet (Pet pet); + void AddPet (Pet body); /// /// Add a new pet to the store @@ -45,9 +45,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// ApiResponse of Object(void) - ApiResponse AddPetWithHttpInfo (Pet pet); + ApiResponse AddPetWithHttpInfo (Pet body); /// /// Deletes a pet /// @@ -141,9 +141,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - void UpdatePet (Pet pet); + void UpdatePet (Pet body); /// /// Update an existing pet @@ -152,9 +152,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// ApiResponse of Object(void) - ApiResponse UpdatePetWithHttpInfo (Pet pet); + ApiResponse UpdatePetWithHttpInfo (Pet body); /// /// Updates a pet in the store with form data /// @@ -246,9 +246,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of void - System.Threading.Tasks.Task AddPetAsync (Pet pet); + System.Threading.Tasks.Task AddPetAsync (Pet body); /// /// Add a new pet to the store @@ -257,9 +257,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of ApiResponse - System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet pet); + System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body); /// /// Deletes a pet /// @@ -353,9 +353,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of void - System.Threading.Tasks.Task UpdatePetAsync (Pet pet); + System.Threading.Tasks.Task UpdatePetAsync (Pet body); /// /// Update an existing pet @@ -364,9 +364,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of ApiResponse - System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet pet); + System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body); /// /// Updates a pet in the store with form data /// @@ -566,24 +566,24 @@ namespace Org.OpenAPITools.Api /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - public void AddPet (Pet pet) + public void AddPet (Pet body) { - AddPetWithHttpInfo(pet); + AddPetWithHttpInfo(body); } /// /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// ApiResponse of Object(void) - public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo (Pet pet) + public Org.OpenAPITools.Client.ApiResponse AddPetWithHttpInfo (Pet body) { - // verify the required parameter 'pet' is set - if (pet == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet"); + // verify the required parameter 'body' is set + if (body == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling PetApi->AddPet"); Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -602,7 +602,7 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(@accepts); if (localVarAccept != null) requestOptions.HeaderParameters.Add("Accept", localVarAccept); - requestOptions.Data = pet; + requestOptions.Data = body; // authentication (petstore_auth) required // oauth required @@ -628,11 +628,11 @@ namespace Org.OpenAPITools.Api /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of void - public async System.Threading.Tasks.Task AddPetAsync (Pet pet) + public async System.Threading.Tasks.Task AddPetAsync (Pet body) { - await AddPetAsyncWithHttpInfo(pet); + await AddPetAsyncWithHttpInfo(body); } @@ -640,13 +640,13 @@ namespace Org.OpenAPITools.Api /// Add a new pet to the store /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of ApiResponse - public async System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet pet) + public async System.Threading.Tasks.Task> AddPetAsyncWithHttpInfo (Pet body) { - // verify the required parameter 'pet' is set - if (pet == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet"); + // verify the required parameter 'body' is set + if (body == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling PetApi->AddPet"); Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -665,7 +665,7 @@ namespace Org.OpenAPITools.Api foreach (var accept in @accepts) requestOptions.HeaderParameters.Add("Accept", accept); - requestOptions.Data = pet; + requestOptions.Data = body; // authentication (petstore_auth) required // oauth required @@ -1239,24 +1239,24 @@ namespace Org.OpenAPITools.Api /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// - public void UpdatePet (Pet pet) + public void UpdatePet (Pet body) { - UpdatePetWithHttpInfo(pet); + UpdatePetWithHttpInfo(body); } /// /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// ApiResponse of Object(void) - public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo (Pet pet) + public Org.OpenAPITools.Client.ApiResponse UpdatePetWithHttpInfo (Pet body) { - // verify the required parameter 'pet' is set - if (pet == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet"); + // verify the required parameter 'body' is set + if (body == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling PetApi->UpdatePet"); Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1275,7 +1275,7 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(@accepts); if (localVarAccept != null) requestOptions.HeaderParameters.Add("Accept", localVarAccept); - requestOptions.Data = pet; + requestOptions.Data = body; // authentication (petstore_auth) required // oauth required @@ -1301,11 +1301,11 @@ namespace Org.OpenAPITools.Api /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of void - public async System.Threading.Tasks.Task UpdatePetAsync (Pet pet) + public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) { - await UpdatePetAsyncWithHttpInfo(pet); + await UpdatePetAsyncWithHttpInfo(body); } @@ -1313,13 +1313,13 @@ namespace Org.OpenAPITools.Api /// Update an existing pet /// /// Thrown when fails to make API call - /// Pet object that needs to be added to the store + /// Pet object that needs to be added to the store /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet pet) + public async System.Threading.Tasks.Task> UpdatePetAsyncWithHttpInfo (Pet body) { - // verify the required parameter 'pet' is set - if (pet == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet"); + // verify the required parameter 'body' is set + if (body == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling PetApi->UpdatePet"); Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1338,7 +1338,7 @@ namespace Org.OpenAPITools.Api foreach (var accept in @accepts) requestOptions.HeaderParameters.Add("Accept", accept); - requestOptions.Data = pet; + requestOptions.Data = body; // authentication (petstore_auth) required // oauth required diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs index 71680befddb..4372f115f32 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Api/StoreApi.cs @@ -95,9 +95,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Order - Order PlaceOrder (Order order); + Order PlaceOrder (Order body); /// /// Place an order for a pet @@ -106,9 +106,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// ApiResponse of Order - ApiResponse PlaceOrderWithHttpInfo (Order order); + ApiResponse PlaceOrderWithHttpInfo (Order body); #endregion Synchronous Operations } @@ -186,9 +186,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Task of Order - System.Threading.Tasks.Task PlaceOrderAsync (Order order); + System.Threading.Tasks.Task PlaceOrderAsync (Order body); /// /// Place an order for a pet @@ -197,9 +197,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Task of ApiResponse (Order) - System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order order); + System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body); #endregion Asynchronous Operations } @@ -663,11 +663,11 @@ namespace Org.OpenAPITools.Api /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Order - public Order PlaceOrder (Order order) + public Order PlaceOrder (Order body) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = PlaceOrderWithHttpInfo(order); + Org.OpenAPITools.Client.ApiResponse localVarResponse = PlaceOrderWithHttpInfo(body); return localVarResponse.Data; } @@ -675,13 +675,13 @@ namespace Org.OpenAPITools.Api /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// ApiResponse of Order - public Org.OpenAPITools.Client.ApiResponse< Order > PlaceOrderWithHttpInfo (Order order) + public Org.OpenAPITools.Client.ApiResponse< Order > PlaceOrderWithHttpInfo (Order body) { - // verify the required parameter 'order' is set - if (order == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder"); + // verify the required parameter 'body' is set + if (body == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling StoreApi->PlaceOrder"); Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -700,7 +700,7 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(@accepts); if (localVarAccept != null) requestOptions.HeaderParameters.Add("Accept", localVarAccept); - requestOptions.Data = order; + requestOptions.Data = body; // make the HTTP request @@ -720,11 +720,11 @@ namespace Org.OpenAPITools.Api /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Task of Order - public async System.Threading.Tasks.Task PlaceOrderAsync (Order order) + public async System.Threading.Tasks.Task PlaceOrderAsync (Order body) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await PlaceOrderAsyncWithHttpInfo(order); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await PlaceOrderAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -733,13 +733,13 @@ namespace Org.OpenAPITools.Api /// Place an order for a pet /// /// Thrown when fails to make API call - /// order placed for purchasing the pet + /// order placed for purchasing the pet /// Task of ApiResponse (Order) - public async System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order order) + public async System.Threading.Tasks.Task> PlaceOrderAsyncWithHttpInfo (Order body) { - // verify the required parameter 'order' is set - if (order == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder"); + // verify the required parameter 'body' is set + if (body == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling StoreApi->PlaceOrder"); Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -758,7 +758,7 @@ namespace Org.OpenAPITools.Api foreach (var accept in @accepts) requestOptions.HeaderParameters.Add("Accept", accept); - requestOptions.Data = order; + requestOptions.Data = body; // make the HTTP request diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs index 5b086124f95..6438d62fdaa 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Api/UserApi.cs @@ -34,9 +34,9 @@ namespace Org.OpenAPITools.Api /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// - void CreateUser (User user); + void CreateUser (User body); /// /// Create user @@ -45,9 +45,9 @@ namespace Org.OpenAPITools.Api /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// ApiResponse of Object(void) - ApiResponse CreateUserWithHttpInfo (User user); + ApiResponse CreateUserWithHttpInfo (User body); /// /// Creates list of users with given input array /// @@ -55,9 +55,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// - void CreateUsersWithArrayInput (List user); + void CreateUsersWithArrayInput (List body); /// /// Creates list of users with given input array @@ -66,9 +66,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// ApiResponse of Object(void) - ApiResponse CreateUsersWithArrayInputWithHttpInfo (List user); + ApiResponse CreateUsersWithArrayInputWithHttpInfo (List body); /// /// Creates list of users with given input array /// @@ -76,9 +76,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// - void CreateUsersWithListInput (List user); + void CreateUsersWithListInput (List body); /// /// Creates list of users with given input array @@ -87,9 +87,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// ApiResponse of Object(void) - ApiResponse CreateUsersWithListInputWithHttpInfo (List user); + ApiResponse CreateUsersWithListInputWithHttpInfo (List body); /// /// Delete user /// @@ -182,9 +182,9 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// - void UpdateUser (string username, User user); + void UpdateUser (string username, User body); /// /// Updated user @@ -194,9 +194,9 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// ApiResponse of Object(void) - ApiResponse UpdateUserWithHttpInfo (string username, User user); + ApiResponse UpdateUserWithHttpInfo (string username, User body); #endregion Synchronous Operations } @@ -213,9 +213,9 @@ namespace Org.OpenAPITools.Api /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// Task of void - System.Threading.Tasks.Task CreateUserAsync (User user); + System.Threading.Tasks.Task CreateUserAsync (User body); /// /// Create user @@ -224,9 +224,9 @@ namespace Org.OpenAPITools.Api /// This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User user); + System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body); /// /// Creates list of users with given input array /// @@ -234,9 +234,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of void - System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List user); + System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body); /// /// Creates list of users with given input array @@ -245,9 +245,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List user); + System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body); /// /// Creates list of users with given input array /// @@ -255,9 +255,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of void - System.Threading.Tasks.Task CreateUsersWithListInputAsync (List user); + System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body); /// /// Creates list of users with given input array @@ -266,9 +266,9 @@ namespace Org.OpenAPITools.Api /// /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of ApiResponse - System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List user); + System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body); /// /// Delete user /// @@ -361,9 +361,9 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// Task of void - System.Threading.Tasks.Task UpdateUserAsync (string username, User user); + System.Threading.Tasks.Task UpdateUserAsync (string username, User body); /// /// Updated user @@ -373,9 +373,9 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// Task of ApiResponse - System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User user); + System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body); #endregion Asynchronous Operations } @@ -500,24 +500,24 @@ namespace Org.OpenAPITools.Api /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// - public void CreateUser (User user) + public void CreateUser (User body) { - CreateUserWithHttpInfo(user); + CreateUserWithHttpInfo(body); } /// /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// ApiResponse of Object(void) - public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo (User user) + public Org.OpenAPITools.Client.ApiResponse CreateUserWithHttpInfo (User body) { - // verify the required parameter 'user' is set - if (user == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser"); + // verify the required parameter 'body' is set + if (body == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUser"); Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -534,7 +534,7 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(@accepts); if (localVarAccept != null) requestOptions.HeaderParameters.Add("Accept", localVarAccept); - requestOptions.Data = user; + requestOptions.Data = body; // make the HTTP request @@ -554,11 +554,11 @@ namespace Org.OpenAPITools.Api /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// Task of void - public async System.Threading.Tasks.Task CreateUserAsync (User user) + public async System.Threading.Tasks.Task CreateUserAsync (User body) { - await CreateUserAsyncWithHttpInfo(user); + await CreateUserAsyncWithHttpInfo(body); } @@ -566,13 +566,13 @@ namespace Org.OpenAPITools.Api /// Create user This can only be done by the logged in user. /// /// Thrown when fails to make API call - /// Created user object + /// Created user object /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User user) + public async System.Threading.Tasks.Task> CreateUserAsyncWithHttpInfo (User body) { - // verify the required parameter 'user' is set - if (user == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser"); + // verify the required parameter 'body' is set + if (body == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUser"); Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -589,7 +589,7 @@ namespace Org.OpenAPITools.Api foreach (var accept in @accepts) requestOptions.HeaderParameters.Add("Accept", accept); - requestOptions.Data = user; + requestOptions.Data = body; // make the HTTP request @@ -609,24 +609,24 @@ namespace Org.OpenAPITools.Api /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// - public void CreateUsersWithArrayInput (List user) + public void CreateUsersWithArrayInput (List body) { - CreateUsersWithArrayInputWithHttpInfo(user); + CreateUsersWithArrayInputWithHttpInfo(body); } /// /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// ApiResponse of Object(void) - public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWithHttpInfo (List user) + public Org.OpenAPITools.Client.ApiResponse CreateUsersWithArrayInputWithHttpInfo (List body) { - // verify the required parameter 'user' is set - if (user == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput"); + // verify the required parameter 'body' is set + if (body == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput"); Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -643,7 +643,7 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(@accepts); if (localVarAccept != null) requestOptions.HeaderParameters.Add("Accept", localVarAccept); - requestOptions.Data = user; + requestOptions.Data = body; // make the HTTP request @@ -663,11 +663,11 @@ namespace Org.OpenAPITools.Api /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of void - public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List user) + public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body) { - await CreateUsersWithArrayInputAsyncWithHttpInfo(user); + await CreateUsersWithArrayInputAsyncWithHttpInfo(body); } @@ -675,13 +675,13 @@ namespace Org.OpenAPITools.Api /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List user) + public async System.Threading.Tasks.Task> CreateUsersWithArrayInputAsyncWithHttpInfo (List body) { - // verify the required parameter 'user' is set - if (user == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput"); + // verify the required parameter 'body' is set + if (body == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput"); Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -698,7 +698,7 @@ namespace Org.OpenAPITools.Api foreach (var accept in @accepts) requestOptions.HeaderParameters.Add("Accept", accept); - requestOptions.Data = user; + requestOptions.Data = body; // make the HTTP request @@ -718,24 +718,24 @@ namespace Org.OpenAPITools.Api /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// - public void CreateUsersWithListInput (List user) + public void CreateUsersWithListInput (List body) { - CreateUsersWithListInputWithHttpInfo(user); + CreateUsersWithListInputWithHttpInfo(body); } /// /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// ApiResponse of Object(void) - public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithHttpInfo (List user) + public Org.OpenAPITools.Client.ApiResponse CreateUsersWithListInputWithHttpInfo (List body) { - // verify the required parameter 'user' is set - if (user == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput"); + // verify the required parameter 'body' is set + if (body == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput"); Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -752,7 +752,7 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(@accepts); if (localVarAccept != null) requestOptions.HeaderParameters.Add("Accept", localVarAccept); - requestOptions.Data = user; + requestOptions.Data = body; // make the HTTP request @@ -772,11 +772,11 @@ namespace Org.OpenAPITools.Api /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of void - public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List user) + public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body) { - await CreateUsersWithListInputAsyncWithHttpInfo(user); + await CreateUsersWithListInputAsyncWithHttpInfo(body); } @@ -784,13 +784,13 @@ namespace Org.OpenAPITools.Api /// Creates list of users with given input array /// /// Thrown when fails to make API call - /// List of user object + /// List of user object /// Task of ApiResponse - public async System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List user) + public async System.Threading.Tasks.Task> CreateUsersWithListInputAsyncWithHttpInfo (List body) { - // verify the required parameter 'user' is set - if (user == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput"); + // verify the required parameter 'body' is set + if (body == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput"); Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -807,7 +807,7 @@ namespace Org.OpenAPITools.Api foreach (var accept in @accepts) requestOptions.HeaderParameters.Add("Accept", accept); - requestOptions.Data = user; + requestOptions.Data = body; // make the HTTP request @@ -1316,11 +1316,11 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// - public void UpdateUser (string username, User user) + public void UpdateUser (string username, User body) { - UpdateUserWithHttpInfo(username, user); + UpdateUserWithHttpInfo(username, body); } /// @@ -1328,16 +1328,16 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// ApiResponse of Object(void) - public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo (string username, User user) + public Org.OpenAPITools.Client.ApiResponse UpdateUserWithHttpInfo (string username, User body) { // verify the required parameter 'username' is set if (username == null) throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); - // verify the required parameter 'user' is set - if (user == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser"); + // verify the required parameter 'body' is set + if (body == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling UserApi->UpdateUser"); Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1356,7 +1356,7 @@ namespace Org.OpenAPITools.Api if (username != null) requestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter - requestOptions.Data = user; + requestOptions.Data = body; // make the HTTP request @@ -1377,11 +1377,11 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// Task of void - public async System.Threading.Tasks.Task UpdateUserAsync (string username, User user) + public async System.Threading.Tasks.Task UpdateUserAsync (string username, User body) { - await UpdateUserAsyncWithHttpInfo(username, user); + await UpdateUserAsyncWithHttpInfo(username, body); } @@ -1390,16 +1390,16 @@ namespace Org.OpenAPITools.Api /// /// Thrown when fails to make API call /// name that need to be deleted - /// Updated user object + /// Updated user object /// Task of ApiResponse - public async System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User user) + public async System.Threading.Tasks.Task> UpdateUserAsyncWithHttpInfo (string username, User body) { // verify the required parameter 'username' is set if (username == null) throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); - // verify the required parameter 'user' is set - if (user == null) - throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser"); + // verify the required parameter 'body' is set + if (body == null) + throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'body' when calling UserApi->UpdateUser"); Org.OpenAPITools.Client.RequestOptions requestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1418,7 +1418,7 @@ namespace Org.OpenAPITools.Api if (username != null) requestOptions.PathParameters.Add("username", Org.OpenAPITools.Client.ClientUtils.ParameterToString(username)); // path parameter - requestOptions.Data = user; + requestOptions.Data = body; // make the HTTP request diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Client/ClientUtils.cs index f021ccbe6d1..5825b8e790d 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Client/ClientUtils.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Client/ClientUtils.cs @@ -18,6 +18,7 @@ using System.Net; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; +using KellermanSoftware.CompareNetObjects; namespace Org.OpenAPITools.Client { @@ -26,6 +27,19 @@ namespace Org.OpenAPITools.Client /// public static class ClientUtils { + /// + /// An instance of CompareLogic. + /// + public static CompareLogic compareLogic; + + /// + /// Static contstructor to initialise compareLogic. + /// + static ClientUtils() + { + compareLogic = new CompareLogic(); + } + /// /// Sanitize filename by removing the path /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs index 59c2d5d047a..32a19a7cc33 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -84,7 +85,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as AdditionalPropertiesClass); + return OpenAPIClientUtils.compareLogic.Compare(this, input as AdditionalPropertiesClass).AreEqual; } /// @@ -94,20 +95,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(AdditionalPropertiesClass input) { - if (input == null) - return false; - - return - ( - this.MapProperty == input.MapProperty || - this.MapProperty != null && - this.MapProperty.SequenceEqual(input.MapProperty) - ) && - ( - this.MapOfMapProperty == input.MapOfMapProperty || - this.MapOfMapProperty != null && - this.MapOfMapProperty.SequenceEqual(input.MapOfMapProperty) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs index ad48639ccba..ca40389f098 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Animal.cs @@ -23,6 +23,7 @@ using Newtonsoft.Json.Converters; using JsonSubTypes; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -30,7 +31,7 @@ namespace Org.OpenAPITools.Model /// Animal /// [DataContract] - [JsonConverter(typeof(JsonSubtypes), "className")] + [JsonConverter(typeof(JsonSubtypes), "ClassName")] [JsonSubtypes.KnownSubType(typeof(Dog), "Dog")] [JsonSubtypes.KnownSubType(typeof(Cat), "Cat")] public partial class Animal : IEquatable, IValidatableObject @@ -109,7 +110,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as Animal); + return OpenAPIClientUtils.compareLogic.Compare(this, input as Animal).AreEqual; } /// @@ -119,20 +120,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(Animal input) { - if (input == null) - return false; - - return - ( - this.ClassName == input.ClassName || - (this.ClassName != null && - this.ClassName.Equals(input.ClassName)) - ) && - ( - this.Color == input.Color || - (this.Color != null && - this.Color.Equals(input.Color)) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/ApiResponse.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/ApiResponse.cs index e5708098f2f..c6c036185f8 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/ApiResponse.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -93,7 +94,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as ApiResponse); + return OpenAPIClientUtils.compareLogic.Compare(this, input as ApiResponse).AreEqual; } /// @@ -103,25 +104,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(ApiResponse input) { - if (input == null) - return false; - - return - ( - this.Code == input.Code || - (this.Code != null && - this.Code.Equals(input.Code)) - ) && - ( - this.Type == input.Type || - (this.Type != null && - this.Type.Equals(input.Type)) - ) && - ( - this.Message == input.Message || - (this.Message != null && - this.Message.Equals(input.Message)) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs index a878980f831..c07787171eb 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -75,7 +76,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as ArrayOfArrayOfNumberOnly); + return OpenAPIClientUtils.compareLogic.Compare(this, input as ArrayOfArrayOfNumberOnly).AreEqual; } /// @@ -85,15 +86,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(ArrayOfArrayOfNumberOnly input) { - if (input == null) - return false; - - return - ( - this.ArrayArrayNumber == input.ArrayArrayNumber || - this.ArrayArrayNumber != null && - this.ArrayArrayNumber.SequenceEqual(input.ArrayArrayNumber) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs index d5947a34321..9e78493af53 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -75,7 +76,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as ArrayOfNumberOnly); + return OpenAPIClientUtils.compareLogic.Compare(this, input as ArrayOfNumberOnly).AreEqual; } /// @@ -85,15 +86,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(ArrayOfNumberOnly input) { - if (input == null) - return false; - - return - ( - this.ArrayNumber == input.ArrayNumber || - this.ArrayNumber != null && - this.ArrayNumber.SequenceEqual(input.ArrayNumber) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayTest.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayTest.cs index 47d0d9d81c1..592677aecda 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/ArrayTest.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -93,7 +94,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as ArrayTest); + return OpenAPIClientUtils.compareLogic.Compare(this, input as ArrayTest).AreEqual; } /// @@ -103,25 +104,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(ArrayTest input) { - if (input == null) - return false; - - return - ( - this.ArrayOfString == input.ArrayOfString || - this.ArrayOfString != null && - this.ArrayOfString.SequenceEqual(input.ArrayOfString) - ) && - ( - this.ArrayArrayOfInteger == input.ArrayArrayOfInteger || - this.ArrayArrayOfInteger != null && - this.ArrayArrayOfInteger.SequenceEqual(input.ArrayArrayOfInteger) - ) && - ( - this.ArrayArrayOfModel == input.ArrayArrayOfModel || - this.ArrayArrayOfModel != null && - this.ArrayArrayOfModel.SequenceEqual(input.ArrayArrayOfModel) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Capitalization.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Capitalization.cs index d4fd2c1490b..8af54f1e73e 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Capitalization.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Capitalization.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -121,7 +122,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as Capitalization); + return OpenAPIClientUtils.compareLogic.Compare(this, input as Capitalization).AreEqual; } /// @@ -131,40 +132,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(Capitalization input) { - if (input == null) - return false; - - return - ( - this.SmallCamel == input.SmallCamel || - (this.SmallCamel != null && - this.SmallCamel.Equals(input.SmallCamel)) - ) && - ( - this.CapitalCamel == input.CapitalCamel || - (this.CapitalCamel != null && - this.CapitalCamel.Equals(input.CapitalCamel)) - ) && - ( - this.SmallSnake == input.SmallSnake || - (this.SmallSnake != null && - this.SmallSnake.Equals(input.SmallSnake)) - ) && - ( - this.CapitalSnake == input.CapitalSnake || - (this.CapitalSnake != null && - this.CapitalSnake.Equals(input.CapitalSnake)) - ) && - ( - this.SCAETHFlowPoints == input.SCAETHFlowPoints || - (this.SCAETHFlowPoints != null && - this.SCAETHFlowPoints.Equals(input.SCAETHFlowPoints)) - ) && - ( - this.ATT_NAME == input.ATT_NAME || - (this.ATT_NAME != null && - this.ATT_NAME.Equals(input.ATT_NAME)) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs index 7f1c26bc24e..1d08b561e75 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Cat.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -83,7 +84,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as Cat); + return OpenAPIClientUtils.compareLogic.Compare(this, input as Cat).AreEqual; } /// @@ -93,15 +94,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(Cat input) { - if (input == null) - return false; - - return base.Equals(input) && - ( - this.Declawed == input.Declawed || - (this.Declawed != null && - this.Declawed.Equals(input.Declawed)) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs index 6fba39bdd03..49a66e58c82 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Category.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -97,7 +98,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as Category); + return OpenAPIClientUtils.compareLogic.Compare(this, input as Category).AreEqual; } /// @@ -107,20 +108,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(Category input) { - if (input == null) - return false; - - return - ( - this.Id == input.Id || - (this.Id != null && - this.Id.Equals(input.Id)) - ) && - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/ClassModel.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/ClassModel.cs index 65d25164aaa..5eccb61a4a3 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/ClassModel.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/ClassModel.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -75,7 +76,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as ClassModel); + return OpenAPIClientUtils.compareLogic.Compare(this, input as ClassModel).AreEqual; } /// @@ -85,15 +86,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(ClassModel input) { - if (input == null) - return false; - - return - ( - this.Class == input.Class || - (this.Class != null && - this.Class.Equals(input.Class)) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs index c87c78afd57..dc3e2b596e0 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Dog.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -83,7 +84,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as Dog); + return OpenAPIClientUtils.compareLogic.Compare(this, input as Dog).AreEqual; } /// @@ -93,15 +94,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(Dog input) { - if (input == null) - return false; - - return base.Equals(input) && - ( - this.Breed == input.Breed || - (this.Breed != null && - this.Breed.Equals(input.Breed)) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/EnumArrays.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/EnumArrays.cs index 69bb039d90e..63fabba7f44 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/EnumArrays.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/EnumArrays.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -123,7 +124,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as EnumArrays); + return OpenAPIClientUtils.compareLogic.Compare(this, input as EnumArrays).AreEqual; } /// @@ -133,19 +134,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(EnumArrays input) { - if (input == null) - return false; - - return - ( - this.JustSymbol == input.JustSymbol || - this.JustSymbol.Equals(input.JustSymbol) - ) && - ( - this.ArrayEnum == input.ArrayEnum || - this.ArrayEnum != null && - this.ArrayEnum.SequenceEqual(input.ArrayEnum) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/EnumClass.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/EnumClass.cs index 9773747578d..db151c2c773 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/EnumClass.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/EnumClass.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/EnumTest.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/EnumTest.cs index 2fa5b6b3e85..d45d1ad623b 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/EnumTest.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/EnumTest.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -201,7 +202,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as EnumTest); + return OpenAPIClientUtils.compareLogic.Compare(this, input as EnumTest).AreEqual; } /// @@ -211,31 +212,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(EnumTest input) { - if (input == null) - return false; - - return - ( - this.EnumString == input.EnumString || - this.EnumString.Equals(input.EnumString) - ) && - ( - this.EnumStringRequired == input.EnumStringRequired || - this.EnumStringRequired.Equals(input.EnumStringRequired) - ) && - ( - this.EnumInteger == input.EnumInteger || - this.EnumInteger.Equals(input.EnumInteger) - ) && - ( - this.EnumNumber == input.EnumNumber || - this.EnumNumber.Equals(input.EnumNumber) - ) && - ( - this.OuterEnum == input.OuterEnum || - (this.OuterEnum != null && - this.OuterEnum.Equals(input.OuterEnum)) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/File.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/File.cs index 7e594c1e949..dabb0d97d3e 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/File.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/File.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -76,7 +77,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as File); + return OpenAPIClientUtils.compareLogic.Compare(this, input as File).AreEqual; } /// @@ -86,15 +87,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(File input) { - if (input == null) - return false; - - return - ( - this.SourceURI == input.SourceURI || - (this.SourceURI != null && - this.SourceURI.Equals(input.SourceURI)) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs index 4d0b36ee724..5cdb9b7e3a3 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/FileSchemaTestClass.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -84,7 +85,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as FileSchemaTestClass); + return OpenAPIClientUtils.compareLogic.Compare(this, input as FileSchemaTestClass).AreEqual; } /// @@ -94,20 +95,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(FileSchemaTestClass input) { - if (input == null) - return false; - - return - ( - this.File == input.File || - (this.File != null && - this.File.Equals(input.File)) - ) && - ( - this.Files == input.Files || - this.Files != null && - this.Files.SequenceEqual(input.Files) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs index 0a6425d0950..529cf5fe5eb 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/FormatTest.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -221,7 +222,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as FormatTest); + return OpenAPIClientUtils.compareLogic.Compare(this, input as FormatTest).AreEqual; } /// @@ -231,75 +232,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(FormatTest input) { - if (input == null) - return false; - - return - ( - this.Integer == input.Integer || - (this.Integer != null && - this.Integer.Equals(input.Integer)) - ) && - ( - this.Int32 == input.Int32 || - (this.Int32 != null && - this.Int32.Equals(input.Int32)) - ) && - ( - this.Int64 == input.Int64 || - (this.Int64 != null && - this.Int64.Equals(input.Int64)) - ) && - ( - this.Number == input.Number || - (this.Number != null && - this.Number.Equals(input.Number)) - ) && - ( - this.Float == input.Float || - (this.Float != null && - this.Float.Equals(input.Float)) - ) && - ( - this.Double == input.Double || - (this.Double != null && - this.Double.Equals(input.Double)) - ) && - ( - this.String == input.String || - (this.String != null && - this.String.Equals(input.String)) - ) && - ( - this.Byte == input.Byte || - (this.Byte != null && - this.Byte.Equals(input.Byte)) - ) && - ( - this.Binary == input.Binary || - (this.Binary != null && - this.Binary.Equals(input.Binary)) - ) && - ( - this.Date == input.Date || - (this.Date != null && - this.Date.Equals(input.Date)) - ) && - ( - this.DateTime == input.DateTime || - (this.DateTime != null && - this.DateTime.Equals(input.DateTime)) - ) && - ( - this.Uuid == input.Uuid || - (this.Uuid != null && - this.Uuid.Equals(input.Uuid)) - ) && - ( - this.Password == input.Password || - (this.Password != null && - this.Password.Equals(input.Password)) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs index 30cce0327d5..6174cd37653 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -81,7 +82,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as HasOnlyReadOnly); + return OpenAPIClientUtils.compareLogic.Compare(this, input as HasOnlyReadOnly).AreEqual; } /// @@ -91,20 +92,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(HasOnlyReadOnly input) { - if (input == null) - return false; - - return - ( - this.Bar == input.Bar || - (this.Bar != null && - this.Bar.Equals(input.Bar)) - ) && - ( - this.Foo == input.Foo || - (this.Foo != null && - this.Foo.Equals(input.Foo)) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/List.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/List.cs index c5c9e46d63c..0a4caa3d950 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/List.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/List.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -75,7 +76,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as List); + return OpenAPIClientUtils.compareLogic.Compare(this, input as List).AreEqual; } /// @@ -85,15 +86,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(List input) { - if (input == null) - return false; - - return - ( - this._123List == input._123List || - (this._123List != null && - this._123List.Equals(input._123List)) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/MapTest.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/MapTest.cs index f5ed2a7da1a..9b0c328cd79 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/MapTest.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/MapTest.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -122,7 +123,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as MapTest); + return OpenAPIClientUtils.compareLogic.Compare(this, input as MapTest).AreEqual; } /// @@ -132,30 +133,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(MapTest input) { - if (input == null) - return false; - - return - ( - this.MapMapOfString == input.MapMapOfString || - this.MapMapOfString != null && - this.MapMapOfString.SequenceEqual(input.MapMapOfString) - ) && - ( - this.MapOfEnumString == input.MapOfEnumString || - this.MapOfEnumString != null && - this.MapOfEnumString.SequenceEqual(input.MapOfEnumString) - ) && - ( - this.DirectMap == input.DirectMap || - this.DirectMap != null && - this.DirectMap.SequenceEqual(input.DirectMap) - ) && - ( - this.IndirectMap == input.IndirectMap || - this.IndirectMap != null && - this.IndirectMap.SequenceEqual(input.IndirectMap) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index e729c3292ea..38a3eb68229 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -93,7 +94,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as MixedPropertiesAndAdditionalPropertiesClass); + return OpenAPIClientUtils.compareLogic.Compare(this, input as MixedPropertiesAndAdditionalPropertiesClass).AreEqual; } /// @@ -103,25 +104,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(MixedPropertiesAndAdditionalPropertiesClass input) { - if (input == null) - return false; - - return - ( - this.Uuid == input.Uuid || - (this.Uuid != null && - this.Uuid.Equals(input.Uuid)) - ) && - ( - this.DateTime == input.DateTime || - (this.DateTime != null && - this.DateTime.Equals(input.DateTime)) - ) && - ( - this.Map == input.Map || - this.Map != null && - this.Map.SequenceEqual(input.Map) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Model200Response.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Model200Response.cs index 76ab8f4e7fe..de38ee1704c 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Model200Response.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Model200Response.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -84,7 +85,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as Model200Response); + return OpenAPIClientUtils.compareLogic.Compare(this, input as Model200Response).AreEqual; } /// @@ -94,20 +95,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(Model200Response input) { - if (input == null) - return false; - - return - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - this.Class == input.Class || - (this.Class != null && - this.Class.Equals(input.Class)) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/ModelClient.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/ModelClient.cs index aa6ac6675b1..04562c4e269 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/ModelClient.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/ModelClient.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -75,7 +76,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as ModelClient); + return OpenAPIClientUtils.compareLogic.Compare(this, input as ModelClient).AreEqual; } /// @@ -85,15 +86,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(ModelClient input) { - if (input == null) - return false; - - return - ( - this.__Client == input.__Client || - (this.__Client != null && - this.__Client.Equals(input.__Client)) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Name.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Name.cs index db42ccc28be..140149c0257 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Name.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Name.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -111,7 +112,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as Name); + return OpenAPIClientUtils.compareLogic.Compare(this, input as Name).AreEqual; } /// @@ -121,30 +122,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(Name input) { - if (input == null) - return false; - - return - ( - this._Name == input._Name || - (this._Name != null && - this._Name.Equals(input._Name)) - ) && - ( - this.SnakeCase == input.SnakeCase || - (this.SnakeCase != null && - this.SnakeCase.Equals(input.SnakeCase)) - ) && - ( - this.Property == input.Property || - (this.Property != null && - this.Property.Equals(input.Property)) - ) && - ( - this._123Number == input._123Number || - (this._123Number != null && - this._123Number.Equals(input._123Number)) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/NumberOnly.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/NumberOnly.cs index 5003ae89c25..54a03abdfcb 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/NumberOnly.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/NumberOnly.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -75,7 +76,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as NumberOnly); + return OpenAPIClientUtils.compareLogic.Compare(this, input as NumberOnly).AreEqual; } /// @@ -85,15 +86,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(NumberOnly input) { - if (input == null) - return false; - - return - ( - this.JustNumber == input.JustNumber || - (this.JustNumber != null && - this.JustNumber.Equals(input.JustNumber)) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Order.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Order.cs index 134dcd51e80..6a1823c7d6f 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Order.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Order.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -155,7 +156,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as Order); + return OpenAPIClientUtils.compareLogic.Compare(this, input as Order).AreEqual; } /// @@ -165,39 +166,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(Order input) { - if (input == null) - return false; - - return - ( - this.Id == input.Id || - (this.Id != null && - this.Id.Equals(input.Id)) - ) && - ( - this.PetId == input.PetId || - (this.PetId != null && - this.PetId.Equals(input.PetId)) - ) && - ( - this.Quantity == input.Quantity || - (this.Quantity != null && - this.Quantity.Equals(input.Quantity)) - ) && - ( - this.ShipDate == input.ShipDate || - (this.ShipDate != null && - this.ShipDate.Equals(input.ShipDate)) - ) && - ( - this.Status == input.Status || - this.Status.Equals(input.Status) - ) && - ( - this.Complete == input.Complete || - (this.Complete != null && - this.Complete.Equals(input.Complete)) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/OuterComposite.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/OuterComposite.cs index 26c75891edc..b5cf177c4c3 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/OuterComposite.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -93,7 +94,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as OuterComposite); + return OpenAPIClientUtils.compareLogic.Compare(this, input as OuterComposite).AreEqual; } /// @@ -103,25 +104,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(OuterComposite input) { - if (input == null) - return false; - - return - ( - this.MyNumber == input.MyNumber || - (this.MyNumber != null && - this.MyNumber.Equals(input.MyNumber)) - ) && - ( - this.MyString == input.MyString || - (this.MyString != null && - this.MyString.Equals(input.MyString)) - ) && - ( - this.MyBoolean == input.MyBoolean || - (this.MyBoolean != null && - this.MyBoolean.Equals(input.MyBoolean)) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnum.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnum.cs index ad5b4ae6d6d..0ad70406402 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnum.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/OuterEnum.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs index bd2d73941b8..e5584f13e28 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Pet.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -168,7 +169,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as Pet); + return OpenAPIClientUtils.compareLogic.Compare(this, input as Pet).AreEqual; } /// @@ -178,39 +179,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(Pet input) { - if (input == null) - return false; - - return - ( - this.Id == input.Id || - (this.Id != null && - this.Id.Equals(input.Id)) - ) && - ( - this.Category == input.Category || - (this.Category != null && - this.Category.Equals(input.Category)) - ) && - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ) && - ( - this.PhotoUrls == input.PhotoUrls || - this.PhotoUrls != null && - this.PhotoUrls.SequenceEqual(input.PhotoUrls) - ) && - ( - this.Tags == input.Tags || - this.Tags != null && - this.Tags.SequenceEqual(input.Tags) - ) && - ( - this.Status == input.Status || - this.Status.Equals(input.Status) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs index 622c98b1b7a..bc10ad93170 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/ReadOnlyFirst.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -82,7 +83,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as ReadOnlyFirst); + return OpenAPIClientUtils.compareLogic.Compare(this, input as ReadOnlyFirst).AreEqual; } /// @@ -92,20 +93,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(ReadOnlyFirst input) { - if (input == null) - return false; - - return - ( - this.Bar == input.Bar || - (this.Bar != null && - this.Bar.Equals(input.Bar)) - ) && - ( - this.Baz == input.Baz || - (this.Baz != null && - this.Baz.Equals(input.Baz)) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Return.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Return.cs index c8943a09bc2..c63f40c8efe 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Return.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Return.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -75,7 +76,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as Return); + return OpenAPIClientUtils.compareLogic.Compare(this, input as Return).AreEqual; } /// @@ -85,15 +86,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(Return input) { - if (input == null) - return false; - - return - ( - this._Return == input._Return || - (this._Return != null && - this._Return.Equals(input._Return)) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialModelName.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialModelName.cs index 540d5c331dc..0c5d06f53e7 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/SpecialModelName.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -75,7 +76,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as SpecialModelName); + return OpenAPIClientUtils.compareLogic.Compare(this, input as SpecialModelName).AreEqual; } /// @@ -85,15 +86,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(SpecialModelName input) { - if (input == null) - return false; - - return - ( - this.SpecialPropertyName == input.SpecialPropertyName || - (this.SpecialPropertyName != null && - this.SpecialPropertyName.Equals(input.SpecialPropertyName)) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Tag.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Tag.cs index 570df7658a7..af5cb2ca655 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Tag.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/Tag.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -84,7 +85,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as Tag); + return OpenAPIClientUtils.compareLogic.Compare(this, input as Tag).AreEqual; } /// @@ -94,20 +95,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(Tag input) { - if (input == null) - return false; - - return - ( - this.Id == input.Id || - (this.Id != null && - this.Id.Equals(input.Id)) - ) && - ( - this.Name == input.Name || - (this.Name != null && - this.Name.Equals(input.Name)) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/User.cs b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/User.cs index 06728fe648d..7e48ab5abb1 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/User.cs +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Model/User.cs @@ -22,6 +22,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; +using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; namespace Org.OpenAPITools.Model { @@ -139,7 +140,7 @@ namespace Org.OpenAPITools.Model /// Boolean public override bool Equals(object input) { - return this.Equals(input as User); + return OpenAPIClientUtils.compareLogic.Compare(this, input as User).AreEqual; } /// @@ -149,50 +150,7 @@ namespace Org.OpenAPITools.Model /// Boolean public bool Equals(User input) { - if (input == null) - return false; - - return - ( - this.Id == input.Id || - (this.Id != null && - this.Id.Equals(input.Id)) - ) && - ( - this.Username == input.Username || - (this.Username != null && - this.Username.Equals(input.Username)) - ) && - ( - this.FirstName == input.FirstName || - (this.FirstName != null && - this.FirstName.Equals(input.FirstName)) - ) && - ( - this.LastName == input.LastName || - (this.LastName != null && - this.LastName.Equals(input.LastName)) - ) && - ( - this.Email == input.Email || - (this.Email != null && - this.Email.Equals(input.Email)) - ) && - ( - this.Password == input.Password || - (this.Password != null && - this.Password.Equals(input.Password)) - ) && - ( - this.Phone == input.Phone || - (this.Phone != null && - this.Phone.Equals(input.Phone)) - ) && - ( - this.UserStatus == input.UserStatus || - (this.UserStatus != null && - this.UserStatus.Equals(input.UserStatus)) - ); + return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; } /// diff --git a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 78274390af8..0c300832cbd 100644 --- a/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp-refactor/OpenAPIClient/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -65,6 +65,12 @@ OpenAPI spec version: 1.0.0 ..\..\packages\RestSharp.106.5.4\lib\net452\RestSharp.dll ..\..\vendor\RestSharp.106.5.4\lib\net452\RestSharp.dll + + $(SolutionDir)\packages\CompareNETObjects.4.57.0\lib\net452\KellermanSoftware.Compare-NET-Objects.dll + ..\packages\CompareNETObjects.4.57.0\lib\net452\KellermanSoftware.Compare-NET-Objects.dll + ..\..\packages\CompareNETObjects.4.57.0\lib\net452\KellermanSoftware.Compare-NET-Objects.dll + ..\..\vendor\CompareNETObjects.4.57.0\lib\net452\KellermanSoftware.Compare-NET-Objects.dll + + - - + +