diff --git a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml index d1181a53ead..ee4c0bfbcc9 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -949,8 +949,17 @@ definitions: - -1.2 AdditionalPropertiesClass: type: object - additionalProperties: - type: string + properties: + map_property: + type: object + additionalProperties: + type: string + map_of_map_property: + type: object + additionalProperties: + type: object + additionalProperties: + type: string MixedPropertiesAndAdditionalPropertiesClass: type: object properties: @@ -960,9 +969,10 @@ definitions: dateTime: type: string format: date-time - additionalProperties: - type: string - $ref: '#/definitions/Animal' + map: + type: object + additionalProperties: + $ref: '#/definitions/Animal' ReadOnlyFirst: type: object properties: @@ -973,23 +983,24 @@ definitions: type: string ArrayTest: type: object - array_of_string: - type: array - items: - type: string - array_array_of_integer: - type: array - items: + properties: + array_of_string: type: array items: - type: integer - format: int64 - array_array_of_model: - type: array - items: + type: string + array_array_of_integer: type: array items: - $ref: '#/definitions/ReadOnlyFirst' + type: array + items: + type: integer + format: int64 + array_array_of_model: + type: array + items: + type: array + items: + $ref: '#/definitions/ReadOnlyFirst' externalDocs: description: Find out more about Swagger url: 'http://swagger.io' diff --git a/samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln b/samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln index f3e0be76b47..c0a42faae52 100644 --- a/samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln +++ b/samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln @@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 VisualStudioVersion = 12.0.0.0 MinimumVisualStudioVersion = 10.0.0.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{D4DE6CAE-4BE8-4F73-862A-6E6B7DF37446}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{C81D6286-7BA5-4920-8591-F59169CCE4A4}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger.Test", "src\IO.Swagger.Test\IO.Swagger.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" EndProject @@ -12,10 +12,10 @@ Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution -{D4DE6CAE-4BE8-4F73-862A-6E6B7DF37446}.Debug|Any CPU.ActiveCfg = Debug|Any CPU -{D4DE6CAE-4BE8-4F73-862A-6E6B7DF37446}.Debug|Any CPU.Build.0 = Debug|Any CPU -{D4DE6CAE-4BE8-4F73-862A-6E6B7DF37446}.Release|Any CPU.ActiveCfg = Release|Any CPU -{D4DE6CAE-4BE8-4F73-862A-6E6B7DF37446}.Release|Any CPU.Build.0 = Release|Any CPU +{C81D6286-7BA5-4920-8591-F59169CCE4A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU +{C81D6286-7BA5-4920-8591-F59169CCE4A4}.Debug|Any CPU.Build.0 = Debug|Any CPU +{C81D6286-7BA5-4920-8591-F59169CCE4A4}.Release|Any CPU.ActiveCfg = Release|Any CPU +{C81D6286-7BA5-4920-8591-F59169CCE4A4}.Release|Any CPU.Build.0 = Release|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/samples/client/petstore/csharp/SwaggerClient/README.md b/samples/client/petstore/csharp/SwaggerClient/README.md index e4677b09503..d9dcb59b2da 100644 --- a/samples/client/petstore/csharp/SwaggerClient/README.md +++ b/samples/client/petstore/csharp/SwaggerClient/README.md @@ -6,7 +6,7 @@ This C# SDK is automatically generated by the [Swagger Codegen](https://github.c - API version: 1.0.0 - SDK version: 1.0.0 -- Build date: 2016-05-25T14:35:23.891+08:00 +- Build date: 2016-05-29T17:27:36.037+08:00 - Build package: class io.swagger.codegen.languages.CSharpClientCodegen ## Frameworks supported diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/AdditionalPropertiesClass.md b/samples/client/petstore/csharp/SwaggerClient/docs/AdditionalPropertiesClass.md index e9922fe6e91..ac4f9d10798 100644 --- a/samples/client/petstore/csharp/SwaggerClient/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp/SwaggerClient/docs/AdditionalPropertiesClass.md @@ -3,6 +3,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**MapProperty** | **Dictionary<string, string>** | | [optional] +**MapOfMapProperty** | **Dictionary<string, Dictionary<string, string>>** | | [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) diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/ArrayTest.md b/samples/client/petstore/csharp/SwaggerClient/docs/ArrayTest.md index 8f9cff9e9cf..37fb2788b77 100644 --- a/samples/client/petstore/csharp/SwaggerClient/docs/ArrayTest.md +++ b/samples/client/petstore/csharp/SwaggerClient/docs/ArrayTest.md @@ -3,6 +3,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**ArrayOfString** | **List<string>** | | [optional] +**ArrayArrayOfInteger** | **List<List<long?>>** | | [optional] +**ArrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [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) diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp/SwaggerClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 0db3f9ee52d..e2c978f9ab1 100644 --- a/samples/client/petstore/csharp/SwaggerClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp/SwaggerClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Uuid** | **Guid?** | | [optional] **DateTime** | **DateTime?** | | [optional] +**Map** | [**Dictionary<string, Animal>**](Animal.md) | | [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) diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/IO.Swagger.Test.csproj b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/IO.Swagger.Test.csproj index f101ec8e206..4e4b161e255 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/IO.Swagger.Test.csproj +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/IO.Swagger.Test.csproj @@ -20,7 +20,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> - + Debug AnyCPU @@ -59,38 +59,36 @@ limitations under the License. - $(SolutionDir)\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll - ..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll - ..\..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll - ..\..\vendor\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll + $(SolutionDir)\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll + ..\..\vendor\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll - $(SolutionDir)\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll - ..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll - ..\..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll - ..\..\vendor\RestSharp.105.1.0\lib\net45\RestSharp.dll + $(SolutionDir)\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll + ..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll + ..\..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll + ..\..\vendor\RestSharp.105.1.0\lib\net45\RestSharp.dll - $(SolutionDir)\packages\NUnit.2.6.3\lib\nunit.framework.dll - ..\packages\NUnit.2.6.3\lib\nunit.framework.dll - ..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll - ..\..\vendor\NUnit.2.6.3\lib\nunit.framework.dll + $(SolutionDir)\packages\NUnit.2.6.3\lib\nunit.framework.dll + ..\packages\NUnit.2.6.3\lib\nunit.framework.dll + ..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll + ..\..\vendor\NUnit.2.6.3\lib\nunit.framework.dll - + - + - - {D4DE6CAE-4BE8-4F73-862A-6E6B7DF37446} - IO.Swagger - - - - + + {C81D6286-7BA5-4920-8591-F59169CCE4A4} + IO.Swagger + + diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/IO.Swagger.csproj b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/IO.Swagger.csproj index 93ba033f6ad..20fdb3385e1 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/IO.Swagger.csproj +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/IO.Swagger.csproj @@ -24,7 +24,7 @@ limitations under the License. Debug AnyCPU - {D4DE6CAE-4BE8-4F73-862A-6E6B7DF37446} + {C81D6286-7BA5-4920-8591-F59169CCE4A4} Library Properties Swagger Library diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/AdditionalPropertiesClass.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/AdditionalPropertiesClass.cs index b442c5e8791..db9ac4006b7 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/AdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/AdditionalPropertiesClass.cs @@ -37,15 +37,29 @@ namespace IO.Swagger.Model /// AdditionalPropertiesClass /// [DataContract] - public partial class AdditionalPropertiesClass : Dictionary, IEquatable + public partial class AdditionalPropertiesClass : IEquatable { /// /// Initializes a new instance of the class. /// - public AdditionalPropertiesClass() + /// MapProperty. + /// MapOfMapProperty. + public AdditionalPropertiesClass(Dictionary MapProperty = null, Dictionary> MapOfMapProperty = null) { + this.MapProperty = MapProperty; + this.MapOfMapProperty = MapOfMapProperty; } + /// + /// Gets or Sets MapProperty + /// + [DataMember(Name="map_property", EmitDefaultValue=false)] + public Dictionary MapProperty { get; set; } + /// + /// Gets or Sets MapOfMapProperty + /// + [DataMember(Name="map_of_map_property", EmitDefaultValue=false)] + public Dictionary> MapOfMapProperty { get; set; } /// /// Returns the string presentation of the object /// @@ -54,6 +68,8 @@ namespace IO.Swagger.Model { var sb = new StringBuilder(); sb.Append("class AdditionalPropertiesClass {\n"); + sb.Append(" MapProperty: ").Append(MapProperty).Append("\n"); + sb.Append(" MapOfMapProperty: ").Append(MapOfMapProperty).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -62,7 +78,7 @@ namespace IO.Swagger.Model /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -89,7 +105,17 @@ namespace IO.Swagger.Model if (other == null) return false; - return false; + return + ( + this.MapProperty == other.MapProperty || + this.MapProperty != null && + this.MapProperty.SequenceEqual(other.MapProperty) + ) && + ( + this.MapOfMapProperty == other.MapOfMapProperty || + this.MapOfMapProperty != null && + this.MapOfMapProperty.SequenceEqual(other.MapOfMapProperty) + ); } /// @@ -103,6 +129,10 @@ namespace IO.Swagger.Model { int hash = 41; // Suitable nullity checks etc, of course :) + if (this.MapProperty != null) + hash = hash * 59 + this.MapProperty.GetHashCode(); + if (this.MapOfMapProperty != null) + hash = hash * 59 + this.MapOfMapProperty.GetHashCode(); return hash; } } diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ArrayTest.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ArrayTest.cs index 9521ae2e3ae..b80118c790f 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ArrayTest.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/ArrayTest.cs @@ -42,10 +42,31 @@ namespace IO.Swagger.Model /// /// Initializes a new instance of the class. /// - public ArrayTest() + /// ArrayOfString. + /// ArrayArrayOfInteger. + /// ArrayArrayOfModel. + public ArrayTest(List ArrayOfString = null, List> ArrayArrayOfInteger = null, List> ArrayArrayOfModel = null) { + this.ArrayOfString = ArrayOfString; + this.ArrayArrayOfInteger = ArrayArrayOfInteger; + this.ArrayArrayOfModel = ArrayArrayOfModel; } + /// + /// Gets or Sets ArrayOfString + /// + [DataMember(Name="array_of_string", EmitDefaultValue=false)] + public List ArrayOfString { get; set; } + /// + /// Gets or Sets ArrayArrayOfInteger + /// + [DataMember(Name="array_array_of_integer", EmitDefaultValue=false)] + public List> ArrayArrayOfInteger { get; set; } + /// + /// Gets or Sets ArrayArrayOfModel + /// + [DataMember(Name="array_array_of_model", EmitDefaultValue=false)] + public List> ArrayArrayOfModel { get; set; } /// /// Returns the string presentation of the object /// @@ -54,6 +75,9 @@ namespace IO.Swagger.Model { var sb = new StringBuilder(); sb.Append("class ArrayTest {\n"); + sb.Append(" ArrayOfString: ").Append(ArrayOfString).Append("\n"); + sb.Append(" ArrayArrayOfInteger: ").Append(ArrayArrayOfInteger).Append("\n"); + sb.Append(" ArrayArrayOfModel: ").Append(ArrayArrayOfModel).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -89,7 +113,22 @@ namespace IO.Swagger.Model if (other == null) return false; - return false; + return + ( + this.ArrayOfString == other.ArrayOfString || + this.ArrayOfString != null && + this.ArrayOfString.SequenceEqual(other.ArrayOfString) + ) && + ( + this.ArrayArrayOfInteger == other.ArrayArrayOfInteger || + this.ArrayArrayOfInteger != null && + this.ArrayArrayOfInteger.SequenceEqual(other.ArrayArrayOfInteger) + ) && + ( + this.ArrayArrayOfModel == other.ArrayArrayOfModel || + this.ArrayArrayOfModel != null && + this.ArrayArrayOfModel.SequenceEqual(other.ArrayArrayOfModel) + ); } /// @@ -103,6 +142,12 @@ namespace IO.Swagger.Model { int hash = 41; // Suitable nullity checks etc, of course :) + if (this.ArrayOfString != null) + hash = hash * 59 + this.ArrayOfString.GetHashCode(); + if (this.ArrayArrayOfInteger != null) + hash = hash * 59 + this.ArrayArrayOfInteger.GetHashCode(); + if (this.ArrayArrayOfModel != null) + hash = hash * 59 + this.ArrayArrayOfModel.GetHashCode(); return hash; } } diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index d66f758575a..ea20988a1ec 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -37,17 +37,19 @@ namespace IO.Swagger.Model /// MixedPropertiesAndAdditionalPropertiesClass /// [DataContract] - public partial class MixedPropertiesAndAdditionalPropertiesClass : Dictionary, IEquatable + public partial class MixedPropertiesAndAdditionalPropertiesClass : IEquatable { /// /// Initializes a new instance of the class. /// /// Uuid. /// DateTime. - public MixedPropertiesAndAdditionalPropertiesClass(Guid? Uuid = null, DateTime? DateTime = null) + /// Map. + public MixedPropertiesAndAdditionalPropertiesClass(Guid? Uuid = null, DateTime? DateTime = null, Dictionary Map = null) { this.Uuid = Uuid; this.DateTime = DateTime; + this.Map = Map; } /// @@ -61,6 +63,11 @@ namespace IO.Swagger.Model [DataMember(Name="dateTime", EmitDefaultValue=false)] public DateTime? DateTime { get; set; } /// + /// Gets or Sets Map + /// + [DataMember(Name="map", EmitDefaultValue=false)] + public Dictionary Map { get; set; } + /// /// Returns the string presentation of the object /// /// String presentation of the object @@ -70,6 +77,7 @@ namespace IO.Swagger.Model sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); + sb.Append(" Map: ").Append(Map).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -78,7 +86,7 @@ namespace IO.Swagger.Model /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object - public new string ToJson() + public string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } @@ -115,6 +123,11 @@ namespace IO.Swagger.Model this.DateTime == other.DateTime || this.DateTime != null && this.DateTime.Equals(other.DateTime) + ) && + ( + this.Map == other.Map || + this.Map != null && + this.Map.SequenceEqual(other.Map) ); } @@ -133,6 +146,8 @@ namespace IO.Swagger.Model hash = hash * 59 + this.Uuid.GetHashCode(); if (this.DateTime != null) hash = hash * 59 + this.DateTime.GetHashCode(); + if (this.Map != null) + hash = hash * 59 + this.Map.GetHashCode(); return hash; } }