Skip to content

Commit 8860d96

Browse files
authored
disabled GetHashCode generation (#17039)
1 parent 322afea commit 8860d96

21 files changed

+21
-2
lines changed

bin/configs/csharp-generichost-latest-allOf.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ additionalProperties:
99
useCompareNetObjects: true
1010
disallowAdditionalPropertiesIfNotPresent: false
1111
nullableReferenceTypes: true
12+
equatable: true

bin/configs/csharp-generichost-latest-anyOf.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ additionalProperties:
99
useCompareNetObjects: true
1010
disallowAdditionalPropertiesIfNotPresent: false
1111
nullableReferenceTypes: true
12+
equatable: true

bin/configs/csharp-generichost-latest-nrt-useSourceGeneration.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ additionalProperties:
1010
disallowAdditionalPropertiesIfNotPresent: false
1111
useSourceGeneration: true
1212
packageName: UseSourceGeneration
13+
equatable: true

bin/configs/csharp-generichost-latest-nrt.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ additionalProperties:
99
useCompareNetObjects: true
1010
disallowAdditionalPropertiesIfNotPresent: false
1111
nullableReferenceTypes: true
12+
equatable: true

bin/configs/csharp-generichost-latest-oneOf.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ additionalProperties:
99
useCompareNetObjects: true
1010
disallowAdditionalPropertiesIfNotPresent: false
1111
nullableReferenceTypes: true
12+
equatable: true

bin/configs/csharp-generichost-latest.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ additionalProperties:
99
useCompareNetObjects: true
1010
disallowAdditionalPropertiesIfNotPresent: false
1111
nullableReferenceTypes: false
12+
equatable: true

bin/configs/csharp-generichost-netstandard2.0.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ additionalProperties:
99
useCompareNetObjects: true
1010
disallowAdditionalPropertiesIfNotPresent: false
1111
targetFramework: netstandard2.0
12+
equatable: true

bin/configs/csharp-httpclient-netstandard2.0.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ additionalProperties:
1010
disallowAdditionalPropertiesIfNotPresent: false
1111
useOneOfDiscriminatorLookup: true
1212
targetFramework: netstandard2.0
13+
equatable: true

bin/configs/csharp-restsharp-echo-api.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ additionalProperties:
77
targetFramework: net6.0
88
setCompareNetObjects: "true"
99
hideGenerationTimestamp: "true"
10+
equatable: true

bin/configs/csharp-restsharp-net4.7-multipleFrameworks.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ additionalProperties:
66
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
77
targetFramework: netstandard2.1;net47
88
useCompareNetObjects: "true"
9+
equatable: true

bin/configs/csharp-restsharp-net4.7.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ additionalProperties:
1010
useOneOfDiscriminatorLookup: true
1111
targetFramework: net47
1212
skipOneOfAnyOfGetter: true
13+
equatable: true

bin/configs/csharp-restsharp-net4.8.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ additionalProperties:
99
disallowAdditionalPropertiesIfNotPresent: false
1010
useOneOfDiscriminatorLookup: true
1111
targetFramework: net48
12+
equatable: true

bin/configs/csharp-restsharp-net6.0-name-mappings.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ additionalProperties:
1616
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
1717
hideGenerationTimestamp: "true"
1818
targetFramework: net6.0
19+
equatable: true

bin/configs/csharp-restsharp-net7.0-compareNetObjects.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ additionalProperties:
66
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
77
targetFramework: net7.0
88
useCompareNetObjects: "true"
9+
equatable: true

bin/configs/csharp-restsharp-net7.0.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ additionalProperties:
99
disallowAdditionalPropertiesIfNotPresent: false
1010
useOneOfDiscriminatorLookup: true
1111
targetFramework: net7.0
12+
equatable: true

bin/configs/csharp-restsharp-netstandard2.0-complexfiles.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ additionalProperties:
66
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
77
targetFramework: netstandard2.0
88
useCompareNetObjects: "true"
9+
equatable: true
910
globalProperties:
1011
skipFormModel: "false"

bin/configs/csharp-restsharp-netstandard2.0-conditionalSerialization.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ additionalProperties:
1010
useOneOfDiscriminatorLookup: true
1111
targetFramework: netstandard2.0
1212
conditionalSerialization: true
13+
equatable: true

bin/configs/csharp-restsharp-netstandard2.0.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ additionalProperties:
99
disallowAdditionalPropertiesIfNotPresent: false
1010
useOneOfDiscriminatorLookup: true
1111
targetFramework: netstandard2.0
12+
equatable: true

bin/configs/csharp-unityWebRequest-netstandard2.0.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ templateDir: modules/openapi-generator/src/main/resources/csharp
66
library: unityWebRequest
77
additionalProperties:
88
targetFramework: netstandard2.0
9+
equatable: true

docs/generators/csharp.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
2525
|dateFormat|The default Date format (only `generichost` library supports this option).| |yyyy'-'MM'-'dd|
2626
|dateTimeFormat|The default DateTime format (only `generichost` library supports this option).| |yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK|
2727
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
28-
|equatable|Overrides Equals and GetHashCode methods.| |true|
28+
|equatable|Overrides Equals and GetHashCode methods.| |false|
2929
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
3030
|interfacePrefix|Prefix interfaces with a community standard or widely accepted prefix.| |I|
3131
|library|HTTP library template (sub-template) to use|<dl><dt>**generichost**</dt><dd>HttpClient with Generic Host dependency injection (https://docs.microsoft.com/en-us/dotnet/core/extensions/generic-host) (Experimental. Subject to breaking changes without notice.)</dd><dt>**httpclient**</dt><dd>HttpClient (https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient) (Experimental. Subject to breaking changes without notice.)</dd><dt>**unityWebRequest**</dt><dd>UnityWebRequest (...) (Experimental. Subject to breaking changes without notice.)</dd><dt>**restsharp**</dt><dd>RestSharp (https://github.com/restsharp/RestSharp)</dd></dl>|restsharp|

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CSharpClientCodegen.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
114114
protected boolean supportsFileParameters = Boolean.TRUE;
115115

116116
protected boolean validatable = Boolean.TRUE;
117-
protected boolean equatable = Boolean.TRUE;
117+
protected boolean equatable = Boolean.FALSE;
118118
// By default, generated code is considered public
119119
protected boolean nonPublicApi = Boolean.FALSE;
120120

0 commit comments

Comments
 (0)