forked from OpenAPITools/openapi-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[csharp] Fixed data type for maps of maps (OpenAPITools#13701)
* fixed data type for maps of maps * added models to samples * moved code to avoid a bug in the property generation
- Loading branch information
1 parent
58f8172
commit 0c1384b
Showing
79 changed files
with
4,523 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/Activity.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Org.OpenAPITools.Model.Activity | ||
test map of maps | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**ActivityOutputs** | **Dictionary<string, List<ActivityOutputElementRepresentation>>** | | [optional] | ||
|
||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||
|
11 changes: 11 additions & 0 deletions
11
...nAPIClient-ConditionalSerialization/docs/ActivityOutputElementRepresentation.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Org.OpenAPITools.Model.ActivityOutputElementRepresentation | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**Prop1** | **string** | | [optional] | ||
**Prop2** | **Object** | | [optional] | ||
|
||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||
|
78 changes: 78 additions & 0 deletions
78
...Serialization/src/Org.OpenAPITools.Test/Model/ActivityOutputElementRepresentationTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* OpenAPI Petstore | ||
* | ||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ | ||
* | ||
* The version of the OpenAPI document: 1.0.0 | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
||
|
||
using Xunit; | ||
|
||
using System; | ||
using System.Linq; | ||
using System.IO; | ||
using System.Collections.Generic; | ||
using Org.OpenAPITools.Api; | ||
using Org.OpenAPITools.Model; | ||
using Org.OpenAPITools.Client; | ||
using System.Reflection; | ||
using Newtonsoft.Json; | ||
|
||
namespace Org.OpenAPITools.Test.Model | ||
{ | ||
/// <summary> | ||
/// Class for testing ActivityOutputElementRepresentation | ||
/// </summary> | ||
/// <remarks> | ||
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). | ||
/// Please update the test case below to test the model. | ||
/// </remarks> | ||
public class ActivityOutputElementRepresentationTests : IDisposable | ||
{ | ||
// TODO uncomment below to declare an instance variable for ActivityOutputElementRepresentation | ||
//private ActivityOutputElementRepresentation instance; | ||
|
||
public ActivityOutputElementRepresentationTests() | ||
{ | ||
// TODO uncomment below to create an instance of ActivityOutputElementRepresentation | ||
//instance = new ActivityOutputElementRepresentation(); | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
// Cleanup when everything is done. | ||
} | ||
|
||
/// <summary> | ||
/// Test an instance of ActivityOutputElementRepresentation | ||
/// </summary> | ||
[Fact] | ||
public void ActivityOutputElementRepresentationInstanceTest() | ||
{ | ||
// TODO uncomment below to test "IsType" ActivityOutputElementRepresentation | ||
//Assert.IsType<ActivityOutputElementRepresentation>(instance); | ||
} | ||
|
||
|
||
/// <summary> | ||
/// Test the property 'Prop1' | ||
/// </summary> | ||
[Fact] | ||
public void Prop1Test() | ||
{ | ||
// TODO unit test for the property 'Prop1' | ||
} | ||
/// <summary> | ||
/// Test the property 'Prop2' | ||
/// </summary> | ||
[Fact] | ||
public void Prop2Test() | ||
{ | ||
// TODO unit test for the property 'Prop2' | ||
} | ||
|
||
} | ||
|
||
} |
70 changes: 70 additions & 0 deletions
70
...e/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Model/ActivityTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
* OpenAPI Petstore | ||
* | ||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ | ||
* | ||
* The version of the OpenAPI document: 1.0.0 | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
||
|
||
using Xunit; | ||
|
||
using System; | ||
using System.Linq; | ||
using System.IO; | ||
using System.Collections.Generic; | ||
using Org.OpenAPITools.Api; | ||
using Org.OpenAPITools.Model; | ||
using Org.OpenAPITools.Client; | ||
using System.Reflection; | ||
using Newtonsoft.Json; | ||
|
||
namespace Org.OpenAPITools.Test.Model | ||
{ | ||
/// <summary> | ||
/// Class for testing Activity | ||
/// </summary> | ||
/// <remarks> | ||
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). | ||
/// Please update the test case below to test the model. | ||
/// </remarks> | ||
public class ActivityTests : IDisposable | ||
{ | ||
// TODO uncomment below to declare an instance variable for Activity | ||
//private Activity instance; | ||
|
||
public ActivityTests() | ||
{ | ||
// TODO uncomment below to create an instance of Activity | ||
//instance = new Activity(); | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
// Cleanup when everything is done. | ||
} | ||
|
||
/// <summary> | ||
/// Test an instance of Activity | ||
/// </summary> | ||
[Fact] | ||
public void ActivityInstanceTest() | ||
{ | ||
// TODO uncomment below to test "IsType" Activity | ||
//Assert.IsType<Activity>(instance); | ||
} | ||
|
||
|
||
/// <summary> | ||
/// Test the property 'ActivityOutputs' | ||
/// </summary> | ||
[Fact] | ||
public void ActivityOutputsTest() | ||
{ | ||
// TODO unit test for the property 'ActivityOutputs' | ||
} | ||
|
||
} | ||
|
||
} |
154 changes: 154 additions & 0 deletions
154
...arp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/Activity.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
/* | ||
* OpenAPI Petstore | ||
* | ||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ | ||
* | ||
* The version of the OpenAPI document: 1.0.0 | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
||
|
||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Linq; | ||
using System.IO; | ||
using System.Runtime.Serialization; | ||
using System.Text; | ||
using System.Text.RegularExpressions; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
using Newtonsoft.Json.Linq; | ||
using System.ComponentModel.DataAnnotations; | ||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; | ||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; | ||
|
||
namespace Org.OpenAPITools.Model | ||
{ | ||
/// <summary> | ||
/// test map of maps | ||
/// </summary> | ||
[DataContract(Name = "Activity")] | ||
public partial class Activity : IEquatable<Activity>, IValidatableObject | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="Activity" /> class. | ||
/// </summary> | ||
/// <param name="activityOutputs">activityOutputs.</param> | ||
public Activity(Dictionary<string, List<ActivityOutputElementRepresentation>> activityOutputs = default(Dictionary<string, List<ActivityOutputElementRepresentation>>)) | ||
{ | ||
this._ActivityOutputs = activityOutputs; | ||
if (this.ActivityOutputs != null) | ||
{ | ||
this._flagActivityOutputs = true; | ||
} | ||
this.AdditionalProperties = new Dictionary<string, object>(); | ||
} | ||
|
||
/// <summary> | ||
/// Gets or Sets ActivityOutputs | ||
/// </summary> | ||
[DataMember(Name = "activity_outputs", EmitDefaultValue = false)] | ||
public Dictionary<string, List<ActivityOutputElementRepresentation>> ActivityOutputs | ||
{ | ||
get{ return _ActivityOutputs;} | ||
set | ||
{ | ||
_ActivityOutputs = value; | ||
_flagActivityOutputs = true; | ||
} | ||
} | ||
private Dictionary<string, List<ActivityOutputElementRepresentation>> _ActivityOutputs; | ||
private bool _flagActivityOutputs; | ||
|
||
/// <summary> | ||
/// Returns false as ActivityOutputs should not be serialized given that it's read-only. | ||
/// </summary> | ||
/// <returns>false (boolean)</returns> | ||
public bool ShouldSerializeActivityOutputs() | ||
{ | ||
return _flagActivityOutputs; | ||
} | ||
/// <summary> | ||
/// Gets or Sets additional properties | ||
/// </summary> | ||
[JsonExtensionData] | ||
public IDictionary<string, object> AdditionalProperties { get; set; } | ||
|
||
/// <summary> | ||
/// Returns the string presentation of the object | ||
/// </summary> | ||
/// <returns>String presentation of the object</returns> | ||
public override string ToString() | ||
{ | ||
StringBuilder sb = new StringBuilder(); | ||
sb.Append("class Activity {\n"); | ||
sb.Append(" ActivityOutputs: ").Append(ActivityOutputs).Append("\n"); | ||
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); | ||
sb.Append("}\n"); | ||
return sb.ToString(); | ||
} | ||
|
||
/// <summary> | ||
/// Returns the JSON string presentation of the object | ||
/// </summary> | ||
/// <returns>JSON string presentation of the object</returns> | ||
public virtual string ToJson() | ||
{ | ||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); | ||
} | ||
|
||
/// <summary> | ||
/// Returns true if objects are equal | ||
/// </summary> | ||
/// <param name="input">Object to be compared</param> | ||
/// <returns>Boolean</returns> | ||
public override bool Equals(object input) | ||
{ | ||
return OpenAPIClientUtils.compareLogic.Compare(this, input as Activity).AreEqual; | ||
} | ||
|
||
/// <summary> | ||
/// Returns true if Activity instances are equal | ||
/// </summary> | ||
/// <param name="input">Instance of Activity to be compared</param> | ||
/// <returns>Boolean</returns> | ||
public bool Equals(Activity input) | ||
{ | ||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual; | ||
} | ||
|
||
/// <summary> | ||
/// Gets the hash code | ||
/// </summary> | ||
/// <returns>Hash code</returns> | ||
public override int GetHashCode() | ||
{ | ||
unchecked // Overflow is fine, just wrap | ||
{ | ||
int hashCode = 41; | ||
if (this.ActivityOutputs != null) | ||
{ | ||
hashCode = (hashCode * 59) + this.ActivityOutputs.GetHashCode(); | ||
} | ||
if (this.AdditionalProperties != null) | ||
{ | ||
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); | ||
} | ||
return hashCode; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// To validate all properties of the instance | ||
/// </summary> | ||
/// <param name="validationContext">Validation context</param> | ||
/// <returns>Validation Result</returns> | ||
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext) | ||
{ | ||
yield break; | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.