diff --git a/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache index 19b60adae9f..45316e679fa 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache @@ -7,7 +7,6 @@ using System.Web; using System.Linq; using System.Net; using System.Text; -using System.Threading.Tasks; using Newtonsoft.Json; using RestSharp; using RestSharp.Extensions; @@ -111,7 +110,7 @@ namespace {{packageName}}.Client /// File parameters. /// Authentication settings. /// The Task instance. - public async Task CallApiAsync(String path, RestSharp.Method method, Dictionary queryParams, String postBody, + public async System.Threading.Tasks.Task CallApiAsync(String path, RestSharp.Method method, Dictionary queryParams, String postBody, Dictionary headerParams, Dictionary formParams, Dictionary fileParams, String[] authSettings) { diff --git a/modules/swagger-codegen/src/main/resources/csharp/api.mustache b/modules/swagger-codegen/src/main/resources/csharp/api.mustache index 8ca15af026b..ceac07ddfd1 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/api.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/api.mustache @@ -1,7 +1,6 @@ using System; using System.IO; using System.Collections.Generic; -using System.Threading.Tasks; using RestSharp; using {{packageName}}.Client; {{#hasImport}}using {{packageName}}.Model; @@ -25,7 +24,7 @@ namespace {{packageName}}.Api /// {{#allParams}}/// {{description}} {{/allParams}}/// {{#returnType}}{{{returnType}}}{{/returnType}} - {{#returnType}}Task<{{{returnType}}}>{{/returnType}}{{^returnType}}Task{{/returnType}} {{nickname}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + {{#returnType}}System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{nickname}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); {{/operation}} } @@ -134,7 +133,7 @@ namespace {{packageName}}.Api /// {{#allParams}}/// {{description}} {{/allParams}}/// {{#returnType}}{{{returnType}}}{{/returnType}} - {{#returnType}}public async Task<{{{returnType}}}>{{/returnType}}{{^returnType}}public async Task{{/returnType}} {{nickname}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) + {{#returnType}}public async System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{nickname}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { {{#allParams}}{{#required}}// verify the required parameter '{{paramName}}' is set if ({{paramName}} == null) throw new ApiException(400, "Missing required parameter '{{paramName}}' when calling {{nickname}}"); 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 91790cb7e06..166d40b5656 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 @@ -1,7 +1,6 @@ using System; using System.IO; using System.Collections.Generic; -using System.Threading.Tasks; using RestSharp; using IO.Swagger.Client; using IO.Swagger.Model; @@ -24,7 +23,7 @@ namespace IO.Swagger.Api /// /// Pet object that needs to be added to the store /// - Task UpdatePetAsync (Pet body); + System.Threading.Tasks.Task UpdatePetAsync (Pet body); /// /// Add a new pet to the store @@ -38,7 +37,7 @@ namespace IO.Swagger.Api /// /// Pet object that needs to be added to the store /// - Task AddPetAsync (Pet body); + System.Threading.Tasks.Task AddPetAsync (Pet body); /// /// Finds Pets by status Multiple status values can be provided with comma seperated strings @@ -52,7 +51,7 @@ namespace IO.Swagger.Api /// /// Status values that need to be considered for filter /// List - Task> FindPetsByStatusAsync (List status); + System.Threading.Tasks.Task> FindPetsByStatusAsync (List status); /// /// Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. @@ -66,7 +65,7 @@ namespace IO.Swagger.Api /// /// Tags to filter by /// List - Task> FindPetsByTagsAsync (List tags); + System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags); /// /// Find pet by ID Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions @@ -80,7 +79,7 @@ namespace IO.Swagger.Api /// /// ID of pet that needs to be fetched /// Pet - Task GetPetByIdAsync (long? petId); + System.Threading.Tasks.Task GetPetByIdAsync (long? petId); /// /// Updates a pet in the store with form data @@ -98,7 +97,7 @@ namespace IO.Swagger.Api /// Updated name of the pet /// Updated status of the pet /// - Task UpdatePetWithFormAsync (string petId, string name, string status); + System.Threading.Tasks.Task UpdatePetWithFormAsync (string petId, string name, string status); /// /// Deletes a pet @@ -114,7 +113,7 @@ namespace IO.Swagger.Api /// /// Pet id to delete /// - Task DeletePetAsync (string apiKey, long? petId); + System.Threading.Tasks.Task DeletePetAsync (string apiKey, long? petId); /// /// uploads an image @@ -132,7 +131,7 @@ namespace IO.Swagger.Api /// Additional data to pass to server /// file to upload /// - Task UploadFileAsync (long? petId, string additionalMetadata, Stream file); + System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata, Stream file); } @@ -234,7 +233,7 @@ namespace IO.Swagger.Api /// /// Pet object that needs to be added to the store /// - public async Task UpdatePetAsync (Pet body) + public async System.Threading.Tasks.Task UpdatePetAsync (Pet body) { @@ -310,7 +309,7 @@ namespace IO.Swagger.Api /// /// Pet object that needs to be added to the store /// - public async Task AddPetAsync (Pet body) + public async System.Threading.Tasks.Task AddPetAsync (Pet body) { @@ -386,7 +385,7 @@ namespace IO.Swagger.Api /// /// Status values that need to be considered for filter /// List - public async Task> FindPetsByStatusAsync (List status) + public async System.Threading.Tasks.Task> FindPetsByStatusAsync (List status) { @@ -461,7 +460,7 @@ namespace IO.Swagger.Api /// /// Tags to filter by /// List - public async Task> FindPetsByTagsAsync (List tags) + public async System.Threading.Tasks.Task> FindPetsByTagsAsync (List tags) { @@ -539,7 +538,7 @@ namespace IO.Swagger.Api /// /// ID of pet that needs to be fetched /// Pet - public async Task GetPetByIdAsync (long? petId) + public async System.Threading.Tasks.Task GetPetByIdAsync (long? petId) { // verify the required parameter 'petId' is set if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling GetPetById"); @@ -625,7 +624,7 @@ namespace IO.Swagger.Api /// Updated name of the pet /// Updated status of the pet /// - public async Task UpdatePetWithFormAsync (string petId, string name, string status) + public async System.Threading.Tasks.Task UpdatePetWithFormAsync (string petId, string name, string status) { // verify the required parameter 'petId' is set if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UpdatePetWithForm"); @@ -711,7 +710,7 @@ namespace IO.Swagger.Api /// /// Pet id to delete /// - public async Task DeletePetAsync (string apiKey, long? petId) + public async System.Threading.Tasks.Task DeletePetAsync (string apiKey, long? petId) { // verify the required parameter 'petId' is set if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling DeletePet"); @@ -799,7 +798,7 @@ namespace IO.Swagger.Api /// Additional data to pass to server /// file to upload /// - public async Task UploadFileAsync (long? petId, string additionalMetadata, Stream file) + public async System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata, Stream file) { // verify the required parameter 'petId' is set if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UploadFile"); 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 014a44cddd7..74d14e7ffe2 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 @@ -1,7 +1,6 @@ using System; using System.IO; using System.Collections.Generic; -using System.Threading.Tasks; using RestSharp; using IO.Swagger.Client; using IO.Swagger.Model; @@ -22,7 +21,7 @@ namespace IO.Swagger.Api /// Returns pet inventories by status Returns a map of status codes to quantities /// /// Dictionary - Task> GetInventoryAsync (); + System.Threading.Tasks.Task> GetInventoryAsync (); /// /// Place an order for a pet @@ -36,7 +35,7 @@ namespace IO.Swagger.Api /// /// order placed for purchasing the pet /// Order - Task PlaceOrderAsync (Order body); + System.Threading.Tasks.Task PlaceOrderAsync (Order body); /// /// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @@ -50,7 +49,7 @@ namespace IO.Swagger.Api /// /// ID of pet that needs to be fetched /// Order - Task GetOrderByIdAsync (string orderId); + System.Threading.Tasks.Task GetOrderByIdAsync (string orderId); /// /// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -64,7 +63,7 @@ namespace IO.Swagger.Api /// /// ID of the order that needs to be deleted /// - Task DeleteOrderAsync (string orderId); + System.Threading.Tasks.Task DeleteOrderAsync (string orderId); } @@ -163,7 +162,7 @@ namespace IO.Swagger.Api /// Returns pet inventories by status Returns a map of status codes to quantities /// /// Dictionary - public async Task> GetInventoryAsync () + public async System.Threading.Tasks.Task> GetInventoryAsync () { @@ -237,7 +236,7 @@ namespace IO.Swagger.Api /// /// order placed for purchasing the pet /// Order - public async Task PlaceOrderAsync (Order body) + public async System.Threading.Tasks.Task PlaceOrderAsync (Order body) { @@ -315,7 +314,7 @@ namespace IO.Swagger.Api /// /// ID of pet that needs to be fetched /// Order - public async Task GetOrderByIdAsync (string orderId) + public async System.Threading.Tasks.Task GetOrderByIdAsync (string orderId) { // verify the required parameter 'orderId' is set if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling GetOrderById"); @@ -395,7 +394,7 @@ namespace IO.Swagger.Api /// /// ID of the order that needs to be deleted /// - public async Task DeleteOrderAsync (string orderId) + public async System.Threading.Tasks.Task DeleteOrderAsync (string orderId) { // verify the required parameter 'orderId' is set if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling DeleteOrder"); 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 227ebd3a4b5..b69bd7be58b 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 @@ -1,7 +1,6 @@ using System; using System.IO; using System.Collections.Generic; -using System.Threading.Tasks; using RestSharp; using IO.Swagger.Client; using IO.Swagger.Model; @@ -24,7 +23,7 @@ namespace IO.Swagger.Api /// /// Created user object /// - Task CreateUserAsync (User body); + System.Threading.Tasks.Task CreateUserAsync (User body); /// /// Creates list of users with given input array @@ -38,7 +37,7 @@ namespace IO.Swagger.Api /// /// List of user object /// - Task CreateUsersWithArrayInputAsync (List body); + System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body); /// /// Creates list of users with given input array @@ -52,7 +51,7 @@ namespace IO.Swagger.Api /// /// List of user object /// - Task CreateUsersWithListInputAsync (List body); + System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body); /// /// Logs user into the system @@ -68,7 +67,7 @@ namespace IO.Swagger.Api /// The user name for login /// The password for login in clear text /// string - Task LoginUserAsync (string username, string password); + System.Threading.Tasks.Task LoginUserAsync (string username, string password); /// /// Logs out current logged in user session @@ -80,7 +79,7 @@ namespace IO.Swagger.Api /// Logs out current logged in user session /// /// - Task LogoutUserAsync (); + System.Threading.Tasks.Task LogoutUserAsync (); /// /// Get user by user name @@ -94,7 +93,7 @@ namespace IO.Swagger.Api /// /// The name that needs to be fetched. Use user1 for testing. /// User - Task GetUserByNameAsync (string username); + System.Threading.Tasks.Task GetUserByNameAsync (string username); /// /// Updated user This can only be done by the logged in user. @@ -110,7 +109,7 @@ namespace IO.Swagger.Api /// name that need to be deleted /// Updated user object /// - Task UpdateUserAsync (string username, User body); + System.Threading.Tasks.Task UpdateUserAsync (string username, User body); /// /// Delete user This can only be done by the logged in user. @@ -124,7 +123,7 @@ namespace IO.Swagger.Api /// /// The name that needs to be deleted /// - Task DeleteUserAsync (string username); + System.Threading.Tasks.Task DeleteUserAsync (string username); } @@ -226,7 +225,7 @@ namespace IO.Swagger.Api /// /// Created user object /// - public async Task CreateUserAsync (User body) + public async System.Threading.Tasks.Task CreateUserAsync (User body) { @@ -302,7 +301,7 @@ namespace IO.Swagger.Api /// /// List of user object /// - public async Task CreateUsersWithArrayInputAsync (List body) + public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List body) { @@ -378,7 +377,7 @@ namespace IO.Swagger.Api /// /// List of user object /// - public async Task CreateUsersWithListInputAsync (List body) + public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List body) { @@ -457,7 +456,7 @@ namespace IO.Swagger.Api /// The user name for login /// The password for login in clear text /// string - public async Task LoginUserAsync (string username, string password) + public async System.Threading.Tasks.Task LoginUserAsync (string username, string password) { @@ -530,7 +529,7 @@ namespace IO.Swagger.Api /// Logs out current logged in user session /// /// - public async Task LogoutUserAsync () + public async System.Threading.Tasks.Task LogoutUserAsync () { @@ -608,7 +607,7 @@ namespace IO.Swagger.Api /// /// The name that needs to be fetched. Use user1 for testing. /// User - public async Task GetUserByNameAsync (string username) + public async System.Threading.Tasks.Task GetUserByNameAsync (string username) { // verify the required parameter 'username' is set if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling GetUserByName"); @@ -691,7 +690,7 @@ namespace IO.Swagger.Api /// name that need to be deleted /// Updated user object /// - public async Task UpdateUserAsync (string username, User body) + public async System.Threading.Tasks.Task UpdateUserAsync (string username, User body) { // verify the required parameter 'username' is set if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling UpdateUser"); @@ -773,7 +772,7 @@ namespace IO.Swagger.Api /// /// The name that needs to be deleted /// - public async Task DeleteUserAsync (string username) + public async System.Threading.Tasks.Task DeleteUserAsync (string username) { // verify the required parameter 'username' is set if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling DeleteUser"); 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 a33675bb5c9..117cd598008 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 @@ -7,7 +7,6 @@ using System.Web; using System.Linq; using System.Net; using System.Text; -using System.Threading.Tasks; using Newtonsoft.Json; using RestSharp; using RestSharp.Extensions; @@ -111,7 +110,7 @@ namespace IO.Swagger.Client /// File parameters. /// Authentication settings. /// The Task instance. - public async Task CallApiAsync(String path, RestSharp.Method method, Dictionary queryParams, String postBody, + public async System.Threading.Tasks.Task CallApiAsync(String path, RestSharp.Method method, Dictionary queryParams, String postBody, Dictionary headerParams, Dictionary formParams, Dictionary fileParams, String[] authSettings) { 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 3ca8f9fa3f2..0e1d0d209c3 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.mdb b/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll.mdb index 3ca8f9fa3f2..0e1d0d209c3 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