[csharp] Fix enum default value (#4681)

* [csharp] Prevent enum assign to string

see swagger-api/swagger-codegen#4670

* [csharp] Regenerate client sample
This commit is contained in:
Jim Schubert
2017-02-06 04:33:10 -05:00
committed by wing328
parent b891a4a4cf
commit 96b0d155b5
38 changed files with 447 additions and 53 deletions

View File

@@ -484,7 +484,13 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
if (p instanceof StringProperty) {
StringProperty dp = (StringProperty) p;
if (dp.getDefault() != null) {
return "\"" + dp.getDefault() + "\"";
String _default = dp.getDefault();
if (dp.getEnum() == null) {
return "\"" + _default + "\"";
} else {
// convert to enum var name later in postProcessModels
return _default;
}
}
} else if (p instanceof BooleanProperty) {
BooleanProperty dp = (BooleanProperty) p;

View File

@@ -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", "{959A8039-E3B9-4660-A666-840955E4520C}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{4F6B73F4-427E-4C54-BB06-A106EBF09288}"
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
{959A8039-E3B9-4660-A666-840955E4520C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{959A8039-E3B9-4660-A666-840955E4520C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{959A8039-E3B9-4660-A666-840955E4520C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{959A8039-E3B9-4660-A666-840955E4520C}.Release|Any CPU.Build.0 = Release|Any CPU
{4F6B73F4-427E-4C54-BB06-A106EBF09288}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4F6B73F4-427E-4C54-BB06-A106EBF09288}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4F6B73F4-427E-4C54-BB06-A106EBF09288}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4F6B73F4-427E-4C54-BB06-A106EBF09288}.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

View File

@@ -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 package: class io.swagger.codegen.languages.CSharpClientCodegen
- Build package: io.swagger.codegen.languages.CSharpClientCodegen
<a name="frameworks-supported"></a>
## Frameworks supported
@@ -38,6 +38,20 @@ using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
```
<a name="packaging"></a>
## Packaging
A `.nuspec` is included with the project. You can follow the Nuget quickstart to [create](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#create-the-package) and [publish](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package#publish-the-package) packages.
This `.nuspec` uses placeholders from the `.csproj`, so build the `.csproj` directly:
```
nuget pack -Build -OutputDirectory out IO.Swagger.csproj
```
Then, publish to a [local feed](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds) or [other host](https://docs.microsoft.com/en-us/nuget/hosting-packages/overview) and consume the new package via Nuget as usual.
<a name="getting-started"></a>
## Getting Started
@@ -115,6 +129,7 @@ Class | Method | HTTP request | Description
- [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
- [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
- [Model.ArrayTest](docs/ArrayTest.md)
- [Model.Capitalization](docs/Capitalization.md)
- [Model.Cat](docs/Cat.md)
- [Model.Category](docs/Category.md)
- [Model.ClassModel](docs/ClassModel.md)

View File

@@ -0,0 +1,14 @@
# IO.Swagger.Model.Capitalization
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**SmallCamel** | **string** | | [optional]
**CapitalCamel** | **string** | | [optional]
**SmallSnake** | **string** | | [optional]
**CapitalSnake** | **string** | | [optional]
**SCAETHFlowPoints** | **string** | | [optional]
**ATT_NAME** | **string** | Name of the pet | [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)

View File

@@ -15,6 +15,8 @@ Method | HTTP request | Description
To test \"client\" model
To test \"client\" model
### Example
```csharp
using System;
@@ -166,6 +168,8 @@ void (empty response body)
To test enum parameters
To test enum parameters
### Example
```csharp
using System;

View File

@@ -0,0 +1,118 @@
/*
* Swagger 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: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/
using NUnit.Framework;
using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using IO.Swagger.Api;
using IO.Swagger.Model;
using IO.Swagger.Client;
using System.Reflection;
namespace IO.Swagger.Test
{
/// <summary>
/// Class for testing Capitalization
/// </summary>
/// <remarks>
/// This file is automatically generated by Swagger Codegen.
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class CapitalizationTests
{
// TODO uncomment below to declare an instance variable for Capitalization
//private Capitalization instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of Capitalization
//instance = new Capitalization();
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
}
/// <summary>
/// Test an instance of Capitalization
/// </summary>
[Test]
public void CapitalizationInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" Capitalization
//Assert.IsInstanceOfType<Capitalization> (instance, "variable 'instance' is a Capitalization");
}
/// <summary>
/// Test the property 'SmallCamel'
/// </summary>
[Test]
public void SmallCamelTest()
{
// TODO unit test for the property 'SmallCamel'
}
/// <summary>
/// Test the property 'CapitalCamel'
/// </summary>
[Test]
public void CapitalCamelTest()
{
// TODO unit test for the property 'CapitalCamel'
}
/// <summary>
/// Test the property 'SmallSnake'
/// </summary>
[Test]
public void SmallSnakeTest()
{
// TODO unit test for the property 'SmallSnake'
}
/// <summary>
/// Test the property 'CapitalSnake'
/// </summary>
[Test]
public void CapitalSnakeTest()
{
// TODO unit test for the property 'CapitalSnake'
}
/// <summary>
/// Test the property 'SCAETHFlowPoints'
/// </summary>
[Test]
public void SCAETHFlowPointsTest()
{
// TODO unit test for the property 'SCAETHFlowPoints'
}
/// <summary>
/// Test the property 'ATT_NAME'
/// </summary>
[Test]
public void ATT_NAMETest()
{
// TODO unit test for the property 'ATT_NAME'
}
}
}

View File

@@ -28,7 +28,7 @@ namespace IO.Swagger.Api
/// To test \&quot;client\&quot; model
/// </summary>
/// <remarks>
///
/// To test \&quot;client\&quot; model
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">client model</param>
@@ -39,7 +39,7 @@ namespace IO.Swagger.Api
/// To test \&quot;client\&quot; model
/// </summary>
/// <remarks>
///
/// To test \&quot;client\&quot; model
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">client model</param>
@@ -96,7 +96,7 @@ namespace IO.Swagger.Api
/// To test enum parameters
/// </summary>
/// <remarks>
///
/// To test enum parameters
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="enumFormStringArray">Form parameter enum test (string array) (optional)</param>
@@ -114,7 +114,7 @@ namespace IO.Swagger.Api
/// To test enum parameters
/// </summary>
/// <remarks>
///
/// To test enum parameters
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="enumFormStringArray">Form parameter enum test (string array) (optional)</param>
@@ -133,7 +133,7 @@ namespace IO.Swagger.Api
/// To test \&quot;client\&quot; model
/// </summary>
/// <remarks>
///
/// To test \&quot;client\&quot; model
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">client model</param>
@@ -144,7 +144,7 @@ namespace IO.Swagger.Api
/// To test \&quot;client\&quot; model
/// </summary>
/// <remarks>
///
/// To test \&quot;client\&quot; model
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">client model</param>
@@ -201,7 +201,7 @@ namespace IO.Swagger.Api
/// To test enum parameters
/// </summary>
/// <remarks>
///
/// To test enum parameters
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="enumFormStringArray">Form parameter enum test (string array) (optional)</param>
@@ -219,7 +219,7 @@ namespace IO.Swagger.Api
/// To test enum parameters
/// </summary>
/// <remarks>
///
/// To test enum parameters
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="enumFormStringArray">Form parameter enum test (string array) (optional)</param>
@@ -345,7 +345,7 @@ namespace IO.Swagger.Api
}
/// <summary>
/// To test \&quot;client\&quot; model
/// To test \&quot;client\&quot; model To test \&quot;client\&quot; model
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">client model</param>
@@ -357,7 +357,7 @@ namespace IO.Swagger.Api
}
/// <summary>
/// To test \&quot;client\&quot; model
/// To test \&quot;client\&quot; model To test \&quot;client\&quot; model
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">client model</param>
@@ -423,7 +423,7 @@ namespace IO.Swagger.Api
}
/// <summary>
/// To test \&quot;client\&quot; model
/// To test \&quot;client\&quot; model To test \&quot;client\&quot; model
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">client model</param>
@@ -436,7 +436,7 @@ namespace IO.Swagger.Api
}
/// <summary>
/// To test \&quot;client\&quot; model
/// To test \&quot;client\&quot; model To test \&quot;client\&quot; model
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">client model</param>
@@ -756,7 +756,7 @@ namespace IO.Swagger.Api
}
/// <summary>
/// To test enum parameters
/// To test enum parameters To test enum parameters
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="enumFormStringArray">Form parameter enum test (string array) (optional)</param>
@@ -774,7 +774,7 @@ namespace IO.Swagger.Api
}
/// <summary>
/// To test enum parameters
/// To test enum parameters To test enum parameters
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="enumFormStringArray">Form parameter enum test (string array) (optional)</param>
@@ -844,7 +844,7 @@ namespace IO.Swagger.Api
}
/// <summary>
/// To test enum parameters
/// To test enum parameters To test enum parameters
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="enumFormStringArray">Form parameter enum test (string array) (optional)</param>
@@ -863,7 +863,7 @@ namespace IO.Swagger.Api
}
/// <summary>
/// To test enum parameters
/// To test enum parameters To test enum parameters
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="enumFormStringArray">Form parameter enum test (string array) (optional)</param>

View File

@@ -19,6 +19,6 @@ namespace IO.Swagger.Client
/// </summary>
/// <param name="methodName">Method name</param>
/// <param name="response">Response</param>
/// <returns>Exceptions</returns>
/// <returns>Exceptions</returns>
public delegate Exception ExceptionFactory(string methodName, IRestResponse response);
}

View File

@@ -11,7 +11,7 @@ Contact: apiteam@swagger.io
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{959A8039-E3B9-4660-A666-840955E4520C}</ProjectGuid>
<ProjectGuid>{4F6B73F4-427E-4C54-BB06-A106EBF09288}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>IO.Swagger</RootNamespace>

View File

@@ -0,0 +1,40 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<!-- The identifier that must be unique within the hosting gallery -->
<id>$id$</id>
<title>Swagger Library</title>
<!-- The package version number that is used when resolving dependencies -->
<version>$version$</version>
<!-- Authors contain text that appears directly on the gallery -->
<authors>$author$</authors>
<!-- Owners are typically nuget.org identities that allow gallery
users to earily find other packages by the same owners. -->
<owners>$author$</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<developmentDependency>false</developmentDependency>
<!-- The description can be used in package manager UI. Note that the
nuget.org gallery uses information you add in the portal. -->
<description>A library generated from a Swagger doc</description>
<copyright>http://swagger.io/terms/</copyright>
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>
<!-- Dependencies are automatically installed when the package is installed -->
<dependencies>
<dependency id="NewtonSoft.Json" version="8.0.3" />
<dependency id="RestSharp" version="105.1.0" />
</dependencies>
</metadata>
<files>
<!-- A readme.txt will be displayed when the package is installed -->
<file src="..\..\README.md" target="" />
<file src="..\..\docs\**\*.*" target="docs" />
</files>
</package>

View File

@@ -34,7 +34,7 @@ namespace IO.Swagger.Model
/// </summary>
/// <param name="MapProperty">MapProperty.</param>
/// <param name="MapOfMapProperty">MapOfMapProperty.</param>
public AdditionalPropertiesClass(Dictionary<string, string> MapProperty = null, Dictionary<string, Dictionary<string, string>> MapOfMapProperty = null)
public AdditionalPropertiesClass(Dictionary<string, string> MapProperty = default(Dictionary<string, string>), Dictionary<string, Dictionary<string, string>> MapOfMapProperty = default(Dictionary<string, Dictionary<string, string>>))
{
this.MapProperty = MapProperty;
this.MapOfMapProperty = MapOfMapProperty;

View File

@@ -39,7 +39,7 @@ namespace IO.Swagger.Model
/// </summary>
/// <param name="ClassName">ClassName (required).</param>
/// <param name="Color">Color (default to &quot;red&quot;).</param>
public Animal(string ClassName = null, string Color = null)
public Animal(string ClassName = default(string), string Color = "red")
{
// to ensure "ClassName" is required (not null)
if (ClassName == null)

View File

@@ -35,7 +35,7 @@ namespace IO.Swagger.Model
/// <param name="Code">Code.</param>
/// <param name="Type">Type.</param>
/// <param name="Message">Message.</param>
public ApiResponse(int? Code = null, string Type = null, string Message = null)
public ApiResponse(int? Code = default(int?), string Type = default(string), string Message = default(string))
{
this.Code = Code;
this.Type = Type;

View File

@@ -33,7 +33,7 @@ namespace IO.Swagger.Model
/// Initializes a new instance of the <see cref="ArrayOfArrayOfNumberOnly" /> class.
/// </summary>
/// <param name="ArrayArrayNumber">ArrayArrayNumber.</param>
public ArrayOfArrayOfNumberOnly(List<List<decimal?>> ArrayArrayNumber = null)
public ArrayOfArrayOfNumberOnly(List<List<decimal?>> ArrayArrayNumber = default(List<List<decimal?>>))
{
this.ArrayArrayNumber = ArrayArrayNumber;
}

View File

@@ -33,7 +33,7 @@ namespace IO.Swagger.Model
/// Initializes a new instance of the <see cref="ArrayOfNumberOnly" /> class.
/// </summary>
/// <param name="ArrayNumber">ArrayNumber.</param>
public ArrayOfNumberOnly(List<decimal?> ArrayNumber = null)
public ArrayOfNumberOnly(List<decimal?> ArrayNumber = default(List<decimal?>))
{
this.ArrayNumber = ArrayNumber;
}

View File

@@ -35,7 +35,7 @@ namespace IO.Swagger.Model
/// <param name="ArrayOfString">ArrayOfString.</param>
/// <param name="ArrayArrayOfInteger">ArrayArrayOfInteger.</param>
/// <param name="ArrayArrayOfModel">ArrayArrayOfModel.</param>
public ArrayTest(List<string> ArrayOfString = null, List<List<long?>> ArrayArrayOfInteger = null, List<List<ReadOnlyFirst>> ArrayArrayOfModel = null)
public ArrayTest(List<string> ArrayOfString = default(List<string>), List<List<long?>> ArrayArrayOfInteger = default(List<List<long?>>), List<List<ReadOnlyFirst>> ArrayArrayOfModel = default(List<List<ReadOnlyFirst>>))
{
this.ArrayOfString = ArrayOfString;
this.ArrayArrayOfInteger = ArrayArrayOfInteger;

View File

@@ -0,0 +1,197 @@
/*
* Swagger 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: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/
using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;
namespace IO.Swagger.Model
{
/// <summary>
/// Capitalization
/// </summary>
[DataContract]
public partial class Capitalization : IEquatable<Capitalization>, IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="Capitalization" /> class.
/// </summary>
/// <param name="SmallCamel">SmallCamel.</param>
/// <param name="CapitalCamel">CapitalCamel.</param>
/// <param name="SmallSnake">SmallSnake.</param>
/// <param name="CapitalSnake">CapitalSnake.</param>
/// <param name="SCAETHFlowPoints">SCAETHFlowPoints.</param>
/// <param name="ATT_NAME">Name of the pet .</param>
public Capitalization(string SmallCamel = default(string), string CapitalCamel = default(string), string SmallSnake = default(string), string CapitalSnake = default(string), string SCAETHFlowPoints = default(string), string ATT_NAME = default(string))
{
this.SmallCamel = SmallCamel;
this.CapitalCamel = CapitalCamel;
this.SmallSnake = SmallSnake;
this.CapitalSnake = CapitalSnake;
this.SCAETHFlowPoints = SCAETHFlowPoints;
this.ATT_NAME = ATT_NAME;
}
/// <summary>
/// Gets or Sets SmallCamel
/// </summary>
[DataMember(Name="smallCamel", EmitDefaultValue=false)]
public string SmallCamel { get; set; }
/// <summary>
/// Gets or Sets CapitalCamel
/// </summary>
[DataMember(Name="CapitalCamel", EmitDefaultValue=false)]
public string CapitalCamel { get; set; }
/// <summary>
/// Gets or Sets SmallSnake
/// </summary>
[DataMember(Name="small_Snake", EmitDefaultValue=false)]
public string SmallSnake { get; set; }
/// <summary>
/// Gets or Sets CapitalSnake
/// </summary>
[DataMember(Name="Capital_Snake", EmitDefaultValue=false)]
public string CapitalSnake { get; set; }
/// <summary>
/// Gets or Sets SCAETHFlowPoints
/// </summary>
[DataMember(Name="SCA_ETH_Flow_Points", EmitDefaultValue=false)]
public string SCAETHFlowPoints { get; set; }
/// <summary>
/// Name of the pet
/// </summary>
/// <value>Name of the pet </value>
[DataMember(Name="ATT_NAME", EmitDefaultValue=false)]
public string ATT_NAME { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class Capitalization {\n");
sb.Append(" SmallCamel: ").Append(SmallCamel).Append("\n");
sb.Append(" CapitalCamel: ").Append(CapitalCamel).Append("\n");
sb.Append(" SmallSnake: ").Append(SmallSnake).Append("\n");
sb.Append(" CapitalSnake: ").Append(CapitalSnake).Append("\n");
sb.Append(" SCAETHFlowPoints: ").Append(SCAETHFlowPoints).Append("\n");
sb.Append(" ATT_NAME: ").Append(ATT_NAME).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 string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="obj">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object obj)
{
// credit: http://stackoverflow.com/a/10454552/677735
return this.Equals(obj as Capitalization);
}
/// <summary>
/// Returns true if Capitalization instances are equal
/// </summary>
/// <param name="other">Instance of Capitalization to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(Capitalization other)
{
// credit: http://stackoverflow.com/a/10454552/677735
if (other == null)
return false;
return
(
this.SmallCamel == other.SmallCamel ||
this.SmallCamel != null &&
this.SmallCamel.Equals(other.SmallCamel)
) &&
(
this.CapitalCamel == other.CapitalCamel ||
this.CapitalCamel != null &&
this.CapitalCamel.Equals(other.CapitalCamel)
) &&
(
this.SmallSnake == other.SmallSnake ||
this.SmallSnake != null &&
this.SmallSnake.Equals(other.SmallSnake)
) &&
(
this.CapitalSnake == other.CapitalSnake ||
this.CapitalSnake != null &&
this.CapitalSnake.Equals(other.CapitalSnake)
) &&
(
this.SCAETHFlowPoints == other.SCAETHFlowPoints ||
this.SCAETHFlowPoints != null &&
this.SCAETHFlowPoints.Equals(other.SCAETHFlowPoints)
) &&
(
this.ATT_NAME == other.ATT_NAME ||
this.ATT_NAME != null &&
this.ATT_NAME.Equals(other.ATT_NAME)
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
// credit: http://stackoverflow.com/a/263416/677735
unchecked // Overflow is fine, just wrap
{
int hash = 41;
// Suitable nullity checks etc, of course :)
if (this.SmallCamel != null)
hash = hash * 59 + this.SmallCamel.GetHashCode();
if (this.CapitalCamel != null)
hash = hash * 59 + this.CapitalCamel.GetHashCode();
if (this.SmallSnake != null)
hash = hash * 59 + this.SmallSnake.GetHashCode();
if (this.CapitalSnake != null)
hash = hash * 59 + this.CapitalSnake.GetHashCode();
if (this.SCAETHFlowPoints != null)
hash = hash * 59 + this.SCAETHFlowPoints.GetHashCode();
if (this.ATT_NAME != null)
hash = hash * 59 + this.ATT_NAME.GetHashCode();
return hash;
}
}
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
yield break;
}
}
}

View File

@@ -40,7 +40,7 @@ namespace IO.Swagger.Model
/// <param name="ClassName">ClassName (required).</param>
/// <param name="Color">Color (default to &quot;red&quot;).</param>
/// <param name="Declawed">Declawed.</param>
public Cat(string ClassName = null, string Color = null, bool? Declawed = null)
public Cat(string ClassName = default(string), string Color = "red", bool? Declawed = default(bool?))
{
// to ensure "ClassName" is required (not null)
if (ClassName == null)

View File

@@ -34,7 +34,7 @@ namespace IO.Swagger.Model
/// </summary>
/// <param name="Id">Id.</param>
/// <param name="Name">Name.</param>
public Category(long? Id = null, string Name = null)
public Category(long? Id = default(long?), string Name = default(string))
{
this.Id = Id;
this.Name = Name;

View File

@@ -33,7 +33,7 @@ namespace IO.Swagger.Model
/// Initializes a new instance of the <see cref="ClassModel" /> class.
/// </summary>
/// <param name="_Class">_Class.</param>
public ClassModel(string _Class = null)
public ClassModel(string _Class = default(string))
{
this._Class = _Class;
}

View File

@@ -40,7 +40,7 @@ namespace IO.Swagger.Model
/// <param name="ClassName">ClassName (required).</param>
/// <param name="Color">Color (default to &quot;red&quot;).</param>
/// <param name="Breed">Breed.</param>
public Dog(string ClassName = null, string Color = null, string Breed = null)
public Dog(string ClassName = default(string), string Color = "red", string Breed = default(string))
{
// to ensure "ClassName" is required (not null)
if (ClassName == null)

View File

@@ -85,7 +85,7 @@ namespace IO.Swagger.Model
/// </summary>
/// <param name="JustSymbol">JustSymbol.</param>
/// <param name="ArrayEnum">ArrayEnum.</param>
public EnumArrays(JustSymbolEnum? JustSymbol = null, List<ArrayEnumEnum> ArrayEnum = null)
public EnumArrays(JustSymbolEnum? JustSymbol = default(JustSymbolEnum?), List<ArrayEnumEnum> ArrayEnum = default(List<ArrayEnumEnum>))
{
this.JustSymbol = JustSymbol;
this.ArrayEnum = ArrayEnum;

View File

@@ -117,7 +117,7 @@ namespace IO.Swagger.Model
/// <param name="EnumInteger">EnumInteger.</param>
/// <param name="EnumNumber">EnumNumber.</param>
/// <param name="OuterEnum">OuterEnum.</param>
public EnumTest(EnumStringEnum? EnumString = null, EnumIntegerEnum? EnumInteger = null, EnumNumberEnum? EnumNumber = null, OuterEnum? OuterEnum = null)
public EnumTest(EnumStringEnum? EnumString = default(EnumStringEnum?), EnumIntegerEnum? EnumInteger = default(EnumIntegerEnum?), EnumNumberEnum? EnumNumber = default(EnumNumberEnum?), OuterEnum OuterEnum = default(OuterEnum))
{
this.EnumString = EnumString;
this.EnumInteger = EnumInteger;
@@ -129,7 +129,7 @@ namespace IO.Swagger.Model
/// Gets or Sets OuterEnum
/// </summary>
[DataMember(Name="outerEnum", EmitDefaultValue=false)]
public OuterEnum? OuterEnum { get; set; }
public OuterEnum OuterEnum { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>

View File

@@ -50,7 +50,7 @@ namespace IO.Swagger.Model
/// <param name="DateTime">DateTime.</param>
/// <param name="Uuid">Uuid.</param>
/// <param name="Password">Password (required).</param>
public FormatTest(int? Integer = null, int? Int32 = null, long? Int64 = null, decimal? Number = null, float? _Float = null, double? _Double = null, string _String = null, byte[] _Byte = null, byte[] Binary = null, DateTime? Date = null, DateTime? DateTime = null, Guid? Uuid = null, string Password = null)
public FormatTest(int? Integer = default(int?), int? Int32 = default(int?), long? Int64 = default(long?), decimal? Number = default(decimal?), float? _Float = default(float?), double? _Double = default(double?), string _String = default(string), byte[] _Byte = default(byte[]), byte[] Binary = default(byte[]), DateTime? Date = default(DateTime?), DateTime? DateTime = default(DateTime?), Guid? Uuid = default(Guid?), string Password = default(string))
{
// to ensure "Number" is required (not null)
if (Number == null)

View File

@@ -33,7 +33,7 @@ namespace IO.Swagger.Model
/// Initializes a new instance of the <see cref="List" /> class.
/// </summary>
/// <param name="_123List">_123List.</param>
public List(string _123List = null)
public List(string _123List = default(string))
{
this._123List = _123List;
}

View File

@@ -60,7 +60,7 @@ namespace IO.Swagger.Model
/// </summary>
/// <param name="MapMapOfString">MapMapOfString.</param>
/// <param name="MapOfEnumString">MapOfEnumString.</param>
public MapTest(Dictionary<string, Dictionary<string, string>> MapMapOfString = null, Dictionary<string, InnerEnum> MapOfEnumString = null)
public MapTest(Dictionary<string, Dictionary<string, string>> MapMapOfString = default(Dictionary<string, Dictionary<string, string>>), Dictionary<string, InnerEnum> MapOfEnumString = default(Dictionary<string, InnerEnum>))
{
this.MapMapOfString = MapMapOfString;
this.MapOfEnumString = MapOfEnumString;

View File

@@ -35,7 +35,7 @@ namespace IO.Swagger.Model
/// <param name="Uuid">Uuid.</param>
/// <param name="DateTime">DateTime.</param>
/// <param name="Map">Map.</param>
public MixedPropertiesAndAdditionalPropertiesClass(Guid? Uuid = null, DateTime? DateTime = null, Dictionary<string, Animal> Map = null)
public MixedPropertiesAndAdditionalPropertiesClass(Guid? Uuid = default(Guid?), DateTime? DateTime = default(DateTime?), Dictionary<string, Animal> Map = default(Dictionary<string, Animal>))
{
this.Uuid = Uuid;
this.DateTime = DateTime;

View File

@@ -34,7 +34,7 @@ namespace IO.Swagger.Model
/// </summary>
/// <param name="Name">Name.</param>
/// <param name="_Class">_Class.</param>
public Model200Response(int? Name = null, string _Class = null)
public Model200Response(int? Name = default(int?), string _Class = default(string))
{
this.Name = Name;
this._Class = _Class;

View File

@@ -33,7 +33,7 @@ namespace IO.Swagger.Model
/// Initializes a new instance of the <see cref="ModelClient" /> class.
/// </summary>
/// <param name="_Client">_Client.</param>
public ModelClient(string _Client = null)
public ModelClient(string _Client = default(string))
{
this._Client = _Client;
}

View File

@@ -33,7 +33,7 @@ namespace IO.Swagger.Model
/// Initializes a new instance of the <see cref="ModelReturn" /> class.
/// </summary>
/// <param name="_Return">_Return.</param>
public ModelReturn(int? _Return = null)
public ModelReturn(int? _Return = default(int?))
{
this._Return = _Return;
}

View File

@@ -39,7 +39,7 @@ namespace IO.Swagger.Model
/// </summary>
/// <param name="_Name">_Name (required).</param>
/// <param name="Property">Property.</param>
public Name(int? _Name = null, string Property = null)
public Name(int? _Name = default(int?), string Property = default(string))
{
// to ensure "_Name" is required (not null)
if (_Name == null)

View File

@@ -33,7 +33,7 @@ namespace IO.Swagger.Model
/// Initializes a new instance of the <see cref="NumberOnly" /> class.
/// </summary>
/// <param name="JustNumber">JustNumber.</param>
public NumberOnly(decimal? JustNumber = null)
public NumberOnly(decimal? JustNumber = default(decimal?))
{
this.JustNumber = JustNumber;
}

View File

@@ -71,7 +71,7 @@ namespace IO.Swagger.Model
/// <param name="ShipDate">ShipDate.</param>
/// <param name="Status">Order Status.</param>
/// <param name="Complete">Complete (default to false).</param>
public Order(long? Id = null, long? PetId = null, int? Quantity = null, DateTime? ShipDate = null, StatusEnum? Status = null, bool? Complete = null)
public Order(long? Id = default(long?), long? PetId = default(long?), int? Quantity = default(int?), DateTime? ShipDate = default(DateTime?), StatusEnum? Status = default(StatusEnum?), bool? Complete = false)
{
this.Id = Id;
this.PetId = PetId;

View File

@@ -76,7 +76,7 @@ namespace IO.Swagger.Model
/// <param name="PhotoUrls">PhotoUrls (required).</param>
/// <param name="Tags">Tags.</param>
/// <param name="Status">pet status in the store.</param>
public Pet(long? Id = null, Category Category = null, string Name = null, List<string> PhotoUrls = null, List<Tag> Tags = null, StatusEnum? Status = null)
public Pet(long? Id = default(long?), Category Category = default(Category), string Name = default(string), List<string> PhotoUrls = default(List<string>), List<Tag> Tags = default(List<Tag>), StatusEnum? Status = default(StatusEnum?))
{
// to ensure "Name" is required (not null)
if (Name == null)

View File

@@ -33,7 +33,7 @@ namespace IO.Swagger.Model
/// Initializes a new instance of the <see cref="ReadOnlyFirst" /> class.
/// </summary>
/// <param name="Baz">Baz.</param>
public ReadOnlyFirst(string Baz = null)
public ReadOnlyFirst(string Baz = default(string))
{
this.Baz = Baz;
}

View File

@@ -33,7 +33,7 @@ namespace IO.Swagger.Model
/// Initializes a new instance of the <see cref="SpecialModelName" /> class.
/// </summary>
/// <param name="SpecialPropertyName">SpecialPropertyName.</param>
public SpecialModelName(long? SpecialPropertyName = null)
public SpecialModelName(long? SpecialPropertyName = default(long?))
{
this.SpecialPropertyName = SpecialPropertyName;
}

View File

@@ -34,7 +34,7 @@ namespace IO.Swagger.Model
/// </summary>
/// <param name="Id">Id.</param>
/// <param name="Name">Name.</param>
public Tag(long? Id = null, string Name = null)
public Tag(long? Id = default(long?), string Name = default(string))
{
this.Id = Id;
this.Name = Name;

View File

@@ -40,7 +40,7 @@ namespace IO.Swagger.Model
/// <param name="Password">Password.</param>
/// <param name="Phone">Phone.</param>
/// <param name="UserStatus">User Status.</param>
public User(long? Id = null, string Username = null, string FirstName = null, string LastName = null, string Email = null, string Password = null, string Phone = null, int? UserStatus = null)
public User(long? Id = default(long?), string Username = default(string), string FirstName = default(string), string LastName = default(string), string Email = default(string), string Password = default(string), string Phone = default(string), int? UserStatus = default(int?))
{
this.Id = Id;
this.Username = Username;