diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api.mustache index 4083269ab18e..7c5669aa2a2f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api.mustache @@ -6,6 +6,7 @@ import {{invokerPackage}}.ApiClient; {{/imports}} import com.fasterxml.jackson.core.type.TypeReference; +import com.google.api.client.http.EmptyContent; import com.google.api.client.http.GenericUrl; import com.google.api.client.http.HttpContent; import com.google.api.client.http.InputStreamContent; @@ -107,7 +108,7 @@ public class {{classname}} { String localVarUrl = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}} GenericUrl genericUrl = new GenericUrl(localVarUrl); - HttpContent content = {{#isBodyAllowed}}apiClient.new JacksonJsonHttpContent({{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}){{/isBodyAllowed}}{{^isBodyAllowed}}null{{/isBodyAllowed}}; + HttpContent content = {{#isBodyAllowed}}{{#bodyParam}}apiClient.new JacksonJsonHttpContent({{paramName}}){{/bodyParam}}{{^bodyParam}}new EmptyContent(){{/bodyParam}}{{/isBodyAllowed}}{{^isBodyAllowed}}null{{/isBodyAllowed}}; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content).execute(); }{{#bodyParam}} @@ -179,7 +180,7 @@ public class {{classname}} { String localVarUrl = uriBuilder{{#hasPathParams}}.buildFromMap(uriVariables).toString();{{/hasPathParams}}{{^hasPathParams}}.build().toString();{{/hasPathParams}} GenericUrl genericUrl = new GenericUrl(localVarUrl); - HttpContent content = {{#isBodyAllowed}}apiClient.new JacksonJsonHttpContent({{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}){{/isBodyAllowed}}{{^isBodyAllowed}}null{{/isBodyAllowed}}; + HttpContent content = {{#isBodyAllowed}}{{#bodyParam}}apiClient.new JacksonJsonHttpContent({{paramName}}){{/bodyParam}}{{^bodyParam}}new EmptyContent(){{/bodyParam}}{{/isBodyAllowed}}{{^isBodyAllowed}}null{{/isBodyAllowed}}; return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.{{httpMethod}}, genericUrl, content).execute(); } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache index ab6a4a1353c6..4d2c3e21b617 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache @@ -704,7 +704,7 @@ public class ApiClient { } } - Entity entity = serialize(body, formParams, contentType); + Entity entity = (body == null) ? Entity.json("") : serialize(body, formParams, contentType); Response response = null; @@ -716,7 +716,7 @@ public class ApiClient { } else if ("PUT".equals(method)) { response = invocationBuilder.put(entity); } else if ("DELETE".equals(method)) { - response = invocationBuilder.delete(); + response = invocationBuilder.method("DELETE", entity); } else if ("PATCH".equals(method)) { response = invocationBuilder.method("PATCH", entity); } else if ("HEAD".equals(method)) { @@ -776,6 +776,8 @@ public class ApiClient { clientConfig.register(json); clientConfig.register(JacksonFeature.class); clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true); + // turn off compliance validation to be able to send payloads with DELETE calls + clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true); if (debugging) { {{^supportJava6}} clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */)); @@ -786,6 +788,9 @@ public class ApiClient { {{#supportJava6}} clientConfig.register(new LoggingFilter(java.util.logging.Logger.getLogger(LoggingFilter.class.getName()), true)); {{/supportJava6}} + } else { + // suppress warnings for payloads with DELETE calls: + java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE); } performAdditionalClientConfiguration(clientConfig); return ClientBuilder.newClient(clientConfig); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache index 19c079e3229b..89131a0f9433 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache @@ -107,7 +107,7 @@ public class {{classname}} { @Deprecated {{/isDeprecated}} public ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException { - Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}new Object(){{/bodyParam}}; + Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set if ({{paramName}} == null) { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache index 32b1e3fcf040..26015967b404 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache @@ -90,7 +90,7 @@ public class {{classname}} { @Deprecated {{/isDeprecated}} public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} okhttp3.Call {{operationId}}Call({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback _callback) throws ApiException { - Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}new Object(){{/bodyParam}}; + Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; // create path and map variables String localVarPath = "{{{path}}}"{{#pathParams}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache index dbf79473a235..ca672da4998a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache @@ -663,9 +663,9 @@ public class ApiClient { } else if ("PUT".equals(method)) { response = invocationBuilder.put(entity); } else if ("DELETE".equals(method)) { - response = invocationBuilder.delete(); + response = invocationBuilder.method("DELETE", entity); } else if ("PATCH".equals(method)) { - response = invocationBuilder.header("X-HTTP-Method-Override", "PATCH").post(entity); + response = invocationBuilder.method("PATCH", entity); } else if ("HEAD".equals(method)) { response = invocationBuilder.head(); } else if ("OPTIONS".equals(method)) { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/api.mustache index f6806af6b5fd..e13ddbc9e161 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/api.mustache @@ -57,7 +57,7 @@ public class {{classname}} { @Deprecated {{/isDeprecated}} public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException { - Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}new Object(){{/bodyParam}}; + Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set if ({{paramName}} == null) { diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index e24d44fdb2cc..f5ef6820a7f3 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -5,6 +5,7 @@ import org.openapitools.client.model.Client; import com.fasterxml.jackson.core.type.TypeReference; +import com.google.api.client.http.EmptyContent; import com.google.api.client.http.GenericUrl; import com.google.api.client.http.HttpContent; import com.google.api.client.http.InputStreamContent; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/FakeApi.java index 0d3e6189c2bf..60705fb09f26 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/FakeApi.java @@ -13,6 +13,7 @@ import org.openapitools.client.model.XmlItem; import com.fasterxml.jackson.core.type.TypeReference; +import com.google.api.client.http.EmptyContent; import com.google.api.client.http.GenericUrl; import com.google.api.client.http.HttpContent; import com.google.api.client.http.InputStreamContent; @@ -807,7 +808,7 @@ public HttpResponse testEndpointParametersForHttpResponse(BigDecimal number, Dou String localVarUrl = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(localVarUrl); - HttpContent content = apiClient.new JacksonJsonHttpContent(null); + HttpContent content = new EmptyContent(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } @@ -848,7 +849,7 @@ public HttpResponse testEndpointParametersForHttpResponse(BigDecimal number, Dou String localVarUrl = uriBuilder.build().toString(); GenericUrl genericUrl = new GenericUrl(localVarUrl); - HttpContent content = apiClient.new JacksonJsonHttpContent(null); + HttpContent content = new EmptyContent(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } @@ -1362,7 +1363,7 @@ public HttpResponse testQueryParameterCollectionFormatForHttpResponse(List pa String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); GenericUrl genericUrl = new GenericUrl(localVarUrl); - HttpContent content = apiClient.new JacksonJsonHttpContent(null); + HttpContent content = new EmptyContent(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } @@ -767,7 +768,7 @@ public HttpResponse uploadFileWithRequiredFileForHttpResponse(Long petId, File r String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); GenericUrl genericUrl = new GenericUrl(localVarUrl); - HttpContent content = apiClient.new JacksonJsonHttpContent(null); + HttpContent content = new EmptyContent(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } @@ -805,7 +806,7 @@ public HttpResponse uploadFileWithRequiredFileForHttpResponse(Long petId, File r String localVarUrl = uriBuilder.buildFromMap(uriVariables).toString(); GenericUrl genericUrl = new GenericUrl(localVarUrl); - HttpContent content = apiClient.new JacksonJsonHttpContent(null); + HttpContent content = new EmptyContent(); return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.POST, genericUrl, content).execute(); } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/StoreApi.java index 5e1af4a412b6..78fc7b3960d2 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/StoreApi.java @@ -5,6 +5,7 @@ import org.openapitools.client.model.Order; import com.fasterxml.jackson.core.type.TypeReference; +import com.google.api.client.http.EmptyContent; import com.google.api.client.http.GenericUrl; import com.google.api.client.http.HttpContent; import com.google.api.client.http.InputStreamContent; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/UserApi.java index 9b49eafa95d4..ee22d3ae0969 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/UserApi.java @@ -5,6 +5,7 @@ import org.openapitools.client.model.User; import com.fasterxml.jackson.core.type.TypeReference; +import com.google.api.client.http.EmptyContent; import com.google.api.client.http.GenericUrl; import com.google.api.client.http.HttpContent; import com.google.api.client.http.InputStreamContent; diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/ApiClient.java index 6ece611c54a7..3ac9d1688ce8 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/ApiClient.java @@ -688,7 +688,7 @@ public ApiResponse invokeAPI(String path, String method, List query } } - Entity entity = serialize(body, formParams, contentType); + Entity entity = (body == null) ? Entity.json("") : serialize(body, formParams, contentType); Response response = null; @@ -700,7 +700,7 @@ public ApiResponse invokeAPI(String path, String method, List query } else if ("PUT".equals(method)) { response = invocationBuilder.put(entity); } else if ("DELETE".equals(method)) { - response = invocationBuilder.delete(); + response = invocationBuilder.method("DELETE", entity); } else if ("PATCH".equals(method)) { response = invocationBuilder.method("PATCH", entity); } else if ("HEAD".equals(method)) { @@ -760,8 +760,13 @@ protected Client buildHttpClient(boolean debugging) { clientConfig.register(json); clientConfig.register(JacksonFeature.class); clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true); + // turn off compliance validation to be able to send payloads with DELETE calls + clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true); if (debugging) { clientConfig.register(new LoggingFilter(java.util.logging.Logger.getLogger(LoggingFilter.class.getName()), true)); + } else { + // suppress warnings for payloads with DELETE calls: + java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE); } performAdditionalClientConfiguration(clientConfig); return ClientBuilder.newClient(clientConfig); diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java index a18ca5f3f56c..267830f13ed4 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/FakeApi.java @@ -584,7 +584,7 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat */ public ApiResponse testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'number' is set if (number == null) { @@ -705,7 +705,7 @@ public void testEnumParameters(List enumHeaderStringArray, String enumHe */ public ApiResponse testEnumParametersWithHttpInfo(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake"; @@ -784,7 +784,7 @@ public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBoo */ public ApiResponse testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'requiredStringGroup' is set if (requiredStringGroup == null) { @@ -928,7 +928,7 @@ public void testJsonFormData(String param, String param2) throws ApiException { */ public ApiResponse testJsonFormDataWithHttpInfo(String param, String param2) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'param' is set if (param == null) { @@ -1007,7 +1007,7 @@ public void testQueryParameterCollectionFormat(List pipe, List i */ public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'pipe' is set if (pipe == null) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/PetApi.java index 22a80aefe3a1..9e59435a5f17 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/PetApi.java @@ -134,7 +134,7 @@ public void deletePet(Long petId, String apiKey) throws ApiException { */ public ApiResponse deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -201,7 +201,7 @@ public List findPetsByStatus(List status) throws ApiException { */ public ApiResponse> findPetsByStatusWithHttpInfo(List status) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'status' is set if (status == null) { @@ -270,7 +270,7 @@ public List findPetsByTags(List tags) throws ApiException { */ @Deprecated public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'tags' is set if (tags == null) { @@ -337,7 +337,7 @@ public Pet getPetById(Long petId) throws ApiException { */ public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -472,7 +472,7 @@ public void updatePetWithForm(Long petId, String name, String status) throws Api */ public ApiResponse updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -543,7 +543,7 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File f */ public ApiResponse uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -614,7 +614,7 @@ public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile */ public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/StoreApi.java index 84c59b439eb0..5093a9d41165 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/StoreApi.java @@ -66,7 +66,7 @@ public void deleteOrder(String orderId) throws ApiException { */ public ApiResponse deleteOrderWithHttpInfo(String orderId) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'orderId' is set if (orderId == null) { @@ -127,7 +127,7 @@ public Map getInventory() throws ApiException { */ public ApiResponse> getInventoryWithHttpInfo() throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/store/inventory"; @@ -188,7 +188,7 @@ public Order getOrderById(Long orderId) throws ApiException { */ public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'orderId' is set if (orderId == null) { diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/UserApi.java index 1573bbde1ca6..78b37fbceab9 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/UserApi.java @@ -252,7 +252,7 @@ public void deleteUser(String username) throws ApiException { */ public ApiResponse deleteUserWithHttpInfo(String username) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -319,7 +319,7 @@ public User getUserByName(String username) throws ApiException { */ public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -386,7 +386,7 @@ public String loginUser(String username, String password) throws ApiException { */ public ApiResponse loginUserWithHttpInfo(String username, String password) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -453,7 +453,7 @@ public void logoutUser() throws ApiException { */ public ApiResponse logoutUserWithHttpInfo() throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/user/logout"; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java index 7910c620b5ae..a06ca6f8d63d 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java @@ -688,7 +688,7 @@ public ApiResponse invokeAPI(String path, String method, List query } } - Entity entity = serialize(body, formParams, contentType); + Entity entity = (body == null) ? Entity.json("") : serialize(body, formParams, contentType); Response response = null; @@ -700,7 +700,7 @@ public ApiResponse invokeAPI(String path, String method, List query } else if ("PUT".equals(method)) { response = invocationBuilder.put(entity); } else if ("DELETE".equals(method)) { - response = invocationBuilder.delete(); + response = invocationBuilder.method("DELETE", entity); } else if ("PATCH".equals(method)) { response = invocationBuilder.method("PATCH", entity); } else if ("HEAD".equals(method)) { @@ -760,11 +760,16 @@ protected Client buildHttpClient(boolean debugging) { clientConfig.register(json); clientConfig.register(JacksonFeature.class); clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true); + // turn off compliance validation to be able to send payloads with DELETE calls + clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true); if (debugging) { clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */)); clientConfig.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY); // Set logger to ALL java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME).setLevel(java.util.logging.Level.ALL); + } else { + // suppress warnings for payloads with DELETE calls: + java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE); } performAdditionalClientConfiguration(clientConfig); return ClientBuilder.newClient(clientConfig); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java index 9437dff71b61..8324e74ea04b 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/FakeApi.java @@ -584,7 +584,7 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat */ public ApiResponse testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'number' is set if (number == null) { @@ -705,7 +705,7 @@ public void testEnumParameters(List enumHeaderStringArray, String enumHe */ public ApiResponse testEnumParametersWithHttpInfo(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake"; @@ -784,7 +784,7 @@ public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBoo */ public ApiResponse testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'requiredStringGroup' is set if (requiredStringGroup == null) { @@ -928,7 +928,7 @@ public void testJsonFormData(String param, String param2) throws ApiException { */ public ApiResponse testJsonFormDataWithHttpInfo(String param, String param2) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'param' is set if (param == null) { @@ -1007,7 +1007,7 @@ public void testQueryParameterCollectionFormat(List pipe, List i */ public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'pipe' is set if (pipe == null) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/PetApi.java index 22a80aefe3a1..9e59435a5f17 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/PetApi.java @@ -134,7 +134,7 @@ public void deletePet(Long petId, String apiKey) throws ApiException { */ public ApiResponse deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -201,7 +201,7 @@ public List findPetsByStatus(List status) throws ApiException { */ public ApiResponse> findPetsByStatusWithHttpInfo(List status) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'status' is set if (status == null) { @@ -270,7 +270,7 @@ public List findPetsByTags(List tags) throws ApiException { */ @Deprecated public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'tags' is set if (tags == null) { @@ -337,7 +337,7 @@ public Pet getPetById(Long petId) throws ApiException { */ public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -472,7 +472,7 @@ public void updatePetWithForm(Long petId, String name, String status) throws Api */ public ApiResponse updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -543,7 +543,7 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File f */ public ApiResponse uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -614,7 +614,7 @@ public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile */ public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/StoreApi.java index 84c59b439eb0..5093a9d41165 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/StoreApi.java @@ -66,7 +66,7 @@ public void deleteOrder(String orderId) throws ApiException { */ public ApiResponse deleteOrderWithHttpInfo(String orderId) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'orderId' is set if (orderId == null) { @@ -127,7 +127,7 @@ public Map getInventory() throws ApiException { */ public ApiResponse> getInventoryWithHttpInfo() throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/store/inventory"; @@ -188,7 +188,7 @@ public Order getOrderById(Long orderId) throws ApiException { */ public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'orderId' is set if (orderId == null) { diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java index 1573bbde1ca6..78b37fbceab9 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java @@ -252,7 +252,7 @@ public void deleteUser(String username) throws ApiException { */ public ApiResponse deleteUserWithHttpInfo(String username) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -319,7 +319,7 @@ public User getUserByName(String username) throws ApiException { */ public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -386,7 +386,7 @@ public String loginUser(String username, String password) throws ApiException { */ public ApiResponse loginUserWithHttpInfo(String username, String password) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -453,7 +453,7 @@ public void logoutUser() throws ApiException { */ public ApiResponse logoutUserWithHttpInfo() throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/user/logout"; diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/ApiClient.java index 7910c620b5ae..a06ca6f8d63d 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/ApiClient.java @@ -688,7 +688,7 @@ public ApiResponse invokeAPI(String path, String method, List query } } - Entity entity = serialize(body, formParams, contentType); + Entity entity = (body == null) ? Entity.json("") : serialize(body, formParams, contentType); Response response = null; @@ -700,7 +700,7 @@ public ApiResponse invokeAPI(String path, String method, List query } else if ("PUT".equals(method)) { response = invocationBuilder.put(entity); } else if ("DELETE".equals(method)) { - response = invocationBuilder.delete(); + response = invocationBuilder.method("DELETE", entity); } else if ("PATCH".equals(method)) { response = invocationBuilder.method("PATCH", entity); } else if ("HEAD".equals(method)) { @@ -760,11 +760,16 @@ protected Client buildHttpClient(boolean debugging) { clientConfig.register(json); clientConfig.register(JacksonFeature.class); clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true); + // turn off compliance validation to be able to send payloads with DELETE calls + clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true); if (debugging) { clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */)); clientConfig.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY); // Set logger to ALL java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME).setLevel(java.util.logging.Level.ALL); + } else { + // suppress warnings for payloads with DELETE calls: + java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE); } performAdditionalClientConfiguration(clientConfig); return ClientBuilder.newClient(clientConfig); diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/FakeApi.java index a18ca5f3f56c..267830f13ed4 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/FakeApi.java @@ -584,7 +584,7 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat */ public ApiResponse testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'number' is set if (number == null) { @@ -705,7 +705,7 @@ public void testEnumParameters(List enumHeaderStringArray, String enumHe */ public ApiResponse testEnumParametersWithHttpInfo(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake"; @@ -784,7 +784,7 @@ public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBoo */ public ApiResponse testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'requiredStringGroup' is set if (requiredStringGroup == null) { @@ -928,7 +928,7 @@ public void testJsonFormData(String param, String param2) throws ApiException { */ public ApiResponse testJsonFormDataWithHttpInfo(String param, String param2) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'param' is set if (param == null) { @@ -1007,7 +1007,7 @@ public void testQueryParameterCollectionFormat(List pipe, List i */ public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'pipe' is set if (pipe == null) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/PetApi.java index 22a80aefe3a1..9e59435a5f17 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/PetApi.java @@ -134,7 +134,7 @@ public void deletePet(Long petId, String apiKey) throws ApiException { */ public ApiResponse deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -201,7 +201,7 @@ public List findPetsByStatus(List status) throws ApiException { */ public ApiResponse> findPetsByStatusWithHttpInfo(List status) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'status' is set if (status == null) { @@ -270,7 +270,7 @@ public List findPetsByTags(List tags) throws ApiException { */ @Deprecated public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'tags' is set if (tags == null) { @@ -337,7 +337,7 @@ public Pet getPetById(Long petId) throws ApiException { */ public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -472,7 +472,7 @@ public void updatePetWithForm(Long petId, String name, String status) throws Api */ public ApiResponse updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -543,7 +543,7 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File f */ public ApiResponse uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -614,7 +614,7 @@ public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile */ public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/StoreApi.java index 84c59b439eb0..5093a9d41165 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/StoreApi.java @@ -66,7 +66,7 @@ public void deleteOrder(String orderId) throws ApiException { */ public ApiResponse deleteOrderWithHttpInfo(String orderId) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'orderId' is set if (orderId == null) { @@ -127,7 +127,7 @@ public Map getInventory() throws ApiException { */ public ApiResponse> getInventoryWithHttpInfo() throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/store/inventory"; @@ -188,7 +188,7 @@ public Order getOrderById(Long orderId) throws ApiException { */ public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'orderId' is set if (orderId == null) { diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/UserApi.java index 1573bbde1ca6..78b37fbceab9 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/api/UserApi.java @@ -252,7 +252,7 @@ public void deleteUser(String username) throws ApiException { */ public ApiResponse deleteUserWithHttpInfo(String username) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -319,7 +319,7 @@ public User getUserByName(String username) throws ApiException { */ public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -386,7 +386,7 @@ public String loginUser(String username, String password) throws ApiException { */ public ApiResponse loginUserWithHttpInfo(String username, String password) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -453,7 +453,7 @@ public void logoutUser() throws ApiException { */ public ApiResponse logoutUserWithHttpInfo() throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/user/logout"; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java index 2fe5bcfc1648..c070ab318358 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java @@ -942,7 +942,7 @@ public okhttp3.Call testClientModelAsync(Client body, final ApiCallback */ public okhttp3.Call testEndpointParametersCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake"; @@ -1168,7 +1168,7 @@ public okhttp3.Call testEndpointParametersAsync(BigDecimal number, Double _doubl */ public okhttp3.Call testEnumParametersCall(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake"; @@ -1312,7 +1312,7 @@ public okhttp3.Call testEnumParametersAsync(List enumHeaderStringArray, return localVarCall; } private okhttp3.Call testGroupParametersCall(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake"; @@ -1637,7 +1637,7 @@ public okhttp3.Call testInlineAdditionalPropertiesAsync(Map para */ public okhttp3.Call testJsonFormDataCall(String param, String param2, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake/jsonFormData"; @@ -1762,7 +1762,7 @@ public okhttp3.Call testJsonFormDataAsync(String param, String param2, final Api */ public okhttp3.Call testQueryParameterCollectionFormatCall(List pipe, List ioutil, List http, List url, List context, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake/test-query-paramters"; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java index ce889eb24ecd..c0c72236815c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java @@ -180,7 +180,7 @@ public okhttp3.Call addPetAsync(Pet body, final ApiCallback _callback) thr */ public okhttp3.Call deletePetCall(Long petId, String apiKey, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/pet/{petId}" @@ -297,7 +297,7 @@ public okhttp3.Call deletePetAsync(Long petId, String apiKey, final ApiCallback< */ public okhttp3.Call findPetsByStatusCall(List status, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/pet/findByStatus"; @@ -416,7 +416,7 @@ public okhttp3.Call findPetsByStatusAsync(List status, final ApiCallback */ @Deprecated public okhttp3.Call findPetsByTagsCall(List tags, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/pet/findByTags"; @@ -541,7 +541,7 @@ public okhttp3.Call findPetsByTagsAsync(List tags, final ApiCallback */ public okhttp3.Call getPetByIdCall(Long petId, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/pet/{petId}" @@ -776,7 +776,7 @@ public okhttp3.Call updatePetAsync(Pet body, final ApiCallback _callback) */ public okhttp3.Call updatePetWithFormCall(Long petId, String name, String status, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/pet/{petId}" @@ -898,7 +898,7 @@ public okhttp3.Call updatePetWithFormAsync(Long petId, String name, String statu */ public okhttp3.Call uploadFileCall(Long petId, String additionalMetadata, File file, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/pet/{petId}/uploadImage" @@ -1024,7 +1024,7 @@ public okhttp3.Call uploadFileAsync(Long petId, String additionalMetadata, File */ public okhttp3.Call uploadFileWithRequiredFileCall(Long petId, File requiredFile, String additionalMetadata, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile" diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/StoreApi.java index d61f72719436..748ae2e8c0a4 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/StoreApi.java @@ -68,7 +68,7 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call deleteOrderCall(String orderId, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/store/order/{order_id}" @@ -176,7 +176,7 @@ public okhttp3.Call deleteOrderAsync(String orderId, final ApiCallback _ca */ public okhttp3.Call getInventoryCall(final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/store/inventory"; @@ -279,7 +279,7 @@ public okhttp3.Call getInventoryAsync(final ApiCallback> _c */ public okhttp3.Call getOrderByIdCall(Long orderId, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/store/order/{order_id}" diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java index f3e783d0bc81..d96b89b607ce 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java @@ -383,7 +383,7 @@ public okhttp3.Call createUsersWithListInputAsync(List body, final ApiCall */ public okhttp3.Call deleteUserCall(String username, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/user/{username}" @@ -494,7 +494,7 @@ public okhttp3.Call deleteUserAsync(String username, final ApiCallback _ca */ public okhttp3.Call getUserByNameCall(String username, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/user/{username}" @@ -612,7 +612,7 @@ public okhttp3.Call getUserByNameAsync(String username, final ApiCallback */ public okhttp3.Call loginUserCall(String username, String password, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/user/login"; @@ -739,7 +739,7 @@ public okhttp3.Call loginUserAsync(String username, String password, final ApiCa */ public okhttp3.Call logoutUserCall(final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/user/logout"; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java index 2fe5bcfc1648..c070ab318358 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java @@ -942,7 +942,7 @@ public okhttp3.Call testClientModelAsync(Client body, final ApiCallback */ public okhttp3.Call testEndpointParametersCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake"; @@ -1168,7 +1168,7 @@ public okhttp3.Call testEndpointParametersAsync(BigDecimal number, Double _doubl */ public okhttp3.Call testEnumParametersCall(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake"; @@ -1312,7 +1312,7 @@ public okhttp3.Call testEnumParametersAsync(List enumHeaderStringArray, return localVarCall; } private okhttp3.Call testGroupParametersCall(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake"; @@ -1637,7 +1637,7 @@ public okhttp3.Call testInlineAdditionalPropertiesAsync(Map para */ public okhttp3.Call testJsonFormDataCall(String param, String param2, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake/jsonFormData"; @@ -1762,7 +1762,7 @@ public okhttp3.Call testJsonFormDataAsync(String param, String param2, final Api */ public okhttp3.Call testQueryParameterCollectionFormatCall(List pipe, List ioutil, List http, List url, List context, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake/test-query-paramters"; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java index ce889eb24ecd..c0c72236815c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java @@ -180,7 +180,7 @@ public okhttp3.Call addPetAsync(Pet body, final ApiCallback _callback) thr */ public okhttp3.Call deletePetCall(Long petId, String apiKey, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/pet/{petId}" @@ -297,7 +297,7 @@ public okhttp3.Call deletePetAsync(Long petId, String apiKey, final ApiCallback< */ public okhttp3.Call findPetsByStatusCall(List status, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/pet/findByStatus"; @@ -416,7 +416,7 @@ public okhttp3.Call findPetsByStatusAsync(List status, final ApiCallback */ @Deprecated public okhttp3.Call findPetsByTagsCall(List tags, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/pet/findByTags"; @@ -541,7 +541,7 @@ public okhttp3.Call findPetsByTagsAsync(List tags, final ApiCallback */ public okhttp3.Call getPetByIdCall(Long petId, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/pet/{petId}" @@ -776,7 +776,7 @@ public okhttp3.Call updatePetAsync(Pet body, final ApiCallback _callback) */ public okhttp3.Call updatePetWithFormCall(Long petId, String name, String status, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/pet/{petId}" @@ -898,7 +898,7 @@ public okhttp3.Call updatePetWithFormAsync(Long petId, String name, String statu */ public okhttp3.Call uploadFileCall(Long petId, String additionalMetadata, File file, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/pet/{petId}/uploadImage" @@ -1024,7 +1024,7 @@ public okhttp3.Call uploadFileAsync(Long petId, String additionalMetadata, File */ public okhttp3.Call uploadFileWithRequiredFileCall(Long petId, File requiredFile, String additionalMetadata, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile" diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/StoreApi.java index d61f72719436..748ae2e8c0a4 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/StoreApi.java @@ -68,7 +68,7 @@ public void setApiClient(ApiClient apiClient) { */ public okhttp3.Call deleteOrderCall(String orderId, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/store/order/{order_id}" @@ -176,7 +176,7 @@ public okhttp3.Call deleteOrderAsync(String orderId, final ApiCallback _ca */ public okhttp3.Call getInventoryCall(final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/store/inventory"; @@ -279,7 +279,7 @@ public okhttp3.Call getInventoryAsync(final ApiCallback> _c */ public okhttp3.Call getOrderByIdCall(Long orderId, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/store/order/{order_id}" diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java index f3e783d0bc81..d96b89b607ce 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java @@ -383,7 +383,7 @@ public okhttp3.Call createUsersWithListInputAsync(List body, final ApiCall */ public okhttp3.Call deleteUserCall(String username, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/user/{username}" @@ -494,7 +494,7 @@ public okhttp3.Call deleteUserAsync(String username, final ApiCallback _ca */ public okhttp3.Call getUserByNameCall(String username, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/user/{username}" @@ -612,7 +612,7 @@ public okhttp3.Call getUserByNameAsync(String username, final ApiCallback */ public okhttp3.Call loginUserCall(String username, String password, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/user/login"; @@ -739,7 +739,7 @@ public okhttp3.Call loginUserAsync(String username, String password, final ApiCa */ public okhttp3.Call logoutUserCall(final ApiCallback _callback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/user/logout"; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java index 6c64af96f197..51552f8230dd 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/ApiClient.java @@ -653,9 +653,9 @@ public T invokeAPI(String path, String method, List queryParams, Objec } else if ("PUT".equals(method)) { response = invocationBuilder.put(entity); } else if ("DELETE".equals(method)) { - response = invocationBuilder.delete(); + response = invocationBuilder.method("DELETE", entity); } else if ("PATCH".equals(method)) { - response = invocationBuilder.header("X-HTTP-Method-Override", "PATCH").post(entity); + response = invocationBuilder.method("PATCH", entity); } else if ("HEAD".equals(method)) { response = invocationBuilder.head(); } else if ("OPTIONS".equals(method)) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java index ff840639782f..bf9c1667efe3 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/FakeApi.java @@ -374,7 +374,7 @@ public Client testClientModel(Client body) throws ApiException { * @throws ApiException if fails to make API call */ public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'number' is set if (number == null) { @@ -464,7 +464,7 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat * @throws ApiException if fails to make API call */ public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/fake".replaceAll("\\{format\\}","json"); @@ -516,7 +516,7 @@ public void testEnumParameters(List enumHeaderStringArray, String enumHe * @throws ApiException if fails to make API call */ public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'requiredStringGroup' is set if (requiredStringGroup == null) { @@ -615,7 +615,7 @@ public void testInlineAdditionalProperties(Map param) throws Api * @throws ApiException if fails to make API call */ public void testJsonFormData(String param, String param2) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'param' is set if (param == null) { @@ -668,7 +668,7 @@ public void testJsonFormData(String param, String param2) throws ApiException { * @throws ApiException if fails to make API call */ public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'pipe' is set if (pipe == null) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/PetApi.java index bde2cae971d9..4d85cdd1fe40 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/PetApi.java @@ -84,7 +84,7 @@ public void addPet(Pet body) throws ApiException { * @throws ApiException if fails to make API call */ public void deletePet(Long petId, String apiKey) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -128,7 +128,7 @@ public void deletePet(Long petId, String apiKey) throws ApiException { * @throws ApiException if fails to make API call */ public List findPetsByStatus(List status) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'status' is set if (status == null) { @@ -172,7 +172,7 @@ public List findPetsByStatus(List status) throws ApiException { */ @Deprecated public List findPetsByTags(List tags) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'tags' is set if (tags == null) { @@ -214,7 +214,7 @@ public List findPetsByTags(List tags) throws ApiException { * @throws ApiException if fails to make API call */ public Pet getPetById(Long petId) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -297,7 +297,7 @@ public void updatePet(Pet body) throws ApiException { * @throws ApiException if fails to make API call */ public void updatePetWithForm(Long petId, String name, String status) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -345,7 +345,7 @@ public void updatePetWithForm(Long petId, String name, String status) throws Api * @throws ApiException if fails to make API call */ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { @@ -393,7 +393,7 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File f * @throws ApiException if fails to make API call */ public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'petId' is set if (petId == null) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/StoreApi.java index 61ecbcd45bd5..c88879d7e845 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/StoreApi.java @@ -41,7 +41,7 @@ public void setApiClient(ApiClient apiClient) { * @throws ApiException if fails to make API call */ public void deleteOrder(String orderId) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'orderId' is set if (orderId == null) { @@ -82,7 +82,7 @@ public void deleteOrder(String orderId) throws ApiException { * @throws ApiException if fails to make API call */ public Map getInventory() throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/store/inventory".replaceAll("\\{format\\}","json"); @@ -118,7 +118,7 @@ public Map getInventory() throws ApiException { * @throws ApiException if fails to make API call */ public Order getOrderById(Long orderId) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'orderId' is set if (orderId == null) { diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/UserApi.java index c52ebbc6eed4..ee251c3858d5 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/UserApi.java @@ -161,7 +161,7 @@ public void createUsersWithListInput(List body) throws ApiException { * @throws ApiException if fails to make API call */ public void deleteUser(String username) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -203,7 +203,7 @@ public void deleteUser(String username) throws ApiException { * @throws ApiException if fails to make API call */ public User getUserByName(String username) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -246,7 +246,7 @@ public User getUserByName(String username) throws ApiException { * @throws ApiException if fails to make API call */ public String loginUser(String username, String password) throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // verify the required parameter 'username' is set if (username == null) { @@ -292,7 +292,7 @@ public String loginUser(String username, String password) throws ApiException { * @throws ApiException if fails to make API call */ public void logoutUser() throws ApiException { - Object localVarPostBody = new Object(); + Object localVarPostBody = null; // create path and map variables String localVarPath = "/user/logout".replaceAll("\\{format\\}","json");