Merge branch 'cs/req_properties_2584' of https://github.com/jimschubert/swagger-codegen into jimschubert-cs/req_properties_2584

Conflicts:
	samples/client/petstore/csharp/SwaggerClient/IO.Swagger.sln
	samples/client/petstore/csharp/SwaggerClient/README.md
	samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/IO.Swagger.Test.csproj
	samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/IO.Swagger.csproj
This commit is contained in:
wing328
2016-05-13 21:49:16 +08:00
14 changed files with 77 additions and 10 deletions

View File

@@ -18,6 +18,11 @@ namespace IO.Swagger.Client
/// </summary>
public class ApiClient
{
private JsonSerializerSettings serializerSettings = new JsonSerializerSettings
{
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor
};
/// <summary>
/// Initializes a new instance of the <see cref="ApiClient" /> class
/// with default configuration and base path (http://petstore.swagger.io/v2).
@@ -289,7 +294,7 @@ namespace IO.Swagger.Client
// at this point, it must be a model (json)
try
{
return JsonConvert.DeserializeObject(response.Content, type);
return JsonConvert.DeserializeObject(response.Content, type, serializerSettings);
}
catch (Exception e)
{

View File

@@ -17,6 +17,11 @@ namespace IO.Swagger.Model
[DataContract]
public partial class Animal : IEquatable<Animal>
{
/// <summary>
/// Initializes a new instance of the <see cref="Animal" /> class.
/// </summary>
[JsonConstructorAttribute]
protected Animal() { }
/// <summary>
/// Initializes a new instance of the <see cref="Animal" /> class.
/// </summary>

View File

@@ -17,6 +17,11 @@ namespace IO.Swagger.Model
[DataContract]
public partial class Cat : Animal, IEquatable<Cat>
{
/// <summary>
/// Initializes a new instance of the <see cref="Cat" /> class.
/// </summary>
[JsonConstructorAttribute]
protected Cat() { }
/// <summary>
/// Initializes a new instance of the <see cref="Cat" /> class.
/// </summary>

View File

@@ -17,6 +17,11 @@ namespace IO.Swagger.Model
[DataContract]
public partial class Dog : Animal, IEquatable<Dog>
{
/// <summary>
/// Initializes a new instance of the <see cref="Dog" /> class.
/// </summary>
[JsonConstructorAttribute]
protected Dog() { }
/// <summary>
/// Initializes a new instance of the <see cref="Dog" /> class.
/// </summary>

View File

@@ -17,6 +17,11 @@ namespace IO.Swagger.Model
[DataContract]
public partial class FormatTest : IEquatable<FormatTest>
{
/// <summary>
/// Initializes a new instance of the <see cref="FormatTest" /> class.
/// </summary>
[JsonConstructorAttribute]
protected FormatTest() { }
/// <summary>
/// Initializes a new instance of the <see cref="FormatTest" /> class.
/// </summary>

View File

@@ -17,6 +17,11 @@ namespace IO.Swagger.Model
[DataContract]
public partial class Name : IEquatable<Name>
{
/// <summary>
/// Initializes a new instance of the <see cref="Name" /> class.
/// </summary>
[JsonConstructorAttribute]
protected Name() { }
/// <summary>
/// Initializes a new instance of the <see cref="Name" /> class.
/// </summary>

View File

@@ -53,6 +53,11 @@ namespace IO.Swagger.Model
/// <summary>
/// Initializes a new instance of the <see cref="Pet" /> class.
/// </summary>
[JsonConstructorAttribute]
protected Pet() { }
/// <summary>
/// Initializes a new instance of the <see cref="Pet" /> class.
/// </summary>
/// <param name="Id">Id.</param>
/// <param name="Category">Category.</param>
/// <param name="Name">Name (required).</param>