Merge pull request #2818 from wing328/bug/fix_2795

[C#] fix constructor with readonly property at the end
This commit is contained in:
wing328 2016-05-10 19:08:17 +08:00
commit 5aaf570782
16 changed files with 122 additions and 30 deletions

View File

@ -32,7 +32,7 @@
/// <param name="{{name}}">{{#description}}{{description}}{{/description}}{{^description}}{{name}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{defaultValue}}){{/defaultValue}}.</param> /// <param name="{{name}}">{{#description}}{{description}}{{/description}}{{^description}}{{name}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{defaultValue}}){{/defaultValue}}.</param>
{{/isReadOnly}} {{/isReadOnly}}
{{/vars}} {{/vars}}
public {{classname}}({{#vars}}{{^isReadOnly}}{{{datatypeWithEnum}}}{{#isEnum}}?{{/isEnum}} {{name}} = null{{#hasMore}}, {{/hasMore}}{{/isReadOnly}}{{/vars}}) public {{classname}}({{#vars}}{{^isReadOnly}}{{{datatypeWithEnum}}}{{#isEnum}}?{{/isEnum}} {{name}} = null{{/isReadOnly}}{{#hasMoreNonReadOnly}}, {{/hasMoreNonReadOnly}}{{/vars}})
{ {
{{#vars}}{{^isReadOnly}}{{#required}}// to ensure "{{name}}" is required (not null) {{#vars}}{{^isReadOnly}}{{#required}}// to ensure "{{name}}" is required (not null)
if ({{name}} == null) if ({{name}} == null)

View File

@ -818,6 +818,9 @@ definitions:
format: int32 format: int32
property: property:
type: string type: string
123Number:
type: integer
readOnly: true
xml: xml:
name: Name name: Name
200_response: 200_response:

View File

@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012 # Visual Studio 2012
VisualStudioVersion = 12.0.0.0 VisualStudioVersion = 12.0.0.0
MinimumVisualStudioVersion = 10.0.0.1 MinimumVisualStudioVersion = 10.0.0.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{AC0D0300-7030-473F-B672-17C40187815A}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{C075FB79-0DDE-43E3-9FA5-E239EE9B9B5A}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger.Test", "src\IO.Swagger.Test\IO.Swagger.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger.Test", "src\IO.Swagger.Test\IO.Swagger.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}"
EndProject EndProject
@ -12,10 +12,10 @@ Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{AC0D0300-7030-473F-B672-17C40187815A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C075FB79-0DDE-43E3-9FA5-E239EE9B9B5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AC0D0300-7030-473F-B672-17C40187815A}.Debug|Any CPU.Build.0 = Debug|Any CPU {C075FB79-0DDE-43E3-9FA5-E239EE9B9B5A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AC0D0300-7030-473F-B672-17C40187815A}.Release|Any CPU.ActiveCfg = Release|Any CPU {C075FB79-0DDE-43E3-9FA5-E239EE9B9B5A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AC0D0300-7030-473F-B672-17C40187815A}.Release|Any CPU.Build.0 = Release|Any CPU {C075FB79-0DDE-43E3-9FA5-E239EE9B9B5A}.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.ActiveCfg = Debug|Any CPU
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = 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 {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU

View File

@ -6,7 +6,7 @@ This C# SDK is automatically generated by the [Swagger Codegen](https://github.c
- API version: 1.0.0 - API version: 1.0.0
- SDK version: 1.0.0 - SDK version: 1.0.0
- Build date: 2016-05-07T17:39:09.181+08:00 - Build date: 2016-05-10T17:39:13.582+08:00
- Build package: class io.swagger.codegen.languages.CSharpClientCodegen - Build package: class io.swagger.codegen.languages.CSharpClientCodegen
## Frameworks supported ## Frameworks supported
@ -69,7 +69,7 @@ namespace Example
try try
{ {
// Fake endpoint for testing various parameters // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
apiInstance.TestEndpointParameters(number, _double, _string, _byte, integer, int32, int64, _float, binary, date, dateTime, password); apiInstance.TestEndpointParameters(number, _double, _string, _byte, integer, int32, int64, _float, binary, date, dateTime, password);
} }
catch (Exception e) catch (Exception e)
@ -87,7 +87,7 @@ All URIs are relative to *http://petstore.swagger.io/v2*
Class | Method | HTTP request | Description Class | Method | HTTP request | Description
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
*FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters *FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
*PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store
*PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet *PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
*PetApi* | [**FindPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status *PetApi* | [**FindPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status

View File

@ -4,6 +4,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**ClassName** | **string** | | **ClassName** | **string** | |
**Color** | **string** | | [optional] [default to "red"]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -4,6 +4,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**ClassName** | **string** | | **ClassName** | **string** | |
**Color** | **string** | | [optional] [default to "red"]
**Declawed** | **bool?** | | [optional] **Declawed** | **bool?** | | [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) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -4,6 +4,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**ClassName** | **string** | | **ClassName** | **string** | |
**Color** | **string** | | [optional] [default to "red"]
**Breed** | **string** | | [optional] **Breed** | **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) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -4,15 +4,15 @@ All URIs are relative to *http://petstore.swagger.io/v2*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
[**TestEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters [**TestEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
# **TestEndpointParameters** # **TestEndpointParameters**
> void TestEndpointParameters (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null) > void TestEndpointParameters (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null)
Fake endpoint for testing various parameters Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
Fake endpoint for testing various parameters Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
### Example ### Example
```csharp ```csharp
@ -45,7 +45,7 @@ namespace Example
try try
{ {
// Fake endpoint for testing various parameters // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
apiInstance.TestEndpointParameters(number, _double, _string, _byte, integer, int32, int64, _float, binary, date, dateTime, password); apiInstance.TestEndpointParameters(number, _double, _string, _byte, integer, int32, int64, _float, binary, date, dateTime, password);
} }
catch (Exception e) catch (Exception e)

View File

@ -6,6 +6,7 @@ Name | Type | Description | Notes
**_Name** | **int?** | | **_Name** | **int?** | |
**SnakeCase** | **int?** | | [optional] **SnakeCase** | **int?** | | [optional]
**Property** | **string** | | [optional] **Property** | **string** | | [optional]
**_123Number** | **int?** | | [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) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -65,7 +65,7 @@
<Import Project="$(MsBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MsBuildToolsPath)\Microsoft.CSharp.targets" />
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\IO.Swagger\IO.Swagger.csproj"> <ProjectReference Include="..\IO.Swagger\IO.Swagger.csproj">
<Project>{AC0D0300-7030-473F-B672-17C40187815A}</Project> <Project>{C075FB79-0DDE-43E3-9FA5-E239EE9B9B5A}</Project>
<Name>IO.Swagger</Name> <Name>IO.Swagger</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>

View File

@ -14,10 +14,10 @@ namespace IO.Swagger.Api
{ {
#region Synchronous Operations #region Synchronous Operations
/// <summary> /// <summary>
/// Fake endpoint for testing various parameters /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// Fake endpoint for testing various parameters /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
/// </remarks> /// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="number">None</param> /// <param name="number">None</param>
@ -36,10 +36,10 @@ namespace IO.Swagger.Api
void TestEndpointParameters (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null); void TestEndpointParameters (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null);
/// <summary> /// <summary>
/// Fake endpoint for testing various parameters /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// Fake endpoint for testing various parameters /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
/// </remarks> /// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="number">None</param> /// <param name="number">None</param>
@ -59,10 +59,10 @@ namespace IO.Swagger.Api
#endregion Synchronous Operations #endregion Synchronous Operations
#region Asynchronous Operations #region Asynchronous Operations
/// <summary> /// <summary>
/// Fake endpoint for testing various parameters /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// Fake endpoint for testing various parameters /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
/// </remarks> /// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="number">None</param> /// <param name="number">None</param>
@ -81,10 +81,10 @@ namespace IO.Swagger.Api
System.Threading.Tasks.Task TestEndpointParametersAsync (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null); System.Threading.Tasks.Task TestEndpointParametersAsync (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null);
/// <summary> /// <summary>
/// Fake endpoint for testing various parameters /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// Fake endpoint for testing various parameters /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
/// </remarks> /// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="number">None</param> /// <param name="number">None</param>
@ -192,7 +192,7 @@ namespace IO.Swagger.Api
} }
/// <summary> /// <summary>
/// Fake endpoint for testing various parameters Fake endpoint for testing various parameters /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
/// </summary> /// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="number">None</param> /// <param name="number">None</param>
@ -214,7 +214,7 @@ namespace IO.Swagger.Api
} }
/// <summary> /// <summary>
/// Fake endpoint for testing various parameters Fake endpoint for testing various parameters /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
/// </summary> /// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="number">None</param> /// <param name="number">None</param>
@ -303,7 +303,7 @@ namespace IO.Swagger.Api
} }
/// <summary> /// <summary>
/// Fake endpoint for testing various parameters Fake endpoint for testing various parameters /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
/// </summary> /// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="number">None</param> /// <param name="number">None</param>
@ -326,7 +326,7 @@ namespace IO.Swagger.Api
} }
/// <summary> /// <summary>
/// Fake endpoint for testing various parameters Fake endpoint for testing various parameters /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
/// </summary> /// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="number">None</param> /// <param name="number">None</param>

View File

@ -3,7 +3,7 @@
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{AC0D0300-7030-473F-B672-17C40187815A}</ProjectGuid> <ProjectGuid>{C075FB79-0DDE-43E3-9FA5-E239EE9B9B5A}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Swagger Library</RootNamespace> <RootNamespace>Swagger Library</RootNamespace>

View File

@ -21,7 +21,8 @@ namespace IO.Swagger.Model
/// Initializes a new instance of the <see cref="Animal" /> class. /// Initializes a new instance of the <see cref="Animal" /> class.
/// </summary> /// </summary>
/// <param name="ClassName">ClassName (required).</param> /// <param name="ClassName">ClassName (required).</param>
public Animal(string ClassName = null) /// <param name="Color">Color (default to &quot;red&quot;).</param>
public Animal(string ClassName = null, string Color = null)
{ {
// to ensure "ClassName" is required (not null) // to ensure "ClassName" is required (not null)
if (ClassName == null) if (ClassName == null)
@ -34,6 +35,16 @@ namespace IO.Swagger.Model
} }
// use default value if no "Color" provided
if (Color == null)
{
this.Color = "red";
}
else
{
this.Color = Color;
}
} }
/// <summary> /// <summary>
@ -42,6 +53,11 @@ namespace IO.Swagger.Model
[DataMember(Name="className", EmitDefaultValue=false)] [DataMember(Name="className", EmitDefaultValue=false)]
public string ClassName { get; set; } public string ClassName { get; set; }
/// <summary> /// <summary>
/// Gets or Sets Color
/// </summary>
[DataMember(Name="color", EmitDefaultValue=false)]
public string Color { get; set; }
/// <summary>
/// Returns the string presentation of the object /// Returns the string presentation of the object
/// </summary> /// </summary>
/// <returns>String presentation of the object</returns> /// <returns>String presentation of the object</returns>
@ -50,6 +66,7 @@ namespace IO.Swagger.Model
var sb = new StringBuilder(); var sb = new StringBuilder();
sb.Append("class Animal {\n"); sb.Append("class Animal {\n");
sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" ClassName: ").Append(ClassName).Append("\n");
sb.Append(" Color: ").Append(Color).Append("\n");
sb.Append("}\n"); sb.Append("}\n");
return sb.ToString(); return sb.ToString();
} }
@ -90,6 +107,11 @@ namespace IO.Swagger.Model
this.ClassName == other.ClassName || this.ClassName == other.ClassName ||
this.ClassName != null && this.ClassName != null &&
this.ClassName.Equals(other.ClassName) this.ClassName.Equals(other.ClassName)
) &&
(
this.Color == other.Color ||
this.Color != null &&
this.Color.Equals(other.Color)
); );
} }
@ -106,6 +128,8 @@ namespace IO.Swagger.Model
// Suitable nullity checks etc, of course :) // Suitable nullity checks etc, of course :)
if (this.ClassName != null) if (this.ClassName != null)
hash = hash * 59 + this.ClassName.GetHashCode(); hash = hash * 59 + this.ClassName.GetHashCode();
if (this.Color != null)
hash = hash * 59 + this.Color.GetHashCode();
return hash; return hash;
} }
} }

