diff --git a/modules/swagger-codegen/src/main/resources/csharp/api.mustache b/modules/swagger-codegen/src/main/resources/csharp/api.mustache
index e6215d3e21a..24c65f85ba8 100644
--- a/modules/swagger-codegen/src/main/resources/csharp/api.mustache
+++ b/modules/swagger-codegen/src/main/resources/csharp/api.mustache
@@ -104,11 +104,11 @@ namespace {{packageName}}.Api
String postBody = null;
pathParams.Add("format", "json");
- {{#pathParams}} if ({{paramName}} != null) pathParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // path parameter
+ {{#pathParams}}if ({{paramName}} != null) pathParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // path parameter
{{/pathParams}}
- {{#queryParams}} if ({{paramName}} != null) queryParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // query parameter
+ {{#queryParams}}if ({{paramName}} != null) queryParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // query parameter
{{/queryParams}}
- {{#headerParams}} if ({{paramName}} != null) headerParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // header parameter
+ {{#headerParams}}if ({{paramName}} != null) headerParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // header parameter
{{/headerParams}}
{{#formParams}}if ({{paramName}} != null) {{#isFile}}fileParams.Add("{{baseName}}", ApiClient.ParameterToFile("{{baseName}}", {{paramName}}));{{/isFile}}{{^isFile}}formParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // form parameter{{/isFile}}
{{/formParams}}
@@ -150,11 +150,11 @@ namespace {{packageName}}.Api
String postBody = null;
pathParams.Add("format", "json");
- {{#pathParams}} if ({{paramName}} != null) pathParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // path parameter
+ {{#pathParams}}if ({{paramName}} != null) pathParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // path parameter
{{/pathParams}}
- {{#queryParams}} if ({{paramName}} != null) queryParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // query parameter
+ {{#queryParams}}if ({{paramName}} != null) queryParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // query parameter
{{/queryParams}}
- {{#headerParams}} if ({{paramName}} != null) headerParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // header parameter
+ {{#headerParams}}if ({{paramName}} != null) headerParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // header parameter
{{/headerParams}}
{{#formParams}}if ({{paramName}} != null) {{#isFile}}fileParams.Add("{{baseName}}", ApiClient.ParameterToFile("{{baseName}}", {{paramName}}));{{/isFile}}{{^isFile}}formParams.Add("{{baseName}}", ApiClient.ParameterToString({{paramName}})); // form parameter{{/isFile}}
{{/formParams}}
diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/PetApi.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/PetApi.cs
index 166d40b5656..9f3bb5501b5 100644
--- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/PetApi.cs
+++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/PetApi.cs
@@ -102,18 +102,18 @@ namespace IO.Swagger.Api
///
/// Deletes a pet
///
- ///
/// Pet id to delete
+ ///
///
- void DeletePet (string apiKey, long? petId);
+ void DeletePet (long? petId, string apiKey);
///
/// Deletes a pet
///
- ///
/// Pet id to delete
+ ///
///
- System.Threading.Tasks.Task DeletePetAsync (string apiKey, long? petId);
+ System.Threading.Tasks.Task DeletePetAsync (long? petId, string apiKey);
///
/// uploads an image
@@ -199,15 +199,16 @@ namespace IO.Swagger.Api
var path = "/pet";
- path = path.Replace("{format}", "json");
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
-
+
+ pathParams.Add("format", "json");
+
@@ -218,7 +219,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { "petstore_auth" };
// make the HTTP request
- IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling UpdatePet: " + response.Content, response.Content);
@@ -238,15 +239,16 @@ namespace IO.Swagger.Api
var path = "/pet";
- path = path.Replace("{format}", "json");
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
+ pathParams.Add("format", "json");
+
@@ -257,7 +259,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { "petstore_auth" };
// make the HTTP request
- IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling UpdatePet: " + response.Content, response.Content);
@@ -275,15 +277,16 @@ namespace IO.Swagger.Api
var path = "/pet";
- path = path.Replace("{format}", "json");
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
-
+
+ pathParams.Add("format", "json");
+
@@ -294,7 +297,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { "petstore_auth" };
// make the HTTP request
- IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling AddPet: " + response.Content, response.Content);
@@ -314,15 +317,16 @@ namespace IO.Swagger.Api
var path = "/pet";
- path = path.Replace("{format}", "json");
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
+ pathParams.Add("format", "json");
+
@@ -333,7 +337,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { "petstore_auth" };
// make the HTTP request
- IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling AddPet: " + response.Content, response.Content);
@@ -351,16 +355,17 @@ namespace IO.Swagger.Api
var path = "/pet/findByStatus";
- path = path.Replace("{format}", "json");
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
-
- if (status != null) queryParams.Add("status", ApiClient.ParameterToString(status)); // query parameter
+
+ pathParams.Add("format", "json");
+
+ if (status != null) queryParams.Add("status", ApiClient.ParameterToString(status)); // query parameter
@@ -370,7 +375,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { "petstore_auth" };
// make the HTTP request
- IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByStatus: " + response.Content, response.Content);
@@ -390,16 +395,17 @@ namespace IO.Swagger.Api
var path = "/pet/findByStatus";
- path = path.Replace("{format}", "json");
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
- if (status != null) queryParams.Add("status", ApiClient.ParameterToString(status)); // query parameter
+ pathParams.Add("format", "json");
+
+ if (status != null) queryParams.Add("status", ApiClient.ParameterToString(status)); // query parameter
@@ -409,7 +415,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { "petstore_auth" };
// make the HTTP request
- IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByStatus: " + response.Content, response.Content);
@@ -426,16 +432,17 @@ namespace IO.Swagger.Api
var path = "/pet/findByTags";
- path = path.Replace("{format}", "json");
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
-
- if (tags != null) queryParams.Add("tags", ApiClient.ParameterToString(tags)); // query parameter
+
+ pathParams.Add("format", "json");
+
+ if (tags != null) queryParams.Add("tags", ApiClient.ParameterToString(tags)); // query parameter
@@ -445,7 +452,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { "petstore_auth" };
// make the HTTP request
- IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByTags: " + response.Content, response.Content);
@@ -465,16 +472,17 @@ namespace IO.Swagger.Api
var path = "/pet/findByTags";
- path = path.Replace("{format}", "json");
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
- if (tags != null) queryParams.Add("tags", ApiClient.ParameterToString(tags)); // query parameter
+ pathParams.Add("format", "json");
+
+ if (tags != null) queryParams.Add("tags", ApiClient.ParameterToString(tags)); // query parameter
@@ -484,7 +492,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { "petstore_auth" };
// make the HTTP request
- IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByTags: " + response.Content, response.Content);
@@ -504,16 +512,17 @@ namespace IO.Swagger.Api
var path = "/pet/{petId}";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId));
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
-
+
+ pathParams.Add("format", "json");
+ if (petId != null) pathParams.Add("petId", ApiClient.ParameterToString(petId)); // path parameter
+
@@ -523,7 +532,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { "api_key", "petstore_auth" };
// make the HTTP request
- IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling GetPetById: " + response.Content, response.Content);
@@ -545,16 +554,17 @@ namespace IO.Swagger.Api
var path = "/pet/{petId}";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId));
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
+ pathParams.Add("format", "json");
+ if (petId != null) pathParams.Add("petId", ApiClient.ParameterToString(petId)); // path parameter
+
@@ -564,7 +574,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { "api_key", "petstore_auth" };
// make the HTTP request
- IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling GetPetById: " + response.Content, response.Content);
@@ -586,16 +596,17 @@ namespace IO.Swagger.Api
var path = "/pet/{petId}";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId));
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
-
+
+ pathParams.Add("format", "json");
+ if (petId != null) pathParams.Add("petId", ApiClient.ParameterToString(petId)); // path parameter
+
if (name != null) formParams.Add("name", ApiClient.ParameterToString(name)); // form parameter
@@ -607,7 +618,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { "petstore_auth" };
// make the HTTP request
- IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling UpdatePetWithForm: " + response.Content, response.Content);
@@ -631,16 +642,17 @@ namespace IO.Swagger.Api
var path = "/pet/{petId}";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId));
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
+ pathParams.Add("format", "json");
+ if (petId != null) pathParams.Add("petId", ApiClient.ParameterToString(petId)); // path parameter
+
if (name != null) formParams.Add("name", ApiClient.ParameterToString(name)); // form parameter
@@ -652,7 +664,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { "petstore_auth" };
// make the HTTP request
- IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling UpdatePetWithForm: " + response.Content, response.Content);
@@ -663,10 +675,10 @@ namespace IO.Swagger.Api
///
/// Deletes a pet
///
- ///
/// Pet id to delete
+ ///
///
- public void DeletePet (string apiKey, long? petId)
+ public void DeletePet (long? petId, string apiKey)
{
// verify the required parameter 'petId' is set
@@ -674,18 +686,19 @@ namespace IO.Swagger.Api
var path = "/pet/{petId}";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId));
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
-
+
+ pathParams.Add("format", "json");
+ if (petId != null) pathParams.Add("petId", ApiClient.ParameterToString(petId)); // path parameter
- if (apiKey != null) headerParams.Add("api_key", ApiClient.ParameterToString(apiKey)); // header parameter
+
+ if (apiKey != null) headerParams.Add("api_key", ApiClient.ParameterToString(apiKey)); // header parameter
@@ -694,7 +707,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { "petstore_auth" };
// make the HTTP request
- IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling DeletePet: " + response.Content, response.Content);
@@ -707,28 +720,29 @@ namespace IO.Swagger.Api
///
/// Deletes a pet
///
- ///
/// Pet id to delete
+ ///
///
- public async System.Threading.Tasks.Task DeletePetAsync (string apiKey, long? petId)
+ public async System.Threading.Tasks.Task DeletePetAsync (long? petId, string apiKey)
{
// verify the required parameter 'petId' is set
if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling DeletePet");
var path = "/pet/{petId}";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId));
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
+ pathParams.Add("format", "json");
+ if (petId != null) pathParams.Add("petId", ApiClient.ParameterToString(petId)); // path parameter
- if (apiKey != null) headerParams.Add("api_key", ApiClient.ParameterToString(apiKey)); // header parameter
+
+ if (apiKey != null) headerParams.Add("api_key", ApiClient.ParameterToString(apiKey)); // header parameter
@@ -737,7 +751,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { "petstore_auth" };
// make the HTTP request
- IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling DeletePet: " + response.Content, response.Content);
@@ -760,16 +774,17 @@ namespace IO.Swagger.Api
var path = "/pet/{petId}/uploadImage";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId));
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
-
+
+ pathParams.Add("format", "json");
+ if (petId != null) pathParams.Add("petId", ApiClient.ParameterToString(petId)); // path parameter
+
if (additionalMetadata != null) formParams.Add("additionalMetadata", ApiClient.ParameterToString(additionalMetadata)); // form parameter
@@ -781,7 +796,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { "petstore_auth" };
// make the HTTP request
- IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling UploadFile: " + response.Content, response.Content);
@@ -805,16 +820,17 @@ namespace IO.Swagger.Api
var path = "/pet/{petId}/uploadImage";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId));
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
+ pathParams.Add("format", "json");
+ if (petId != null) pathParams.Add("petId", ApiClient.ParameterToString(petId)); // path parameter
+
if (additionalMetadata != null) formParams.Add("additionalMetadata", ApiClient.ParameterToString(additionalMetadata)); // form parameter
@@ -826,7 +842,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { "petstore_auth" };
// make the HTTP request
- IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling UploadFile: " + response.Content, response.Content);
diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/StoreApi.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/StoreApi.cs
index 74d14e7ffe2..6dfd81bd99d 100644
--- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/StoreApi.cs
+++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/StoreApi.cs
@@ -130,15 +130,16 @@ namespace IO.Swagger.Api
var path = "/store/inventory";
- path = path.Replace("{format}", "json");
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
-
+
+ pathParams.Add("format", "json");
+
@@ -148,7 +149,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { "api_key" };
// make the HTTP request
- IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling GetInventory: " + response.Content, response.Content);
@@ -167,15 +168,16 @@ namespace IO.Swagger.Api
var path = "/store/inventory";
- path = path.Replace("{format}", "json");
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
+ pathParams.Add("format", "json");
+
@@ -185,7 +187,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { "api_key" };
// make the HTTP request
- IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling GetInventory: " + response.Content, response.Content);
@@ -202,15 +204,16 @@ namespace IO.Swagger.Api
var path = "/store/order";
- path = path.Replace("{format}", "json");
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
-
+
+ pathParams.Add("format", "json");
+
@@ -221,7 +224,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { };
// make the HTTP request
- IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling PlaceOrder: " + response.Content, response.Content);
@@ -241,15 +244,16 @@ namespace IO.Swagger.Api
var path = "/store/order";
- path = path.Replace("{format}", "json");
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
+ pathParams.Add("format", "json");
+
@@ -260,7 +264,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { };
// make the HTTP request
- IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling PlaceOrder: " + response.Content, response.Content);
@@ -280,16 +284,17 @@ namespace IO.Swagger.Api
var path = "/store/order/{orderId}";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "orderId" + "}", ApiClient.ParameterToString(orderId));
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
-
+
+ pathParams.Add("format", "json");
+ if (orderId != null) pathParams.Add("orderId", ApiClient.ParameterToString(orderId)); // path parameter
+
@@ -299,7 +304,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { };
// make the HTTP request
- IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling GetOrderById: " + response.Content, response.Content);
@@ -321,16 +326,17 @@ namespace IO.Swagger.Api
var path = "/store/order/{orderId}";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "orderId" + "}", ApiClient.ParameterToString(orderId));
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
+ pathParams.Add("format", "json");
+ if (orderId != null) pathParams.Add("orderId", ApiClient.ParameterToString(orderId)); // path parameter
+
@@ -340,7 +346,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { };
// make the HTTP request
- IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling GetOrderById: " + response.Content, response.Content);
@@ -360,16 +366,17 @@ namespace IO.Swagger.Api
var path = "/store/order/{orderId}";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "orderId" + "}", ApiClient.ParameterToString(orderId));
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
-
+
+ pathParams.Add("format", "json");
+ if (orderId != null) pathParams.Add("orderId", ApiClient.ParameterToString(orderId)); // path parameter
+
@@ -379,7 +386,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { };
// make the HTTP request
- IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling DeleteOrder: " + response.Content, response.Content);
@@ -401,16 +408,17 @@ namespace IO.Swagger.Api
var path = "/store/order/{orderId}";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "orderId" + "}", ApiClient.ParameterToString(orderId));
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
+ pathParams.Add("format", "json");
+ if (orderId != null) pathParams.Add("orderId", ApiClient.ParameterToString(orderId)); // path parameter
+
@@ -420,7 +428,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { };
// make the HTTP request
- IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling DeleteOrder: " + response.Content, response.Content);
diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/UserApi.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/UserApi.cs
index b69bd7be58b..1ca200137a2 100644
--- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/UserApi.cs
+++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Api/UserApi.cs
@@ -191,15 +191,16 @@ namespace IO.Swagger.Api
var path = "/user";
- path = path.Replace("{format}", "json");
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
-
+
+ pathParams.Add("format", "json");
+
@@ -210,7 +211,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { };
// make the HTTP request
- IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling CreateUser: " + response.Content, response.Content);
@@ -230,15 +231,16 @@ namespace IO.Swagger.Api
var path = "/user";
- path = path.Replace("{format}", "json");
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
+ pathParams.Add("format", "json");
+
@@ -249,7 +251,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { };
// make the HTTP request
- IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling CreateUser: " + response.Content, response.Content);
@@ -267,15 +269,16 @@ namespace IO.Swagger.Api
var path = "/user/createWithArray";
- path = path.Replace("{format}", "json");
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
-
+
+ pathParams.Add("format", "json");
+
@@ -286,7 +289,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { };
// make the HTTP request
- IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithArrayInput: " + response.Content, response.Content);
@@ -306,15 +309,16 @@ namespace IO.Swagger.Api
var path = "/user/createWithArray";
- path = path.Replace("{format}", "json");
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
+ pathParams.Add("format", "json");
+
@@ -325,7 +329,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { };
// make the HTTP request
- IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithArrayInput: " + response.Content, response.Content);
@@ -343,15 +347,16 @@ namespace IO.Swagger.Api
var path = "/user/createWithList";
- path = path.Replace("{format}", "json");
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
-
+
+ pathParams.Add("format", "json");
+
@@ -362,7 +367,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { };
// make the HTTP request
- IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithListInput: " + response.Content, response.Content);
@@ -382,15 +387,16 @@ namespace IO.Swagger.Api
var path = "/user/createWithList";
- path = path.Replace("{format}", "json");
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
+ pathParams.Add("format", "json");
+
@@ -401,7 +407,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { };
// make the HTTP request
- IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling CreateUsersWithListInput: " + response.Content, response.Content);
@@ -420,17 +426,18 @@ namespace IO.Swagger.Api
var path = "/user/login";
- path = path.Replace("{format}", "json");
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
-
- if (username != null) queryParams.Add("username", ApiClient.ParameterToString(username)); // query parameter
- if (password != null) queryParams.Add("password", ApiClient.ParameterToString(password)); // query parameter
+
+ pathParams.Add("format", "json");
+
+ if (username != null) queryParams.Add("username", ApiClient.ParameterToString(username)); // query parameter
+ if (password != null) queryParams.Add("password", ApiClient.ParameterToString(password)); // query parameter
@@ -440,7 +447,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { };
// make the HTTP request
- IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling LoginUser: " + response.Content, response.Content);
@@ -461,17 +468,18 @@ namespace IO.Swagger.Api
var path = "/user/login";
- path = path.Replace("{format}", "json");
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
- if (username != null) queryParams.Add("username", ApiClient.ParameterToString(username)); // query parameter
- if (password != null) queryParams.Add("password", ApiClient.ParameterToString(password)); // query parameter
+ pathParams.Add("format", "json");
+
+ if (username != null) queryParams.Add("username", ApiClient.ParameterToString(username)); // query parameter
+ if (password != null) queryParams.Add("password", ApiClient.ParameterToString(password)); // query parameter
@@ -481,7 +489,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { };
// make the HTTP request
- IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling LoginUser: " + response.Content, response.Content);
@@ -497,15 +505,16 @@ namespace IO.Swagger.Api
var path = "/user/logout";
- path = path.Replace("{format}", "json");
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
-
+
+ pathParams.Add("format", "json");
+
@@ -515,7 +524,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { };
// make the HTTP request
- IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling LogoutUser: " + response.Content, response.Content);
@@ -534,15 +543,16 @@ namespace IO.Swagger.Api
var path = "/user/logout";
- path = path.Replace("{format}", "json");
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
+ pathParams.Add("format", "json");
+
@@ -552,7 +562,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { };
// make the HTTP request
- IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling LogoutUser: " + response.Content, response.Content);
@@ -573,16 +583,17 @@ namespace IO.Swagger.Api
var path = "/user/{username}";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username));
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
-
+
+ pathParams.Add("format", "json");
+ if (username != null) pathParams.Add("username", ApiClient.ParameterToString(username)); // path parameter
+
@@ -592,7 +603,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { };
// make the HTTP request
- IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling GetUserByName: " + response.Content, response.Content);
@@ -614,16 +625,17 @@ namespace IO.Swagger.Api
var path = "/user/{username}";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username));
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
+ pathParams.Add("format", "json");
+ if (username != null) pathParams.Add("username", ApiClient.ParameterToString(username)); // path parameter
+
@@ -633,7 +645,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { };
// make the HTTP request
- IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling GetUserByName: " + response.Content, response.Content);
@@ -654,16 +666,17 @@ namespace IO.Swagger.Api
var path = "/user/{username}";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username));
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
-
+
+ pathParams.Add("format", "json");
+ if (username != null) pathParams.Add("username", ApiClient.ParameterToString(username)); // path parameter
+
@@ -674,7 +687,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { };
// make the HTTP request
- IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling UpdateUser: " + response.Content, response.Content);
@@ -697,16 +710,17 @@ namespace IO.Swagger.Api
var path = "/user/{username}";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username));
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
+ pathParams.Add("format", "json");
+ if (username != null) pathParams.Add("username", ApiClient.ParameterToString(username)); // path parameter
+
@@ -717,7 +731,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { };
// make the HTTP request
- IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling UpdateUser: " + response.Content, response.Content);
@@ -738,16 +752,17 @@ namespace IO.Swagger.Api
var path = "/user/{username}";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username));
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
-
+
+ pathParams.Add("format", "json");
+ if (username != null) pathParams.Add("username", ApiClient.ParameterToString(username)); // path parameter
+
@@ -757,7 +772,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { };
// make the HTTP request
- IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling DeleteUser: " + response.Content, response.Content);
@@ -779,16 +794,17 @@ namespace IO.Swagger.Api
var path = "/user/{username}";
- path = path.Replace("{format}", "json");
- path = path.Replace("{" + "username" + "}", ApiClient.ParameterToString(username));
-
+ var pathParams = new Dictionary();
var queryParams = new Dictionary();
var headerParams = new Dictionary();
var formParams = new Dictionary();
var fileParams = new Dictionary();
String postBody = null;
+ pathParams.Add("format", "json");
+ if (username != null) pathParams.Add("username", ApiClient.ParameterToString(username)); // path parameter
+
@@ -798,7 +814,7 @@ namespace IO.Swagger.Api
String[] authSettings = new String[] { };
// make the HTTP request
- IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
+ IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling DeleteUser: " + response.Content, response.Content);
diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Client/ApiClient.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Client/ApiClient.cs
index 117cd598008..2ba6e4380a9 100644
--- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Client/ApiClient.cs
+++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Client/ApiClient.cs
@@ -50,23 +50,12 @@ namespace IO.Swagger.Client
get { return _defaultHeaderMap; }
}
- ///
- /// Makes the HTTP request (Sync).
- ///
- /// URL path.
- /// HTTP method.
- /// Query parameters.
- /// HTTP body (POST request).
- /// Header parameters.
- /// Form parameters.
- /// File parameters.
- /// Authentication settings.
- /// Object
- public Object CallApi(String path, RestSharp.Method method, Dictionary queryParams, String postBody,
- Dictionary headerParams, Dictionary formParams,
- Dictionary fileParams, String[] authSettings)
+ // Creates and sets up a RestRequest prior to a call.
+ private RestRequest PrepareRequest(
+ String path, RestSharp.Method method, Dictionary queryParams, String postBody,
+ Dictionary headerParams, Dictionary formParams,
+ Dictionary fileParams, Dictionary pathParams, String[] authSettings)
{
-
var request = new RestRequest(path, method);
UpdateParamsForAuth(queryParams, headerParams, authSettings);
@@ -75,6 +64,10 @@ namespace IO.Swagger.Client
foreach(var defaultHeader in _defaultHeaderMap)
request.AddHeader(defaultHeader.Key, defaultHeader.Value);
+ // add path parameter, if any
+ foreach(var param in pathParams)
+ request.AddParameter(param.Key, param.Value, ParameterType.UrlSegment);
+
// add header parameter, if any
foreach(var param in headerParams)
request.AddHeader(param.Key, param.Value);
@@ -93,9 +86,31 @@ namespace IO.Swagger.Client
if (postBody != null) // http body (model) parameter
request.AddParameter("application/json", postBody, ParameterType.RequestBody);
+
+ return request;
+ }
+ ///
+ /// Makes the HTTP request (Sync).
+ ///
+ /// URL path.
+ /// HTTP method.
+ /// Query parameters.
+ /// HTTP body (POST request).
+ /// Header parameters.
+ /// Form parameters.
+ /// File parameters.
+ /// Path parameters.
+ /// Authentication settings.
+ /// Object
+ public Object CallApi(
+ String path, RestSharp.Method method, Dictionary queryParams, String postBody,
+ Dictionary headerParams, Dictionary formParams,
+ Dictionary fileParams, Dictionary pathParams, String[] authSettings)
+ {
+ var request = PrepareRequest(
+ path, method, queryParams, postBody, headerParams, formParams, fileParams, pathParams, authSettings);
return (Object)RestClient.Execute(request);
-
}
///
@@ -108,39 +123,16 @@ namespace IO.Swagger.Client
/// Header parameters.
/// Form parameters.
/// File parameters.
+ /// Path parameters.
/// Authentication settings.
/// The Task instance.
- public async System.Threading.Tasks.Task