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 4e7e84fb725..00bd7a5e9f2 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 @@ -248,7 +248,7 @@ namespace IO.Swagger.Api { - var path = "/pet"; + var path_ = "/pet"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -279,7 +279,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, pathParams, 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); @@ -298,7 +298,7 @@ namespace IO.Swagger.Api { - var path = "/pet"; + var path_ = "/pet"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -329,7 +329,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, pathParams, 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); @@ -346,7 +346,7 @@ namespace IO.Swagger.Api { - var path = "/pet"; + var path_ = "/pet"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -377,7 +377,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, pathParams, 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); @@ -396,7 +396,7 @@ namespace IO.Swagger.Api { - var path = "/pet"; + var path_ = "/pet"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -427,7 +427,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, pathParams, 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); @@ -444,7 +444,7 @@ namespace IO.Swagger.Api { - var path = "/pet/findByStatus"; + var path_ = "/pet/findByStatus"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -475,14 +475,14 @@ 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, pathParams, 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); else if (((int)response.StatusCode) == 0) throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByStatus: " + response.ErrorMessage, response.ErrorMessage); - return (List) ApiClient.Deserialize(response.Content, typeof(List), response.Headers); + return (List) ApiClient.Deserialize(response, typeof(List)); } /// @@ -494,7 +494,7 @@ namespace IO.Swagger.Api { - var path = "/pet/findByStatus"; + var path_ = "/pet/findByStatus"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -525,11 +525,11 @@ 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, pathParams, 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); - return (List) ApiClient.Deserialize(response.Content, typeof(List), response.Headers); + return (List) ApiClient.Deserialize(response, typeof(List)); } /// @@ -541,7 +541,7 @@ namespace IO.Swagger.Api { - var path = "/pet/findByTags"; + var path_ = "/pet/findByTags"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -572,14 +572,14 @@ 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, pathParams, 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); else if (((int)response.StatusCode) == 0) throw new ApiException ((int)response.StatusCode, "Error calling FindPetsByTags: " + response.ErrorMessage, response.ErrorMessage); - return (List) ApiClient.Deserialize(response.Content, typeof(List), response.Headers); + return (List) ApiClient.Deserialize(response, typeof(List)); } /// @@ -591,7 +591,7 @@ namespace IO.Swagger.Api { - var path = "/pet/findByTags"; + var path_ = "/pet/findByTags"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -622,11 +622,11 @@ 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, pathParams, 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); - return (List) ApiClient.Deserialize(response.Content, typeof(List), response.Headers); + return (List) ApiClient.Deserialize(response, typeof(List)); } /// @@ -641,7 +641,7 @@ namespace IO.Swagger.Api if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling GetPetById"); - var path = "/pet/{petId}"; + var path_ = "/pet/{petId}"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -669,17 +669,17 @@ namespace IO.Swagger.Api // authentication setting, if any - String[] authSettings = new String[] { "api_key", "petstore_auth" }; + String[] authSettings = new String[] { "api_key" }; // make the HTTP request - IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, 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); else if (((int)response.StatusCode) == 0) throw new ApiException ((int)response.StatusCode, "Error calling GetPetById: " + response.ErrorMessage, response.ErrorMessage); - return (Pet) ApiClient.Deserialize(response.Content, typeof(Pet), response.Headers); + return (Pet) ApiClient.Deserialize(response, typeof(Pet)); } /// @@ -693,7 +693,7 @@ namespace IO.Swagger.Api if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling GetPetById"); - var path = "/pet/{petId}"; + var path_ = "/pet/{petId}"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -721,14 +721,14 @@ namespace IO.Swagger.Api // authentication setting, if any - String[] authSettings = new String[] { "api_key", "petstore_auth" }; + String[] authSettings = new String[] { "api_key" }; // make the HTTP request - IRestResponse response = (IRestResponse) await ApiClient.CallApiAsync(path, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams, 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); - return (Pet) ApiClient.Deserialize(response.Content, typeof(Pet), response.Headers); + return (Pet) ApiClient.Deserialize(response, typeof(Pet)); } /// @@ -745,7 +745,7 @@ namespace IO.Swagger.Api if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UpdatePetWithForm"); - var path = "/pet/{petId}"; + var path_ = "/pet/{petId}"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -778,7 +778,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, pathParams, 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); @@ -801,7 +801,7 @@ namespace IO.Swagger.Api if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UpdatePetWithForm"); - var path = "/pet/{petId}"; + var path_ = "/pet/{petId}"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -834,7 +834,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, pathParams, 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); @@ -855,7 +855,7 @@ namespace IO.Swagger.Api if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling DeletePet"); - var path = "/pet/{petId}"; + var path_ = "/pet/{petId}"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -887,7 +887,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, pathParams, 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); @@ -909,7 +909,7 @@ namespace IO.Swagger.Api if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling DeletePet"); - var path = "/pet/{petId}"; + var path_ = "/pet/{petId}"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -941,7 +941,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, pathParams, 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); @@ -963,7 +963,7 @@ namespace IO.Swagger.Api if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UploadFile"); - var path = "/pet/{petId}/uploadImage"; + var path_ = "/pet/{petId}/uploadImage"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -996,7 +996,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, pathParams, 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); @@ -1019,7 +1019,7 @@ namespace IO.Swagger.Api if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UploadFile"); - var path = "/pet/{petId}/uploadImage"; + var path_ = "/pet/{petId}/uploadImage"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -1052,7 +1052,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, pathParams, 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 f96b773c76f..b0a439ddf1a 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 @@ -155,7 +155,7 @@ namespace IO.Swagger.Api { - var path = "/store/inventory"; + var path_ = "/store/inventory"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -185,14 +185,14 @@ 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, pathParams, 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); else if (((int)response.StatusCode) == 0) throw new ApiException ((int)response.StatusCode, "Error calling GetInventory: " + response.ErrorMessage, response.ErrorMessage); - return (Dictionary) ApiClient.Deserialize(response.Content, typeof(Dictionary), response.Headers); + return (Dictionary) ApiClient.Deserialize(response, typeof(Dictionary)); } /// @@ -203,7 +203,7 @@ namespace IO.Swagger.Api { - var path = "/store/inventory"; + var path_ = "/store/inventory"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -233,11 +233,11 @@ 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, pathParams, 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); - return (Dictionary) ApiClient.Deserialize(response.Content, typeof(Dictionary), response.Headers); + return (Dictionary) ApiClient.Deserialize(response, typeof(Dictionary)); } /// @@ -249,7 +249,7 @@ namespace IO.Swagger.Api { - var path = "/store/order"; + var path_ = "/store/order"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -280,14 +280,14 @@ 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, pathParams, 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); else if (((int)response.StatusCode) == 0) throw new ApiException ((int)response.StatusCode, "Error calling PlaceOrder: " + response.ErrorMessage, response.ErrorMessage); - return (Order) ApiClient.Deserialize(response.Content, typeof(Order), response.Headers); + return (Order) ApiClient.Deserialize(response, typeof(Order)); } /// @@ -299,7 +299,7 @@ namespace IO.Swagger.Api { - var path = "/store/order"; + var path_ = "/store/order"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -330,11 +330,11 @@ 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, pathParams, 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); - return (Order) ApiClient.Deserialize(response.Content, typeof(Order), response.Headers); + return (Order) ApiClient.Deserialize(response, typeof(Order)); } /// @@ -349,7 +349,7 @@ namespace IO.Swagger.Api if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling GetOrderById"); - var path = "/store/order/{orderId}"; + var path_ = "/store/order/{orderId}"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -380,14 +380,14 @@ 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, pathParams, 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); else if (((int)response.StatusCode) == 0) throw new ApiException ((int)response.StatusCode, "Error calling GetOrderById: " + response.ErrorMessage, response.ErrorMessage); - return (Order) ApiClient.Deserialize(response.Content, typeof(Order), response.Headers); + return (Order) ApiClient.Deserialize(response, typeof(Order)); } /// @@ -401,7 +401,7 @@ namespace IO.Swagger.Api if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling GetOrderById"); - var path = "/store/order/{orderId}"; + var path_ = "/store/order/{orderId}"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -432,11 +432,11 @@ 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, pathParams, 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); - return (Order) ApiClient.Deserialize(response.Content, typeof(Order), response.Headers); + return (Order) ApiClient.Deserialize(response, typeof(Order)); } /// @@ -451,7 +451,7 @@ namespace IO.Swagger.Api if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling DeleteOrder"); - var path = "/store/order/{orderId}"; + var path_ = "/store/order/{orderId}"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -482,7 +482,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, pathParams, 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); @@ -503,7 +503,7 @@ namespace IO.Swagger.Api if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling DeleteOrder"); - var path = "/store/order/{orderId}"; + var path_ = "/store/order/{orderId}"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -534,7 +534,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, pathParams, 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 f7c68cfbe35..b4c8d93c28c 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 @@ -240,7 +240,7 @@ namespace IO.Swagger.Api { - var path = "/user"; + var path_ = "/user"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -271,7 +271,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, pathParams, 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); @@ -290,7 +290,7 @@ namespace IO.Swagger.Api { - var path = "/user"; + var path_ = "/user"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -321,7 +321,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, pathParams, 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); @@ -338,7 +338,7 @@ namespace IO.Swagger.Api { - var path = "/user/createWithArray"; + var path_ = "/user/createWithArray"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -369,7 +369,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, pathParams, 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); @@ -388,7 +388,7 @@ namespace IO.Swagger.Api { - var path = "/user/createWithArray"; + var path_ = "/user/createWithArray"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -419,7 +419,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, pathParams, 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); @@ -436,7 +436,7 @@ namespace IO.Swagger.Api { - var path = "/user/createWithList"; + var path_ = "/user/createWithList"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -467,7 +467,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, pathParams, 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); @@ -486,7 +486,7 @@ namespace IO.Swagger.Api { - var path = "/user/createWithList"; + var path_ = "/user/createWithList"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -517,7 +517,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, pathParams, 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); @@ -535,7 +535,7 @@ namespace IO.Swagger.Api { - var path = "/user/login"; + var path_ = "/user/login"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -567,14 +567,14 @@ 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, pathParams, 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); else if (((int)response.StatusCode) == 0) throw new ApiException ((int)response.StatusCode, "Error calling LoginUser: " + response.ErrorMessage, response.ErrorMessage); - return (string) ApiClient.Deserialize(response.Content, typeof(string), response.Headers); + return (string) ApiClient.Deserialize(response, typeof(string)); } /// @@ -587,7 +587,7 @@ namespace IO.Swagger.Api { - var path = "/user/login"; + var path_ = "/user/login"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -619,11 +619,11 @@ 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, pathParams, 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); - return (string) ApiClient.Deserialize(response.Content, typeof(string), response.Headers); + return (string) ApiClient.Deserialize(response, typeof(string)); } /// @@ -634,7 +634,7 @@ namespace IO.Swagger.Api { - var path = "/user/logout"; + var path_ = "/user/logout"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -664,7 +664,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, pathParams, 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); @@ -682,7 +682,7 @@ namespace IO.Swagger.Api { - var path = "/user/logout"; + var path_ = "/user/logout"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -712,7 +712,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, pathParams, 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); @@ -732,7 +732,7 @@ namespace IO.Swagger.Api if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling GetUserByName"); - var path = "/user/{username}"; + var path_ = "/user/{username}"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -763,14 +763,14 @@ 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, pathParams, 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); else if (((int)response.StatusCode) == 0) throw new ApiException ((int)response.StatusCode, "Error calling GetUserByName: " + response.ErrorMessage, response.ErrorMessage); - return (User) ApiClient.Deserialize(response.Content, typeof(User), response.Headers); + return (User) ApiClient.Deserialize(response, typeof(User)); } /// @@ -784,7 +784,7 @@ namespace IO.Swagger.Api if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling GetUserByName"); - var path = "/user/{username}"; + var path_ = "/user/{username}"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -815,11 +815,11 @@ 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, pathParams, 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); - return (User) ApiClient.Deserialize(response.Content, typeof(User), response.Headers); + return (User) ApiClient.Deserialize(response, typeof(User)); } /// @@ -835,7 +835,7 @@ namespace IO.Swagger.Api if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling UpdateUser"); - var path = "/user/{username}"; + var path_ = "/user/{username}"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -867,7 +867,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, pathParams, 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); @@ -889,7 +889,7 @@ namespace IO.Swagger.Api if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling UpdateUser"); - var path = "/user/{username}"; + var path_ = "/user/{username}"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -921,7 +921,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, pathParams, 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); @@ -941,7 +941,7 @@ namespace IO.Swagger.Api if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling DeleteUser"); - var path = "/user/{username}"; + var path_ = "/user/{username}"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -972,7 +972,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, pathParams, 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); @@ -993,7 +993,7 @@ namespace IO.Swagger.Api if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling DeleteUser"); - var path = "/user/{username}"; + var path_ = "/user/{username}"; var pathParams = new Dictionary(); var queryParams = new Dictionary(); @@ -1024,7 +1024,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, pathParams, 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 74b898be626..0416f985360 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 @@ -214,12 +214,14 @@ namespace IO.Swagger.Client /// /// Deserialize the JSON string into a proper object. /// - /// HTTP body (e.g. string, JSON). + /// The HTTP response. /// Object type. - /// /// Object representation of the JSON string. - public object Deserialize(string content, Type type, IList headers=null) + public object Deserialize(IRestResponse response, Type type) { + byte[] data = response.RawBytes; + string content = response.Content; + IList headers = response.Headers; if (type == typeof(Object)) // return an object { return content; @@ -227,21 +229,22 @@ namespace IO.Swagger.Client if (type == typeof(Stream)) { - var filePath = String.IsNullOrEmpty(Configuration.TempFolderPath) - ? Path.GetTempPath() - : Configuration.TempFolderPath; - - var fileName = filePath + Guid.NewGuid(); if (headers != null) { + var filePath = String.IsNullOrEmpty(Configuration.TempFolderPath) + ? Path.GetTempPath() + : Configuration.TempFolderPath; var regex = new Regex(@"Content-Disposition:.*filename=['""]?([^'""\s]+)['""]?$"); var match = regex.Match(headers.ToString()); if (match.Success) - fileName = filePath + match.Value.Replace("\"", "").Replace("'", ""); + { + string fileName = filePath + match.Value.Replace("\"", "").Replace("'", ""); + File.WriteAllBytes(fileName, data); + return new FileStream(fileName, FileMode.Open); + } } - File.WriteAllText(fileName, content); - return new FileStream(fileName, FileMode.Open); - + var stream = new MemoryStream(data); + return stream; } if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object diff --git a/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll b/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll index 74b5b6455e3..3541160c3b9 100755 Binary files a/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll and b/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll differ diff --git a/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll.mdb b/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll.mdb index 9700c554fbd..1a9c96751ba 100644 Binary files a/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll.mdb and b/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll.mdb differ diff --git a/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll b/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll index 74b5b6455e3..3541160c3b9 100755 Binary files a/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll and b/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll differ diff --git a/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll.mdb b/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll.mdb index 9700c554fbd..1a9c96751ba 100644 Binary files a/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll.mdb and b/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll.mdb differ