diff --git a/modules/swagger-codegen/src/main/resources/csharp/api.mustache b/modules/swagger-codegen/src/main/resources/csharp/api.mustache
index e5b497b31e..18c675d635 100644
--- a/modules/swagger-codegen/src/main/resources/csharp/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/csharp/api.mustache
@@ -178,14 +178,15 @@ namespace {{packageName}}.Api
{{/allParams}}/// ApiResponse of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object(void){{/returnType}}
public ApiResponse<{{#returnType}} {{{returnType}}} {{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
{
- {{#allParams}}{{#required}}
+ {{#allParams}}
+ {{#required}}
// verify the required parameter '{{paramName}}' is set
if ({{paramName}} == null)
throw new ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}");
- {{/required}}{{/allParams}}
+ {{/required}}
+ {{/allParams}}
var localVarPath = "{{path}}";
-
var localVarPathParams = new Dictionary();
var localVarQueryParams = new Dictionary();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
@@ -195,13 +196,17 @@ namespace {{packageName}}.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
- {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
+ {{#consumes}}
+ "{{mediaType}}"{{#hasMore}}, {{/hasMore}}
+ {{/consumes}}
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
- {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
+ {{#produces}}
+ "{{mediaType}}"{{#hasMore}}, {{/hasMore}}
+ {{/produces}}
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -210,38 +215,53 @@ namespace {{packageName}}.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
- {{#pathParams}}if ({{paramName}} != null) localVarPathParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // path parameter
+ {{#pathParams}}
+ if ({{paramName}} != null) localVarPathParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // path parameter
{{/pathParams}}
- {{#queryParams}}if ({{paramName}} != null) localVarQueryParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // query parameter
+ {{#queryParams}}
+ if ({{paramName}} != null) localVarQueryParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // query parameter
{{/queryParams}}
- {{#headerParams}}if ({{paramName}} != null) localVarHeaderParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // header parameter
+ {{#headerParams}}
+ if ({{paramName}} != null) localVarHeaderParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // header parameter
{{/headerParams}}
- {{#formParams}}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}}
+ 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[]))
+ {{#bodyParam}}
+ if ({{paramName}}.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize({{paramName}}); // http body (model) parameter
}
else
{
localVarPostBody = {{paramName}}; // byte array
- }{{/bodyParam}}
+ }
+ {{/bodyParam}}
- {{#authMethods}}// authentication ({{name}}) required
- {{#isApiKey}}{{#isKeyInHeader}}
+ {{#authMethods}}
+ // authentication ({{name}}) required
+ {{#isApiKey}}
+ {{#isKeyInHeader}}
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("{{keyParamName}}")))
{
localVarHeaderParams["{{keyParamName}}"] = Configuration.GetApiKeyWithPrefix("{{keyParamName}}");
- }{{/isKeyInHeader}}{{#isKeyInQuery}}
+ }
+ {{/isKeyInHeader}}
+ {{#isKeyInQuery}}
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("{{keyParamName}}")))
{
localVarQueryParams["{{keyParamName}}"] = Configuration.GetApiKeyWithPrefix("{{keyParamName}}");
- }{{/isKeyInQuery}}{{/isApiKey}}{{#isBasic}}
+ }
+ {{/isKeyInQuery}}
+ {{/isApiKey}}
+ {{#isBasic}}
// http basic authentication required
if (!String.IsNullOrEmpty(Configuration.Username) || !String.IsNullOrEmpty(Configuration.Password))
{
localVarHeaderParams["Authorization"] = "Basic " + ApiClient.Base64Encode(Configuration.Username + ":" + Configuration.Password);
- }{{/isBasic}}{{#isOAuth}}
+ }
+ {{/isBasic}}
+ {{#isOAuth}}
// oauth required
if (!String.IsNullOrEmpty(Configuration.AccessToken))
{
@@ -291,12 +311,15 @@ namespace {{packageName}}.Api
{{/allParams}}/// Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}}
public async System.Threading.Tasks.Task> {{operationId}}AsyncWithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
{
- {{#allParams}}{{#required}}// verify the required parameter '{{paramName}}' is set
- if ({{paramName}} == null) throw new ApiException(400, "Missing required parameter '{{paramName}}' when calling {{operationId}}");
- {{/required}}{{/allParams}}
+ {{#allParams}}
+ {{#required}}
+ // verify the required parameter '{{paramName}}' is set
+ if ({{paramName}} == null)
+ throw new ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}");
+ {{/required}}
+ {{/allParams}}
var localVarPath = "{{path}}";
-
var localVarPathParams = new Dictionary();
var localVarQueryParams = new Dictionary();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
@@ -306,13 +329,17 @@ namespace {{packageName}}.Api
// to determine the Content-Type header
String[] localVarHttpContentTypes = new String[] {
- {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
+ {{#consumes}}
+ "{{mediaType}}"{{#hasMore}}, {{/hasMore}}
+ {{/consumes}}
};
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
- {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
+ {{#produces}}
+ "{{mediaType}}"{{#hasMore}}, {{/hasMore}}
+ {{/produces}}
};
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -321,44 +348,59 @@ namespace {{packageName}}.Api
// set "format" to json by default
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
localVarPathParams.Add("format", "json");
- {{#pathParams}}if ({{paramName}} != null) localVarPathParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // path parameter
+ {{#pathParams}}
+ if ({{paramName}} != null) localVarPathParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // path parameter
{{/pathParams}}
- {{#queryParams}}if ({{paramName}} != null) localVarQueryParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // query parameter
+ {{#queryParams}}
+ if ({{paramName}} != null) localVarQueryParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // query parameter
{{/queryParams}}
- {{#headerParams}}if ({{paramName}} != null) localVarHeaderParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // header parameter
+ {{#headerParams}}
+ if ({{paramName}} != null) localVarHeaderParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // header parameter
{{/headerParams}}
- {{#formParams}}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}}
+ 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[]))
+ {{#bodyParam}}
+ if ({{paramName}}.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize({{paramName}}); // http body (model) parameter
}
else
{
localVarPostBody = {{paramName}}; // byte array
- }{{/bodyParam}}
+ }
+ {{/bodyParam}}
{{#authMethods}}
// authentication ({{name}}) required
- {{#isApiKey}}{{#isKeyInHeader}}
+ {{#isApiKey}}
+ {{#isKeyInHeader}}
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("{{keyParamName}}")))
{
localVarHeaderParams["{{keyParamName}}"] = Configuration.GetApiKeyWithPrefix("{{keyParamName}}");
- }{{/isKeyInHeader}}{{#isKeyInQuery}}
+ }
+ {{/isKeyInHeader}}
+ {{#isKeyInQuery}}
if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("{{keyParamName}}")))
{
localVarQueryParams["{{keyParamName}}"] = Configuration.GetApiKeyWithPrefix("{{keyParamName}}");
- }{{/isKeyInQuery}}{{/isApiKey}}{{#isBasic}}
+ }
+ {{/isKeyInQuery}}
+ {{/isApiKey}}
+ {{#isBasic}}
// http basic authentication required
if (!String.IsNullOrEmpty(Configuration.Username) || !String.IsNullOrEmpty(Configuration.Password))
{
localVarHeaderParams["Authorization"] = "Basic " + ApiClient.Base64Encode(Configuration.Username + ":" + Configuration.Password);
- }{{/isBasic}}{{#isOAuth}}
+ }
+ {{/isBasic}}
+ {{#isOAuth}}
// oauth required
if (!String.IsNullOrEmpty(Configuration.AccessToken))
{
localVarHeaderParams["Authorization"] = "Bearer " + Configuration.AccessToken;
- }{{/isOAuth}}
+ }
+ {{/isOAuth}}
{{/authMethods}}
// make the HTTP request
@@ -379,7 +421,9 @@ namespace {{packageName}}.Api
{{^returnType}}return new ApiResponse