Merge branch 'csharp-bug' of https://github.com/guohuang/swagger-codegen into guohuang-csharp-bug

This commit is contained in:
wing328
2016-05-10 20:01:44 +08:00
4 changed files with 16 additions and 16 deletions

View File

@@ -227,7 +227,7 @@ namespace {{packageName}}.Api
if ({{paramName}} != null) {{#isFile}}localVarFileParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToFile("{{baseName}}", {{paramName}}));{{/isFile}}{{^isFile}}localVarFormParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // form parameter{{/isFile}}
{{/formParams}}
{{#bodyParam}}
if ({{paramName}}.GetType() != typeof(byte[]))
if ({{paramName}} != null && {{paramName}}.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize({{paramName}}); // http body (model) parameter
}
@@ -360,7 +360,7 @@ namespace {{packageName}}.Api
if ({{paramName}} != null) {{#isFile}}localVarFileParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToFile("{{baseName}}", {{paramName}}));{{/isFile}}{{^isFile}}localVarFormParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // form parameter{{/isFile}}
{{/formParams}}
{{#bodyParam}}
if ({{paramName}}.GetType() != typeof(byte[]))
if ({{paramName}} != null && {{paramName}}.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize({{paramName}}); // http body (model) parameter
}

View File

@@ -512,7 +512,7 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (body.GetType() != typeof(byte[]))
if (body != null && body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
@@ -597,7 +597,7 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (body.GetType() != typeof(byte[]))
if (body != null && body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
@@ -1296,7 +1296,7 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (body.GetType() != typeof(byte[]))
if (body != null && body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
@@ -1381,7 +1381,7 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (body.GetType() != typeof(byte[]))
if (body != null && body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}

View File

@@ -737,7 +737,7 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (body.GetType() != typeof(byte[]))
if (body != null && body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
@@ -815,7 +815,7 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (body.GetType() != typeof(byte[]))
if (body != null && body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}

View File

@@ -494,7 +494,7 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (body.GetType() != typeof(byte[]))
if (body != null && body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
@@ -571,7 +571,7 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (body.GetType() != typeof(byte[]))
if (body != null && body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
@@ -647,7 +647,7 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (body.GetType() != typeof(byte[]))
if (body != null && body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
@@ -724,7 +724,7 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (body.GetType() != typeof(byte[]))
if (body != null && body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
@@ -800,7 +800,7 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (body.GetType() != typeof(byte[]))
if (body != null && body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
@@ -877,7 +877,7 @@ namespace IO.Swagger.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (body.GetType() != typeof(byte[]))
if (body != null && body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
@@ -1519,7 +1519,7 @@ namespace IO.Swagger.Api
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter
if (body.GetType() != typeof(byte[]))
if (body != null && body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}
@@ -1602,7 +1602,7 @@ namespace IO.Swagger.Api
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
if (username != null) localVarPathParams.Add("username", Configuration.ApiClient.ParameterToString(username)); // path parameter
if (body.GetType() != typeof(byte[]))
if (body != null && body.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
}