View File

@ -21,8 +21,9 @@ namespace IO.Swagger.Model
/// Initializes a new instance of the <see cref="Cat" /> class. /// Initializes a new instance of the <see cref="Cat" /> class.
/// </summary> /// </summary>
/// <param name="ClassName">ClassName (required).</param> /// <param name="ClassName">ClassName (required).</param>
/// <param name="Color">Color (default to &quot;red&quot;).</param>
/// <param name="Declawed">Declawed.</param> /// <param name="Declawed">Declawed.</param>
public Cat(string ClassName = null, bool? Declawed = null) public Cat(string ClassName = null, string Color = null, bool? Declawed = null)
{ {
// to ensure "ClassName" is required (not null) // to ensure "ClassName" is required (not null)
if (ClassName == null) if (ClassName == null)
@ -35,6 +36,16 @@ namespace IO.Swagger.Model
} }
// use default value if no "Color" provided
if (Color == null)
{
this.Color = "red";
}
else
{
this.Color = Color;
}
this.Declawed = Declawed; this.Declawed = Declawed;
} }
@ -45,6 +56,11 @@ namespace IO.Swagger.Model
[DataMember(Name="className", EmitDefaultValue=false)] [DataMember(Name="className", EmitDefaultValue=false)]
public string ClassName { get; set; } public string ClassName { get; set; }
/// <summary> /// <summary>
/// Gets or Sets Color
/// </summary>
[DataMember(Name="color", EmitDefaultValue=false)]
public string Color { get; set; }
/// <summary>
/// Gets or Sets Declawed /// Gets or Sets Declawed
/// </summary> /// </summary>
[DataMember(Name="declawed", EmitDefaultValue=false)] [DataMember(Name="declawed", EmitDefaultValue=false)]
@ -58,6 +74,7 @@ namespace IO.Swagger.Model
var sb = new StringBuilder(); var sb = new StringBuilder();
sb.Append("class Cat {\n"); sb.Append("class Cat {\n");
sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" ClassName: ").Append(ClassName).Append("\n");
sb.Append(" Color: ").Append(Color).Append("\n");
sb.Append(" Declawed: ").Append(Declawed).Append("\n"); sb.Append(" Declawed: ").Append(Declawed).Append("\n");
sb.Append("}\n"); sb.Append("}\n");
return sb.ToString(); return sb.ToString();
@ -100,6 +117,11 @@ sb.Append(" Declawed: ").Append(Declawed).Append("\n");
this.ClassName != null && this.ClassName != null &&
this.ClassName.Equals(other.ClassName) this.ClassName.Equals(other.ClassName)
) && ) &&
(
this.Color == other.Color ||
this.Color != null &&
this.Color.Equals(other.Color)
) &&
( (
this.Declawed == other.Declawed || this.Declawed == other.Declawed ||
this.Declawed != null && this.Declawed != null &&
@ -120,6 +142,8 @@ sb.Append(" Declawed: ").Append(Declawed).Append("\n");
// Suitable nullity checks etc, of course :) // Suitable nullity checks etc, of course :)
if (this.ClassName != null) if (this.ClassName != null)
hash = hash * 59 + this.ClassName.GetHashCode(); hash = hash * 59 + this.ClassName.GetHashCode();
if (this.Color != null)
hash = hash * 59 + this.Color.GetHashCode();
if (this.Declawed != null) if (this.Declawed != null)
hash = hash * 59 + this.Declawed.GetHashCode(); hash = hash * 59 + this.Declawed.GetHashCode();
return hash; return hash;

View File

@ -21,8 +21,9 @@ namespace IO.Swagger.Model
/// Initializes a new instance of the <see cref="Dog" /> class. /// Initializes a new instance of the <see cref="Dog" /> class.
/// </summary> /// </summary>
/// <param name="ClassName">ClassName (required).</param> /// <param name="ClassName">ClassName (required).</param>
/// <param name="Color">Color (default to &quot;red&quot;).</param>
/// <param name="Breed">Breed.</param> /// <param name="Breed">Breed.</param>
public Dog(string ClassName = null, string Breed = null) public Dog(string ClassName = null, string Color = null, string Breed = null)
{ {
// to ensure "ClassName" is required (not null) // to ensure "ClassName" is required (not null)
if (ClassName == null) if (ClassName == null)
@ -35,6 +36,16 @@ namespace IO.Swagger.Model
} }
// use default value if no "Color" provided
if (Color == null)
{
this.Color = "red";
}
else
{
this.Color = Color;
}
this.Breed = Breed; this.Breed = Breed;
} }
@ -45,6 +56,11 @@ namespace IO.Swagger.Model
[DataMember(Name="className", EmitDefaultValue=false)] [DataMember(Name="className", EmitDefaultValue=false)]
public string ClassName { get; set; } public string ClassName { get; set; }
/// <summary> /// <summary>
/// Gets or Sets Color
/// </summary>
[DataMember(Name="color", EmitDefaultValue=false)]
public string Color { get; set; }
/// <summary>
/// Gets or Sets Breed /// Gets or Sets Breed
/// </summary> /// </summary>
[DataMember(Name="breed", EmitDefaultValue=false)] [DataMember(Name="breed", EmitDefaultValue=false)]
@ -58,6 +74,7 @@ namespace IO.Swagger.Model
var sb = new StringBuilder(); var sb = new StringBuilder();
sb.Append("class Dog {\n"); sb.Append("class Dog {\n");
sb.Append(" ClassName: ").Append(ClassName).Append("\n"); sb.Append(" ClassName: ").Append(ClassName).Append("\n");
sb.Append(" Color: ").Append(Color).Append("\n");
sb.Append(" Breed: ").Append(Breed).Append("\n"); sb.Append(" Breed: ").Append(Breed).Append("\n");
sb.Append("}\n"); sb.Append("}\n");
return sb.ToString(); return sb.ToString();
@ -100,6 +117,11 @@ sb.Append(" Breed: ").Append(Breed).Append("\n");
this.ClassName != null && this.ClassName != null &&
this.ClassName.Equals(other.ClassName) this.ClassName.Equals(other.ClassName)
) && ) &&
(
this.Color == other.Color ||
this.Color != null &&
this.Color.Equals(other.Color)
) &&
( (
this.Breed == other.Breed || this.Breed == other.Breed ||
this.Breed != null && this.Breed != null &&
@ -120,6 +142,8 @@ sb.Append(" Breed: ").Append(Breed).Append("\n");
// Suitable nullity checks etc, of course :) // Suitable nullity checks etc, of course :)
if (this.ClassName != null) if (this.ClassName != null)
hash = hash * 59 + this.ClassName.GetHashCode(); hash = hash * 59 + this.ClassName.GetHashCode();
if (this.Color != null)
hash = hash * 59 + this.Color.GetHashCode();
if (this.Breed != null) if (this.Breed != null)
hash = hash * 59 + this.Breed.GetHashCode(); hash = hash * 59 + this.Breed.GetHashCode();
return hash; return hash;

View File

@ -55,6 +55,11 @@ namespace IO.Swagger.Model
[DataMember(Name="property", EmitDefaultValue=false)] [DataMember(Name="property", EmitDefaultValue=false)]
public string Property { get; set; } public string Property { get; set; }
/// <summary> /// <summary>
/// Gets or Sets _123Number
/// </summary>
[DataMember(Name="123Number", EmitDefaultValue=false)]
public int? _123Number { get; private set; }
/// <summary>
/// Returns the string presentation of the object /// Returns the string presentation of the object
/// </summary> /// </summary>
/// <returns>String presentation of the object</returns> /// <returns>String presentation of the object</returns>
@ -65,6 +70,7 @@ namespace IO.Swagger.Model
sb.Append(" _Name: ").Append(_Name).Append("\n"); sb.Append(" _Name: ").Append(_Name).Append("\n");
sb.Append(" SnakeCase: ").Append(SnakeCase).Append("\n"); sb.Append(" SnakeCase: ").Append(SnakeCase).Append("\n");
sb.Append(" Property: ").Append(Property).Append("\n"); sb.Append(" Property: ").Append(Property).Append("\n");
sb.Append(" _123Number: ").Append(_123Number).Append("\n");
sb.Append("}\n"); sb.Append("}\n");
return sb.ToString(); return sb.ToString();
} }
@ -115,6 +121,11 @@ sb.Append(" Property: ").Append(Property).Append("\n");
this.Property == other.Property || this.Property == other.Property ||
this.Property != null && this.Property != null &&
this.Property.Equals(other.Property) this.Property.Equals(other.Property)
) &&
(
this._123Number == other._123Number ||
this._123Number != null &&
this._123Number.Equals(other._123Number)
); );
} }
@ -135,6 +146,8 @@ sb.Append(" Property: ").Append(Property).Append("\n");
hash = hash * 59 + this.SnakeCase.GetHashCode(); hash = hash * 59 + this.SnakeCase.GetHashCode();
if (this.Property != null) if (this.Property != null)
hash = hash * 59 + this.Property.GetHashCode(); hash = hash * 59 + this.Property.GetHashCode();
if (this._123Number != null)
hash = hash * 59 + this._123Number.GetHashCode();
return hash; return hash;
} }
} }