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 @@ -32,7 +32,7 @@
/// <param name="{{name}}">{{#description}}{{description}}{{/description}}{{^description}}{{name}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{defaultValue}}){{/defaultValue}}.</param>
{{/isReadOnly}}
{{/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)
if ({{name}} == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,9 @@ definitions:
format: int32
property:
type: string
123Number:
type: integer
readOnly: true
xml:
name: Name
200_response:
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", "{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
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
{AC0D0300-7030-473F-B672-17C40187815A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AC0D0300-7030-473F-B672-17C40187815A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AC0D0300-7030-473F-B672-17C40187815A}.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}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C075FB79-0DDE-43E3-9FA5-E239EE9B9B5A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C075FB79-0DDE-43E3-9FA5-E239EE9B9B5A}.Release|Any CPU.ActiveCfg = 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.Build.0 = Debug|Any CPU
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
6 changes: 3 additions & 3 deletions 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 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

## Frameworks supported
Expand Down Expand Up @@ -69,7 +69,7 @@ namespace Example

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);
}
catch (Exception e)
Expand All @@ -87,7 +87,7 @@ All URIs are relative to *http://petstore.swagger.io/v2*

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* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
*PetApi* | [**FindPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**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)

1 change: 1 addition & 0 deletions samples/client/petstore/csharp/SwaggerClient/docs/Cat.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ClassName** | **string** | |
**Color** | **string** | | [optional] [default to "red"]
**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)
Expand Down
1 change: 1 addition & 0 deletions samples/client/petstore/csharp/SwaggerClient/docs/Dog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ClassName** | **string** | |
**Color** | **string** | | [optional] [default to "red"]
**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)
Expand Down
8 changes: 4 additions & 4 deletions samples/client/petstore/csharp/SwaggerClient/docs/FakeApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ All URIs are relative to *http://petstore.swagger.io/v2*

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**
> 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
```csharp
Expand Down Expand Up @@ -45,7 +45,7 @@ namespace Example

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);
}
catch (Exception e)
Expand Down
1 change: 1 addition & 0 deletions samples/client/petstore/csharp/SwaggerClient/docs/Name.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Name | Type | Description | Notes
**_Name** | **int?** | |
**SnakeCase** | **int?** | | [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)

Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<Import Project="$(MsBuildToolsPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<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>
</ProjectReference>
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ public interface IFakeApi
{
#region Synchronous Operations
/// <summary>
/// Fake endpoint for testing various parameters
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
/// </summary>
/// <remarks>
/// Fake endpoint for testing various parameters
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="number">None</param>
Expand All @@ -36,10 +36,10 @@ public interface IFakeApi
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>
/// Fake endpoint for testing various parameters
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
/// </summary>
/// <remarks>
/// Fake endpoint for testing various parameters
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="number">None</param>
Expand All @@ -59,10 +59,10 @@ public interface IFakeApi
#endregion Synchronous Operations
#region Asynchronous Operations
/// <summary>
/// Fake endpoint for testing various parameters
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
/// </summary>
/// <remarks>
/// Fake endpoint for testing various parameters
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="number">None</param>
Expand All @@ -81,10 +81,10 @@ public interface IFakeApi
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>
/// Fake endpoint for testing various parameters
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
/// </summary>
/// <remarks>
/// Fake endpoint for testing various parameters
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="number">None</param>
Expand Down Expand Up @@ -192,7 +192,7 @@ public void AddDefaultHeader(string key, string value)
}

/// <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>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="number">None</param>
Expand All @@ -214,7 +214,7 @@ public void TestEndpointParameters (double? number, double? _double, string _str
}

/// <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>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="number">None</param>
Expand Down Expand Up @@ -303,7 +303,7 @@ public ApiResponse<Object> TestEndpointParametersWithHttpInfo (double? number, d
}

/// <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>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="number">None</param>
Expand All @@ -326,7 +326,7 @@ public async System.Threading.Tasks.Task TestEndpointParametersAsync (double? nu
}

/// <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>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="number">None</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{AC0D0300-7030-473F-B672-17C40187815A}</ProjectGuid>
<ProjectGuid>{C075FB79-0DDE-43E3-9FA5-E239EE9B9B5A}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Swagger Library</RootNamespace>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ public partial class Animal : IEquatable<Animal>
/// Initializes a new instance of the <see cref="Animal" /> class.
/// </summary>
/// <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)
if (ClassName == null)
Expand All @@ -34,6 +35,16 @@ public Animal(string ClassName = null)
}


// use default value if no "Color" provided
if (Color == null)
{
this.Color = "red";
}
else
{
this.Color = Color;
}

}

/// <summary>
Expand All @@ -42,6 +53,11 @@ public Animal(string ClassName = null)
[DataMember(Name="className", EmitDefaultValue=false)]
public string ClassName { get; set; }
/// <summary>
/// Gets or Sets Color
/// </summary>
[DataMember(Name="color", EmitDefaultValue=false)]
public string Color { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
Expand All @@ -50,6 +66,7 @@ public override string ToString()
var sb = new StringBuilder();
sb.Append("class Animal {\n");
sb.Append(" ClassName: ").Append(ClassName).Append("\n");
sb.Append(" Color: ").Append(Color).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
Expand Down Expand Up @@ -90,6 +107,11 @@ public bool Equals(Animal other)
this.ClassName == other.ClassName ||
this.ClassName != null &&
this.ClassName.Equals(other.ClassName)
) &&
(
this.Color == other.Color ||
this.Color != null &&
this.Color.Equals(other.Color)
);
}

Expand All @@ -106,6 +128,8 @@ public override int GetHashCode()
// Suitable nullity checks etc, of course :)
if (this.ClassName != null)
hash = hash * 59 + this.ClassName.GetHashCode();
if (this.Color != null)
hash = hash * 59 + this.Color.GetHashCode();
return hash;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ public partial class Cat : Animal, IEquatable<Cat>
/// Initializes a new instance of the <see cref="Cat" /> class.
/// </summary>
/// <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, bool? Declawed = null)
public Cat(string ClassName = null, string Color = null, bool? Declawed = null)
{
// to ensure "ClassName" is required (not null)
if (ClassName == null)
Expand All @@ -35,6 +36,16 @@ public Cat(string ClassName = null, bool? Declawed = null)
}


// use default value if no "Color" provided
if (Color == null)
{
this.Color = "red";
}
else
{
this.Color = Color;
}

this.Declawed = Declawed;

}
Expand All @@ -45,6 +56,11 @@ public Cat(string ClassName = null, bool? Declawed = null)
[DataMember(Name="className", EmitDefaultValue=false)]
public string ClassName { get; set; }
/// <summary>
/// Gets or Sets Color
/// </summary>
[DataMember(Name="color", EmitDefaultValue=false)]
public string Color { get; set; }
/// <summary>
/// Gets or Sets Declawed
/// </summary>
[DataMember(Name="declawed", EmitDefaultValue=false)]
Expand All @@ -58,6 +74,7 @@ public override string ToString()
var sb = new StringBuilder();
sb.Append("class Cat {\n");
sb.Append(" ClassName: ").Append(ClassName).Append("\n");
sb.Append(" Color: ").Append(Color).Append("\n");
sb.Append(" Declawed: ").Append(Declawed).Append("\n");
sb.Append("}\n");
return sb.ToString();
Expand Down Expand Up @@ -100,6 +117,11 @@ public bool Equals(Cat other)
this.ClassName != null &&
this.ClassName.Equals(other.ClassName)
) &&
(
this.Color == other.Color ||
this.Color != null &&
this.Color.Equals(other.Color)
) &&
(
this.Declawed == other.Declawed ||
this.Declawed != null &&
Expand All @@ -120,6 +142,8 @@ public override int GetHashCode()
// Suitable nullity checks etc, of course :)
if (this.ClassName != null)
hash = hash * 59 + this.ClassName.GetHashCode();
if (this.Color != null)
hash = hash * 59 + this.Color.GetHashCode();
if (this.Declawed != null)
hash = hash * 59 + this.Declawed.GetHashCode();
return hash;
Expand Down
Loading