diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java
index 10ccff345c1..e9259a4b3f4 100644
--- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java
+++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractCSharpCodegen.java
@@ -484,7 +484,13 @@ public String toDefaultValue(Property p) {
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;
diff --git a/samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln b/samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln
index b7c1013e434..04424e0729f 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", "{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
diff --git a/samples/client/petstore/csharp/SwaggerClient/README.md b/samples/client/petstore/csharp/SwaggerClient/README.md
index 67a001aa0cf..ab8b4d19139 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 package: class io.swagger.codegen.languages.CSharpClientCodegen
+- Build package: io.swagger.codegen.languages.CSharpClientCodegen
## Frameworks supported
@@ -38,6 +38,20 @@ using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
```
+
+
+## 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.
+
## 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)
diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/Capitalization.md b/samples/client/petstore/csharp/SwaggerClient/docs/Capitalization.md
new file mode 100644
index 00000000000..87d14f03e0d
--- /dev/null
+++ b/samples/client/petstore/csharp/SwaggerClient/docs/Capitalization.md
@@ -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)
+
diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/FakeApi.md b/samples/client/petstore/csharp/SwaggerClient/docs/FakeApi.md
index de9d842ee06..44699db1dc2 100644
--- a/samples/client/petstore/csharp/SwaggerClient/docs/FakeApi.md
+++ b/samples/client/petstore/csharp/SwaggerClient/docs/FakeApi.md
@@ -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;
diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/CapitalizationTests.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/CapitalizationTests.cs
new file mode 100644
index 00000000000..30ed8700f74
--- /dev/null
+++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/CapitalizationTests.cs
@@ -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
+{
+ ///
+ /// Class for testing Capitalization
+ ///
+ ///
+ /// This file is automatically generated by Swagger Codegen.
+ /// Please update the test case below to test the model.
+ ///
+ [TestFixture]
+ public class CapitalizationTests
+ {
+ // TODO uncomment below to declare an instance variable for Capitalization
+ //private Capitalization instance;
+
+ ///
+ /// Setup before each test
+ ///
+ [SetUp]
+ public void Init()
+ {
+ // TODO uncomment below to create an instance of Capitalization
+ //instance = new Capitalization();
+ }
+
+ ///
+ /// Clean up after each test
+ ///
+ [TearDown]
+ public void Cleanup()
+ {
+
+ }
+
+ ///
+ /// Test an instance of Capitalization
+ ///
+ [Test]
+ public void CapitalizationInstanceTest()
+ {
+ // TODO uncomment below to test "IsInstanceOfType" Capitalization
+ //Assert.IsInstanceOfType (instance, "variable 'instance' is a Capitalization");
+ }
+
+ ///
+ /// Test the property 'SmallCamel'
+ ///
+ [Test]
+ public void SmallCamelTest()
+ {
+ // TODO unit test for the property 'SmallCamel'
+ }
+ ///
+ /// Test the property 'CapitalCamel'
+ ///
+ [Test]
+ public void CapitalCamelTest()
+ {
+ // TODO unit test for the property 'CapitalCamel'
+ }
+ ///
+ /// Test the property 'SmallSnake'
+ ///
+ [Test]
+ public void SmallSnakeTest()
+ {
+ // TODO unit test for the property 'SmallSnake'
+ }
+ ///
+ /// Test the property 'CapitalSnake'
+ ///
+ [Test]
+ public void CapitalSnakeTest()
+ {
+ // TODO unit test for the property 'CapitalSnake'
+ }
+ ///
+ /// Test the property 'SCAETHFlowPoints'
+ ///
+ [Test]
+ public void SCAETHFlowPointsTest()
+ {
+ // TODO unit test for the property 'SCAETHFlowPoints'
+ }
+ ///
+ /// Test the property 'ATT_NAME'
+ ///
+ [Test]
+ public void ATT_NAMETest()
+ {
+ // TODO unit test for the property 'ATT_NAME'
+ }
+
+ }
+
+}
diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs
index 52a26a00dbf..502deb884fd 100644
--- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs
+++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs
@@ -28,7 +28,7 @@ public interface IFakeApi : IApiAccessor
/// To test \"client\" model
///
///
- ///
+ /// To test \"client\" model
///
/// Thrown when fails to make API call
/// client model
@@ -39,7 +39,7 @@ public interface IFakeApi : IApiAccessor
/// To test \"client\" model
///
///
- ///
+ /// To test \"client\" model
///
/// Thrown when fails to make API call
/// client model
@@ -96,7 +96,7 @@ public interface IFakeApi : IApiAccessor
/// To test enum parameters
///
///
- ///
+ /// To test enum parameters
///
/// Thrown when fails to make API call
/// Form parameter enum test (string array) (optional)
@@ -114,7 +114,7 @@ public interface IFakeApi : IApiAccessor
/// To test enum parameters
///
///
- ///
+ /// To test enum parameters
///
/// Thrown when fails to make API call
/// Form parameter enum test (string array) (optional)
@@ -133,7 +133,7 @@ public interface IFakeApi : IApiAccessor
/// To test \"client\" model
///
///
- ///
+ /// To test \"client\" model
///
/// Thrown when fails to make API call
/// client model
@@ -144,7 +144,7 @@ public interface IFakeApi : IApiAccessor
/// To test \"client\" model
///
///
- ///
+ /// To test \"client\" model
///
/// Thrown when fails to make API call
/// client model
@@ -201,7 +201,7 @@ public interface IFakeApi : IApiAccessor
/// To test enum parameters
///
///
- ///
+ /// To test enum parameters
///
/// Thrown when fails to make API call
/// Form parameter enum test (string array) (optional)
@@ -219,7 +219,7 @@ public interface IFakeApi : IApiAccessor
/// To test enum parameters
///
///
- ///
+ /// To test enum parameters
///
/// Thrown when fails to make API call
/// Form parameter enum test (string array) (optional)
@@ -345,7 +345,7 @@ public void AddDefaultHeader(string key, string value)
}
///
- /// To test \"client\" model
+ /// To test \"client\" model To test \"client\" model
///
/// Thrown when fails to make API call
/// client model
@@ -357,7 +357,7 @@ public ModelClient TestClientModel (ModelClient body)
}
///
- /// To test \"client\" model
+ /// To test \"client\" model To test \"client\" model
///
/// Thrown when fails to make API call
/// client model
@@ -423,7 +423,7 @@ public ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient body)
}
///
- /// To test \"client\" model
+ /// To test \"client\" model To test \"client\" model
///
/// Thrown when fails to make API call
/// client model
@@ -436,7 +436,7 @@ public async System.Threading.Tasks.Task TestClientModelAsync (Mode
}
///
- /// To test \"client\" model
+ /// To test \"client\" model To test \"client\" model
///
/// Thrown when fails to make API call
/// client model
@@ -756,7 +756,7 @@ public async System.Threading.Tasks.Task> TestEndpointParame
}
///
- /// To test enum parameters
+ /// To test enum parameters To test enum parameters
///
/// Thrown when fails to make API call
/// Form parameter enum test (string array) (optional)
@@ -774,7 +774,7 @@ public void TestEnumParameters (List enumFormStringArray = null, string
}
///
- /// To test enum parameters
+ /// To test enum parameters To test enum parameters
///
/// Thrown when fails to make API call
/// Form parameter enum test (string array) (optional)
@@ -844,7 +844,7 @@ public ApiResponse