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
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
17 changes: 16 additions & 1 deletion samples/client/petstore/csharp/SwaggerClient/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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)

4 changes: 4 additions & 0 deletions samples/client/petstore/csharp/SwaggerClient/docs/FakeApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Method | HTTP request | Description

To test \"client\" model

To test \"client\" model

### Example
```csharp
using System;
Expand Down Expand Up @@ -166,6 +168,8 @@ void (empty response body)

To test enum parameters

To test enum parameters

### Example
```csharp
using System;
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public interface IFakeApi : IApiAccessor
/// 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>
Expand All @@ -39,7 +39,7 @@ public interface IFakeApi : IApiAccessor
/// 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>
Expand Down Expand Up @@ -96,7 +96,7 @@ public interface IFakeApi : IApiAccessor
/// 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>
Expand All @@ -114,7 +114,7 @@ public interface IFakeApi : IApiAccessor
/// 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>
Expand All @@ -133,7 +133,7 @@ public interface IFakeApi : IApiAccessor
/// 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>
Expand All @@ -144,7 +144,7 @@ public interface IFakeApi : IApiAccessor
/// 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>
Expand Down Expand Up @@ -201,7 +201,7 @@ public interface IFakeApi : IApiAccessor
/// 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>
Expand All @@ -219,7 +219,7 @@ public interface IFakeApi : IApiAccessor
/// 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>
Expand Down Expand Up @@ -345,7 +345,7 @@ public void AddDefaultHeader(string key, string value)
}

/// <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>
Expand All @@ -357,7 +357,7 @@ public ModelClient TestClientModel (ModelClient body)
}

/// <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>
Expand Down Expand Up @@ -423,7 +423,7 @@ public ApiResponse< ModelClient > TestClientModelWithHttpInfo (ModelClient body)
}

/// <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>
Expand All @@ -436,7 +436,7 @@ public async System.Threading.Tasks.Task<ModelClient> TestClientModelAsync (Mode
}

/// <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>
Expand Down Expand Up @@ -756,7 +756,7 @@ public async System.Threading.Tasks.Task<ApiResponse<Object>> TestEndpointParame
}

/// <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>
Expand All @@ -774,7 +774,7 @@ public void TestEnumParameters (List<string> enumFormStringArray = null, string
}

/// <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>
Expand Down Expand Up @@ -844,7 +844,7 @@ public ApiResponse<Object> TestEnumParametersWithHttpInfo (List<string> enumForm
}

/// <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>
Expand All @@ -863,7 +863,7 @@ public async System.Threading.Tasks.Task TestEnumParametersAsync (List<string> e
}

/// <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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Loading