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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ packages/
.packages
.vagrant/
.vscode/
**/.vs

.settings

Expand Down Expand Up @@ -128,7 +129,6 @@ samples/client/petstore/swift3/**/SwaggerClientTests/Podfile.lock
# C#
*.csproj.user
samples/client/petstore/csharp/SwaggerClient/IO.Swagger.userprefs
samples/client/petstore/csharp/SwaggerClientTest/.vs
samples/client/petstore/csharp/SwaggerClientTest/obj
samples/client/petstore/csharp/SwaggerClientTest/bin
samples/client/petstore/csharp/SwaggerClientTest/packages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
{{#description}}
/// <value>{{description}}</value>
{{/description}}
[DataMember(Name="{{baseName}}", EmitDefaultValue={{emitDefaultValue}})]
[DataMember(Name="{{baseName}}", EmitDefaultValue={{#isNullable}}true{{/isNullable}}{{^isNullable}}{{emitDefaultValue}}{{/isNullable}})]
public {{#complexType}}{{{complexType}}}{{/complexType}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; }
{{/isEnum}}
{{/vars}}
Expand Down Expand Up @@ -70,12 +70,16 @@
{
this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}};
}

{{/isEnum}}
{{#isEnum}}
this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}};
{{/isEnum}}
{{/required}}
{{/isNullable}}
{{#isNullable}}
this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}};
{{/isNullable}}
{{/isReadOnly}}
{{/isInherited}}
{{/vars}}
Expand Down Expand Up @@ -110,7 +114,7 @@
/// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}}
/// </summary>{{#description}}
/// <value>{{description}}</value>{{/description}}
[DataMember(Name="{{baseName}}", EmitDefaultValue={{emitDefaultValue}})]{{#isDate}}
[DataMember(Name="{{baseName}}", EmitDefaultValue={{#isNullable}}true{{/isNullable}}{{^isNullable}}{{emitDefaultValue}}{{/isNullable}})]{{#isDate}}
[JsonConverter(typeof(OpenAPIDateConverter))]{{/isDate}}
public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; }

Expand Down

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,17 @@ public void StatusTest()
// TODO unit test for the property 'Status'
}

/// <summary>
/// Test serialization
/// </summary>
[Test()]
public void TestSerialization()
{
// create pet
Pet p1 = new Pet(name: "Csharp test", photoUrls: new List<string> { "http://petstore.com/csharp_test" });
Assert.AreEqual("{\"name\":\"Csharp test\",\"photoUrls\":[\"http://petstore.com/csharp_test\"]}", JsonConvert.SerializeObject(p1));
}

/// <summary>
/// Test Equal
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ protected Animal() { }
{
this.ClassName = className;
}

// use default value if no "color" provided
if (color == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ protected Category() { }
{
this.Name = name;
}

this.Id = id;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ protected FormatTest() { }
{
this.Number = number;
}

// to ensure "_byte" is required (not null)
if (_byte == null)
{
Expand All @@ -73,6 +74,7 @@ protected FormatTest() { }
{
this.Byte = _byte;
}

// to ensure "date" is required (not null)
if (date == null)
{
Expand All @@ -82,6 +84,7 @@ protected FormatTest() { }
{
this.Date = date;
}

// to ensure "password" is required (not null)
if (password == null)
{
Expand All @@ -91,6 +94,7 @@ protected FormatTest() { }
{
this.Password = password;
}

this.Integer = integer;
this.Int32 = int32;
this.Int64 = int64;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ protected Name() { }
{
this._Name = name;
}

this.Property = property;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ protected Pet() { }
{
this.Name = name;
}

// to ensure "photoUrls" is required (not null)
if (photoUrls == null)
{
Expand All @@ -99,6 +100,7 @@ protected Pet() { }
{
this.PhotoUrls = photoUrls;
}

this.Id = id;
this.Category = category;
this.Tags = tags;
Expand Down