Skip to content

[csharp] Disabled GetHashCode generation #17039

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bin/configs/csharp-generichost-latest-allOf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ additionalProperties:
useCompareNetObjects: true
disallowAdditionalPropertiesIfNotPresent: false
nullableReferenceTypes: true
equatable: true
1 change: 1 addition & 0 deletions bin/configs/csharp-generichost-latest-anyOf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ additionalProperties:
useCompareNetObjects: true
disallowAdditionalPropertiesIfNotPresent: false
nullableReferenceTypes: true
equatable: true
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ additionalProperties:
disallowAdditionalPropertiesIfNotPresent: false
useSourceGeneration: true
packageName: UseSourceGeneration
equatable: true
1 change: 1 addition & 0 deletions bin/configs/csharp-generichost-latest-nrt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ additionalProperties:
useCompareNetObjects: true
disallowAdditionalPropertiesIfNotPresent: false
nullableReferenceTypes: true
equatable: true
1 change: 1 addition & 0 deletions bin/configs/csharp-generichost-latest-oneOf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ additionalProperties:
useCompareNetObjects: true
disallowAdditionalPropertiesIfNotPresent: false
nullableReferenceTypes: true
equatable: true
1 change: 1 addition & 0 deletions bin/configs/csharp-generichost-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ additionalProperties:
useCompareNetObjects: true
disallowAdditionalPropertiesIfNotPresent: false
nullableReferenceTypes: false
equatable: true
1 change: 1 addition & 0 deletions bin/configs/csharp-generichost-netstandard2.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ additionalProperties:
useCompareNetObjects: true
disallowAdditionalPropertiesIfNotPresent: false
targetFramework: netstandard2.0
equatable: true
1 change: 1 addition & 0 deletions bin/configs/csharp-httpclient-netstandard2.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ additionalProperties:
disallowAdditionalPropertiesIfNotPresent: false
useOneOfDiscriminatorLookup: true
targetFramework: netstandard2.0
equatable: true
1 change: 1 addition & 0 deletions bin/configs/csharp-restsharp-echo-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ additionalProperties:
targetFramework: net6.0
setCompareNetObjects: "true"
hideGenerationTimestamp: "true"
equatable: true
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ additionalProperties:
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
targetFramework: netstandard2.1;net47
useCompareNetObjects: "true"
equatable: true
1 change: 1 addition & 0 deletions bin/configs/csharp-restsharp-net4.7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ additionalProperties:
useOneOfDiscriminatorLookup: true
targetFramework: net47
skipOneOfAnyOfGetter: true
equatable: true
1 change: 1 addition & 0 deletions bin/configs/csharp-restsharp-net4.8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ additionalProperties:
disallowAdditionalPropertiesIfNotPresent: false
useOneOfDiscriminatorLookup: true
targetFramework: net48
equatable: true
1 change: 1 addition & 0 deletions bin/configs/csharp-restsharp-net6.0-name-mappings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ additionalProperties:
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
hideGenerationTimestamp: "true"
targetFramework: net6.0
equatable: true
1 change: 1 addition & 0 deletions bin/configs/csharp-restsharp-net7.0-compareNetObjects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ additionalProperties:
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
targetFramework: net7.0
useCompareNetObjects: "true"
equatable: true
1 change: 1 addition & 0 deletions bin/configs/csharp-restsharp-net7.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ additionalProperties:
disallowAdditionalPropertiesIfNotPresent: false
useOneOfDiscriminatorLookup: true
targetFramework: net7.0
equatable: true
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ additionalProperties:
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
targetFramework: netstandard2.0
useCompareNetObjects: "true"
equatable: true
globalProperties:
skipFormModel: "false"
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ additionalProperties:
useOneOfDiscriminatorLookup: true
targetFramework: netstandard2.0
conditionalSerialization: true
equatable: true
1 change: 1 addition & 0 deletions bin/configs/csharp-restsharp-netstandard2.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ additionalProperties:
disallowAdditionalPropertiesIfNotPresent: false
useOneOfDiscriminatorLookup: true
targetFramework: netstandard2.0
equatable: true
1 change: 1 addition & 0 deletions bin/configs/csharp-unityWebRequest-netstandard2.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ templateDir: modules/openapi-generator/src/main/resources/csharp
library: unityWebRequest
additionalProperties:
targetFramework: netstandard2.0
equatable: true
2 changes: 1 addition & 1 deletion docs/generators/csharp.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|dateFormat|The default Date format (only `generichost` library supports this option).| |yyyy'-'MM'-'dd|
|dateTimeFormat|The default DateTime format (only `generichost` library supports this option).| |yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK|
|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|
|equatable|Overrides Equals and GetHashCode methods.| |true|
|equatable|Overrides Equals and GetHashCode methods.| |false|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|interfacePrefix|Prefix interfaces with a community standard or widely accepted prefix.| |I|
|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|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
protected boolean supportsFileParameters = Boolean.TRUE;

protected boolean validatable = Boolean.TRUE;
protected boolean equatable = Boolean.TRUE;
protected boolean equatable = Boolean.FALSE;
// By default, generated code is considered public
protected boolean nonPublicApi = Boolean.FALSE;

Expand Down