From e0f43c1c589936c657a8c47c26706044e29a6200 Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 11 Jan 2016 00:39:22 +0800 Subject: [PATCH] add binary support to C# client --- .../languages/CSharpClientCodegen.java | 1 + .../main/resources/csharp/ApiClient.mustache | 63 +- .../src/main/resources/csharp/api.mustache | 56 +- .../src/test/resources/2_0/petstore.json | 93 +++ .../src/main/csharp/IO/Swagger/Api/PetApi.cs | 774 +++++++++++++++--- .../main/csharp/IO/Swagger/Api/StoreApi.cs | 177 ++-- .../src/main/csharp/IO/Swagger/Api/UserApi.cs | 369 ++++++--- .../csharp/IO/Swagger/Client/ApiClient.cs | 63 +- .../SwaggerClientTest.userprefs | 6 +- .../csharp/SwaggerClientTest/TestApiClient.cs | 20 + .../csharp/SwaggerClientTest/TestPet.cs | 52 +- .../obj/Debug/SwaggerClientTest.dll.mdb | Bin 31212 -> 0 bytes 12 files changed, 1359 insertions(+), 315 deletions(-) delete mode 100644 samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll.mdb diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java index 8966e19b9ce..23c266e618f 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java @@ -92,6 +92,7 @@ public CSharpClientCodegen() { typeMapping = new HashMap(); typeMapping.put("string", "string"); + typeMapping.put("binary", "byte[]"); typeMapping.put("boolean", "bool?"); typeMapping.put("integer", "int?"); typeMapping.put("float", "float?"); diff --git a/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache index fab938460fc..8a22c2f23f9 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache @@ -77,9 +77,10 @@ namespace {{packageName}}.Client // Creates and sets up a RestRequest prior to a call. private RestRequest PrepareRequest( - String path, RestSharp.Method method, Dictionary queryParams, String postBody, + String path, RestSharp.Method method, Dictionary queryParams, Object postBody, Dictionary headerParams, Dictionary formParams, - Dictionary fileParams, Dictionary pathParams) + Dictionary fileParams, Dictionary pathParams, + String contentType) { var request = new RestRequest(path, method); @@ -103,8 +104,17 @@ namespace {{packageName}}.Client foreach(var param in fileParams) request.AddFile(param.Value.Name, param.Value.Writer, param.Value.FileName, param.Value.ContentType); - if (postBody != null) // http body (model) parameter - request.AddParameter("application/json", postBody, ParameterType.RequestBody); + if (postBody != null) // http body (model or byte[]) parameter + { + if (postBody.GetType() == typeof(String)) + { + request.AddParameter("application/json", postBody, ParameterType.RequestBody); + } + else if (postBody.GetType() == typeof(byte[])) + { + request.AddParameter(contentType, postBody, ParameterType.RequestBody); + } + } return request; } @@ -120,14 +130,18 @@ namespace {{packageName}}.Client /// Form parameters. /// File parameters. /// Path parameters. + /// Content Type of the request /// Object public Object CallApi( - String path, RestSharp.Method method, Dictionary queryParams, String postBody, + String path, RestSharp.Method method, Dictionary queryParams, Object postBody, Dictionary headerParams, Dictionary formParams, - Dictionary fileParams, Dictionary pathParams) + Dictionary fileParams, Dictionary pathParams, + String contentType) { var request = PrepareRequest( - path, method, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + path, method, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, contentType); + var response = RestClient.Execute(request); return (Object) response; } @@ -143,14 +157,17 @@ namespace {{packageName}}.Client /// Form parameters. /// File parameters. /// Path parameters. + /// Content type. /// The Task instance. public async System.Threading.Tasks.Task CallApiAsync( - String path, RestSharp.Method method, Dictionary queryParams, String postBody, + String path, RestSharp.Method method, Dictionary queryParams, Object postBody, Dictionary headerParams, Dictionary formParams, - Dictionary fileParams, Dictionary pathParams) + Dictionary fileParams, Dictionary pathParams, + String contentType) { var request = PrepareRequest( - path, method, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + path, method, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, contentType); var response = await RestClient.ExecuteTaskAsync(request); return (Object)response; } @@ -230,6 +247,10 @@ namespace {{packageName}}.Client { return content; } + else if (type == typeof(byte[])) // return byte array + { + return data; + } if (type == typeof(Stream)) { @@ -276,11 +297,11 @@ namespace {{packageName}}.Client } /// - /// Serialize an object into JSON string. + /// Serialize an input (model) into JSON string /// /// Object. /// JSON string. - public string Serialize(object obj) + public String Serialize(object obj) { try { @@ -292,6 +313,24 @@ namespace {{packageName}}.Client } } + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public String SelectHeaderContentType(String[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + if (contentTypes.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + /// /// Select the Accept header's value from the given accepts array: /// if JSON exists in the given array, use it; diff --git a/modules/swagger-codegen/src/main/resources/csharp/api.mustache b/modules/swagger-codegen/src/main/resources/csharp/api.mustache index 51f8b3f9394..28919d6be49 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/api.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/api.mustache @@ -154,7 +154,8 @@ namespace {{packageName}}.Api { {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set - if ({{paramName}} == null) throw new ApiException(400, "Missing required parameter '{{paramName}}' when calling {{operationId}}"); + if ({{paramName}} == null) + throw new ApiException(400, "Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}"); {{/required}}{{/allParams}} var path_ = "{{path}}"; @@ -164,15 +165,21 @@ namespace {{packageName}}.Api var headerParams = new Dictionary(Configuration.DefaultHeader); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -185,11 +192,16 @@ namespace {{packageName}}.Api {{/headerParams}} {{#formParams}}if ({{paramName}} != null) {{#isFile}}fileParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToFile("{{baseName}}", {{paramName}}));{{/isFile}}{{^isFile}}formParams.Add("{{baseName}}", Configuration.ApiClient.ParameterToString({{paramName}})); // form parameter{{/isFile}} {{/formParams}} - {{#bodyParam}}postBody = Configuration.ApiClient.Serialize({{paramName}}); // http body (model) parameter - {{/bodyParam}} + {{#bodyParam}}if ({{paramName}}.GetType() != typeof(byte[])) + { + postBody = Configuration.ApiClient.Serialize({{paramName}}); // http body (model) parameter + } + else + { + postBody = {{paramName}}; // byte array + }{{/bodyParam}} - {{#authMethods}} - // authentication ({{name}}) required + {{#authMethods}}// authentication ({{name}}) required {{#isApiKey}}{{#isKeyInHeader}} var apiKeyValue = Configuration.GetApiKeyWithPrefix("{{keyParamName}}"); if (!String.IsNullOrEmpty(apiKeyValue)) @@ -214,7 +226,9 @@ namespace {{packageName}}.Api {{/authMethods}} // make the HTTP request - IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.{{httpMethod}}, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, + Method.{{httpMethod}}, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -261,15 +275,21 @@ namespace {{packageName}}.Api var headerParams = new Dictionary(); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + {{#consumes}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { {{#produces}}"{{mediaType}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -311,7 +331,9 @@ namespace {{packageName}}.Api {{/authMethods}} // make the HTTP request - IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.{{httpMethod}}, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, + Method.{{httpMethod}}, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; diff --git a/modules/swagger-codegen/src/test/resources/2_0/petstore.json b/modules/swagger-codegen/src/test/resources/2_0/petstore.json index 66762d74b2b..703b920db21 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/petstore.json +++ b/modules/swagger-codegen/src/test/resources/2_0/petstore.json @@ -19,6 +19,49 @@ "http" ], "paths": { + "/pet?testing_byte_array=true": { + "post": { + "tags": [ + "pet" + ], + "summary": "Fake endpoint to test byte array in body parameter for adding a new pet to the store", + "description": "", + "operationId": "addPetUsingByteArray", + "consumes": [ + "application/json", + "application/xml" + ], + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "in": "body", + "name": "body", + "description": "Pet object in the form of byte array", + "required": false, + "schema": { + "type": "string", + "format": "binary" + } + } + ], + "responses": { + "405": { + "description": "Invalid input" + } + }, + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + } + }, "/pet": { "post": { "tags": [ @@ -206,6 +249,56 @@ ] } }, + "/pet/{petId}?testing_byte_array=true": { + "get": { + "tags": [ + "pet" + ], + "summary": "Fake endpoint to test byte array return by 'Find pet by ID'", + "description": "Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions", + "operationId": "getPetByIdWithByteArray", + "produces": [ + "application/json", + "application/xml" + ], + "parameters": [ + { + "name": "petId", + "in": "path", + "description": "ID of pet that needs to be fetched", + "required": true, + "type": "integer", + "format": "int64" + } + ], + "responses": { + "404": { + "description": "Pet not found" + }, + "200": { + "description": "successful operation", + "schema": { + "type": "string", + "format": "binary" + } + }, + "400": { + "description": "Invalid ID supplied" + } + }, + "security": [ + { + "api_key": [] + }, + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ] + } + }, "/pet/{petId}": { "get": { "tags": [ 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 ba58eeac9e0..892412e5b3e 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 @@ -355,6 +355,86 @@ public interface IPetApi /// Task of ApiResponse System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, Stream file = null); + /// + /// Fake endpoint to test byte array return by 'Find pet by ID' + /// + /// + /// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + /// + /// ID of pet that needs to be fetched + /// byte[] + byte[] GetPetByIdWithByteArray (long? petId); + + /// + /// Fake endpoint to test byte array return by 'Find pet by ID' + /// + /// + /// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + /// + /// ID of pet that needs to be fetched + /// ApiResponse of byte[] + ApiResponse GetPetByIdWithByteArrayWithHttpInfo (long? petId); + + /// + /// Fake endpoint to test byte array return by 'Find pet by ID' + /// + /// + /// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + /// + /// ID of pet that needs to be fetched + /// Task of byte[] + System.Threading.Tasks.Task GetPetByIdWithByteArrayAsync (long? petId); + + /// + /// Fake endpoint to test byte array return by 'Find pet by ID' + /// + /// + /// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + /// + /// ID of pet that needs to be fetched + /// Task of ApiResponse (byte[]) + System.Threading.Tasks.Task> GetPetByIdWithByteArrayAsyncWithHttpInfo (long? petId); + + /// + /// Fake endpoint to test byte array in body parameter for adding a new pet to the store + /// + /// + /// + /// + /// Pet object in the form of byte array + /// + void AddPetUsingByteArray (byte[] body = null); + + /// + /// Fake endpoint to test byte array in body parameter for adding a new pet to the store + /// + /// + /// + /// + /// Pet object in the form of byte array + /// ApiResponse of Object(void) + ApiResponse AddPetUsingByteArrayWithHttpInfo (byte[] body = null); + + /// + /// Fake endpoint to test byte array in body parameter for adding a new pet to the store + /// + /// + /// + /// + /// Pet object in the form of byte array + /// Task of void + System.Threading.Tasks.Task AddPetUsingByteArrayAsync (byte[] body = null); + + /// + /// Fake endpoint to test byte array in body parameter for adding a new pet to the store + /// + /// + /// + /// + /// Pet object in the form of byte array + /// Task of ApiResponse + System.Threading.Tasks.Task> AddPetUsingByteArrayAsyncWithHttpInfo (byte[] body = null); + } /// @@ -459,15 +539,21 @@ public ApiResponse UpdatePetWithHttpInfo (Pet body = null) var headerParams = new Dictionary(Configuration.DefaultHeader); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + "application/json", "application/xml" + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -476,10 +562,15 @@ public ApiResponse UpdatePetWithHttpInfo (Pet body = null) - postBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter - + if (body.GetType() != typeof(byte[])) + { + postBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + postBody = body; // byte array + } - // authentication (petstore_auth) required // oauth required @@ -490,7 +581,9 @@ public ApiResponse UpdatePetWithHttpInfo (Pet body = null) // make the HTTP request - IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, + Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -532,15 +625,21 @@ public async System.Threading.Tasks.Task> UpdatePetAsyncWith var headerParams = new Dictionary(); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + "application/json", "application/xml" + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -563,7 +662,9 @@ public async System.Threading.Tasks.Task> UpdatePetAsyncWith // make the HTTP request - IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, + Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -604,15 +705,21 @@ public ApiResponse AddPetWithHttpInfo (Pet body = null) var headerParams = new Dictionary(Configuration.DefaultHeader); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + "application/json", "application/xml" + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -621,10 +728,15 @@ public ApiResponse AddPetWithHttpInfo (Pet body = null) - postBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter - + if (body.GetType() != typeof(byte[])) + { + postBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + postBody = body; // byte array + } - // authentication (petstore_auth) required // oauth required @@ -635,7 +747,9 @@ public ApiResponse AddPetWithHttpInfo (Pet body = null) // make the HTTP request - IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, + Method.POST, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -677,15 +791,21 @@ public async System.Threading.Tasks.Task> AddPetAsyncWithHtt var headerParams = new Dictionary(); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + "application/json", "application/xml" + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -708,7 +828,9 @@ public async System.Threading.Tasks.Task> AddPetAsyncWithHtt // make the HTTP request - IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, + Method.POST, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -750,15 +872,21 @@ public ApiResponse< List > FindPetsByStatusWithHttpInfo (List statu var headerParams = new Dictionary(Configuration.DefaultHeader); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -770,7 +898,6 @@ public ApiResponse< List > FindPetsByStatusWithHttpInfo (List statu - // authentication (petstore_auth) required // oauth required @@ -781,7 +908,9 @@ public ApiResponse< List > FindPetsByStatusWithHttpInfo (List statu // make the HTTP request - IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, + Method.GET, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -824,15 +953,21 @@ public async System.Threading.Tasks.Task>> FindPetsByStatu var headerParams = new Dictionary(); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -855,7 +990,9 @@ public async System.Threading.Tasks.Task>> FindPetsByStatu // make the HTTP request - IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, + Method.GET, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -897,15 +1034,21 @@ public ApiResponse< List > FindPetsByTagsWithHttpInfo (List tags = var headerParams = new Dictionary(Configuration.DefaultHeader); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -917,7 +1060,6 @@ public ApiResponse< List > FindPetsByTagsWithHttpInfo (List tags = - // authentication (petstore_auth) required // oauth required @@ -928,7 +1070,9 @@ public ApiResponse< List > FindPetsByTagsWithHttpInfo (List tags = // make the HTTP request - IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, + Method.GET, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -971,15 +1115,21 @@ public async System.Threading.Tasks.Task>> FindPetsByTagsA var headerParams = new Dictionary(); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -1002,7 +1152,9 @@ public async System.Threading.Tasks.Task>> FindPetsByTagsA // make the HTTP request - IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, + Method.GET, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -1037,7 +1189,8 @@ public ApiResponse< Pet > GetPetByIdWithHttpInfo (long? petId) { // verify the required parameter 'petId' is set - if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling GetPetById"); + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->GetPetById"); var path_ = "/pet/{petId}"; @@ -1047,15 +1200,21 @@ public ApiResponse< Pet > GetPetByIdWithHttpInfo (long? petId) var headerParams = new Dictionary(Configuration.DefaultHeader); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -1067,7 +1226,6 @@ public ApiResponse< Pet > GetPetByIdWithHttpInfo (long? petId) - // authentication (api_key) required var apiKeyValue = Configuration.GetApiKeyWithPrefix("api_key"); @@ -1078,7 +1236,9 @@ public ApiResponse< Pet > GetPetByIdWithHttpInfo (long? petId) // make the HTTP request - IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, + Method.GET, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -1123,15 +1283,21 @@ public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHt var headerParams = new Dictionary(); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -1154,7 +1320,9 @@ public async System.Threading.Tasks.Task> GetPetByIdAsyncWithHt // make the HTTP request - IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, + Method.GET, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -1192,7 +1360,8 @@ public ApiResponse UpdatePetWithFormWithHttpInfo (string petId, string n { // verify the required parameter 'petId' is set - if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UpdatePetWithForm"); + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->UpdatePetWithForm"); var path_ = "/pet/{petId}"; @@ -1202,15 +1371,21 @@ public ApiResponse UpdatePetWithFormWithHttpInfo (string petId, string n var headerParams = new Dictionary(Configuration.DefaultHeader); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + "application/x-www-form-urlencoded" + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -1224,7 +1399,6 @@ public ApiResponse UpdatePetWithFormWithHttpInfo (string petId, string n - // authentication (petstore_auth) required // oauth required @@ -1235,7 +1409,9 @@ public ApiResponse UpdatePetWithFormWithHttpInfo (string petId, string n // make the HTTP request - IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, + Method.POST, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -1283,15 +1459,21 @@ public async System.Threading.Tasks.Task> UpdatePetWithFormA var headerParams = new Dictionary(); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + "application/x-www-form-urlencoded" + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -1316,7 +1498,9 @@ public async System.Threading.Tasks.Task> UpdatePetWithFormA // make the HTTP request - IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, + Method.POST, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -1352,7 +1536,8 @@ public ApiResponse DeletePetWithHttpInfo (long? petId, string apiKey = n { // verify the required parameter 'petId' is set - if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling DeletePet"); + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->DeletePet"); var path_ = "/pet/{petId}"; @@ -1362,15 +1547,21 @@ public ApiResponse DeletePetWithHttpInfo (long? petId, string apiKey = n var headerParams = new Dictionary(Configuration.DefaultHeader); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -1383,7 +1574,6 @@ public ApiResponse DeletePetWithHttpInfo (long? petId, string apiKey = n - // authentication (petstore_auth) required // oauth required @@ -1394,7 +1584,9 @@ public ApiResponse DeletePetWithHttpInfo (long? petId, string apiKey = n // make the HTTP request - IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, + Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -1440,15 +1632,21 @@ public async System.Threading.Tasks.Task> DeletePetAsyncWith var headerParams = new Dictionary(); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -1472,7 +1670,9 @@ public async System.Threading.Tasks.Task> DeletePetAsyncWith // make the HTTP request - IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, + Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -1510,7 +1710,8 @@ public ApiResponse UploadFileWithHttpInfo (long? petId, string additiona { // verify the required parameter 'petId' is set - if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UploadFile"); + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFile"); var path_ = "/pet/{petId}/uploadImage"; @@ -1520,15 +1721,21 @@ public ApiResponse UploadFileWithHttpInfo (long? petId, string additiona var headerParams = new Dictionary(Configuration.DefaultHeader); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + "multipart/form-data" + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -1542,7 +1749,6 @@ public ApiResponse UploadFileWithHttpInfo (long? petId, string additiona - // authentication (petstore_auth) required // oauth required @@ -1553,7 +1759,9 @@ public ApiResponse UploadFileWithHttpInfo (long? petId, string additiona // make the HTTP request - IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, + Method.POST, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -1601,15 +1809,21 @@ public async System.Threading.Tasks.Task> UploadFileAsyncWit var headerParams = new Dictionary(); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + "multipart/form-data" + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -1634,7 +1848,9 @@ public async System.Threading.Tasks.Task> UploadFileAsyncWit // make the HTTP request - IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, + Method.POST, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -1649,6 +1865,340 @@ public async System.Threading.Tasks.Task> UploadFileAsyncWit null); } + /// + /// Fake endpoint to test byte array return by 'Find pet by ID' Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + /// + /// ID of pet that needs to be fetched + /// byte[] + public byte[] GetPetByIdWithByteArray (long? petId) + { + ApiResponse response = GetPetByIdWithByteArrayWithHttpInfo(petId); + return response.Data; + } + + /// + /// Fake endpoint to test byte array return by 'Find pet by ID' Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + /// + /// ID of pet that needs to be fetched + /// ApiResponse of byte[] + public ApiResponse< byte[] > GetPetByIdWithByteArrayWithHttpInfo (long? petId) + { + + // verify the required parameter 'petId' is set + if (petId == null) + throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->GetPetByIdWithByteArray"); + + + var path_ = "/pet/{petId}?testing_byte_array=true"; + + var pathParams = new Dictionary(); + var queryParams = new Dictionary(); + var headerParams = new Dictionary(Configuration.DefaultHeader); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); + + // to determine the Accept header + String[] httpHeaderAccepts = new String[] { + "application/json", "application/xml" + }; + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); + + // set "format" to json by default + // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json + pathParams.Add("format", "json"); + if (petId != null) pathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter + + + + + + + // authentication (api_key) required + + var apiKeyValue = Configuration.GetApiKeyWithPrefix("api_key"); + if (!String.IsNullOrEmpty(apiKeyValue)) + { + headerParams["api_key"] = apiKeyValue; + } + + + // make the HTTP request + IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, + Method.GET, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); + + int statusCode = (int) response.StatusCode; + + if (statusCode >= 400) + throw new ApiException (statusCode, "Error calling GetPetByIdWithByteArray: " + response.Content, response.Content); + else if (statusCode == 0) + throw new ApiException (statusCode, "Error calling GetPetByIdWithByteArray: " + response.ErrorMessage, response.ErrorMessage); + + return new ApiResponse(statusCode, + response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (byte[]) Configuration.ApiClient.Deserialize(response, typeof(byte[]))); + + } + + /// + /// Fake endpoint to test byte array return by 'Find pet by ID' Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + /// + /// ID of pet that needs to be fetched + /// Task of byte[] + public async System.Threading.Tasks.Task GetPetByIdWithByteArrayAsync (long? petId) + { + ApiResponse response = await GetPetByIdWithByteArrayAsyncWithHttpInfo(petId); + return response.Data; + + } + + /// + /// Fake endpoint to test byte array return by 'Find pet by ID' Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + /// + /// ID of pet that needs to be fetched + /// Task of ApiResponse (byte[]) + public async System.Threading.Tasks.Task> GetPetByIdWithByteArrayAsyncWithHttpInfo (long? petId) + { + // verify the required parameter 'petId' is set + if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling GetPetByIdWithByteArray"); + + + var path_ = "/pet/{petId}?testing_byte_array=true"; + + var pathParams = new Dictionary(); + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); + + // to determine the Accept header + String[] httpHeaderAccepts = new String[] { + "application/json", "application/xml" + }; + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); + + // set "format" to json by default + // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json + pathParams.Add("format", "json"); + if (petId != null) pathParams.Add("petId", Configuration.ApiClient.ParameterToString(petId)); // path parameter + + + + + + + + // authentication (api_key) required + + var apiKeyValue = Configuration.GetApiKeyWithPrefix("api_key"); + if (!String.IsNullOrEmpty(apiKeyValue)) + { + headerParams["api_key"] = apiKeyValue; + } + + + // make the HTTP request + IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, + Method.GET, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); + + int statusCode = (int) response.StatusCode; + + if (statusCode >= 400) + throw new ApiException (statusCode, "Error calling GetPetByIdWithByteArray: " + response.Content, response.Content); + else if (statusCode == 0) + throw new ApiException (statusCode, "Error calling GetPetByIdWithByteArray: " + response.ErrorMessage, response.ErrorMessage); + + return new ApiResponse(statusCode, + response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + (byte[]) Configuration.ApiClient.Deserialize(response, typeof(byte[]))); + + } + + /// + /// Fake endpoint to test byte array in body parameter for adding a new pet to the store + /// + /// Pet object in the form of byte array + /// + public void AddPetUsingByteArray (byte[] body = null) + { + AddPetUsingByteArrayWithHttpInfo(body); + } + + /// + /// Fake endpoint to test byte array in body parameter for adding a new pet to the store + /// + /// Pet object in the form of byte array + /// ApiResponse of Object(void) + public ApiResponse AddPetUsingByteArrayWithHttpInfo (byte[] body = null) + { + + + var path_ = "/pet?testing_byte_array=true"; + + var pathParams = new Dictionary(); + var queryParams = new Dictionary(); + var headerParams = new Dictionary(Configuration.DefaultHeader); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + "application/json", "application/xml" + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); + + // to determine the Accept header + String[] httpHeaderAccepts = new String[] { + "application/json", "application/xml" + }; + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); + + // set "format" to json by default + // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json + pathParams.Add("format", "json"); + + + + + if (body.GetType() != typeof(byte[])) + { + postBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + postBody = body; // byte array + } + + // authentication (petstore_auth) required + + // oauth required + if (!String.IsNullOrEmpty(Configuration.AccessToken)) + { + headerParams["Authorization"] = "Bearer " + Configuration.AccessToken; + } + + + // make the HTTP request + IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, + Method.POST, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); + + int statusCode = (int) response.StatusCode; + + if (statusCode >= 400) + throw new ApiException (statusCode, "Error calling AddPetUsingByteArray: " + response.Content, response.Content); + else if (statusCode == 0) + throw new ApiException (statusCode, "Error calling AddPetUsingByteArray: " + response.ErrorMessage, response.ErrorMessage); + + + return new ApiResponse(statusCode, + response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + null); + } + + /// + /// Fake endpoint to test byte array in body parameter for adding a new pet to the store + /// + /// Pet object in the form of byte array + /// Task of void + public async System.Threading.Tasks.Task AddPetUsingByteArrayAsync (byte[] body = null) + { + await AddPetUsingByteArrayAsyncWithHttpInfo(body); + + } + + /// + /// Fake endpoint to test byte array in body parameter for adding a new pet to the store + /// + /// Pet object in the form of byte array + /// Task of ApiResponse + public async System.Threading.Tasks.Task> AddPetUsingByteArrayAsyncWithHttpInfo (byte[] body = null) + { + + + var path_ = "/pet?testing_byte_array=true"; + + var pathParams = new Dictionary(); + var queryParams = new Dictionary(); + var headerParams = new Dictionary(); + var formParams = new Dictionary(); + var fileParams = new Dictionary(); + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + "application/json", "application/xml" + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); + + // to determine the Accept header + String[] httpHeaderAccepts = new String[] { + "application/json", "application/xml" + }; + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); + + // set "format" to json by default + // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json + pathParams.Add("format", "json"); + + + + + postBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + + + + // authentication (petstore_auth) required + + // oauth required + if (!String.IsNullOrEmpty(Configuration.AccessToken)) + { + headerParams["Authorization"] = "Bearer " + Configuration.AccessToken; + } + + + // make the HTTP request + IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, + Method.POST, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); + + int statusCode = (int) response.StatusCode; + + if (statusCode >= 400) + throw new ApiException (statusCode, "Error calling AddPetUsingByteArray: " + response.Content, response.Content); + else if (statusCode == 0) + throw new ApiException (statusCode, "Error calling AddPetUsingByteArray: " + response.ErrorMessage, response.ErrorMessage); + + + return new ApiResponse(statusCode, + response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), + null); + } + } } 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 a9e9d6e9b74..a92876f1a53 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 @@ -274,15 +274,21 @@ public void AddDefaultHeader(string key, string value) var headerParams = new Dictionary(Configuration.DefaultHeader); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -293,7 +299,6 @@ public void AddDefaultHeader(string key, string value) - // authentication (api_key) required var apiKeyValue = Configuration.GetApiKeyWithPrefix("api_key"); @@ -304,7 +309,9 @@ public void AddDefaultHeader(string key, string value) // make the HTTP request - IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, + Method.GET, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -345,15 +352,21 @@ public void AddDefaultHeader(string key, string value) var headerParams = new Dictionary(); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -375,7 +388,9 @@ public void AddDefaultHeader(string key, string value) // make the HTTP request - IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, + Method.GET, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -417,15 +432,21 @@ public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body = null) var headerParams = new Dictionary(Configuration.DefaultHeader); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -434,13 +455,21 @@ public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body = null) - postBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter - + if (body.GetType() != typeof(byte[])) + { + postBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + postBody = body; // byte array + } // make the HTTP request - IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, + Method.POST, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -483,15 +512,21 @@ public async System.Threading.Tasks.Task> PlaceOrderAsyncWith var headerParams = new Dictionary(); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -506,7 +541,9 @@ public async System.Threading.Tasks.Task> PlaceOrderAsyncWith // make the HTTP request - IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, + Method.POST, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -541,7 +578,8 @@ public ApiResponse< Order > GetOrderByIdWithHttpInfo (string orderId) { // verify the required parameter 'orderId' is set - if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling GetOrderById"); + if (orderId == null) + throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById"); var path_ = "/store/order/{orderId}"; @@ -551,15 +589,21 @@ public ApiResponse< Order > GetOrderByIdWithHttpInfo (string orderId) var headerParams = new Dictionary(Configuration.DefaultHeader); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -574,7 +618,9 @@ public ApiResponse< Order > GetOrderByIdWithHttpInfo (string orderId) // make the HTTP request - IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, + Method.GET, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -619,15 +665,21 @@ public async System.Threading.Tasks.Task> GetOrderByIdAsyncWi var headerParams = new Dictionary(); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -642,7 +694,9 @@ public async System.Threading.Tasks.Task> GetOrderByIdAsyncWi // make the HTTP request - IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, + Method.GET, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -676,7 +730,8 @@ public ApiResponse DeleteOrderWithHttpInfo (string orderId) { // verify the required parameter 'orderId' is set - if (orderId == null) throw new ApiException(400, "Missing required parameter 'orderId' when calling DeleteOrder"); + if (orderId == null) + throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->DeleteOrder"); var path_ = "/store/order/{orderId}"; @@ -686,15 +741,21 @@ public ApiResponse DeleteOrderWithHttpInfo (string orderId) var headerParams = new Dictionary(Configuration.DefaultHeader); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -709,7 +770,9 @@ public ApiResponse DeleteOrderWithHttpInfo (string orderId) // make the HTTP request - IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, + Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -753,15 +816,21 @@ public async System.Threading.Tasks.Task> DeleteOrderAsyncWi var headerParams = new Dictionary(); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -776,7 +845,9 @@ public async System.Threading.Tasks.Task> DeleteOrderAsyncWi // make the HTTP request - IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, + Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; 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 5502fe15da1..0b9e633c5f3 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 @@ -443,15 +443,21 @@ public ApiResponse CreateUserWithHttpInfo (User body = null) var headerParams = new Dictionary(Configuration.DefaultHeader); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -460,13 +466,21 @@ public ApiResponse CreateUserWithHttpInfo (User body = null) - postBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter - + if (body.GetType() != typeof(byte[])) + { + postBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + postBody = body; // byte array + } // make the HTTP request - IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, + Method.POST, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -508,15 +522,21 @@ public async System.Threading.Tasks.Task> CreateUserAsyncWit var headerParams = new Dictionary(); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -531,7 +551,9 @@ public async System.Threading.Tasks.Task> CreateUserAsyncWit // make the HTTP request - IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, + Method.POST, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -572,15 +594,21 @@ public ApiResponse CreateUsersWithArrayInputWithHttpInfo (List bod var headerParams = new Dictionary(Configuration.DefaultHeader); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -589,13 +617,21 @@ public ApiResponse CreateUsersWithArrayInputWithHttpInfo (List bod - postBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter - + if (body.GetType() != typeof(byte[])) + { + postBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + postBody = body; // byte array + } // make the HTTP request - IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, + Method.POST, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -637,15 +673,21 @@ public async System.Threading.Tasks.Task> CreateUsersWithArr var headerParams = new Dictionary(); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -660,7 +702,9 @@ public async System.Threading.Tasks.Task> CreateUsersWithArr // make the HTTP request - IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, + Method.POST, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -701,15 +745,21 @@ public ApiResponse CreateUsersWithListInputWithHttpInfo (List body var headerParams = new Dictionary(Configuration.DefaultHeader); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -718,13 +768,21 @@ public ApiResponse CreateUsersWithListInputWithHttpInfo (List body - postBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter - + if (body.GetType() != typeof(byte[])) + { + postBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + postBody = body; // byte array + } // make the HTTP request - IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, + Method.POST, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -766,15 +824,21 @@ public async System.Threading.Tasks.Task> CreateUsersWithLis var headerParams = new Dictionary(); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -789,7 +853,9 @@ public async System.Threading.Tasks.Task> CreateUsersWithLis // make the HTTP request - IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, + Method.POST, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -833,15 +899,21 @@ public ApiResponse< string > LoginUserWithHttpInfo (string username = null, stri var headerParams = new Dictionary(Configuration.DefaultHeader); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -857,7 +929,9 @@ public ApiResponse< string > LoginUserWithHttpInfo (string username = null, stri // make the HTTP request - IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, + Method.GET, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -902,15 +976,21 @@ public async System.Threading.Tasks.Task> LoginUserAsyncWith var headerParams = new Dictionary(); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -926,7 +1006,9 @@ public async System.Threading.Tasks.Task> LoginUserAsyncWith // make the HTTP request - IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, + Method.GET, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -965,15 +1047,21 @@ public ApiResponse LogoutUserWithHttpInfo () var headerParams = new Dictionary(Configuration.DefaultHeader); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -987,7 +1075,9 @@ public ApiResponse LogoutUserWithHttpInfo () // make the HTTP request - IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, + Method.GET, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -1027,15 +1117,21 @@ public async System.Threading.Tasks.Task> LogoutUserAsyncWit var headerParams = new Dictionary(); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -1049,7 +1145,9 @@ public async System.Threading.Tasks.Task> LogoutUserAsyncWit // make the HTTP request - IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, + Method.GET, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -1084,7 +1182,8 @@ public ApiResponse< User > GetUserByNameWithHttpInfo (string username) { // verify the required parameter 'username' is set - if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling GetUserByName"); + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->GetUserByName"); var path_ = "/user/{username}"; @@ -1094,15 +1193,21 @@ public ApiResponse< User > GetUserByNameWithHttpInfo (string username) var headerParams = new Dictionary(Configuration.DefaultHeader); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -1117,7 +1222,9 @@ public ApiResponse< User > GetUserByNameWithHttpInfo (string username) // make the HTTP request - IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, + Method.GET, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -1162,15 +1269,21 @@ public async System.Threading.Tasks.Task> GetUserByNameAsyncWi var headerParams = new Dictionary(); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -1185,7 +1298,9 @@ public async System.Threading.Tasks.Task> GetUserByNameAsyncWi // make the HTTP request - IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.GET, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, + Method.GET, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -1221,7 +1336,8 @@ public ApiResponse UpdateUserWithHttpInfo (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"); + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser"); var path_ = "/user/{username}"; @@ -1231,15 +1347,21 @@ public ApiResponse UpdateUserWithHttpInfo (string username, User body = var headerParams = new Dictionary(Configuration.DefaultHeader); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -1249,13 +1371,21 @@ public ApiResponse UpdateUserWithHttpInfo (string username, User body = - postBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter - + if (body.GetType() != typeof(byte[])) + { + postBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter + } + else + { + postBody = body; // byte array + } // make the HTTP request - IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, + Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -1301,15 +1431,21 @@ public async System.Threading.Tasks.Task> UpdateUserAsyncWit var headerParams = new Dictionary(); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -1325,7 +1461,9 @@ public async System.Threading.Tasks.Task> UpdateUserAsyncWit // make the HTTP request - IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, + Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -1359,7 +1497,8 @@ public ApiResponse DeleteUserWithHttpInfo (string username) { // verify the required parameter 'username' is set - if (username == null) throw new ApiException(400, "Missing required parameter 'username' when calling DeleteUser"); + if (username == null) + throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->DeleteUser"); var path_ = "/user/{username}"; @@ -1369,15 +1508,21 @@ public ApiResponse DeleteUserWithHttpInfo (string username) var headerParams = new Dictionary(Configuration.DefaultHeader); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -1392,7 +1537,9 @@ public ApiResponse DeleteUserWithHttpInfo (string username) // make the HTTP request - IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, + Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; @@ -1436,15 +1583,21 @@ public async System.Threading.Tasks.Task> DeleteUserAsyncWit var headerParams = new Dictionary(); var formParams = new Dictionary(); var fileParams = new Dictionary(); - String postBody = null; + Object postBody = null; + + // to determine the Content-Type header + String[] httpContentTypes = new String[] { + + }; + String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header - String[] http_header_accepts = new String[] { + String[] httpHeaderAccepts = new String[] { "application/json", "application/xml" }; - String http_header_accept = Configuration.ApiClient.SelectHeaderAccept(http_header_accepts); - if (http_header_accept != null) - headerParams.Add("Accept", Configuration.ApiClient.SelectHeaderAccept(http_header_accepts)); + String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAccept != null) + headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json @@ -1459,7 +1612,9 @@ public async System.Threading.Tasks.Task> DeleteUserAsyncWit // make the HTTP request - IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, + Method.DELETE, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, httpContentType); int statusCode = (int) response.StatusCode; 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 ee2e1b8b8f0..ab115aba980 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 @@ -77,9 +77,10 @@ public ApiClient(String basePath = "http://petstore.swagger.io/v2") // Creates and sets up a RestRequest prior to a call. private RestRequest PrepareRequest( - String path, RestSharp.Method method, Dictionary queryParams, String postBody, + String path, RestSharp.Method method, Dictionary queryParams, Object postBody, Dictionary headerParams, Dictionary formParams, - Dictionary fileParams, Dictionary pathParams) + Dictionary fileParams, Dictionary pathParams, + String contentType) { var request = new RestRequest(path, method); @@ -103,8 +104,17 @@ private RestRequest PrepareRequest( foreach(var param in fileParams) request.AddFile(param.Value.Name, param.Value.Writer, param.Value.FileName, param.Value.ContentType); - if (postBody != null) // http body (model) parameter - request.AddParameter("application/json", postBody, ParameterType.RequestBody); + if (postBody != null) // http body (model or byte[]) parameter + { + if (postBody.GetType() == typeof(String)) + { + request.AddParameter("application/json", postBody, ParameterType.RequestBody); + } + else if (postBody.GetType() == typeof(byte[])) + { + request.AddParameter(contentType, postBody, ParameterType.RequestBody); + } + } return request; } @@ -120,14 +130,18 @@ private RestRequest PrepareRequest( /// Form parameters. /// File parameters. /// Path parameters. + /// Content Type of the request /// Object public Object CallApi( - String path, RestSharp.Method method, Dictionary queryParams, String postBody, + String path, RestSharp.Method method, Dictionary queryParams, Object postBody, Dictionary headerParams, Dictionary formParams, - Dictionary fileParams, Dictionary pathParams) + Dictionary fileParams, Dictionary pathParams, + String contentType) { var request = PrepareRequest( - path, method, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + path, method, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, contentType); + var response = RestClient.Execute(request); return (Object) response; } @@ -143,14 +157,17 @@ public Object CallApi( /// Form parameters. /// File parameters. /// Path parameters. + /// Content type. /// The Task instance. public async System.Threading.Tasks.Task CallApiAsync( - String path, RestSharp.Method method, Dictionary queryParams, String postBody, + String path, RestSharp.Method method, Dictionary queryParams, Object postBody, Dictionary headerParams, Dictionary formParams, - Dictionary fileParams, Dictionary pathParams) + Dictionary fileParams, Dictionary pathParams, + String contentType) { var request = PrepareRequest( - path, method, queryParams, postBody, headerParams, formParams, fileParams, pathParams); + path, method, queryParams, postBody, headerParams, formParams, fileParams, + pathParams, contentType); var response = await RestClient.ExecuteTaskAsync(request); return (Object)response; } @@ -230,6 +247,10 @@ public object Deserialize(IRestResponse response, Type type) { return content; } + else if (type == typeof(byte[])) // return byte array + { + return data; + } if (type == typeof(Stream)) { @@ -276,11 +297,11 @@ public object Deserialize(IRestResponse response, Type type) } /// - /// Serialize an object into JSON string. + /// Serialize an input (model) into JSON string /// /// Object. /// JSON string. - public string Serialize(object obj) + public String Serialize(object obj) { try { @@ -292,6 +313,24 @@ public string Serialize(object obj) } } + /// + /// Select the Content-Type header's value from the given content-type array: + /// if JSON exists in the given array, use it; + /// otherwise use the first one defined in 'consumes' + /// + /// The Content-Type array to select from. + /// The Content-Type header to use. + public String SelectHeaderContentType(String[] contentTypes) + { + if (contentTypes.Length == 0) + return null; + + if (contentTypes.Contains("application/json", StringComparer.OrdinalIgnoreCase)) + return "application/json"; + + return contentTypes[0]; // use the first content type specified in 'consumes' + } + /// /// Select the Accept header's value from the given accepts array: /// if JSON exists in the given array, use it; diff --git a/samples/client/petstore/csharp/SwaggerClientTest/SwaggerClientTest.userprefs b/samples/client/petstore/csharp/SwaggerClientTest/SwaggerClientTest.userprefs index afe62f18b31..34b1a516f28 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/SwaggerClientTest.userprefs +++ b/samples/client/petstore/csharp/SwaggerClientTest/SwaggerClientTest.userprefs @@ -3,6 +3,10 @@ + + + + @@ -18,4 +22,4 @@ - \ No newline at end of file + diff --git a/samples/client/petstore/csharp/SwaggerClientTest/TestApiClient.cs b/samples/client/petstore/csharp/SwaggerClientTest/TestApiClient.cs index 0fc92c7266e..6eb32a38442 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/TestApiClient.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/TestApiClient.cs @@ -14,6 +14,26 @@ public void TearDown() Configuration.Default.DateTimeFormat = "o"; } + /// + /// Test SelectHeaderContentType + /// + [Test ()] + public void TestSelectHeaderContentType () + { + ApiClient api = new ApiClient (); + String[] contentTypes = new String[] { "application/json", "application/xml" }; + Assert.AreEqual("application/json", api.SelectHeaderContentType (contentTypes)); + + contentTypes = new String[] { "application/xml" }; + Assert.AreEqual("application/xml", api.SelectHeaderContentType (contentTypes)); + + contentTypes = new String[] {}; + Assert.IsNull(api.SelectHeaderContentType (contentTypes)); + } + + /// + /// Test ParameterToString + /// [Test ()] public void TestParameterToString () { diff --git a/samples/client/petstore/csharp/SwaggerClientTest/TestPet.cs b/samples/client/petstore/csharp/SwaggerClientTest/TestPet.cs index fbbf4494951..001b052bf76 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/TestPet.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/TestPet.cs @@ -15,7 +15,10 @@ public class TestPet { public long petId = 11088; - [SetUp] public void Init() + /// + /// Create a Pet object + /// + private Pet createPet() { // create pet Pet p = new Pet(); @@ -36,6 +39,24 @@ [SetUp] public void Init() p.Category = category; p.PhotoUrls = photoUrls; + return p; + } + + /// + /// Convert string to byte array + /// + private byte[] GetBytes(string str) + { + byte[] bytes = new byte[str.Length * sizeof(char)]; + System.Buffer.BlockCopy(str.ToCharArray(), 0, bytes, 0, bytes.Length); + return bytes; + } + + [SetUp] public void Init() + { + // create pet + Pet p = createPet(); + // add pet before testing PetApi petApi = new PetApi("http://petstore.swagger.io/v2/"); petApi.AddPet (p); @@ -137,6 +158,35 @@ public void TestGetPetById () } + /// + /// Test GetPetByIdWithByteArray + /// + [Test ()] + public void TestGetPetByIdWithByteArray () + { + // set timeout to 10 seconds + Configuration c1 = new Configuration (timeout: 10000); + + PetApi petApi = new PetApi (c1); + byte[] response = petApi.GetPetByIdWithByteArray (petId); + Assert.IsInstanceOf (response, "Response is byte array"); + } + + /// + /// Test AddPetUsingByteArray + /// + [Test ()] + public void TestAddPetUsingByteArray () + { + // set timeout to 10 seconds + Configuration c1 = new Configuration (timeout: 10000); + + PetApi petApi = new PetApi (c1); + Pet p = createPet (); + byte[] petByteArray = GetBytes ((string)petApi.Configuration.ApiClient.Serialize (p)); + petApi.AddPetUsingByteArray (petByteArray); + } + /// /// Test UpdatePetWithForm /// diff --git a/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll.mdb b/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll.mdb deleted file mode 100644 index d4c01b5c42a8c3b132647584a5049b0c6ed86807..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 31212 zcmdUY2UrwW`~AH;3+%G4x)g=AfFL#mWEU)e4KUW&q9y?q0TDqdQY;u1uqAe}_kvxq zHxRIQ6BA49y=#hHV~PKBr?HD@%>Vhm@9`%&d(OP?otZoDymRlJyE7ZRWy9XOR=eBG zK!ktGjy%43>2`k8tf#x{*zHl+{5FV?M7VnNB&003FP786O#e1e&^eTlpW&})2c!6p zt;hbo!#@>R%`Xu$lX`Vdj!H`Q8W7XBZ%lYxWbdf>Xs@7zo>5*Yafx2Z1Hz-Dqmn!# zVTg{3_eu_rOY9q!>=oHJCMrI~D={i1IVB+}$}2LtcX(2w*H=REAl}<4DmlfgO-zKj z)hjtE(km`JCSF>nWjm>WSJT88ul7+XAkWC;9?RmJ9PgRgX6wViQyEFiXZd}XJk595 zvO9-%Yu^YUh0p8 zM+dvPKJIO-W*_qMo(-A*In`arHI_PpDj{9Z1SQ1xiiu853je@CblSZn@y@AN z&m1PN4|{k?;Ya3vP6zQN+PJ=6LE$M;(FsX|N;n5I3l=G@_S|e~X#4xND`}lheqI-` zQ2lmEJ)@FJsC$8DrP#__3JVP*e3NI}c%CCOKEKeT=`W$?z5~jZKeyeFoBH~N-0rZcwE$ggrq*TyI?SkF1TTT zA5UM;rpd`saS?q7HBCuLiit=~DXHeizIk{dX`i8o;&uhUd9>bPg3-5v5RMQfAr^#K z5@JON#@rZkTN9!oq!b}qLP`@-Mi{rF@IwXlx78aAMnY*>wbsYQMopiTCr`^iE6+AY zxYw+Jzh76qSVC7$S58f*I*@4&(;b8&-*eQ~Cd6Qf#5UAgNAG}OHQnYwwmamC1+qA5 z$9!sf)`6UJI4_!Ka}-t&`lkbV=arsfmk9>s|>-apHo7b+4GdQR0H7Dls8BB`~4qAYx_PJ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