From 8791c1b07a17f386c62b6bbe7b8d280d9c48027f Mon Sep 17 00:00:00 2001 From: Chhida <44230565+Chhida@users.noreply.github.com> Date: Tue, 14 Apr 2026 15:54:12 +0100 Subject: [PATCH 01/17] [Java][jersey3] Add error entity deserialization to ApiException - Add errorEntity field and getErrorEntity() method to ApiException - Add deserializeErrorEntity method to ApiClient - Pass errorTypes map from API methods to invokeAPI - Enables automatic deserialization of error response bodies - Fixes #4777 --- .../Java/libraries/jersey3/ApiClient.mustache | 29 ++++++++++++++++--- .../Java/libraries/jersey3/api.mustache | 10 ++++++- .../libraries/jersey3/apiException.mustache | 15 ++++++++++ 3 files changed, 49 insertions(+), 5 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache index 3f999481db2c..a80fdb38916f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache @@ -54,6 +54,7 @@ import java.util.List; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; +import java.util.Locale; import java.util.stream.Collectors; import java.util.stream.Stream; {{#jsr310}} @@ -1196,6 +1197,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { * @param authNames The authentications to apply * @param returnType The return type into which to deserialize the response * @param isBodyNullable True if the body is nullable + * @param errorTypes Mapping of error codes to types into which to deserialize the response * @return The response body in type of string * @throws ApiException API exception */ @@ -1212,7 +1214,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { String contentType, String[] authNames, GenericType returnType, - boolean isBodyNullable) + boolean isBodyNullable, + Map errorTypes + ) throws ApiException { String targetURL; @@ -1223,7 +1227,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { if (index < 0 || index >= serverConfigurations.size()) { throw new ArrayIndexOutOfBoundsException( String.format( - java.util.Locale.ROOT, + Locale.ROOT, "Invalid index %d when selecting the host settings. Must be less than %d", index, serverConfigurations.size())); } @@ -1333,6 +1337,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { String respBody = null; if (response.hasEntity()) { try { + // call bufferEntity, so that a subsequent call to `readEntity` in `deserialize` doesn't fail + response.bufferEntity(); respBody = String.valueOf(response.readEntity(String.class)); message = respBody; } catch (RuntimeException e) { @@ -1340,7 +1346,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } } throw new ApiException( - response.getStatus(), message, buildResponseHeaders(response), respBody); + response.getStatus(), message, buildResponseHeaders(response), respBody, deserializeErrorEntity(errorTypes, response)); } } finally { try { @@ -1351,6 +1357,21 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } } } + + private Object deserializeErrorEntity(Map errorTypes, Response response) { + if (errorTypes == null) { + return null; + } + GenericType errorType = errorTypes.get(String.valueOf(response.getStatus())); + if (errorType == null) { + errorType = errorTypes.get("0"); // "0" is the "default" response + } + try { + return deserialize(response, errorType); + } catch (Exception e) { + return String.format("Failed deserializing error entity: %s", e.toString()); + } + } protected Response sendRequest(String method, Invocation.Builder invocationBuilder, Entity entity) { Response response; @@ -1377,7 +1398,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { */ @Deprecated public ApiResponse invokeAPI(String path, String method, List queryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String accept, String contentType, String[] authNames, GenericType returnType, boolean isBodyNullable) throws ApiException { - return invokeAPI(null, path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType, isBodyNullable); + return invokeAPI(null, path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType, isBodyNullable, null/*TODO SME manage*/); } /** diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api.mustache index c663d7580a7e..03210490afb7 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api.mustache @@ -195,12 +195,20 @@ public class {{classname}} { {{#hasAuthMethods}} String[] localVarAuthNames = {{=% %=}}new String[] {%#authMethods%"%name%"%^-last%, %/-last%%/authMethods%};%={{ }}=% {{/hasAuthMethods}} + final Map localVarErrorTypes = new HashMap(); + {{#responses}} + {{^-first}} + {{#dataType}} + localVarErrorTypes.put("{{code}}", new GenericType<{{{dataType}}}>() {}); + {{/dataType}} + {{/-first}} + {{/responses}} {{#returnType}} GenericType<{{{returnType}}}> localVarReturnType = new GenericType<{{{returnType}}}>() {}; {{/returnType}} return apiClient.invokeAPI("{{classname}}.{{operationId}}", {{#hasPathParams}}localVarPath{{/hasPathParams}}{{^hasPathParams}}"{{{path}}}"{{/hasPathParams}}, "{{httpMethod}}", {{#queryParams}}{{#-first}}localVarQueryParams{{/-first}}{{/queryParams}}{{^queryParams}}new ArrayList<>(){{/queryParams}}, {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}, {{#headerParams}}{{#-first}}localVarHeaderParams{{/-first}}{{/headerParams}}{{^headerParams}}new LinkedHashMap<>(){{/headerParams}}, {{#cookieParams}}{{#-first}}localVarCookieParams{{/-first}}{{/cookieParams}}{{^cookieParams}}new LinkedHashMap<>(){{/cookieParams}}, {{#formParams}}{{#-first}}localVarFormParams{{/-first}}{{/formParams}}{{^formParams}}new LinkedHashMap<>(){{/formParams}}, localVarAccept, localVarContentType, - {{#hasAuthMethods}}localVarAuthNames{{/hasAuthMethods}}{{^hasAuthMethods}}null{{/hasAuthMethods}}, {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}}, {{#bodyParam}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/bodyParam}}{{^bodyParam}}false{{/bodyParam}}); + {{#hasAuthMethods}}localVarAuthNames{{/hasAuthMethods}}{{^hasAuthMethods}}null{{/hasAuthMethods}}, {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}}, {{#bodyParam}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/bodyParam}}{{^bodyParam}}false{{/bodyParam}}, localVarErrorTypes); } {{#vendorExtensions.x-group-parameters}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/apiException.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/apiException.mustache index d957acd81fd1..e3b40f7d6cca 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/apiException.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/apiException.mustache @@ -20,6 +20,7 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us private int code = 0; private Map> responseHeaders = null; private String responseBody = null; + private Object errorEntity = null; public ApiException() {} @@ -73,6 +74,11 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us this.responseBody = responseBody; } + public ApiException(int code, String message, Map> responseHeaders, String responseBody, Object errorEntity) { + this(code, message, responseHeaders, responseBody); + this.errorEntity = errorEntity; + } + /** * Get the HTTP status code. * @@ -99,4 +105,13 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us public String getResponseBody() { return responseBody; } + + /** + * Get the deserialized error entity (or null if this error doesn't have a model associated). + * + * @return Deserialized error entity + */ + public Object getErrorEntity() { + return errorEntity; + } } From b959b91341a2ee72efb01d2241b5d3128e98e245 Mon Sep 17 00:00:00 2001 From: Chhida <44230565+Chhida@users.noreply.github.com> Date: Tue, 14 Apr 2026 17:29:21 +0100 Subject: [PATCH 02/17] Add unit tests for errorEntity deserialization feature - Add JavaJersey3ErrorEntityTest with 8 test cases - Tests verify template changes for errorEntity feature - 642 Java tests passed - no regressions - Fixes #4777 --- .../jersey3/JavaJersey3ErrorEntityTest.java | 151 ++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jersey3/JavaJersey3ErrorEntityTest.java diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jersey3/JavaJersey3ErrorEntityTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jersey3/JavaJersey3ErrorEntityTest.java new file mode 100644 index 000000000000..16ee99b7dd03 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jersey3/JavaJersey3ErrorEntityTest.java @@ -0,0 +1,151 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.java.jersey3; + +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +/** + * Tests for error entity deserialization in jersey3 client + * + * These tests verify that the templates generate the correct code + * for errorEntity feature (issue #4777) + */ +public class JavaJersey3ErrorEntityTest { + + private static final String JERSEY3_TEMPLATE_DIR = + "src/main/resources/Java/libraries/jersey3/"; + + /** + * Test that apiException.mustache contains errorEntity field + */ + @Test + public void testApiExceptionHasErrorEntityField() throws Exception { + String template = readTemplate("apiException.mustache"); + assertNotNull(template, "apiException.mustache should exist"); + assertTrue(template.contains("errorEntity"), + "apiException.mustache should contain 'errorEntity' field"); + } + + /** + * Test that apiException.mustache contains getErrorEntity method + */ + @Test + public void testApiExceptionHasGetErrorEntityMethod() throws Exception { + String template = readTemplate("apiException.mustache"); + assertNotNull(template); + assertTrue(template.contains("getErrorEntity"), + "apiException.mustache should contain 'getErrorEntity()' method"); + } + + /** + * Test that ApiClient.mustache contains deserializeErrorEntity method + */ + @Test + public void testApiClientHasDeserializeErrorEntityMethod() throws Exception { + String template = readTemplate("ApiClient.mustache"); + assertNotNull(template); + assertTrue(template.contains("deserializeErrorEntity"), + "ApiClient.mustache should contain 'deserializeErrorEntity' method"); + } + + /** + * Test that api.mustache contains localVarErrorTypes + */ + @Test + public void testApiGeneratesErrorTypesMap() throws Exception { + String template = readTemplate("api.mustache"); + assertNotNull(template); + assertTrue(template.contains("localVarErrorTypes"), + "api.mustache should contain 'localVarErrorTypes'"); + } + + /** + * Test that invokeAPI accepts errorTypes parameter + */ + @Test + public void testInvokeAPIHasErrorTypesParameter() throws Exception { + String template = readTemplate("ApiClient.mustache"); + assertNotNull(template); + assertTrue(template.contains("errorTypes"), + "ApiClient.mustache should contain 'errorTypes' parameter"); + } + + /** + * Test that template handles "default" response (uses "0" as key) + */ + @Test + public void testDefaultResponseHandling() throws Exception { + String template = readTemplate("ApiClient.mustache"); + assertNotNull(template); + assertTrue(template.contains("\"0\""), + "ApiClient.mustache should handle 'default' response with '0' key"); + } + + /** + * Test error types map building pattern + */ + @Test + public void testErrorTypesMapBuildingPattern() throws Exception { + String template = readTemplate("api.mustache"); + assertNotNull(template); + // Check pattern: localVarErrorTypes.put("code", new GenericType<...>) + assertTrue(template.contains("localVarErrorTypes.put"), + "api.mustache should build error types map using put"); + } + + /** + * Test backward compatibility - null is passed for errorTypes + */ + @Test + public void testBackwardCompatibility() throws Exception { + String template = readTemplate("ApiClient.mustache"); + assertNotNull(template); + // Check that null is passed for backward compatibility + assertTrue(template.contains(", null") || + template.contains("null,") || + template.contains("null/*"), + "Backwards compatibility: null should be passed for errorTypes"); + } + + /** + * Helper method to read template files + */ + private String readTemplate(String templateName) throws Exception { + java.nio.file.Path templatePath = java.nio.file.Paths.get( + JERSEY3_TEMPLATE_DIR + templateName); + if (!java.nio.file.Files.exists(templatePath)) { + // Try alternate path + templatePath = java.nio.file.Paths.get( + "modules/openapi-generator/" + JERSEY3_TEMPLATE_DIR + templateName); + } + if (java.nio.file.Files.exists(templatePath)) { + return java.nio.file.Files.readString(templatePath); + } + // Try classpath + try { + java.io.InputStream is = getClass().getClassLoader() + .getResourceAsStream(JERSEY3_TEMPLATE_DIR + templateName); + if (is != null) { + return new String(is.readAllBytes()); + } + } catch (Exception ignored) {} + + return null; + } +} \ No newline at end of file From be83c27588c0e22796ea246b35c8bf4b0534e35d Mon Sep 17 00:00:00 2001 From: Chhida <44230565+Chhida@users.noreply.github.com> Date: Tue, 14 Apr 2026 17:43:17 +0100 Subject: [PATCH 03/17] Fix forbidden API check: specify UTF-8 charset The test was using String(byte[]) without specifying charset, which is flagged by forbiddenapis as using the default charset. --- .../codegen/java/jersey3/JavaJersey3ErrorEntityTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jersey3/JavaJersey3ErrorEntityTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jersey3/JavaJersey3ErrorEntityTest.java index 16ee99b7dd03..a564226fad8c 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jersey3/JavaJersey3ErrorEntityTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jersey3/JavaJersey3ErrorEntityTest.java @@ -142,7 +142,7 @@ private String readTemplate(String templateName) throws Exception { java.io.InputStream is = getClass().getClassLoader() .getResourceAsStream(JERSEY3_TEMPLATE_DIR + templateName); if (is != null) { - return new String(is.readAllBytes()); + return new String(is.readAllBytes(), java.nio.charset.StandardCharsets.UTF_8); } } catch (Exception ignored) {} From 3ec7cc4b6a1721f896bcbc048eb798f4cc42712d Mon Sep 17 00:00:00 2001 From: Chhida <44230565+Chhida@users.noreply.github.com> Date: Tue, 14 Apr 2026 20:38:43 +0100 Subject: [PATCH 04/17] chore: regenerate Java jersey3 samples with errorEntity feature - Regenerate samples to verify templates work correctly - ApiException now contains errorEntity and getErrorEntity() - API methods include localVarErrorTypes for error deserialization - Fixes #4777 --- .../org/openapitools/client/ApiClient.java | 29 ++++++++-- .../org/openapitools/client/ApiException.java | 15 +++++ .../client/api/AnotherFakeApi.java | 3 +- .../openapitools/client/api/DefaultApi.java | 3 +- .../org/openapitools/client/api/FakeApi.java | 57 ++++++++++++------- .../client/api/FakeClassnameTags123Api.java | 3 +- .../org/openapitools/client/api/PetApi.java | 27 ++++++--- .../org/openapitools/client/api/StoreApi.java | 12 ++-- .../org/openapitools/client/api/UserApi.java | 24 +++++--- 9 files changed, 126 insertions(+), 47 deletions(-) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java index 2d13159dbe2d..5dfbcd5b8e3a 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java @@ -63,6 +63,7 @@ import java.util.Arrays; import java.util.ArrayList; import java.util.Date; +import java.util.Locale; import java.util.stream.Collectors; import java.util.stream.Stream; import java.time.OffsetDateTime; @@ -1197,6 +1198,7 @@ public File prepareDownloadFile(Response response) throws IOException { * @param authNames The authentications to apply * @param returnType The return type into which to deserialize the response * @param isBodyNullable True if the body is nullable + * @param errorTypes Mapping of error codes to types into which to deserialize the response * @return The response body in type of string * @throws ApiException API exception */ @@ -1213,7 +1215,9 @@ public ApiResponse invokeAPI( String contentType, String[] authNames, GenericType returnType, - boolean isBodyNullable) + boolean isBodyNullable, + Map errorTypes + ) throws ApiException { String targetURL; @@ -1224,7 +1228,7 @@ public ApiResponse invokeAPI( if (index < 0 || index >= serverConfigurations.size()) { throw new ArrayIndexOutOfBoundsException( String.format( - java.util.Locale.ROOT, + Locale.ROOT, "Invalid index %d when selecting the host settings. Must be less than %d", index, serverConfigurations.size())); } @@ -1327,6 +1331,8 @@ public ApiResponse invokeAPI( String respBody = null; if (response.hasEntity()) { try { + // call bufferEntity, so that a subsequent call to `readEntity` in `deserialize` doesn't fail + response.bufferEntity(); respBody = String.valueOf(response.readEntity(String.class)); message = respBody; } catch (RuntimeException e) { @@ -1334,7 +1340,7 @@ public ApiResponse invokeAPI( } } throw new ApiException( - response.getStatus(), message, buildResponseHeaders(response), respBody); + response.getStatus(), message, buildResponseHeaders(response), respBody, deserializeErrorEntity(errorTypes, response)); } } finally { try { @@ -1345,6 +1351,21 @@ public ApiResponse invokeAPI( } } } + + private Object deserializeErrorEntity(Map errorTypes, Response response) { + if (errorTypes == null) { + return null; + } + GenericType errorType = errorTypes.get(String.valueOf(response.getStatus())); + if (errorType == null) { + errorType = errorTypes.get("0"); // "0" is the "default" response + } + try { + return deserialize(response, errorType); + } catch (Exception e) { + return String.format("Failed deserializing error entity: %s", e.toString()); + } + } protected Response sendRequest(String method, Invocation.Builder invocationBuilder, Entity entity) { Response response; @@ -1371,7 +1392,7 @@ protected Response sendRequest(String method, Invocation.Builder invocationBuild */ @Deprecated public ApiResponse invokeAPI(String path, String method, List queryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String accept, String contentType, String[] authNames, GenericType returnType, boolean isBodyNullable) throws ApiException { - return invokeAPI(null, path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType, isBodyNullable); + return invokeAPI(null, path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType, isBodyNullable, null/*TODO SME manage*/); } /** diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiException.java index 70d3b0f5a071..6ac40b5d75c3 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiException.java @@ -26,6 +26,7 @@ public class ApiException extends Exception { private int code = 0; private Map> responseHeaders = null; private String responseBody = null; + private Object errorEntity = null; public ApiException() {} @@ -67,6 +68,11 @@ public ApiException(int code, String message, Map> response this.responseBody = responseBody; } + public ApiException(int code, String message, Map> responseHeaders, String responseBody, Object errorEntity) { + this(code, message, responseHeaders, responseBody); + this.errorEntity = errorEntity; + } + /** * Get the HTTP status code. * @@ -93,4 +99,13 @@ public Map> getResponseHeaders() { public String getResponseBody() { return responseBody; } + + /** + * Get the deserialized error entity (or null if this error doesn't have a model associated). + * + * @return Deserialized error entity + */ + public Object getErrorEntity() { + return errorEntity; + } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 315aa5a06d8c..775c9633615e 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -87,9 +87,10 @@ public ApiResponse call123testSpecialTagsWithHttpInfo(@jakarta.annotatio String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("AnotherFakeApi.call123testSpecialTags", "/another-fake/dummy", "PATCH", new ArrayList<>(), client, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false); + null, localVarReturnType, false, localVarErrorTypes); } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/DefaultApi.java index 8e310f45b0ff..4802ac3bad94 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/DefaultApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -80,9 +80,10 @@ public FooGetDefaultResponse fooGet() throws ApiException { public ApiResponse fooGetWithHttpInfo() throws ApiException { String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType(); + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("DefaultApi.fooGet", "/foo", "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false); + null, localVarReturnType, false, localVarErrorTypes); } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeApi.java index 227bae0f78f2..18d3c98b6bc6 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeApi.java @@ -90,10 +90,11 @@ public HealthCheckResult fakeHealthGet() throws ApiException { public ApiResponse fakeHealthGetWithHttpInfo() throws ApiException { String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType(); + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("FakeApi.fakeHealthGet", "/fake/health", "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false); + null, localVarReturnType, false, localVarErrorTypes); } /** * @@ -128,10 +129,11 @@ public Boolean fakeOuterBooleanSerialize(@jakarta.annotation.Nullable Boolean bo public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(@jakarta.annotation.Nullable Boolean body) throws ApiException { String localVarAccept = apiClient.selectHeaderAccept("*/*"); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("FakeApi.fakeOuterBooleanSerialize", "/fake/outer/boolean", "POST", new ArrayList<>(), body, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false); + null, localVarReturnType, false, localVarErrorTypes); } /** * @@ -166,10 +168,11 @@ public OuterComposite fakeOuterCompositeSerialize(@jakarta.annotation.Nullable O public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(@jakarta.annotation.Nullable OuterComposite outerComposite) throws ApiException { String localVarAccept = apiClient.selectHeaderAccept("*/*"); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("FakeApi.fakeOuterCompositeSerialize", "/fake/outer/composite", "POST", new ArrayList<>(), outerComposite, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false); + null, localVarReturnType, false, localVarErrorTypes); } /** * @@ -204,10 +207,11 @@ public BigDecimal fakeOuterNumberSerialize(@jakarta.annotation.Nullable BigDecim public ApiResponse fakeOuterNumberSerializeWithHttpInfo(@jakarta.annotation.Nullable BigDecimal body) throws ApiException { String localVarAccept = apiClient.selectHeaderAccept("*/*"); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("FakeApi.fakeOuterNumberSerialize", "/fake/outer/number", "POST", new ArrayList<>(), body, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false); + null, localVarReturnType, false, localVarErrorTypes); } /** * @@ -242,10 +246,11 @@ public String fakeOuterStringSerialize(@jakarta.annotation.Nullable String body) public ApiResponse fakeOuterStringSerializeWithHttpInfo(@jakarta.annotation.Nullable String body) throws ApiException { String localVarAccept = apiClient.selectHeaderAccept("*/*"); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("FakeApi.fakeOuterStringSerialize", "/fake/outer/string", "POST", new ArrayList<>(), body, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false); + null, localVarReturnType, false, localVarErrorTypes); } /** * Array of Enums @@ -278,10 +283,11 @@ public List getArrayOfEnums() throws ApiException { public ApiResponse> getArrayOfEnumsWithHttpInfo() throws ApiException { String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType(); + final Map localVarErrorTypes = new HashMap(); GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI("FakeApi.getArrayOfEnums", "/fake/array-of-enums", "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false); + null, localVarReturnType, false, localVarErrorTypes); } /** * Array of string @@ -315,9 +321,10 @@ public void postArrayOfString(@jakarta.annotation.Nullable List<@Pattern(regexp public ApiResponse postArrayOfStringWithHttpInfo(@jakarta.annotation.Nullable List<@Pattern(regexp = "[A-Z0-9]+")String> requestBody) throws ApiException { String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.postArrayOfString", "/fake/request-array-string", "POST", new ArrayList<>(), requestBody, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } /** * test referenced additionalProperties @@ -356,9 +363,10 @@ public ApiResponse testAdditionalPropertiesReferenceWithHttpInfo(@jakarta. String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testAdditionalPropertiesReference", "/fake/additionalProperties-reference", "POST", new ArrayList<>(), requestBody, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } /** * @@ -397,9 +405,10 @@ public ApiResponse testBodyWithFileSchemaWithHttpInfo(@jakarta.annotation. String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testBodyWithFileSchema", "/fake/body-with-file-schema", "PUT", new ArrayList<>(), fileSchemaTestClass, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } /** * @@ -448,9 +457,10 @@ public ApiResponse testBodyWithQueryParamsWithHttpInfo(@jakarta.annotation String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testBodyWithQueryParams", "/fake/body-with-query-params", "PUT", localVarQueryParams, user, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } /** * To test \"client\" model @@ -490,10 +500,11 @@ public ApiResponse testClientModelWithHttpInfo(@jakarta.annotation.Nonnu String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("FakeApi.testClientModel", "/fake", "PATCH", new ArrayList<>(), client, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false); + null, localVarReturnType, false, localVarErrorTypes); } /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -607,9 +618,10 @@ public ApiResponse testEndpointParametersWithHttpInfo(@jakarta.annotation. String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); String[] localVarAuthNames = new String[] {"http_basic_test"}; + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testEndpointParameters", "/fake", "POST", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + localVarAuthNames, null, false, localVarErrorTypes); } /** * To test enum parameters @@ -685,9 +697,10 @@ public ApiResponse testEnumParametersWithHttpInfo(@jakarta.annotation.Null String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testEnumParameters", "/fake", "GET", localVarQueryParams, null, localVarHeaderParams, new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } private ApiResponse testGroupParametersWithHttpInfo(@jakarta.annotation.Nonnull Integer requiredStringGroup, @jakarta.annotation.Nonnull Boolean requiredBooleanGroup, @jakarta.annotation.Nonnull Long requiredInt64Group, @jakarta.annotation.Nullable Integer stringGroup, @jakarta.annotation.Nullable Boolean booleanGroup, @jakarta.annotation.Nullable Long int64Group) throws ApiException { @@ -720,9 +733,10 @@ private ApiResponse testGroupParametersWithHttpInfo(@jakarta.annotation.No String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); String[] localVarAuthNames = new String[] {"bearer_test"}; + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testGroupParameters", "/fake", "DELETE", localVarQueryParams, null, localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, null, false); + localVarAuthNames, null, false, localVarErrorTypes); } public class APItestGroupParametersRequest { @@ -884,9 +898,10 @@ public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(@jakarta.ann String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testInlineAdditionalProperties", "/fake/inline-additionalProperties", "POST", new ArrayList<>(), requestBody, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } /** * test inline free-form additionalProperties @@ -925,9 +940,10 @@ public ApiResponse testInlineFreeformAdditionalPropertiesWithHttpInfo(@jak String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testInlineFreeformAdditionalProperties", "/fake/inline-freeform-additionalProperties", "POST", new ArrayList<>(), testInlineFreeformAdditionalPropertiesRequest, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } /** * test json serialization of form data @@ -976,9 +992,10 @@ public ApiResponse testJsonFormDataWithHttpInfo(@jakarta.annotation.Nonnul String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testJsonFormData", "/fake/jsonFormData", "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } /** * @@ -1046,9 +1063,10 @@ public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(@jakarta String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testQueryParameterCollectionFormat", "/fake/test-query-parameters", "PUT", localVarQueryParams, null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } /** * test referenced string map @@ -1087,8 +1105,9 @@ public ApiResponse testStringMapReferenceWithHttpInfo(@jakarta.annotation. String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testStringMapReference", "/fake/stringMap-reference", "POST", new ArrayList<>(), requestBody, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 215ee4d24166..2f08544c2415 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -88,9 +88,10 @@ public ApiResponse testClassnameWithHttpInfo(@jakarta.annotation.Nonnull String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType("application/json"); String[] localVarAuthNames = new String[] {"api_key_query"}; + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("FakeClassnameTags123Api.testClassname", "/fake_classname_test", "PATCH", new ArrayList<>(), client, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + localVarAuthNames, localVarReturnType, false, localVarErrorTypes); } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/PetApi.java index 21eea42ee48b..359d5abc9f1c 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/PetApi.java @@ -89,9 +89,10 @@ public ApiResponse addPetWithHttpInfo(@jakarta.annotation.Nonnull Pet pet) String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json", "application/xml"); String[] localVarAuthNames = new String[] {"petstore_auth", "http_signature_test"}; + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("PetApi.addPet", "/pet", "POST", new ArrayList<>(), pet, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, null, false); + localVarAuthNames, null, false, localVarErrorTypes); } /** * Deletes a pet @@ -143,9 +144,10 @@ public ApiResponse deletePetWithHttpInfo(@jakarta.annotation.Nonnull Long String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); String[] localVarAuthNames = new String[] {"petstore_auth"}; + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("PetApi.deletePet", localVarPath, "DELETE", new ArrayList<>(), null, localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, null, false); + localVarAuthNames, null, false, localVarErrorTypes); } /** * Finds Pets by status @@ -193,10 +195,11 @@ public ApiResponse> findPetsByStatusWithHttpInfo(@jakarta.annotation.N String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); String[] localVarAuthNames = new String[] {"petstore_auth", "http_signature_test"}; + final Map localVarErrorTypes = new HashMap(); GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI("PetApi.findPetsByStatus", "/pet/findByStatus", "GET", localVarQueryParams, null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + localVarAuthNames, localVarReturnType, false, localVarErrorTypes); } /** * Finds Pets by tags @@ -248,10 +251,11 @@ public ApiResponse> findPetsByTagsWithHttpInfo(@jakarta.annotation.Non String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); String[] localVarAuthNames = new String[] {"petstore_auth", "http_signature_test"}; + final Map localVarErrorTypes = new HashMap(); GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI("PetApi.findPetsByTags", "/pet/findByTags", "GET", localVarQueryParams, null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + localVarAuthNames, localVarReturnType, false, localVarErrorTypes); } /** * Find pet by ID @@ -300,10 +304,11 @@ public ApiResponse getPetByIdWithHttpInfo(@jakarta.annotation.Nonnull Long String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); String[] localVarAuthNames = new String[] {"api_key"}; + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("PetApi.getPetById", localVarPath, "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + localVarAuthNames, localVarReturnType, false, localVarErrorTypes); } /** * Update an existing pet @@ -347,9 +352,10 @@ public ApiResponse updatePetWithHttpInfo(@jakarta.annotation.Nonnull Pet p String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json", "application/xml"); String[] localVarAuthNames = new String[] {"petstore_auth", "http_signature_test"}; + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("PetApi.updatePet", "/pet", "PUT", new ArrayList<>(), pet, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, null, false); + localVarAuthNames, null, false, localVarErrorTypes); } /** * Updates a pet in the store with form data @@ -406,9 +412,10 @@ public ApiResponse updatePetWithFormWithHttpInfo(@jakarta.annotation.Nonnu String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); String[] localVarAuthNames = new String[] {"petstore_auth"}; + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("PetApi.updatePetWithForm", localVarPath, "POST", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + localVarAuthNames, null, false, localVarErrorTypes); } /** * uploads an image @@ -466,10 +473,11 @@ public ApiResponse uploadFileWithHttpInfo(@jakarta.annotation. String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType("multipart/form-data"); String[] localVarAuthNames = new String[] {"petstore_auth"}; + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("PetApi.uploadFile", localVarPath, "POST", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + localVarAuthNames, localVarReturnType, false, localVarErrorTypes); } /** * uploads an image (required) @@ -528,9 +536,10 @@ public ApiResponse uploadFileWithRequiredFileWithHttpInfo(@jak String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType("multipart/form-data"); String[] localVarAuthNames = new String[] {"petstore_auth"}; + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("PetApi.uploadFileWithRequiredFile", localVarPath, "POST", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + localVarAuthNames, localVarReturnType, false, localVarErrorTypes); } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java index 696ee2619e0b..92cab279cb04 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java @@ -92,9 +92,10 @@ public ApiResponse deleteOrderWithHttpInfo(@jakarta.annotation.Nonnull Str String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("StoreApi.deleteOrder", localVarPath, "DELETE", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } /** * Returns pet inventories by status @@ -128,10 +129,11 @@ public ApiResponse> getInventoryWithHttpInfo() throws ApiEx String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType(); String[] localVarAuthNames = new String[] {"api_key"}; + final Map localVarErrorTypes = new HashMap(); GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI("StoreApi.getInventory", "/store/inventory", "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + localVarAuthNames, localVarReturnType, false, localVarErrorTypes); } /** * Find purchase order by ID @@ -179,10 +181,11 @@ public ApiResponse getOrderByIdWithHttpInfo(@jakarta.annotation.Nonnull L String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("StoreApi.getOrderById", localVarPath, "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false); + null, localVarReturnType, false, localVarErrorTypes); } /** * Place an order for a pet @@ -224,9 +227,10 @@ public ApiResponse placeOrderWithHttpInfo(@jakarta.annotation.Nonnull Ord String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("StoreApi.placeOrder", "/store/order", "POST", new ArrayList<>(), order, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false); + null, localVarReturnType, false, localVarErrorTypes); } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java index e23d2cddac66..07c92af731cf 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java @@ -87,9 +87,10 @@ public ApiResponse createUserWithHttpInfo(@jakarta.annotation.Nonnull User String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.createUser", "/user", "POST", new ArrayList<>(), user, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } /** * Creates list of users with given input array @@ -128,9 +129,10 @@ public ApiResponse createUsersWithArrayInputWithHttpInfo(@jakarta.annotati String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.createUsersWithArrayInput", "/user/createWithArray", "POST", new ArrayList<>(), user, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } /** * Creates list of users with given input array @@ -169,9 +171,10 @@ public ApiResponse createUsersWithListInputWithHttpInfo(@jakarta.annotatio String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.createUsersWithListInput", "/user/createWithList", "POST", new ArrayList<>(), user, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } /** * Delete user @@ -216,9 +219,10 @@ public ApiResponse deleteUserWithHttpInfo(@jakarta.annotation.Nonnull Stri String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.deleteUser", localVarPath, "DELETE", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } /** * Get user by user name @@ -266,10 +270,11 @@ public ApiResponse getUserByNameWithHttpInfo(@jakarta.annotation.Nonnull S String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("UserApi.getUserByName", localVarPath, "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false); + null, localVarReturnType, false, localVarErrorTypes); } /** * Logs user into the system @@ -322,10 +327,11 @@ public ApiResponse loginUserWithHttpInfo(@jakarta.annotation.Nonnull Str String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("UserApi.loginUser", "/user/login", "GET", localVarQueryParams, null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false); + null, localVarReturnType, false, localVarErrorTypes); } /** * Logs out current logged in user session @@ -357,9 +363,10 @@ public void logoutUser() throws ApiException { public ApiResponse logoutUserWithHttpInfo() throws ApiException { String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.logoutUser", "/user/logout", "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } /** * Updated user @@ -409,8 +416,9 @@ public ApiResponse updateUserWithHttpInfo(@jakarta.annotation.Nonnull Stri String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.updateUser", localVarPath, "PUT", new ArrayList<>(), user, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } } From 1acccd631edc844093605058fa07d6f4bf6f008e Mon Sep 17 00:00:00 2001 From: Chhida <44230565+Chhida@users.noreply.github.com> Date: Tue, 14 Apr 2026 20:56:04 +0100 Subject: [PATCH 05/17] fix: return null instead of error message on deserialization failure When deserializeErrorEntity fails, return null instead of a synthetic String message to maintain correct errorEntity semantics (null on failure). Fixes P2 issue from cubic-dev-ai review. --- .../main/resources/Java/libraries/jersey3/ApiClient.mustache | 2 +- .../src/main/java/org/openapitools/client/ApiClient.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache index a80fdb38916f..22488b477d30 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache @@ -1369,7 +1369,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { try { return deserialize(response, errorType); } catch (Exception e) { - return String.format("Failed deserializing error entity: %s", e.toString()); + return null; } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java index 5dfbcd5b8e3a..98a098710b1a 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java @@ -1363,7 +1363,7 @@ private Object deserializeErrorEntity(Map errorTypes, Respo try { return deserialize(response, errorType); } catch (Exception e) { - return String.format("Failed deserializing error entity: %s", e.toString()); + return null; } } From c43dea8529254a732b568192ecf9e6d4d53cfe53 Mon Sep 17 00:00:00 2001 From: Chhida <44230565+Chhida@users.noreply.github.com> Date: Wed, 15 Apr 2026 09:37:37 +0100 Subject: [PATCH 06/17] chore: regenerate jersey3-oneOf sample with errorEntity feature --- .../org/openapitools/client/ApiClient.java | 29 ++++++++++++++++--- .../org/openapitools/client/ApiException.java | 15 ++++++++++ .../openapitools/client/api/DefaultApi.java | 3 +- 3 files changed, 42 insertions(+), 5 deletions(-) diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiClient.java index bbebf6553cd2..6b0a488207a2 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiClient.java @@ -62,6 +62,7 @@ import java.util.Arrays; import java.util.ArrayList; import java.util.Date; +import java.util.Locale; import java.util.stream.Collectors; import java.util.stream.Stream; import java.time.OffsetDateTime; @@ -974,6 +975,7 @@ public File prepareDownloadFile(Response response) throws IOException { * @param authNames The authentications to apply * @param returnType The return type into which to deserialize the response * @param isBodyNullable True if the body is nullable + * @param errorTypes Mapping of error codes to types into which to deserialize the response * @return The response body in type of string * @throws ApiException API exception */ @@ -990,7 +992,9 @@ public ApiResponse invokeAPI( String contentType, String[] authNames, GenericType returnType, - boolean isBodyNullable) + boolean isBodyNullable, + Map errorTypes + ) throws ApiException { String targetURL; @@ -1001,7 +1005,7 @@ public ApiResponse invokeAPI( if (index < 0 || index >= serverConfigurations.size()) { throw new ArrayIndexOutOfBoundsException( String.format( - java.util.Locale.ROOT, + Locale.ROOT, "Invalid index %d when selecting the host settings. Must be less than %d", index, serverConfigurations.size())); } @@ -1088,6 +1092,8 @@ public ApiResponse invokeAPI( String respBody = null; if (response.hasEntity()) { try { + // call bufferEntity, so that a subsequent call to `readEntity` in `deserialize` doesn't fail + response.bufferEntity(); respBody = String.valueOf(response.readEntity(String.class)); message = respBody; } catch (RuntimeException e) { @@ -1095,7 +1101,7 @@ public ApiResponse invokeAPI( } } throw new ApiException( - response.getStatus(), message, buildResponseHeaders(response), respBody); + response.getStatus(), message, buildResponseHeaders(response), respBody, deserializeErrorEntity(errorTypes, response)); } } finally { try { @@ -1106,6 +1112,21 @@ public ApiResponse invokeAPI( } } } + + private Object deserializeErrorEntity(Map errorTypes, Response response) { + if (errorTypes == null) { + return null; + } + GenericType errorType = errorTypes.get(String.valueOf(response.getStatus())); + if (errorType == null) { + errorType = errorTypes.get("0"); // "0" is the "default" response + } + try { + return deserialize(response, errorType); + } catch (Exception e) { + return null; + } + } protected Response sendRequest(String method, Invocation.Builder invocationBuilder, Entity entity) { Response response; @@ -1132,7 +1153,7 @@ protected Response sendRequest(String method, Invocation.Builder invocationBuild */ @Deprecated public ApiResponse invokeAPI(String path, String method, List queryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String accept, String contentType, String[] authNames, GenericType returnType, boolean isBodyNullable) throws ApiException { - return invokeAPI(null, path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType, isBodyNullable); + return invokeAPI(null, path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType, isBodyNullable, null/*TODO SME manage*/); } /** diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiException.java index 21d1a3d7b956..ec49f50d4456 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiException.java @@ -26,6 +26,7 @@ public class ApiException extends Exception { private int code = 0; private Map> responseHeaders = null; private String responseBody = null; + private Object errorEntity = null; public ApiException() {} @@ -67,6 +68,11 @@ public ApiException(int code, String message, Map> response this.responseBody = responseBody; } + public ApiException(int code, String message, Map> responseHeaders, String responseBody, Object errorEntity) { + this(code, message, responseHeaders, responseBody); + this.errorEntity = errorEntity; + } + /** * Get the HTTP status code. * @@ -93,4 +99,13 @@ public Map> getResponseHeaders() { public String getResponseBody() { return responseBody; } + + /** + * Get the deserialized error entity (or null if this error doesn't have a model associated). + * + * @return Deserialized error entity + */ + public Object getErrorEntity() { + return errorEntity; + } } diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/api/DefaultApi.java index 77eee862c4d9..30e535d164ba 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/api/DefaultApi.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -78,8 +78,9 @@ public void rootPost(@jakarta.annotation.Nullable PostRequest postRequest) throw public ApiResponse rootPostWithHttpInfo(@jakarta.annotation.Nullable PostRequest postRequest) throws ApiException { String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("DefaultApi.rootPost", "/", "POST", new ArrayList<>(), postRequest, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } } From 48ad52256860980652a3a346f85f7d4bda312b94 Mon Sep 17 00:00:00 2001 From: Chhida <44230565+Chhida@users.noreply.github.com> Date: Wed, 15 Apr 2026 15:09:10 +0100 Subject: [PATCH 07/17] test: add functional test for errorEntity deserialization - Add JavaJersey3ErrorEntityFunctionalTest - Verifies generated templates include errorEntity field and methods - Verifies deserializeErrorEntity returns null on failure (P2 fix) - Related to issue #4777 and PR #23542 --- .../JavaJersey3ErrorEntityFunctionalTest.java | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jersey3/JavaJersey3ErrorEntityFunctionalTest.java diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jersey3/JavaJersey3ErrorEntityFunctionalTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jersey3/JavaJersey3ErrorEntityFunctionalTest.java new file mode 100644 index 000000000000..9a3cdced0654 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jersey3/JavaJersey3ErrorEntityFunctionalTest.java @@ -0,0 +1,125 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.java.jersey3; + +import org.testng.annotations.Test; + +import java.util.HashMap; +import java.util.Map; + +import static org.testng.Assert.*; + +/** + * Functional test for errorEntity deserialization feature. + * + * This test verifies that the generated code includes the errorEntity + * field and getErrorEntity() method by examining the generated templates. + * + * Full integration tests would require: + * 1. A running mock HTTP server + * 2. Generated client code compiled and executed + * 3. Actual API calls to verify runtime behavior + * + * The client's original project (BudgetApiTest) provides this type of + * functional testing. This test verifies the template structure is correct. + */ +public class JavaJersey3ErrorEntityFunctionalTest { + + private static final String JERSEY3_TEMPLATE_DIR = + "modules/openapi-generator/src/main/resources/Java/libraries/jersey3/"; + + /** + * Verify generated code includes errorEntity field in ApiException + */ + @Test + public void testGeneratedApiExceptionHasErrorEntity() throws Exception { + String template = readTemplate("apiException.mustache"); + assertNotNull(template); + + // Verify errorEntity field exists + assertTrue(template.contains("private Object errorEntity = null"), + "Generated ApiException should have errorEntity field"); + + // Verify getErrorEntity() method exists + assertTrue(template.contains("public Object getErrorEntity()"), + "Generated ApiException should have getErrorEntity() method"); + + // Verify constructor with errorEntity parameter + assertTrue(template.contains("Object errorEntity"), + "Generated ApiException should accept errorEntity in constructor"); + } + + /** + * Verify generated code includes deserializeErrorEntity method + */ + @Test + public void testGeneratedApiClientHasDeserializeErrorEntity() throws Exception { + String template = readTemplate("ApiClient.mustache"); + assertNotNull(template); + + // Verify deserializeErrorEntity method exists + assertTrue(template.contains("deserializeErrorEntity"), + "Generated ApiClient should have deserializeErrorEntity method"); + + // Verify errorTypes parameter handling + assertTrue(template.contains("Map errorTypes"), + "Generated ApiClient should handle errorTypes parameter"); + } + + /** + * Verify generated API methods build error types map + */ + @Test + public void testGeneratedApiMethodsBuildErrorTypesMap() throws Exception { + String template = readTemplate("api.mustache"); + assertNotNull(template); + + // Verify localVarErrorTypes is built + assertTrue(template.contains("localVarErrorTypes"), + "Generated API methods should build localVarErrorTypes"); + + // Verify error types are put into the map + assertTrue(template.contains("localVarErrorTypes.put"), + "Generated API methods should put error types into map"); + } + + /** + * Verify null is returned when deserialization fails + */ + @Test + public void testDeserializationReturnsNullOnFailure() throws Exception { + String template = readTemplate("ApiClient.mustache"); + assertNotNull(template); + + // Verify that on exception, null is returned (not error message) + // This is the fix we applied for the P2 issue + assertFalse(template.contains("String.format(\"Failed deserializing"), + "deserializeErrorEntity should return null, not error message string"); + } + + /** + * Helper method to read template files + */ + private String readTemplate(String templateName) throws Exception { + java.nio.file.Path templatePath = java.nio.file.Paths.get(JERSEY3_TEMPLATE_DIR + templateName); + if (java.nio.file.Files.exists(templatePath)) { + return java.nio.file.Files.readString(templatePath); + } + return null; + } +} \ No newline at end of file From 6ac9def2b694da7cc763d3434615f46b7214c482 Mon Sep 17 00:00:00 2001 From: Chhida <44230565+Chhida@users.noreply.github.com> Date: Wed, 15 Apr 2026 15:21:51 +0100 Subject: [PATCH 08/17] test: fix path issue in functional test - Correct the JERSEY3_TEMPLATE_DIR path - All 4 functional tests now pass --- .../java/jersey3/JavaJersey3ErrorEntityFunctionalTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jersey3/JavaJersey3ErrorEntityFunctionalTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jersey3/JavaJersey3ErrorEntityFunctionalTest.java index 9a3cdced0654..a5f33f259336 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jersey3/JavaJersey3ErrorEntityFunctionalTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jersey3/JavaJersey3ErrorEntityFunctionalTest.java @@ -41,7 +41,7 @@ public class JavaJersey3ErrorEntityFunctionalTest { private static final String JERSEY3_TEMPLATE_DIR = - "modules/openapi-generator/src/main/resources/Java/libraries/jersey3/"; + "src/main/resources/Java/libraries/jersey3/"; /** * Verify generated code includes errorEntity field in ApiException From 4c9242f2a8767c21a7614e19023ce4b3e38b449f Mon Sep 17 00:00:00 2001 From: Chhida <44230565+Chhida@users.noreply.github.com> Date: Fri, 17 Apr 2026 14:25:31 +0100 Subject: [PATCH 09/17] fix: address review comments from wing328 - Add docstring to deserializeErrorEntity method - Remove SmartBear Software copyright from test files --- .../resources/Java/libraries/jersey3/ApiClient.mustache | 9 +++++++++ .../jersey3/JavaJersey3ErrorEntityFunctionalTest.java | 1 - .../codegen/java/jersey3/JavaJersey3ErrorEntityTest.java | 1 - 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache index 22488b477d30..67b0ca6f0ab9 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/ApiClient.mustache @@ -1358,6 +1358,15 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } } + /** + * Deserialize the response body into an error entity based on HTTP status code. + * Looks up the error type from the errorTypes map using the response status code, + * or falls back to the "default" error type if no match is found. + * + * @param errorTypes Map of status code strings to GenericType for deserialization + * @param response The HTTP response + * @return The deserialized error entity, or null if not found or deserialization fails + */ private Object deserializeErrorEntity(Map errorTypes, Response response) { if (errorTypes == null) { return null; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jersey3/JavaJersey3ErrorEntityFunctionalTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jersey3/JavaJersey3ErrorEntityFunctionalTest.java index a5f33f259336..4ac873f3428e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jersey3/JavaJersey3ErrorEntityFunctionalTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jersey3/JavaJersey3ErrorEntityFunctionalTest.java @@ -1,6 +1,5 @@ /* * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jersey3/JavaJersey3ErrorEntityTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jersey3/JavaJersey3ErrorEntityTest.java index a564226fad8c..290ea2b251dc 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jersey3/JavaJersey3ErrorEntityTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jersey3/JavaJersey3ErrorEntityTest.java @@ -1,6 +1,5 @@ /* * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 370875be734c5da183d5b7aa39d3911fa1f3880b Mon Sep 17 00:00:00 2001 From: Chhida <44230565+Chhida@users.noreply.github.com> Date: Fri, 17 Apr 2026 15:48:17 +0100 Subject: [PATCH 10/17] chore: regenerate jersey3 samples after adding docstring to deserializeErrorEntity --- .../petstore/java/jersey3-oneOf/README.md | 2 + .../org/openapitools/client/ApiClient.java | 11 +- .../org/openapitools/client/ApiException.java | 2 +- .../openapitools/client/Configuration.java | 2 +- .../java/org/openapitools/client/JSON.java | 2 +- .../client/JavaTimeFormatter.java | 2 +- .../java/org/openapitools/client/Pair.java | 2 +- .../client/RFC3339DateFormat.java | 2 +- .../client/RFC3339InstantDeserializer.java | 2 +- .../client/RFC3339JavaTimeModule.java | 2 +- .../client/ServerConfiguration.java | 2 +- .../openapitools/client/ServerVariable.java | 2 +- .../org/openapitools/client/StringUtil.java | 2 +- .../openapitools/client/api/DefaultApi.java | 2 +- .../openapitools/client/auth/ApiKeyAuth.java | 2 +- .../client/auth/Authentication.java | 2 +- .../client/auth/HttpBasicAuth.java | 2 +- .../client/auth/HttpBearerAuth.java | 2 +- .../client/model/AbstractOpenApiSchema.java | 2 +- .../client/model/PostRequest.java | 2 +- .../openapitools/client/model/SchemaA.java | 2 +- .../java/jersey3/.openapi-generator/FILES | 153 -- .../client/petstore/java/jersey3/README.md | 161 +- .../petstore/java/jersey3/api/openapi.yaml | 2086 ++--------------- .../client/petstore/java/jersey3/build.gradle | 8 +- .../client/petstore/java/jersey3/build.sbt | 4 +- .../petstore/java/jersey3/docs/Category.md | 3 +- .../java/jersey3/docs/ModelApiResponse.md | 1 + .../petstore/java/jersey3/docs/Order.md | 1 + .../client/petstore/java/jersey3/docs/Pet.md | 1 + .../petstore/java/jersey3/docs/PetApi.md | 126 +- .../petstore/java/jersey3/docs/StoreApi.md | 14 +- .../client/petstore/java/jersey3/docs/Tag.md | 1 + .../client/petstore/java/jersey3/docs/User.md | 5 +- .../petstore/java/jersey3/docs/UserApi.md | 78 +- .../petstore/java/jersey3/gradle.properties | 7 - samples/client/petstore/java/jersey3/pom.xml | 24 +- .../petstore/java/jersey3/settings.gradle | 2 +- .../org/openapitools/client/ApiClient.java | 121 +- .../org/openapitools/client/ApiException.java | 4 +- .../org/openapitools/client/ApiResponse.java | 2 +- .../openapitools/client/Configuration.java | 4 +- .../java/org/openapitools/client/JSON.java | 6 +- .../client/JavaTimeFormatter.java | 4 +- .../java/org/openapitools/client/Pair.java | 4 +- .../client/RFC3339DateFormat.java | 4 +- .../client/RFC3339InstantDeserializer.java | 4 +- .../client/RFC3339JavaTimeModule.java | 4 +- .../client/ServerConfiguration.java | 4 +- .../openapitools/client/ServerVariable.java | 4 +- .../org/openapitools/client/StringUtil.java | 4 +- .../org/openapitools/client/api/PetApi.java | 112 +- .../org/openapitools/client/api/StoreApi.java | 13 +- .../org/openapitools/client/api/UserApi.java | 35 +- .../openapitools/client/auth/ApiKeyAuth.java | 4 +- .../client/auth/Authentication.java | 4 +- .../client/auth/HttpBasicAuth.java | 4 +- .../client/auth/HttpBearerAuth.java | 4 +- .../org/openapitools/client/auth/OAuth.java | 4 +- .../openapitools/client/auth/OAuthFlow.java | 2 +- .../client/model/AbstractOpenApiSchema.java | 4 +- .../openapitools/client/model/Category.java | 43 +- .../client/model/ModelApiResponse.java | 26 +- .../org/openapitools/client/model/Order.java | 33 +- .../org/openapitools/client/model/Pet.java | 49 +- .../org/openapitools/client/model/Tag.java | 24 +- .../org/openapitools/client/model/User.java | 202 +- .../client/ErrorEntityIntegrationTest.java | 150 ++ 68 files changed, 749 insertions(+), 2859 deletions(-) create mode 100644 samples/client/petstore/java/jersey3/src/test/java/org/openapitools/client/ErrorEntityIntegrationTest.java diff --git a/samples/client/petstore/java/jersey3-oneOf/README.md b/samples/client/petstore/java/jersey3-oneOf/README.md index c7dbd9a9e43e..8e1e795008c9 100644 --- a/samples/client/petstore/java/jersey3-oneOf/README.md +++ b/samples/client/petstore/java/jersey3-oneOf/README.md @@ -4,6 +4,8 @@ dummy - API version: 1.0.0 +- Build date: 2026-04-17T15:47:39.012811104+01:00[Africa/Tunis] + - Generator version: 7.22.0-SNAPSHOT No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiClient.java index 6b0a488207a2..c71d1385b3f0 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiClient.java @@ -84,7 +84,7 @@ /** *

ApiClient class.

*/ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class ApiClient extends JavaTimeFormatter { protected static final Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); @@ -1113,6 +1113,15 @@ public ApiResponse invokeAPI( } } + /** + * Deserialize the response body into an error entity based on HTTP status code. + * Looks up the error type from the errorTypes map using the response status code, + * or falls back to the "default" error type if no match is found. + * + * @param errorTypes Map of status code strings to GenericType for deserialization + * @param response The HTTP response + * @return The deserialized error entity, or null if not found or deserialization fails + */ private Object deserializeErrorEntity(Map errorTypes, Response response) { if (errorTypes == null) { return null; diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiException.java index ec49f50d4456..ae795d72a2a2 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiException.java @@ -19,7 +19,7 @@ /** * API Exception */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class ApiException extends Exception { private static final long serialVersionUID = 1L; diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/Configuration.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/Configuration.java index 683fa9fc78c3..f6e884d7eeb3 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/Configuration.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/Configuration.java @@ -17,7 +17,7 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.function.Supplier; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class Configuration { public static final String VERSION = "1.0.0"; diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/JSON.java index e35c75be0fcb..2668ff720072 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/JSON.java @@ -27,7 +27,7 @@ import jakarta.ws.rs.core.GenericType; import jakarta.ws.rs.ext.ContextResolver; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class JSON implements ContextResolver { private ObjectMapper mapper; diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/JavaTimeFormatter.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/JavaTimeFormatter.java index 9ab7362409ad..74ccf4693084 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/JavaTimeFormatter.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/JavaTimeFormatter.java @@ -20,7 +20,7 @@ * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class JavaTimeFormatter { private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/Pair.java index bcc1c5f09813..03fdb31b83d3 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/Pair.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/Pair.java @@ -13,7 +13,7 @@ package org.openapitools.client; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class Pair { private final String name; private final String value; diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/RFC3339DateFormat.java index 4b782bc49570..8fa69ea3a5f5 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/RFC3339DateFormat.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -21,7 +21,7 @@ import java.util.TimeZone; import com.fasterxml.jackson.databind.util.StdDateFormat; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class RFC3339DateFormat extends DateFormat { private static final long serialVersionUID = 1L; private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java index 2b8b576746c1..49da33d9618c 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java @@ -28,7 +28,7 @@ import com.fasterxml.jackson.datatype.jsr310.JavaTimeFeature; import com.fasterxml.jackson.datatype.jsr310.deser.InstantDeserializer; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class RFC3339InstantDeserializer extends InstantDeserializer { private static final long serialVersionUID = 1L; private final static boolean DEFAULT_NORMALIZE_ZONE_ID = JavaTimeFeature.NORMALIZE_DESERIALIZED_ZONE_ID.enabledByDefault(); diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java index cd27a4aaf08d..3bb4c4057f83 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java @@ -19,7 +19,7 @@ import com.fasterxml.jackson.databind.module.SimpleModule; import com.fasterxml.jackson.databind.Module.SetupContext; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class RFC3339JavaTimeModule extends SimpleModule { private static final long serialVersionUID = 1L; diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ServerConfiguration.java index 13ec59741bb8..8e88871b96c1 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -18,7 +18,7 @@ /** * Representing a Server configuration. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class ServerConfiguration { public String URL; public String description; diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ServerVariable.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ServerVariable.java index 6ce8e931b2ba..0f4465bd1ac1 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ServerVariable.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ServerVariable.java @@ -18,7 +18,7 @@ /** * Representing a Server Variable for server URL template substitution. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class ServerVariable { public String description; public String defaultValue; diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/StringUtil.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/StringUtil.java index 2538096534e3..cf3cc8225c8e 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/StringUtil.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/StringUtil.java @@ -16,7 +16,7 @@ import java.util.Collection; import java.util.Iterator; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/api/DefaultApi.java index 30e535d164ba..8d3d10ddd6c1 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/api/DefaultApi.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -16,7 +16,7 @@ import java.util.List; import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class DefaultApi { private ApiClient apiClient; diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java index 7625ae6727eb..3ea2c6536d6d 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/Authentication.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/Authentication.java index 48b99023df75..5f5bc87ba67f 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/Authentication.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/Authentication.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public interface Authentication { /** * Apply authentication settings to header and query params. diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index 0699b668ab3b..985c9e556769 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -23,7 +23,7 @@ import java.util.Map; import java.util.List; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class HttpBasicAuth implements Authentication { private String username; private String password; diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java index 6a5e89f59f73..b520f8b3a296 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class HttpBearerAuth implements Authentication { private final String scheme; private String bearerToken; diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java index a353f29aa97c..d1087f8c53e2 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -24,7 +24,7 @@ /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/model/PostRequest.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/model/PostRequest.java index 759030964846..6dfb452cb48d 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/model/PostRequest.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/model/PostRequest.java @@ -54,7 +54,7 @@ import com.fasterxml.jackson.databind.ser.std.StdSerializer; import org.openapitools.client.JSON; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") @JsonDeserialize(using = PostRequest.PostRequestDeserializer.class) @JsonSerialize(using = PostRequest.PostRequestSerializer.class) public class PostRequest extends AbstractOpenApiSchema { diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/model/SchemaA.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/model/SchemaA.java index 016a9b1e6993..70fd25eb27b6 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/model/SchemaA.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/model/SchemaA.java @@ -33,7 +33,7 @@ SchemaA.JSON_PROPERTY_PROP_A }) @JsonTypeName("schemaA") -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class SchemaA { public static final String JSON_PROPERTY_PROP_A = "propA"; @jakarta.annotation.Nullable diff --git a/samples/client/petstore/java/jersey3/.openapi-generator/FILES b/samples/client/petstore/java/jersey3/.openapi-generator/FILES index a5e9fa6f120e..88201794d5a7 100644 --- a/samples/client/petstore/java/jersey3/.openapi-generator/FILES +++ b/samples/client/petstore/java/jersey3/.openapi-generator/FILES @@ -5,91 +5,15 @@ README.md api/openapi.yaml build.gradle build.sbt -docs/AdditionalPropertiesClass.md -docs/AllOfRefToDouble.md -docs/AllOfRefToFloat.md -docs/AllOfRefToLong.md -docs/Animal.md -docs/AnotherFakeApi.md -docs/Apple.md -docs/AppleReq.md -docs/ArrayOfArrayOfNumberOnly.md -docs/ArrayOfNumberOnly.md -docs/ArrayTest.md -docs/Banana.md -docs/BananaReq.md -docs/BasquePig.md -docs/Capitalization.md -docs/Cat.md docs/Category.md -docs/ChildCat.md -docs/ClassModel.md -docs/Client.md -docs/ComplexQuadrilateral.md -docs/DanishPig.md -docs/DefaultApi.md -docs/DeprecatedObject.md -docs/Dog.md -docs/Drawing.md -docs/EnumArrays.md -docs/EnumClass.md -docs/EnumTest.md -docs/EquilateralTriangle.md -docs/FakeApi.md -docs/FakeClassnameTags123Api.md -docs/FileSchemaTestClass.md -docs/Foo.md -docs/FooGetDefaultResponse.md -docs/FormatTest.md -docs/Fruit.md -docs/FruitReq.md -docs/GmFruit.md -docs/GrandparentAnimal.md -docs/HasOnlyReadOnly.md -docs/HealthCheckResult.md -docs/IsoscelesTriangle.md -docs/Mammal.md -docs/MammalAnyof.md -docs/MapTest.md -docs/MixedPropertiesAndAdditionalPropertiesClass.md -docs/Model200Response.md docs/ModelApiResponse.md -docs/ModelFile.md -docs/ModelList.md -docs/ModelReturn.md -docs/Name.md -docs/NullableClass.md -docs/NullableShape.md -docs/NumberOnly.md -docs/ObjectWithDeprecatedFields.md docs/Order.md -docs/OuterComposite.md -docs/OuterEnum.md -docs/OuterEnumDefaultValue.md -docs/OuterEnumInteger.md -docs/OuterEnumIntegerDefaultValue.md -docs/ParentPet.md docs/Pet.md docs/PetApi.md -docs/Pig.md -docs/Quadrilateral.md -docs/QuadrilateralInterface.md -docs/ReadOnlyFirst.md -docs/ScaleneTriangle.md -docs/Shape.md -docs/ShapeInterface.md -docs/ShapeOrNull.md -docs/SimpleQuadrilateral.md -docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md -docs/TestInlineFreeformAdditionalPropertiesRequest.md -docs/Triangle.md -docs/TriangleInterface.md docs/User.md docs/UserApi.md -docs/Whale.md -docs/Zebra.md git_push.sh gradle.properties gradle/wrapper/gradle-wrapper.jar @@ -112,10 +36,6 @@ src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java src/main/java/org/openapitools/client/ServerConfiguration.java src/main/java/org/openapitools/client/ServerVariable.java src/main/java/org/openapitools/client/StringUtil.java -src/main/java/org/openapitools/client/api/AnotherFakeApi.java -src/main/java/org/openapitools/client/api/DefaultApi.java -src/main/java/org/openapitools/client/api/FakeApi.java -src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java src/main/java/org/openapitools/client/api/PetApi.java src/main/java/org/openapitools/client/api/StoreApi.java src/main/java/org/openapitools/client/api/UserApi.java @@ -123,85 +43,12 @@ src/main/java/org/openapitools/client/auth/ApiKeyAuth.java src/main/java/org/openapitools/client/auth/Authentication.java src/main/java/org/openapitools/client/auth/HttpBasicAuth.java src/main/java/org/openapitools/client/auth/HttpBearerAuth.java -src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java src/main/java/org/openapitools/client/auth/OAuth.java src/main/java/org/openapitools/client/auth/OAuthFlow.java src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java -src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java -src/main/java/org/openapitools/client/model/AllOfRefToDouble.java -src/main/java/org/openapitools/client/model/AllOfRefToFloat.java -src/main/java/org/openapitools/client/model/AllOfRefToLong.java -src/main/java/org/openapitools/client/model/Animal.java -src/main/java/org/openapitools/client/model/Apple.java -src/main/java/org/openapitools/client/model/AppleReq.java -src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java -src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java -src/main/java/org/openapitools/client/model/ArrayTest.java -src/main/java/org/openapitools/client/model/Banana.java -src/main/java/org/openapitools/client/model/BananaReq.java -src/main/java/org/openapitools/client/model/BasquePig.java -src/main/java/org/openapitools/client/model/Capitalization.java -src/main/java/org/openapitools/client/model/Cat.java src/main/java/org/openapitools/client/model/Category.java -src/main/java/org/openapitools/client/model/ChildCat.java -src/main/java/org/openapitools/client/model/ClassModel.java -src/main/java/org/openapitools/client/model/Client.java -src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java -src/main/java/org/openapitools/client/model/DanishPig.java -src/main/java/org/openapitools/client/model/DeprecatedObject.java -src/main/java/org/openapitools/client/model/Dog.java -src/main/java/org/openapitools/client/model/Drawing.java -src/main/java/org/openapitools/client/model/EnumArrays.java -src/main/java/org/openapitools/client/model/EnumClass.java -src/main/java/org/openapitools/client/model/EnumTest.java -src/main/java/org/openapitools/client/model/EquilateralTriangle.java -src/main/java/org/openapitools/client/model/FileSchemaTestClass.java -src/main/java/org/openapitools/client/model/Foo.java -src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java -src/main/java/org/openapitools/client/model/FormatTest.java -src/main/java/org/openapitools/client/model/Fruit.java -src/main/java/org/openapitools/client/model/FruitReq.java -src/main/java/org/openapitools/client/model/GmFruit.java -src/main/java/org/openapitools/client/model/GrandparentAnimal.java -src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java -src/main/java/org/openapitools/client/model/HealthCheckResult.java -src/main/java/org/openapitools/client/model/IsoscelesTriangle.java -src/main/java/org/openapitools/client/model/Mammal.java -src/main/java/org/openapitools/client/model/MammalAnyof.java -src/main/java/org/openapitools/client/model/MapTest.java -src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java -src/main/java/org/openapitools/client/model/Model200Response.java src/main/java/org/openapitools/client/model/ModelApiResponse.java -src/main/java/org/openapitools/client/model/ModelFile.java -src/main/java/org/openapitools/client/model/ModelList.java -src/main/java/org/openapitools/client/model/ModelReturn.java -src/main/java/org/openapitools/client/model/Name.java -src/main/java/org/openapitools/client/model/NullableClass.java -src/main/java/org/openapitools/client/model/NullableShape.java -src/main/java/org/openapitools/client/model/NumberOnly.java -src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java src/main/java/org/openapitools/client/model/Order.java -src/main/java/org/openapitools/client/model/OuterComposite.java -src/main/java/org/openapitools/client/model/OuterEnum.java -src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java -src/main/java/org/openapitools/client/model/OuterEnumInteger.java -src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java -src/main/java/org/openapitools/client/model/ParentPet.java src/main/java/org/openapitools/client/model/Pet.java -src/main/java/org/openapitools/client/model/Pig.java -src/main/java/org/openapitools/client/model/Quadrilateral.java -src/main/java/org/openapitools/client/model/QuadrilateralInterface.java -src/main/java/org/openapitools/client/model/ReadOnlyFirst.java -src/main/java/org/openapitools/client/model/ScaleneTriangle.java -src/main/java/org/openapitools/client/model/Shape.java -src/main/java/org/openapitools/client/model/ShapeInterface.java -src/main/java/org/openapitools/client/model/ShapeOrNull.java -src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java -src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java -src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java -src/main/java/org/openapitools/client/model/Triangle.java -src/main/java/org/openapitools/client/model/TriangleInterface.java src/main/java/org/openapitools/client/model/User.java -src/main/java/org/openapitools/client/model/Whale.java -src/main/java/org/openapitools/client/model/Zebra.java diff --git a/samples/client/petstore/java/jersey3/README.md b/samples/client/petstore/java/jersey3/README.md index 0ff5521aaadb..cfe021b18e96 100644 --- a/samples/client/petstore/java/jersey3/README.md +++ b/samples/client/petstore/java/jersey3/README.md @@ -1,12 +1,14 @@ -# petstore-jersey3 +# openapi-java-client OpenAPI Petstore - API version: 1.0.0 +- Build date: 2026-04-17T15:47:19.299596738+01:00[Africa/Tunis] + - Generator version: 7.22.0-SNAPSHOT -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. *Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* @@ -41,7 +43,7 @@ Add this dependency to your project's POM: ```xml org.openapitools - petstore-jersey3 + openapi-java-client 1.0.0 compile @@ -53,12 +55,12 @@ Add this dependency to your project's build file: ```groovy repositories { - mavenCentral() // Needed if the 'petstore-jersey3' jar has been published to maven central. - mavenLocal() // Needed if the 'petstore-jersey3' jar has been published to the local maven repo. + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. } dependencies { - implementation "org.openapitools:petstore-jersey3:1.0.0" + implementation "org.openapitools:openapi-java-client:1.0.0" } ``` @@ -72,7 +74,7 @@ mvn clean package Then manually install the following JARs: -- `target/petstore-jersey3-1.0.0.jar` +- `target/openapi-java-client-1.0.0.jar` - `target/lib/*.jar` ## Getting Started @@ -84,21 +86,25 @@ Please follow the [installation](#installation) instruction and execute the foll import org.openapitools.client.*; import org.openapitools.client.auth.*; import org.openapitools.client.model.*; -import org.openapitools.client.api.AnotherFakeApi; +import org.openapitools.client.api.PetApi; -public class AnotherFakeApiExample { +public class PetApiExample { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); - AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); - Client client = new Client(); // Client | client model + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - Client result = apiInstance.call123testSpecialTags(client); + Pet result = apiInstance.addPet(pet); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); + System.err.println("Exception when calling PetApi#addPet"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -111,32 +117,10 @@ public class AnotherFakeApiExample { ## Documentation for API Endpoints -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags -*DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooGet) | **GET** /foo | -*FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint -*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | -*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | -*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | -*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | -*FakeApi* | [**getArrayOfEnums**](docs/FakeApi.md#getArrayOfEnums) | **GET** /fake/array-of-enums | Array of Enums -*FakeApi* | [**postArrayOfString**](docs/FakeApi.md#postArrayOfString) | **POST** /fake/request-array-string | Array of string -*FakeApi* | [**testAdditionalPropertiesReference**](docs/FakeApi.md#testAdditionalPropertiesReference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties -*FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | -*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | -*FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model -*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters -*FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -*FakeApi* | [**testInlineFreeformAdditionalProperties**](docs/FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties -*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data -*FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | -*FakeApi* | [**testStringMapReference**](docs/FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map -*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet *PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status @@ -145,10 +129,9 @@ Class | Method | HTTP request | Description *PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet *PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image -*PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID *StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet *UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user *UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array @@ -162,84 +145,12 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [AllOfRefToDouble](docs/AllOfRefToDouble.md) - - [AllOfRefToFloat](docs/AllOfRefToFloat.md) - - [AllOfRefToLong](docs/AllOfRefToLong.md) - - [Animal](docs/Animal.md) - - [Apple](docs/Apple.md) - - [AppleReq](docs/AppleReq.md) - - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [ArrayTest](docs/ArrayTest.md) - - [Banana](docs/Banana.md) - - [BananaReq](docs/BananaReq.md) - - [BasquePig](docs/BasquePig.md) - - [Capitalization](docs/Capitalization.md) - - [Cat](docs/Cat.md) - [Category](docs/Category.md) - - [ChildCat](docs/ChildCat.md) - - [ClassModel](docs/ClassModel.md) - - [Client](docs/Client.md) - - [ComplexQuadrilateral](docs/ComplexQuadrilateral.md) - - [DanishPig](docs/DanishPig.md) - - [DeprecatedObject](docs/DeprecatedObject.md) - - [Dog](docs/Dog.md) - - [Drawing](docs/Drawing.md) - - [EnumArrays](docs/EnumArrays.md) - - [EnumClass](docs/EnumClass.md) - - [EnumTest](docs/EnumTest.md) - - [EquilateralTriangle](docs/EquilateralTriangle.md) - - [FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [Foo](docs/Foo.md) - - [FooGetDefaultResponse](docs/FooGetDefaultResponse.md) - - [FormatTest](docs/FormatTest.md) - - [Fruit](docs/Fruit.md) - - [FruitReq](docs/FruitReq.md) - - [GmFruit](docs/GmFruit.md) - - [GrandparentAnimal](docs/GrandparentAnimal.md) - - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [HealthCheckResult](docs/HealthCheckResult.md) - - [IsoscelesTriangle](docs/IsoscelesTriangle.md) - - [Mammal](docs/Mammal.md) - - [MammalAnyof](docs/MammalAnyof.md) - - [MapTest](docs/MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](docs/Model200Response.md) - [ModelApiResponse](docs/ModelApiResponse.md) - - [ModelFile](docs/ModelFile.md) - - [ModelList](docs/ModelList.md) - - [ModelReturn](docs/ModelReturn.md) - - [Name](docs/Name.md) - - [NullableClass](docs/NullableClass.md) - - [NullableShape](docs/NullableShape.md) - - [NumberOnly](docs/NumberOnly.md) - - [ObjectWithDeprecatedFields](docs/ObjectWithDeprecatedFields.md) - [Order](docs/Order.md) - - [OuterComposite](docs/OuterComposite.md) - - [OuterEnum](docs/OuterEnum.md) - - [OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) - - [OuterEnumInteger](docs/OuterEnumInteger.md) - - [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) - - [ParentPet](docs/ParentPet.md) - [Pet](docs/Pet.md) - - [Pig](docs/Pig.md) - - [Quadrilateral](docs/Quadrilateral.md) - - [QuadrilateralInterface](docs/QuadrilateralInterface.md) - - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [ScaleneTriangle](docs/ScaleneTriangle.md) - - [Shape](docs/Shape.md) - - [ShapeInterface](docs/ShapeInterface.md) - - [ShapeOrNull](docs/ShapeOrNull.md) - - [SimpleQuadrilateral](docs/SimpleQuadrilateral.md) - - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - - [TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) - - [Triangle](docs/Triangle.md) - - [TriangleInterface](docs/TriangleInterface.md) - [User](docs/User.md) - - [Whale](docs/Whale.md) - - [Zebra](docs/Zebra.md) @@ -266,32 +177,6 @@ Authentication schemes defined for the API: - **API key parameter name**: api_key - **Location**: HTTP header - -### api_key_query - - -- **Type**: API key -- **API key parameter name**: api_key_query -- **Location**: URL query string - - -### http_basic_test - - -- **Type**: HTTP basic authentication - - -### bearer_test - - -- **Type**: HTTP Bearer Token authentication (JWT) - - -### http_signature_test - - -- **Type**: HTTP signature authentication - ## Recommendation diff --git a/samples/client/petstore/java/jersey3/api/openapi.yaml b/samples/client/petstore/java/jersey3/api/openapi.yaml index 724ee694f1f2..c3c0afb36f74 100644 --- a/samples/client/petstore/java/jersey3/api/openapi.yaml +++ b/samples/client/petstore/java/jersey3/api/openapi.yaml @@ -1,38 +1,17 @@ openapi: 3.0.0 info: - description: "This spec is mainly for testing Petstore server and contains fake\ - \ endpoints, models. Please do not use this for any other purpose. Special characters:\ - \ \" \\" + description: "This is a sample server Petstore server. For this sample, you can\ + \ use the api key `special-key` to test the authorization filters." license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html title: OpenAPI Petstore version: 1.0.0 +externalDocs: + description: Find out more about Swagger + url: http://swagger.io servers: -- description: petstore server - url: "http://{server}.swagger.io:{port}/v2" - variables: - server: - default: petstore - enum: - - petstore - - qa-petstore - - dev-petstore - port: - default: "80" - enum: - - "80" - - "8080" -- description: The local server - url: "https://localhost:8080/{version}" - variables: - version: - default: v2 - enum: - - v1 - - v2 -- description: The local server without variables - url: https://127.0.0.1/no_variable +- url: http://petstore.swagger.io/v2 tags: - description: Everything about your Pets name: pet @@ -41,17 +20,6 @@ tags: - description: Operations about user name: user paths: - /foo: - get: - responses: - default: - content: - application/json: - schema: - $ref: "#/components/schemas/_foo_get_default_response" - description: response - x-accepts: - - application/json /pet: post: description: "" @@ -59,10 +27,18 @@ paths: requestBody: $ref: "#/components/requestBodies/Pet" responses: + "200": + content: + application/xml: + schema: + $ref: "#/components/schemas/Pet" + application/json: + schema: + $ref: "#/components/schemas/Pet" + description: successful operation "405": description: Invalid input security: - - http_signature_test: [] - petstore_auth: - write:pets - read:pets @@ -72,12 +48,25 @@ paths: x-content-type: application/json x-accepts: - application/json + - application/xml put: description: "" + externalDocs: + description: API documentation for the updatePet operation + url: http://petstore.swagger.io/v2/doc/updatePet operationId: updatePet requestBody: $ref: "#/components/requestBodies/Pet" responses: + "200": + content: + application/xml: + schema: + $ref: "#/components/schemas/Pet" + application/json: + schema: + $ref: "#/components/schemas/Pet" + description: successful operation "400": description: Invalid ID supplied "404": @@ -85,7 +74,6 @@ paths: "405": description: Validation exception security: - - http_signature_test: [] - petstore_auth: - write:pets - read:pets @@ -95,9 +83,7 @@ paths: x-content-type: application/json x-accepts: - application/json - servers: - - url: http://petstore.swagger.io/v2 - - url: http://path-server-test.petstore.local/v2 + - application/xml /pet/findByStatus: get: description: Multiple status values can be provided with comma separated strings @@ -136,9 +122,7 @@ paths: "400": description: Invalid status value security: - - http_signature_test: [] - petstore_auth: - - write:pets - read:pets summary: Finds Pets by status tags: @@ -180,9 +164,7 @@ paths: "400": description: Invalid tag value security: - - http_signature_test: [] - petstore_auth: - - write:pets - read:pets summary: Finds Pets by tags tags: @@ -376,7 +358,7 @@ paths: x-accepts: - application/json - application/xml - /store/order/{order_id}: + /store/order/{orderId}: delete: description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -385,7 +367,7 @@ paths: - description: ID of the order that needs to be deleted explode: false in: path - name: order_id + name: orderId required: true schema: type: string @@ -408,7 +390,7 @@ paths: - description: ID of pet that needs to be fetched explode: false in: path - name: order_id + name: orderId required: true schema: format: int64 @@ -450,6 +432,8 @@ paths: responses: default: description: successful operation + security: + - api_key: [] summary: Create user tags: - user @@ -465,6 +449,8 @@ paths: responses: default: description: successful operation + security: + - api_key: [] summary: Creates list of users with given input array tags: - user @@ -480,6 +466,8 @@ paths: responses: default: description: successful operation + security: + - api_key: [] summary: Creates list of users with given input array tags: - user @@ -497,6 +485,7 @@ paths: name: username required: true schema: + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" type: string style: form - description: The password for login in clear text @@ -518,6 +507,14 @@ paths: type: string description: successful operation headers: + Set-Cookie: + description: Cookie authentication key for use with the `api_key` apiKey + authentication. + explode: false + schema: + example: AUTH_KEY=abcde12345; Path=/; HttpOnly + type: string + style: simple X-Rate-Limit: description: calls per hour allowed by the user explode: false @@ -547,6 +544,8 @@ paths: responses: default: description: successful operation + security: + - api_key: [] summary: Logs out current logged in user session tags: - user @@ -570,6 +569,8 @@ paths: description: Invalid username supplied "404": description: User not found + security: + - api_key: [] summary: Delete user tags: - user @@ -631,1711 +632,208 @@ paths: description: Invalid user supplied "404": description: User not found + security: + - api_key: [] summary: Updated user tags: - user x-content-type: application/json x-accepts: - application/json - /fake_classname_test: - patch: - description: To test class name in snake case - operationId: testClassname - requestBody: - $ref: "#/components/requestBodies/Client" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/Client" - description: successful operation - security: - - api_key_query: [] - summary: To test class name in snake case - tags: - - fake_classname_tags 123#$%^ - x-content-type: application/json - x-accepts: - - application/json - /fake: - delete: - description: Fake endpoint to test group parameters (optional) - operationId: testGroupParameters - parameters: - - description: Required String in group parameters - explode: true - in: query - name: required_string_group - required: true - schema: +components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: "#/components/schemas/User" + type: array + description: List of user object + required: true + Pet: + content: + application/json: + schema: + $ref: "#/components/schemas/Pet" + application/xml: + schema: + $ref: "#/components/schemas/Pet" + description: Pet object that needs to be added to the store + required: true + schemas: + Order: + description: An order for a pets from the pet store + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 type: integer - style: form - - description: Required Boolean in group parameters - explode: false - in: header - name: required_boolean_group - required: true - schema: - type: boolean - style: simple - - description: Required Integer in group parameters - explode: true - in: query - name: required_int64_group - required: true - schema: + petId: format: int64 type: integer - style: form - - description: String in group parameters - explode: true - in: query - name: string_group - required: false - schema: + quantity: + format: int32 type: integer - style: form - - description: Boolean in group parameters - explode: false - in: header - name: boolean_group - required: false - schema: + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false type: boolean - style: simple - - description: Integer in group parameters - explode: true - in: query - name: int64_group - required: false - schema: + title: Pet Order + type: object + xml: + name: Order + Category: + description: A category for a pet + example: + name: name + id: 6 + properties: + id: format: int64 type: integer - style: form - responses: - "400": - description: Something wrong - security: - - bearer_test: [] - summary: Fake endpoint to test group parameters (optional) - tags: - - fake - x-group-parameters: true - x-accepts: - - application/json - get: - description: To test enum parameters - operationId: testEnumParameters - parameters: - - description: Header parameter enum test (string array) - explode: false - in: header - name: enum_header_string_array - required: false - schema: + name: + pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" + type: string + title: Pet category + type: object + xml: + name: Category + User: + description: A User who is purchasing from the pet store + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + title: a User + type: object + xml: + name: User + Tag: + description: A tag for a pet + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + title: Pet Tag + type: object + xml: + name: Tag + Pet: + description: A pet for sale in the pet store + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + category: + $ref: "#/components/schemas/Category" + name: + example: doggie + type: string + photoUrls: items: - default: $ - enum: - - '>' - - $ type: string type: array - style: simple - - description: Header parameter enum test (string) - explode: false - in: header - name: enum_header_string - required: false - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - style: simple - - description: Query parameter enum test (string array) - explode: true - in: query - name: enum_query_string_array - required: false - schema: + xml: + name: photoUrl + wrapped: true + tags: items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: form - - description: Query parameter enum test (string) - explode: true - in: query - name: enum_query_string - required: false - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - style: form - - description: Query parameter enum test (double) - explode: true - in: query - name: enum_query_integer - required: false - schema: - enum: - - 1 - - -2 - format: int32 - type: integer - style: form - - description: Query parameter enum test (double) - explode: true - in: query - name: enum_query_double - required: false - schema: - enum: - - 1.1 - - -1.2 - format: double - type: number - style: form - requestBody: - content: - application/x-www-form-urlencoded: - schema: - $ref: "#/components/schemas/testEnumParameters_request" - responses: - "400": - description: Invalid request - "404": - description: Not found - summary: To test enum parameters - tags: - - fake - x-content-type: application/x-www-form-urlencoded - x-accepts: - - application/json - patch: - description: To test "client" model - operationId: testClientModel - requestBody: - $ref: "#/components/requestBodies/Client" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/Client" - description: successful operation - summary: To test "client" model - tags: - - fake - x-content-type: application/json - x-accepts: - - application/json - post: - description: | - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - operationId: testEndpointParameters - requestBody: - content: - application/x-www-form-urlencoded: - schema: - $ref: "#/components/schemas/testEndpointParameters_request" - responses: - "400": - description: Invalid username supplied - "404": - description: User not found - security: - - http_basic_test: [] - summary: | - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - tags: - - fake - x-content-type: application/x-www-form-urlencoded - x-accepts: - - application/json - /fake/outer/number: - post: - description: Test serialization of outer number types - operationId: fakeOuterNumberSerialize - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/OuterNumber" - description: Input number as post body - responses: - "200": - content: - '*/*': - schema: - $ref: "#/components/schemas/OuterNumber" - description: Output number - tags: - - fake - x-content-type: application/json - x-accepts: - - '*/*' - /fake/outer/string: - post: - description: Test serialization of outer string types - operationId: fakeOuterStringSerialize - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/OuterString" - description: Input string as post body - responses: - "200": - content: - '*/*': - schema: - $ref: "#/components/schemas/OuterString" - description: Output string - tags: - - fake - x-content-type: application/json - x-accepts: - - '*/*' - /fake/outer/boolean: - post: - description: Test serialization of outer boolean types - operationId: fakeOuterBooleanSerialize - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/OuterBoolean" - description: Input boolean as post body - responses: - "200": - content: - '*/*': - schema: - $ref: "#/components/schemas/OuterBoolean" - description: Output boolean - tags: - - fake - x-content-type: application/json - x-accepts: - - '*/*' - /fake/outer/composite: - post: - description: Test serialization of object with outer number type - operationId: fakeOuterCompositeSerialize - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/OuterComposite" - description: Input composite as post body - responses: - "200": - content: - '*/*': - schema: - $ref: "#/components/schemas/OuterComposite" - description: Output composite - tags: - - fake - x-content-type: application/json - x-accepts: - - '*/*' - /fake/jsonFormData: - get: - description: "" - operationId: testJsonFormData - requestBody: - content: - application/x-www-form-urlencoded: - schema: - $ref: "#/components/schemas/testJsonFormData_request" - responses: - "200": - description: successful operation - summary: test json serialization of form data - tags: - - fake - x-content-type: application/x-www-form-urlencoded - x-accepts: - - application/json - /fake/additionalProperties-reference: - post: - description: "" - operationId: testAdditionalPropertiesReference - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/FreeFormObject" - description: request body - required: true - responses: - "200": - description: successful operation - summary: test referenced additionalProperties - tags: - - fake - x-content-type: application/json - x-accepts: - - application/json - /fake/stringMap-reference: - post: - description: "" - operationId: testStringMapReference - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/MapOfString" - description: request body - required: true - responses: - "200": - description: successful operation - summary: test referenced string map - tags: - - fake - x-content-type: application/json - x-accepts: - - application/json - /fake/inline-additionalProperties: - post: - description: "" - operationId: testInlineAdditionalProperties - requestBody: - content: - application/json: - schema: - additionalProperties: - type: string - type: object - description: request body - required: true - responses: - "200": - description: successful operation - summary: test inline additionalProperties - tags: - - fake - x-content-type: application/json - x-accepts: - - application/json - /fake/inline-freeform-additionalProperties: - post: - description: "" - operationId: testInlineFreeformAdditionalProperties - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/testInlineFreeformAdditionalProperties_request" - description: request body - required: true - responses: - "200": - description: successful operation - summary: test inline free-form additionalProperties - tags: - - fake - x-content-type: application/json - x-accepts: - - application/json - /fake/body-with-query-params: - put: - operationId: testBodyWithQueryParams - parameters: - - explode: true - in: query - name: query - required: true - schema: - type: string - style: form - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/User" - required: true - responses: - "200": - description: Success - tags: - - fake - x-content-type: application/json - x-accepts: - - application/json - /another-fake/dummy: - patch: - description: To test special tags and operation ID starting with number - operationId: 123_test_@#$%_special_tags - requestBody: - $ref: "#/components/requestBodies/Client" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/Client" - description: successful operation - summary: To test special tags - tags: - - $another-fake? - x-content-type: application/json - x-accepts: - - application/json - /fake/body-with-file-schema: - put: - description: "For this test, the body for this request much reference a schema\ - \ named `File`." - operationId: testBodyWithFileSchema - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/FileSchemaTestClass" - required: true - responses: - "200": - description: Success - tags: - - fake - x-content-type: application/json - x-accepts: - - application/json - /fake/test-query-parameters: - put: - description: To test the collection format in query parameters - operationId: testQueryParameterCollectionFormat - parameters: - - explode: true - in: query - name: pipe - required: true - schema: - items: - type: string - type: array - style: form - - explode: false - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - style: form - - explode: false - in: query - name: http - required: true - schema: - items: - type: string - type: array - style: spaceDelimited - - explode: false - in: query - name: url - required: true - schema: - items: - type: string - type: array - style: form - - explode: true - in: query - name: context - required: true - schema: - items: - type: string - type: array - style: form - responses: - "200": - description: Success - tags: - - fake - x-accepts: - - application/json - /fake/{petId}/uploadImageWithRequiredFile: - post: - description: "" - operationId: uploadFileWithRequiredFile - parameters: - - description: ID of pet to update - explode: false - in: path - name: petId - required: true - schema: - format: int64 - type: integer - style: simple - requestBody: - content: - multipart/form-data: - schema: - $ref: "#/components/schemas/uploadFileWithRequiredFile_request" - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ApiResponse" - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image (required) - tags: - - pet - x-content-type: multipart/form-data - x-accepts: - - application/json - /fake/health: - get: - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/HealthCheckResult" - description: The instance started successfully - summary: Health check endpoint - tags: - - fake - x-accepts: - - application/json - /fake/array-of-enums: - get: - operationId: getArrayOfEnums - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/ArrayOfEnums" - description: Got named array of enums - summary: Array of Enums - tags: - - fake - x-accepts: - - application/json - /fake/request-array-string: - post: - operationId: postArrayOfString - requestBody: - content: - application/json: - schema: - items: - pattern: "[A-Z0-9]+" - type: string - type: array - responses: - "200": - description: ok - summary: Array of string - tags: - - fake - x-content-type: application/json - x-accepts: - - application/json -components: - requestBodies: - UserArray: - content: - application/json: - examples: - simple-list: - description: Should not get into code examples - summary: Simple list example - value: - - username: foo - - username: bar - schema: - items: - $ref: "#/components/schemas/User" - type: array - description: List of user object - required: true - Client: - content: - application/json: - schema: - $ref: "#/components/schemas/Client" - description: client model - required: true - Pet: - content: - application/json: - schema: - $ref: "#/components/schemas/Pet" - application/xml: - schema: - $ref: "#/components/schemas/Pet" - description: Pet object that needs to be added to the store - required: true - schemas: - Foo: - example: - bar: bar - properties: - bar: - default: bar - type: string - type: object - Bar: - default: bar - type: string - Order: - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2020-02-02T20:20:20.000222Z - complete: false - status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - example: 2020-02-02T20:20:20.000222Z - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - type: object - xml: - name: Order - Category: - example: - name: default-name - id: 6 - properties: - id: - format: int64 - type: integer - name: - default: default-name - type: string - required: - - name - type: object - xml: - name: Category - User: - example: - firstName: firstName - lastName: lastName - password: password - userStatus: 6 - objectWithNoDeclaredPropsNullable: "{}" - phone: phone - objectWithNoDeclaredProps: "{}" - id: 0 - anyTypePropNullable: "" - email: email - anyTypeProp: "" - username: username - properties: - id: - format: int64 - type: integer - x-is-unique: true - username: - type: string - firstName: - type: string - lastName: - type: string - email: - type: string - password: - type: string - phone: - type: string - userStatus: - description: User Status - format: int32 - type: integer - objectWithNoDeclaredProps: - description: test code generation for objects Value must be a map of strings - to values. It cannot be the 'null' value. - type: object - objectWithNoDeclaredPropsNullable: - description: test code generation for nullable objects. Value must be a - map of strings to values or the 'null' value. - nullable: true - type: object - anyTypeProp: - description: "test code generation for any type Here the 'type' attribute\ - \ is not specified, which means the value can be anything, including the\ - \ null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389" - anyTypePropNullable: - description: "test code generation for any type Here the 'type' attribute\ - \ is not specified, which means the value can be anything, including the\ - \ null value, string, number, boolean, array or object. The 'nullable'\ - \ attribute does not change the allowed values." - nullable: true - type: object - xml: - name: User - Tag: - example: - name: name - id: 1 - properties: - id: - format: int64 - type: integer - name: - type: string - type: object - xml: - name: Tag - Pet: - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: default-name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available - properties: - id: - format: int64 - type: integer - x-is-unique: true - category: - $ref: "#/components/schemas/Category" - name: - example: doggie - type: string - photoUrls: - items: - type: string - type: array - xml: - name: photoUrl - wrapped: true - tags: - items: - $ref: "#/components/schemas/Tag" + $ref: "#/components/schemas/Tag" type: array xml: - name: tag - wrapped: true - status: - description: pet status in the store - enum: - - available - - pending - - sold - type: string - required: - - name - - photoUrls - type: object - xml: - name: Pet - ApiResponse: - example: - code: 0 - type: type - message: message - properties: - code: - format: int32 - type: integer - type: - type: string - message: - type: string - type: object - Return: - description: Model for testing reserved words - properties: - return: - format: int32 - type: integer - xml: - name: Return - Name: - description: Model for testing model name same as property name - properties: - name: - format: int32 - type: integer - snake_case: - format: int32 - readOnly: true - type: integer - property: - type: string - "123Number": - readOnly: true - type: integer - required: - - name - xml: - name: Name - "200_response": - description: Model for testing model name starting with number - properties: - name: - format: int32 - type: integer - class: - type: string - xml: - name: Name - ClassModel: - description: Model for testing model with "_class" property - properties: - _class: - type: string - Dog: - allOf: - - $ref: "#/components/schemas/Animal" - - properties: - breed: - type: string - type: object - Cat: - allOf: - - $ref: "#/components/schemas/Animal" - - $ref: "#/components/schemas/Address" - - properties: - declawed: - type: boolean - type: object - Address: - additionalProperties: - type: integer - type: object - Animal: - discriminator: - propertyName: className - properties: - className: - type: string - color: - default: red - type: string - required: - - className - type: object - AnimalFarm: - items: - $ref: "#/components/schemas/Animal" - type: array - format_test: - properties: - integer: - maximum: 100 - minimum: 10 - multipleOf: 2 - type: integer - int32: - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - format: int64 - type: integer - number: - maximum: 543.2 - minimum: 32.1 - multipleOf: 32.5 - type: number - float: - format: float - maximum: 987.6 - minimum: 54.3 - type: number - double: - format: double - maximum: 123.4 - minimum: 67.8 - type: number - decimal: - format: number - type: string - string: - pattern: "/[a-z]/i" - type: string - byte: - format: byte - type: string - binary: - format: binary - type: string - date: - example: 2020-02-02 - format: date - type: string - dateTime: - example: 2007-12-03T10:15:30+01:00 - format: date-time - type: string - uuid: - example: 72f98069-206d-4f12-9f12-3d1e525a8e84 - format: uuid - type: string - password: - format: password - maxLength: 64 - minLength: 10 - type: string - pattern_with_digits: - description: A string that is a 10 digit number. Can have leading zeros. - pattern: "^\\d{10}$" - type: string - pattern_with_digits_and_delimiter: - description: A string starting with 'image_' (case insensitive) and one - to three digits following i.e. Image_01. - pattern: "/^image_\\d{1,3}$/i" - type: string - required: - - byte - - date - - number - - password - type: object - EnumClass: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - Enum_Test: - properties: - enum_string: - enum: - - UPPER - - lower - - "" - type: string - enum_string_required: + name: tag + wrapped: true + status: + deprecated: true + description: pet status in the store enum: - - UPPER - - lower - - "" + - available + - pending + - sold type: string - enum_integer: - enum: - - 1 - - -1 - format: int32 - type: integer - enum_integer_only: - enum: - - 2 - - -2 - type: integer - enum_number: - enum: - - 1.1 - - -1.2 - format: double - type: number - outerEnum: - $ref: "#/components/schemas/OuterEnum" - outerEnumInteger: - $ref: "#/components/schemas/OuterEnumInteger" - outerEnumDefaultValue: - $ref: "#/components/schemas/OuterEnumDefaultValue" - outerEnumIntegerDefaultValue: - $ref: "#/components/schemas/OuterEnumIntegerDefaultValue" required: - - enum_string_required - type: object - AdditionalPropertiesClass: - properties: - map_property: - additionalProperties: - type: string - type: object - map_of_map_property: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - anytype_1: {} - map_with_undeclared_properties_anytype_1: - type: object - map_with_undeclared_properties_anytype_2: - properties: {} - type: object - map_with_undeclared_properties_anytype_3: - additionalProperties: true - type: object - empty_map: - additionalProperties: false - description: "an object with no declared properties and no undeclared properties,\ - \ hence it's an empty map." - type: object - map_with_undeclared_properties_string: - additionalProperties: - type: string - type: object - type: object - MixedPropertiesAndAdditionalPropertiesClass: - properties: - uuid: - format: uuid - type: string - dateTime: - format: date-time - type: string - map: - additionalProperties: - $ref: "#/components/schemas/Animal" - type: object - type: object - List: - properties: - "123-list": - type: string - type: object - Client: - example: - client: client - properties: - client: - type: string - type: object - ReadOnlyFirst: - properties: - bar: - readOnly: true - type: string - baz: - type: string - type: object - hasOnlyReadOnly: - properties: - bar: - readOnly: true - type: string - foo: - readOnly: true - type: string - type: object - Capitalization: - properties: - smallCamel: - type: string - CapitalCamel: - type: string - small_Snake: - type: string - Capital_Snake: - type: string - SCA_ETH_Flow_Points: - type: string - ATT_NAME: - description: | - Name of the pet - type: string - type: object - MapTest: - properties: - map_map_of_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_of_enum_string: - additionalProperties: - enum: - - UPPER - - lower - type: string - type: object - direct_map: - additionalProperties: - type: boolean - type: object - indirect_map: - additionalProperties: - type: boolean - type: object - type: object - ArrayTest: - properties: - array_of_string: - items: - type: string - type: array - array_array_of_integer: - items: - items: - format: int64 - type: integer - type: array - type: array - array_array_of_model: - items: - items: - $ref: "#/components/schemas/ReadOnlyFirst" - type: array - type: array - type: object - NumberOnly: - properties: - JustNumber: - type: number - type: object - ArrayOfNumberOnly: - properties: - ArrayNumber: - items: - type: number - type: array - type: object - ArrayOfArrayOfNumberOnly: - properties: - ArrayArrayNumber: - items: - items: - type: number - type: array - type: array - type: object - EnumArrays: - properties: - just_symbol: - enum: - - '>=' - - $ - type: string - array_enum: - items: - enum: - - fish - - crab - type: string - type: array - type: object - FreeFormObject: - additionalProperties: true - description: A schema consisting only of additional properties - type: object - MapOfString: - additionalProperties: - type: string - description: A schema consisting only of additional properties of type string - type: object - OuterEnum: - enum: - - placed - - approved - - delivered - nullable: true - type: string - OuterEnumInteger: - enum: - - 0 - - 1 - - 2 - type: integer - OuterEnumDefaultValue: - default: placed - enum: - - placed - - approved - - delivered - type: string - OuterEnumIntegerDefaultValue: - default: 0 - enum: - - 0 - - 1 - - 2 - type: integer - OuterComposite: - example: - my_string: my_string - my_number: 0.8008281904610115 - my_boolean: true - properties: - my_number: - type: number - my_string: - type: string - my_boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - type: object - OuterNumber: - type: number - OuterString: - type: string - OuterBoolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - StringBooleanMap: - additionalProperties: - type: boolean - type: object - FileSchemaTestClass: - example: - file: - sourceURI: sourceURI - files: - - sourceURI: sourceURI - - sourceURI: sourceURI - properties: - file: - $ref: "#/components/schemas/File" - files: - items: - $ref: "#/components/schemas/File" - type: array - type: object - File: - description: Must be named `File` for test. - example: - sourceURI: sourceURI - properties: - sourceURI: - description: Test capitalization - type: string + - name + - photoUrls + title: a Pet type: object - _special_model.name_: - properties: - $special[property.name]: - format: int64 - type: integer - _special_model.name_: - type: string xml: - name: "$special[model.name]" - HealthCheckResult: - description: Just a string to inform instance is up and running. Make it nullable - in hope to get it as pointer in generated model. + name: Pet + ApiResponse: + description: Describes the result of uploading an image resource example: - NullableMessage: NullableMessage - properties: - NullableMessage: - nullable: true - type: string - type: object - NullableClass: - additionalProperties: - nullable: true - type: object + code: 0 + type: type + message: message properties: - integer_prop: - nullable: true + code: + format: int32 type: integer - number_prop: - nullable: true - type: number - boolean_prop: - nullable: true - type: boolean - string_prop: - nullable: true - type: string - date_prop: - format: date - nullable: true - type: string - datetime_prop: - format: date-time - nullable: true - type: string - array_nullable_prop: - items: - type: object - nullable: true - type: array - array_and_items_nullable_prop: - items: - nullable: true - type: object - nullable: true - type: array - array_items_nullable: - items: - nullable: true - type: object - type: array - object_nullable_prop: - additionalProperties: - type: object - nullable: true - type: object - object_and_items_nullable_prop: - additionalProperties: - nullable: true - type: object - nullable: true - type: object - object_items_nullable: - additionalProperties: - nullable: true - type: object - type: object - type: object - fruit: - additionalProperties: false - oneOf: - - $ref: "#/components/schemas/apple" - - $ref: "#/components/schemas/banana" - properties: - color: - type: string - apple: - nullable: true - properties: - cultivar: - pattern: "^[a-zA-Z\\s]*$" - type: string - origin: - pattern: "/^[A-Z\\s]*$/i" - type: string - type: object - banana: - properties: - lengthCm: - type: number - type: object - mammal: - discriminator: - propertyName: className - oneOf: - - $ref: "#/components/schemas/whale" - - $ref: "#/components/schemas/zebra" - - $ref: "#/components/schemas/Pig" - mammal_anyof: - anyOf: - - $ref: "#/components/schemas/whale" - - $ref: "#/components/schemas/zebra" - - $ref: "#/components/schemas/Pig" - discriminator: - propertyName: className - whale: - properties: - hasBaleen: - type: boolean - hasTeeth: - type: boolean - className: - type: string - required: - - className - type: object - zebra: - additionalProperties: true - properties: type: - enum: - - plains - - mountain - - grevys - type: string - className: - type: string - required: - - className - type: object - Pig: - discriminator: - propertyName: className - oneOf: - - $ref: "#/components/schemas/BasquePig" - - $ref: "#/components/schemas/DanishPig" - BasquePig: - properties: - className: - type: string - required: - - className - type: object - DanishPig: - properties: - className: - type: string - required: - - className - type: object - gmFruit: - additionalProperties: false - anyOf: - - $ref: "#/components/schemas/apple" - - $ref: "#/components/schemas/banana" - properties: - color: - type: string - fruitReq: - additionalProperties: false - nullable: true - oneOf: - - $ref: "#/components/schemas/appleReq" - - $ref: "#/components/schemas/bananaReq" - appleReq: - additionalProperties: false - properties: - cultivar: - type: string - mealy: - type: boolean - required: - - cultivar - type: object - bananaReq: - additionalProperties: false - properties: - lengthCm: - type: number - sweet: - type: boolean - required: - - lengthCm - type: object - Drawing: - additionalProperties: - $ref: "#/components/schemas/fruit" - properties: - mainShape: - $ref: "#/components/schemas/Shape" - shapeOrNull: - $ref: "#/components/schemas/ShapeOrNull" - nullableShape: - $ref: "#/components/schemas/NullableShape" - shapes: - items: - $ref: "#/components/schemas/Shape" - type: array - type: object - Shape: - discriminator: - propertyName: shapeType - oneOf: - - $ref: "#/components/schemas/Triangle" - - $ref: "#/components/schemas/Quadrilateral" - ShapeOrNull: - description: The value may be a shape or the 'null' value. This is introduced - in OAS schema >= 3.1. - discriminator: - propertyName: shapeType - nullable: true - oneOf: - - $ref: "#/components/schemas/Triangle" - - $ref: "#/components/schemas/Quadrilateral" - NullableShape: - description: The value may be a shape or the 'null' value. The 'nullable' attribute - was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema - >= 3.1. - discriminator: - propertyName: shapeType - nullable: true - oneOf: - - $ref: "#/components/schemas/Triangle" - - $ref: "#/components/schemas/Quadrilateral" - ShapeInterface: - properties: - shapeType: - type: string - required: - - shapeType - TriangleInterface: - properties: - triangleType: - type: string - required: - - triangleType - Triangle: - discriminator: - propertyName: triangleType - oneOf: - - $ref: "#/components/schemas/EquilateralTriangle" - - $ref: "#/components/schemas/IsoscelesTriangle" - - $ref: "#/components/schemas/ScaleneTriangle" - EquilateralTriangle: - allOf: - - $ref: "#/components/schemas/ShapeInterface" - - $ref: "#/components/schemas/TriangleInterface" - IsoscelesTriangle: - additionalProperties: false - allOf: - - $ref: "#/components/schemas/ShapeInterface" - - $ref: "#/components/schemas/TriangleInterface" - ScaleneTriangle: - allOf: - - $ref: "#/components/schemas/ShapeInterface" - - $ref: "#/components/schemas/TriangleInterface" - QuadrilateralInterface: - properties: - quadrilateralType: - type: string - required: - - quadrilateralType - Quadrilateral: - discriminator: - propertyName: quadrilateralType - oneOf: - - $ref: "#/components/schemas/SimpleQuadrilateral" - - $ref: "#/components/schemas/ComplexQuadrilateral" - SimpleQuadrilateral: - allOf: - - $ref: "#/components/schemas/ShapeInterface" - - $ref: "#/components/schemas/QuadrilateralInterface" - ComplexQuadrilateral: - allOf: - - $ref: "#/components/schemas/ShapeInterface" - - $ref: "#/components/schemas/QuadrilateralInterface" - GrandparentAnimal: - discriminator: - propertyName: pet_type - properties: - pet_type: - type: string - required: - - pet_type - type: object - ParentPet: - allOf: - - $ref: "#/components/schemas/GrandparentAnimal" - type: object - ChildCat: - allOf: - - $ref: "#/components/schemas/ParentPet" - - properties: - name: - type: string - pet_type: - default: ChildCat - enum: - - ChildCat - type: string - x-enum-as-string: true - type: object - ArrayOfEnums: - items: - $ref: "#/components/schemas/OuterEnum" - type: array - DateTimeTest: - default: 2010-01-01T10:10:10.000111+01:00 - example: 2010-01-01T10:10:10.000111+01:00 - format: date-time - type: string - DeprecatedObject: - deprecated: true - properties: - name: type: string - type: object - ObjectWithDeprecatedFields: - properties: - uuid: + message: type: string - id: - deprecated: true - type: number - deprecatedRef: - $ref: "#/components/schemas/DeprecatedObject" - bars: - deprecated: true - items: - $ref: "#/components/schemas/Bar" - type: array - type: object - LongId: - description: Id as long - format: int64 - type: integer - Weight: - description: Weight as float - format: float - type: number - Height: - description: Height as double - format: double - type: number - AllOfRefToLong: - description: Object with allOf ref to long - properties: - id: - allOf: - - $ref: "#/components/schemas/LongId" - default: 10 - type: object - AllOfRefToFloat: - description: Object with allOf ref to float - properties: - weight: - allOf: - - $ref: "#/components/schemas/Weight" - default: 7.89 - type: object - AllOfRefToDouble: - description: Object with allOf ref to double - properties: - height: - allOf: - - $ref: "#/components/schemas/Height" - default: 32.1 - type: object - _foo_get_default_response: - example: - string: - bar: bar - properties: - string: - $ref: "#/components/schemas/Foo" + title: An uploaded response type: object updatePetWithForm_request: properties: @@ -2356,130 +854,6 @@ components: format: binary type: string type: object - testEnumParameters_request: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string - type: object - testEndpointParameters_request: - properties: - integer: - description: None - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: "/[a-z]/i" - type: string - pattern_without_delimiter: - description: None - pattern: "^[A-Z].*" - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - default: 2010-02-01T10:20:10.11111+01:00 - description: None - example: 2020-02-02T20:20:20.22222Z - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter - type: object - testJsonFormData_request: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 - type: object - testInlineFreeformAdditionalProperties_request: - additionalProperties: true - properties: - someProperty: - type: string - type: object - uploadFileWithRequiredFile_request: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile - type: object securitySchemes: petstore_auth: flows: @@ -2493,18 +867,4 @@ components: in: header name: api_key type: apiKey - api_key_query: - in: query - name: api_key_query - type: apiKey - http_basic_test: - scheme: basic - type: http - bearer_test: - bearerFormat: JWT - scheme: bearer - type: http - http_signature_test: - scheme: signature - type: http diff --git a/samples/client/petstore/java/jersey3/build.gradle b/samples/client/petstore/java/jersey3/build.gradle index 0b26c0545286..088b31f1a211 100644 --- a/samples/client/petstore/java/jersey3/build.gradle +++ b/samples/client/petstore/java/jersey3/build.gradle @@ -84,7 +84,7 @@ if(hasProperty('target') && target == 'android') { publishing { publications { maven(MavenPublication) { - artifactId = 'petstore-jersey3' + artifactId = 'openapi-java-client' from components.java } @@ -104,12 +104,9 @@ ext { jackson_databind_version = "2.21.1" jackson_databind_nullable_version = "0.2.10" jakarta_annotation_version = "2.1.0" - bean_validation_version = "3.0.2" jersey_version = "3.0.4" junit_version = "5.8.2" scribejava_apis_version = "8.3.1" - tomitribe_http_signatures_version = "1.7" - commons_lang3_version = "3.17.0" } dependencies { @@ -126,10 +123,7 @@ dependencies { implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "com.github.scribejava:scribejava-apis:$scribejava_apis_version" - implementation "org.tomitribe:tomitribe-http-signatures:$tomitribe_http_signatures_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - implementation "jakarta.validation:jakarta.validation-api:$bean_validation_version" - implementation "org.apache.commons:commons-lang3:$commons_lang3_version" testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" } diff --git a/samples/client/petstore/java/jersey3/build.sbt b/samples/client/petstore/java/jersey3/build.sbt index ef9f97ebb175..82ca0f5317ba 100644 --- a/samples/client/petstore/java/jersey3/build.sbt +++ b/samples/client/petstore/java/jersey3/build.sbt @@ -1,7 +1,7 @@ lazy val root = (project in file(".")). settings( organization := "org.openapitools", - name := "petstore-jersey3", + name := "openapi-java-client", version := "1.0.0", scalaVersion := "2.11.12", scalacOptions ++= Seq("-feature"), @@ -22,9 +22,7 @@ lazy val root = (project in file(".")). "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.21.1" % "compile", "org.openapitools" % "jackson-databind-nullable" % "0.2.10" % "compile", "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", - "org.tomitribe" % "tomitribe-http-signatures" % "1.7" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "2.1.0" % "compile", - "org.apache.commons" % "commons-lang3" % "3.17.0" % "compile", "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" ) ) diff --git a/samples/client/petstore/java/jersey3/docs/Category.md b/samples/client/petstore/java/jersey3/docs/Category.md index ab6d1ec334dc..a7fc939d252e 100644 --- a/samples/client/petstore/java/jersey3/docs/Category.md +++ b/samples/client/petstore/java/jersey3/docs/Category.md @@ -2,13 +2,14 @@ # Category +A category for a pet ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**id** | **Long** | | [optional] | -|**name** | **String** | | | +|**name** | **String** | | [optional] | diff --git a/samples/client/petstore/java/jersey3/docs/ModelApiResponse.md b/samples/client/petstore/java/jersey3/docs/ModelApiResponse.md index e374c2dd2dec..cd7e3c400be6 100644 --- a/samples/client/petstore/java/jersey3/docs/ModelApiResponse.md +++ b/samples/client/petstore/java/jersey3/docs/ModelApiResponse.md @@ -2,6 +2,7 @@ # ModelApiResponse +Describes the result of uploading an image resource ## Properties diff --git a/samples/client/petstore/java/jersey3/docs/Order.md b/samples/client/petstore/java/jersey3/docs/Order.md index 27af32855c5c..0c33059b8b6a 100644 --- a/samples/client/petstore/java/jersey3/docs/Order.md +++ b/samples/client/petstore/java/jersey3/docs/Order.md @@ -2,6 +2,7 @@ # Order +An order for a pets from the pet store ## Properties diff --git a/samples/client/petstore/java/jersey3/docs/Pet.md b/samples/client/petstore/java/jersey3/docs/Pet.md index 08dfd8623602..8bb363301232 100644 --- a/samples/client/petstore/java/jersey3/docs/Pet.md +++ b/samples/client/petstore/java/jersey3/docs/Pet.md @@ -2,6 +2,7 @@ # Pet +A pet for sale in the pet store ## Properties diff --git a/samples/client/petstore/java/jersey3/docs/PetApi.md b/samples/client/petstore/java/jersey3/docs/PetApi.md index b6096623c133..cde9058fb771 100644 --- a/samples/client/petstore/java/jersey3/docs/PetApi.md +++ b/samples/client/petstore/java/jersey3/docs/PetApi.md @@ -1,6 +1,6 @@ # PetApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://petstore.swagger.io/v2* | Method | HTTP request | Description | |------------- | ------------- | -------------| @@ -12,13 +12,12 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* | [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet | | [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data | | [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image | -| [**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) | ## addPet -> addPet(pet) +> Pet addPet(pet) Add a new pet to the store @@ -38,17 +37,17 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - PetApi apiInstance = new PetApi(defaultClient); Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(pet); + Pet result = apiInstance.addPet(pet); + System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); System.err.println("Status code: " + e.getCode()); @@ -69,20 +68,21 @@ public class Example { ### Return type -null (empty response body) +[**Pet**](Pet.md) ### Authorization -[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) +[petstore_auth](../README.md#petstore_auth) ### HTTP request headers - **Content-Type**: application/json, application/xml -- **Accept**: Not defined +- **Accept**: application/xml, application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| +| **200** | successful operation | - | | **405** | Invalid input | - | @@ -108,7 +108,7 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); @@ -179,13 +179,12 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - PetApi apiInstance = new PetApi(defaultClient); List status = Arrays.asList("available"); // List | Status values that need to be considered for filter try { @@ -215,7 +214,7 @@ public class Example { ### Authorization -[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) +[petstore_auth](../README.md#petstore_auth) ### HTTP request headers @@ -251,13 +250,12 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - PetApi apiInstance = new PetApi(defaultClient); List tags = Arrays.asList(); // List | Tags to filter by try { @@ -287,7 +285,7 @@ public class Example { ### Authorization -[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) +[petstore_auth](../README.md#petstore_auth) ### HTTP request headers @@ -323,7 +321,7 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); // Configure API key authorization: api_key ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); @@ -377,7 +375,7 @@ public class Example { ## updatePet -> updatePet(pet) +> Pet updatePet(pet) Update an existing pet @@ -397,17 +395,17 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - PetApi apiInstance = new PetApi(defaultClient); Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.updatePet(pet); + Pet result = apiInstance.updatePet(pet); + System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); System.err.println("Status code: " + e.getCode()); @@ -428,20 +426,21 @@ public class Example { ### Return type -null (empty response body) +[**Pet**](Pet.md) ### Authorization -[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) +[petstore_auth](../README.md#petstore_auth) ### HTTP request headers - **Content-Type**: application/json, application/xml -- **Accept**: Not defined +- **Accept**: application/xml, application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| +| **200** | successful operation | - | | **400** | Invalid ID supplied | - | | **404** | Pet not found | - | | **405** | Validation exception | - | @@ -469,7 +468,7 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); @@ -543,7 +542,7 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); @@ -594,78 +593,3 @@ public class Example { |-------------|-------------|------------------| | **200** | successful operation | - | - -## uploadFileWithRequiredFile - -> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) - -uploads an image (required) - - - -### Example - -```java -import java.io.File; -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; -import org.openapitools.client.model.*; -import org.openapitools.client.api.PetApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - // Configure OAuth2 access token for authorization: petstore_auth - OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); - petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - - PetApi apiInstance = new PetApi(defaultClient); - Long petId = 56L; // Long | ID of pet to update - File requiredFile = new File("/path/to/file"); // File | file to upload - String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server - try { - ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **petId** | **Long**| ID of pet to update | | -| **requiredFile** | **File**| file to upload | | -| **additionalMetadata** | **String**| Additional data to pass to server | [optional] | - -### Return type - -[**ModelApiResponse**](ModelApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - -- **Content-Type**: multipart/form-data -- **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | successful operation | - | - diff --git a/samples/client/petstore/java/jersey3/docs/StoreApi.md b/samples/client/petstore/java/jersey3/docs/StoreApi.md index 6eab555ee029..a88a09d61ec2 100644 --- a/samples/client/petstore/java/jersey3/docs/StoreApi.md +++ b/samples/client/petstore/java/jersey3/docs/StoreApi.md @@ -1,12 +1,12 @@ # StoreApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://petstore.swagger.io/v2* | Method | HTTP request | Description | |------------- | ------------- | -------------| -| [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID | +| [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID | | [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status | -| [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID | +| [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID | | [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet | @@ -32,7 +32,7 @@ import org.openapitools.client.api.StoreApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); StoreApi apiInstance = new StoreApi(defaultClient); String orderId = "orderId_example"; // String | ID of the order that needs to be deleted @@ -98,7 +98,7 @@ import org.openapitools.client.api.StoreApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); // Configure API key authorization: api_key ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); @@ -165,7 +165,7 @@ import org.openapitools.client.api.StoreApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); StoreApi apiInstance = new StoreApi(defaultClient); Long orderId = 56L; // Long | ID of pet that needs to be fetched @@ -232,7 +232,7 @@ import org.openapitools.client.api.StoreApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); StoreApi apiInstance = new StoreApi(defaultClient); Order order = new Order(); // Order | order placed for purchasing the pet diff --git a/samples/client/petstore/java/jersey3/docs/Tag.md b/samples/client/petstore/java/jersey3/docs/Tag.md index 5088b2dd1c31..abfde4afb501 100644 --- a/samples/client/petstore/java/jersey3/docs/Tag.md +++ b/samples/client/petstore/java/jersey3/docs/Tag.md @@ -2,6 +2,7 @@ # Tag +A tag for a pet ## Properties diff --git a/samples/client/petstore/java/jersey3/docs/User.md b/samples/client/petstore/java/jersey3/docs/User.md index 9e97dc35485f..426845227bd3 100644 --- a/samples/client/petstore/java/jersey3/docs/User.md +++ b/samples/client/petstore/java/jersey3/docs/User.md @@ -2,6 +2,7 @@ # User +A User who is purchasing from the pet store ## Properties @@ -15,10 +16,6 @@ |**password** | **String** | | [optional] | |**phone** | **String** | | [optional] | |**userStatus** | **Integer** | User Status | [optional] | -|**objectWithNoDeclaredProps** | **Object** | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | [optional] | -|**objectWithNoDeclaredPropsNullable** | **Object** | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional] | -|**anyTypeProp** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 | [optional] | -|**anyTypePropNullable** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. | [optional] | diff --git a/samples/client/petstore/java/jersey3/docs/UserApi.md b/samples/client/petstore/java/jersey3/docs/UserApi.md index 091549fc7c8f..bb5adf10b8d7 100644 --- a/samples/client/petstore/java/jersey3/docs/UserApi.md +++ b/samples/client/petstore/java/jersey3/docs/UserApi.md @@ -1,6 +1,6 @@ # UserApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://petstore.swagger.io/v2* | Method | HTTP request | Description | |------------- | ------------- | -------------| @@ -30,13 +30,20 @@ This can only be done by the logged in user. import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; import org.openapitools.client.model.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); UserApi apiInstance = new UserApi(defaultClient); User user = new User(); // User | Created user object @@ -66,7 +73,7 @@ null (empty response body) ### Authorization -No authorization required +[api_key](../README.md#api_key) ### HTTP request headers @@ -94,16 +101,23 @@ Creates list of users with given input array import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; import org.openapitools.client.model.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); UserApi apiInstance = new UserApi(defaultClient); - List<@Valid User> user = Arrays.asList(); // List<@Valid User> | List of user object + List user = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { @@ -130,7 +144,7 @@ null (empty response body) ### Authorization -No authorization required +[api_key](../README.md#api_key) ### HTTP request headers @@ -158,16 +172,23 @@ Creates list of users with given input array import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; import org.openapitools.client.model.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); UserApi apiInstance = new UserApi(defaultClient); - List<@Valid User> user = Arrays.asList(); // List<@Valid User> | List of user object + List user = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithListInput(user); } catch (ApiException e) { @@ -194,7 +215,7 @@ null (empty response body) ### Authorization -No authorization required +[api_key](../README.md#api_key) ### HTTP request headers @@ -222,13 +243,20 @@ This can only be done by the logged in user. import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; import org.openapitools.client.model.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); UserApi apiInstance = new UserApi(defaultClient); String username = "username_example"; // String | The name that needs to be deleted @@ -258,7 +286,7 @@ null (empty response body) ### Authorization -No authorization required +[api_key](../README.md#api_key) ### HTTP request headers @@ -293,7 +321,7 @@ import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); UserApi apiInstance = new UserApi(defaultClient); String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. @@ -360,7 +388,7 @@ import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); UserApi apiInstance = new UserApi(defaultClient); String username = "username_example"; // String | The user name for login @@ -403,7 +431,7 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **200** | successful operation | * Set-Cookie - Cookie authentication key for use with the `api_key` apiKey authentication.
* X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| | **400** | Invalid username/password supplied | - | @@ -422,13 +450,20 @@ Logs out current logged in user session import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; import org.openapitools.client.model.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); UserApi apiInstance = new UserApi(defaultClient); try { @@ -454,7 +489,7 @@ null (empty response body) ### Authorization -No authorization required +[api_key](../README.md#api_key) ### HTTP request headers @@ -482,13 +517,20 @@ This can only be done by the logged in user. import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; import org.openapitools.client.model.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + defaultClient.setBasePath("http://petstore.swagger.io/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); UserApi apiInstance = new UserApi(defaultClient); String username = "username_example"; // String | name that need to be deleted @@ -520,7 +562,7 @@ null (empty response body) ### Authorization -No authorization required +[api_key](../README.md#api_key) ### HTTP request headers diff --git a/samples/client/petstore/java/jersey3/gradle.properties b/samples/client/petstore/java/jersey3/gradle.properties index d3e8e41ba6fb..a3408578278a 100644 --- a/samples/client/petstore/java/jersey3/gradle.properties +++ b/samples/client/petstore/java/jersey3/gradle.properties @@ -4,10 +4,3 @@ # Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties # For example, uncomment below to build for Android #target = android - -# JVM arguments -org.gradle.jvmargs=-Xmx2024m -XX:MaxPermSize=512m -# set timeout -org.gradle.daemon.idletimeout=3600000 -# show all warnings -org.gradle.warning.mode=all diff --git a/samples/client/petstore/java/jersey3/pom.xml b/samples/client/petstore/java/jersey3/pom.xml index faf628278687..ead06c423bae 100644 --- a/samples/client/petstore/java/jersey3/pom.xml +++ b/samples/client/petstore/java/jersey3/pom.xml @@ -2,9 +2,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 org.openapitools - petstore-jersey3 + openapi-java-client jar - petstore-jersey3 + openapi-java-client 1.0.0 https://github.com/openapitools/openapi-generator OpenAPI Java @@ -307,23 +307,11 @@ jackson-datatype-jsr310 ${jackson-version} - - org.tomitribe - tomitribe-http-signatures - ${http-signature-version} - com.github.scribejava scribejava-apis ${scribejava-apis-version} - - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - provided - jakarta.annotation jakarta.annotation-api @@ -335,12 +323,6 @@ jersey-apache-connector ${jersey-version} - - - org.apache.commons - commons-lang3 - ${commons-lang3-version} - @@ -360,9 +342,7 @@ 2.1.1 3.0.2 5.10.0 - 1.8 8.3.3 - 3.17.0 2.21.0 diff --git a/samples/client/petstore/java/jersey3/settings.gradle b/samples/client/petstore/java/jersey3/settings.gradle index b50c71ae7985..369ba54a9e06 100644 --- a/samples/client/petstore/java/jersey3/settings.gradle +++ b/samples/client/petstore/java/jersey3/settings.gradle @@ -1 +1 @@ -rootProject.name = "petstore-jersey3" \ No newline at end of file +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java index 98a098710b1a..4007f3e3a924 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -80,100 +80,32 @@ import org.openapitools.client.auth.Authentication; import org.openapitools.client.auth.HttpBasicAuth; import org.openapitools.client.auth.HttpBearerAuth; -import org.openapitools.client.auth.HttpSignatureAuth; import org.openapitools.client.auth.ApiKeyAuth; import org.openapitools.client.auth.OAuth; /** *

ApiClient class.

*/ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class ApiClient extends JavaTimeFormatter { protected static final Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); protected Map defaultHeaderMap = new HashMap<>(); protected Map defaultCookieMap = new HashMap<>(); - protected String basePath = "http://petstore.swagger.io:80/v2"; + protected String basePath = "http://petstore.swagger.io/v2"; protected String userAgent; protected static final Logger log = Logger.getLogger(ApiClient.class.getName()); protected List servers = new ArrayList<>(Arrays.asList( new ServerConfiguration( - "http://{server}.swagger.io:{port}/v2", - "petstore server", - Stream.>of( - new SimpleEntry<>("server", new ServerVariable( - "No description provided", - "petstore", - new LinkedHashSet<>(Arrays.asList( - "petstore", - "qa-petstore", - "dev-petstore" - )) - )), - new SimpleEntry<>("port", new ServerVariable( - "No description provided", - "80", - new LinkedHashSet<>(Arrays.asList( - "80", - "8080" - )) - )) - ).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (a, b) -> a, LinkedHashMap::new)) - ), - new ServerConfiguration( - "https://localhost:8080/{version}", - "The local server", - Stream.>of( - new SimpleEntry<>("version", new ServerVariable( - "No description provided", - "v2", - new LinkedHashSet<>(Arrays.asList( - "v1", - "v2" - )) - )) - ).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (a, b) -> a, LinkedHashMap::new)) - ), - new ServerConfiguration( - "https://127.0.0.1/no_variable", - "The local server without variables", + "http://petstore.swagger.io/v2", + "No description provided", new LinkedHashMap<>() ) )); protected Integer serverIndex = 0; protected Map serverVariables = null; - protected Map> operationServers; - - { - Map> operationServers = new HashMap<>(); - operationServers.put("PetApi.addPet", new ArrayList<>(Arrays.asList( - new ServerConfiguration( - "http://petstore.swagger.io/v2", - "No description provided", - new LinkedHashMap<>() - ), - new ServerConfiguration( - "http://path-server-test.petstore.local/v2", - "No description provided", - new LinkedHashMap<>() - ) - ))); - operationServers.put("PetApi.updatePet", new ArrayList<>(Arrays.asList( - new ServerConfiguration( - "http://petstore.swagger.io/v2", - "No description provided", - new LinkedHashMap<>() - ), - new ServerConfiguration( - "http://path-server-test.petstore.local/v2", - "No description provided", - new LinkedHashMap<>() - ) - ))); - this.operationServers = operationServers; - } - + protected Map> operationServers = new HashMap<>(); protected Map operationServerIndex = new HashMap<>(); protected Map> operationServerVariables = new HashMap<>(); protected boolean debugging = false; @@ -230,36 +162,6 @@ public ApiClient(Map authMap) { } else { authentications.put("api_key", new ApiKeyAuth("header", "api_key")); } - if (authMap != null) { - auth = authMap.get("api_key_query"); - } - if (auth instanceof ApiKeyAuth) { - authentications.put("api_key_query", auth); - } else { - authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query")); - } - if (authMap != null) { - auth = authMap.get("http_basic_test"); - } - if (auth instanceof HttpBasicAuth) { - authentications.put("http_basic_test", auth); - } else { - authentications.put("http_basic_test", new HttpBasicAuth()); - } - if (authMap != null) { - auth = authMap.get("bearer_test"); - } - if (auth instanceof HttpBearerAuth) { - authentications.put("bearer_test", auth); - } else { - authentications.put("bearer_test", new HttpBearerAuth("bearer")); - } - if (authMap != null) { - auth = authMap.get("http_signature_test"); - } - if (auth instanceof HttpSignatureAuth) { - authentications.put("http_signature_test", auth); - } // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); @@ -1251,7 +1153,7 @@ public ApiResponse invokeAPI( queryParams, allHeaderParams, cookieParams, - serializeToString(body, formParams, contentType, isBodyNullable), + null, method, target.getUri()); } @@ -1352,6 +1254,15 @@ public ApiResponse invokeAPI( } } + /** + * Deserialize the response body into an error entity based on HTTP status code. + * Looks up the error type from the errorTypes map using the response status code, + * or falls back to the "default" error type if no match is found. + * + * @param errorTypes Map of status code strings to GenericType for deserialization + * @param response The HTTP response + * @return The deserialized error entity, or null if not found or deserialization fails + */ private Object deserializeErrorEntity(Map errorTypes, Response response) { if (errorTypes == null) { return null; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiException.java index 6ac40b5d75c3..26926496675e 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiException.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -19,7 +19,7 @@ /** * API Exception */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class ApiException extends Exception { private static final long serialVersionUID = 1L; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiResponse.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiResponse.java index 5f3daf26600c..38f1eafec1be 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiResponse.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiResponse.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/Configuration.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/Configuration.java index 074ea717ed45..f26d4c1b8846 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/Configuration.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/Configuration.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -17,7 +17,7 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.function.Supplier; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class Configuration { public static final String VERSION = "1.0.0"; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JSON.java index d08e35ad2406..bdf8a6976fd7 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JSON.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -27,7 +27,7 @@ import jakarta.ws.rs.core.GenericType; import jakarta.ws.rs.ext.ContextResolver; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class JSON implements ContextResolver { private ObjectMapper mapper; @@ -35,7 +35,7 @@ public JSON() { mapper = JsonMapper.builder() .serializationInclusion(JsonInclude.Include.NON_NULL) .configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false) - .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true) + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) .configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true) .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) .enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JavaTimeFormatter.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JavaTimeFormatter.java index 5375be2a037c..91f956accf9f 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JavaTimeFormatter.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JavaTimeFormatter.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -20,7 +20,7 @@ * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class JavaTimeFormatter { private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/Pair.java index 97a87096fe20..9fe424d226e4 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/Pair.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/Pair.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -13,7 +13,7 @@ package org.openapitools.client; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class Pair { private final String name; private final String value; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339DateFormat.java index bfff3e4ea117..d16943642078 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339DateFormat.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -21,7 +21,7 @@ import java.util.TimeZone; import com.fasterxml.jackson.databind.util.StdDateFormat; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class RFC3339DateFormat extends DateFormat { private static final long serialVersionUID = 1L; private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java index 5f72d6da8e8e..0e655ad3ed49 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -28,7 +28,7 @@ import com.fasterxml.jackson.datatype.jsr310.JavaTimeFeature; import com.fasterxml.jackson.datatype.jsr310.deser.InstantDeserializer; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class RFC3339InstantDeserializer extends InstantDeserializer { private static final long serialVersionUID = 1L; private final static boolean DEFAULT_NORMALIZE_ZONE_ID = JavaTimeFeature.NORMALIZE_DESERIALIZED_ZONE_ID.enabledByDefault(); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java index 040afc32fa43..5a0fcd91c5c3 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -19,7 +19,7 @@ import com.fasterxml.jackson.databind.module.SimpleModule; import com.fasterxml.jackson.databind.Module.SetupContext; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class RFC3339JavaTimeModule extends SimpleModule { private static final long serialVersionUID = 1L; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ServerConfiguration.java index f2cfbff656d7..de7996ce2180 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -18,7 +18,7 @@ /** * Representing a Server configuration. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class ServerConfiguration { public String URL; public String description; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ServerVariable.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ServerVariable.java index 6bf7f946d8d0..2cd34261d444 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ServerVariable.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ServerVariable.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -18,7 +18,7 @@ /** * Representing a Server Variable for server URL template substitution. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class ServerVariable { public String description; public String defaultValue; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/StringUtil.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/StringUtil.java index dc3dd02c79a4..5c3fef9b4ec1 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/StringUtil.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/StringUtil.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -16,7 +16,7 @@ import java.util.Collection; import java.util.Iterator; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/PetApi.java index 359d5abc9f1c..3ac16c3c556f 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/PetApi.java @@ -12,16 +12,13 @@ import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; - import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class PetApi { private ApiClient apiClient; @@ -55,44 +52,48 @@ public void setApiClient(ApiClient apiClient) { * Add a new pet to the store * * @param pet Pet object that needs to be added to the store (required) + * @return Pet * @throws ApiException if fails to make API call * @http.response.details +
Response Details
Status Code Description Response Headers
200 successful operation -
405 Invalid input -
*/ - public void addPet(@jakarta.annotation.Nonnull Pet pet) throws ApiException { - addPetWithHttpInfo(pet); + public Pet addPet(@jakarta.annotation.Nonnull Pet pet) throws ApiException { + return addPetWithHttpInfo(pet).getData(); } /** * Add a new pet to the store * * @param pet Pet object that needs to be added to the store (required) - * @return ApiResponse<Void> + * @return ApiResponse<Pet> * @throws ApiException if fails to make API call * @http.response.details +
Response Details
Status Code Description Response Headers
200 successful operation -
405 Invalid input -
*/ - public ApiResponse addPetWithHttpInfo(@jakarta.annotation.Nonnull Pet pet) throws ApiException { + public ApiResponse addPetWithHttpInfo(@jakarta.annotation.Nonnull Pet pet) throws ApiException { // Check required parameters if (pet == null) { throw new ApiException(400, "Missing the required parameter 'pet' when calling addPet"); } - String localVarAccept = apiClient.selectHeaderAccept(); + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType("application/json", "application/xml"); - String[] localVarAuthNames = new String[] {"petstore_auth", "http_signature_test"}; + String[] localVarAuthNames = new String[] {"petstore_auth"}; final Map localVarErrorTypes = new HashMap(); + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("PetApi.addPet", "/pet", "POST", new ArrayList<>(), pet, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, null, false, localVarErrorTypes); + localVarAuthNames, localVarReturnType, false, localVarErrorTypes); } /** * Deletes a pet @@ -194,7 +195,7 @@ public ApiResponse> findPetsByStatusWithHttpInfo(@jakarta.annotation.N String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"petstore_auth", "http_signature_test"}; + String[] localVarAuthNames = new String[] {"petstore_auth"}; final Map localVarErrorTypes = new HashMap(); GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI("PetApi.findPetsByStatus", "/pet/findByStatus", "GET", localVarQueryParams, null, @@ -250,7 +251,7 @@ public ApiResponse> findPetsByTagsWithHttpInfo(@jakarta.annotation.Non String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"petstore_auth", "http_signature_test"}; + String[] localVarAuthNames = new String[] {"petstore_auth"}; final Map localVarErrorTypes = new HashMap(); GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI("PetApi.findPetsByTags", "/pet/findByTags", "GET", localVarQueryParams, null, @@ -314,48 +315,56 @@ public ApiResponse getPetByIdWithHttpInfo(@jakarta.annotation.Nonnull Long * Update an existing pet * * @param pet Pet object that needs to be added to the store (required) + * @return Pet * @throws ApiException if fails to make API call * @http.response.details +
Response Details
Status Code Description Response Headers
200 successful operation -
400 Invalid ID supplied -
404 Pet not found -
405 Validation exception -
+ * API documentation for the updatePet operation + * @see Update an existing pet Documentation */ - public void updatePet(@jakarta.annotation.Nonnull Pet pet) throws ApiException { - updatePetWithHttpInfo(pet); + public Pet updatePet(@jakarta.annotation.Nonnull Pet pet) throws ApiException { + return updatePetWithHttpInfo(pet).getData(); } /** * Update an existing pet * * @param pet Pet object that needs to be added to the store (required) - * @return ApiResponse<Void> + * @return ApiResponse<Pet> * @throws ApiException if fails to make API call * @http.response.details +
Response Details
Status Code Description Response Headers
200 successful operation -
400 Invalid ID supplied -
404 Pet not found -
405 Validation exception -
+ * API documentation for the updatePet operation + * @see Update an existing pet Documentation */ - public ApiResponse updatePetWithHttpInfo(@jakarta.annotation.Nonnull Pet pet) throws ApiException { + public ApiResponse updatePetWithHttpInfo(@jakarta.annotation.Nonnull Pet pet) throws ApiException { // Check required parameters if (pet == null) { throw new ApiException(400, "Missing the required parameter 'pet' when calling updatePet"); } - String localVarAccept = apiClient.selectHeaderAccept(); + String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType("application/json", "application/xml"); - String[] localVarAuthNames = new String[] {"petstore_auth", "http_signature_test"}; + String[] localVarAuthNames = new String[] {"petstore_auth"}; final Map localVarErrorTypes = new HashMap(); + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("PetApi.updatePet", "/pet", "PUT", new ArrayList<>(), pet, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, null, false, localVarErrorTypes); + localVarAuthNames, localVarReturnType, false, localVarErrorTypes); } /** * Updates a pet in the store with form data @@ -479,67 +488,4 @@ public ApiResponse uploadFileWithHttpInfo(@jakarta.annotation. new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false, localVarErrorTypes); } - /** - * uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return ModelApiResponse - * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Response Details
Status Code Description Response Headers
200 successful operation -
- */ - public ModelApiResponse uploadFileWithRequiredFile(@jakarta.annotation.Nonnull Long petId, @jakarta.annotation.Nonnull File requiredFile, @jakarta.annotation.Nullable String additionalMetadata) throws ApiException { - return uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata).getData(); - } - - /** - * uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return ApiResponse<ModelApiResponse> - * @throws ApiException if fails to make API call - * @http.response.details - - - - -
Response Details
Status Code Description Response Headers
200 successful operation -
- */ - public ApiResponse uploadFileWithRequiredFileWithHttpInfo(@jakarta.annotation.Nonnull Long petId, @jakarta.annotation.Nonnull File requiredFile, @jakarta.annotation.Nullable String additionalMetadata) throws ApiException { - // Check required parameters - if (petId == null) { - throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile"); - } - if (requiredFile == null) { - throw new ApiException(400, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile"); - } - - // Path parameters - String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile" - .replaceAll("\\{petId}", apiClient.escapeString(petId.toString())); - - // Form parameters - Map localVarFormParams = new LinkedHashMap<>(); - if (additionalMetadata != null) { - localVarFormParams.put("additionalMetadata", additionalMetadata); - } - localVarFormParams.put("requiredFile", requiredFile); - - String localVarAccept = apiClient.selectHeaderAccept("application/json"); - String localVarContentType = apiClient.selectHeaderContentType("multipart/form-data"); - String[] localVarAuthNames = new String[] {"petstore_auth"}; - final Map localVarErrorTypes = new HashMap(); - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI("PetApi.uploadFileWithRequiredFile", localVarPath, "POST", new ArrayList<>(), null, - new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false, localVarErrorTypes); - } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java index 92cab279cb04..fb816b6f4a51 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java @@ -10,16 +10,13 @@ import org.openapitools.client.model.Order; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; - import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class StoreApi { private ApiClient apiClient; @@ -87,8 +84,8 @@ public ApiResponse deleteOrderWithHttpInfo(@jakarta.annotation.Nonnull Str } // Path parameters - String localVarPath = "/store/order/{order_id}" - .replaceAll("\\{order_id}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{orderId}" + .replaceAll("\\{orderId}", apiClient.escapeString(orderId.toString())); String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); @@ -176,8 +173,8 @@ public ApiResponse getOrderByIdWithHttpInfo(@jakarta.annotation.Nonnull L } // Path parameters - String localVarPath = "/store/order/{order_id}" - .replaceAll("\\{order_id}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{orderId}" + .replaceAll("\\{orderId}", apiClient.escapeString(orderId.toString())); String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java index 07c92af731cf..1f640bb84465 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java @@ -11,16 +11,13 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.User; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; - import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class UserApi { private ApiClient apiClient; @@ -87,10 +84,11 @@ public ApiResponse createUserWithHttpInfo(@jakarta.annotation.Nonnull User String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.createUser", "/user", "POST", new ArrayList<>(), user, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false, localVarErrorTypes); + localVarAuthNames, null, false, localVarErrorTypes); } /** * Creates list of users with given input array @@ -104,7 +102,7 @@ public ApiResponse createUserWithHttpInfo(@jakarta.annotation.Nonnull User 0 successful operation - */ - public void createUsersWithArrayInput(@jakarta.annotation.Nonnull List<@Valid User> user) throws ApiException { + public void createUsersWithArrayInput(@jakarta.annotation.Nonnull List user) throws ApiException { createUsersWithArrayInputWithHttpInfo(user); } @@ -121,7 +119,7 @@ public void createUsersWithArrayInput(@jakarta.annotation.Nonnull List<@Valid Us 0 successful operation - */ - public ApiResponse createUsersWithArrayInputWithHttpInfo(@jakarta.annotation.Nonnull List<@Valid User> user) throws ApiException { + public ApiResponse createUsersWithArrayInputWithHttpInfo(@jakarta.annotation.Nonnull List user) throws ApiException { // Check required parameters if (user == null) { throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput"); @@ -129,10 +127,11 @@ public ApiResponse createUsersWithArrayInputWithHttpInfo(@jakarta.annotati String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.createUsersWithArrayInput", "/user/createWithArray", "POST", new ArrayList<>(), user, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false, localVarErrorTypes); + localVarAuthNames, null, false, localVarErrorTypes); } /** * Creates list of users with given input array @@ -146,7 +145,7 @@ public ApiResponse createUsersWithArrayInputWithHttpInfo(@jakarta.annotati 0 successful operation - */ - public void createUsersWithListInput(@jakarta.annotation.Nonnull List<@Valid User> user) throws ApiException { + public void createUsersWithListInput(@jakarta.annotation.Nonnull List user) throws ApiException { createUsersWithListInputWithHttpInfo(user); } @@ -163,7 +162,7 @@ public void createUsersWithListInput(@jakarta.annotation.Nonnull List<@Valid Use 0 successful operation - */ - public ApiResponse createUsersWithListInputWithHttpInfo(@jakarta.annotation.Nonnull List<@Valid User> user) throws ApiException { + public ApiResponse createUsersWithListInputWithHttpInfo(@jakarta.annotation.Nonnull List user) throws ApiException { // Check required parameters if (user == null) { throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput"); @@ -171,10 +170,11 @@ public ApiResponse createUsersWithListInputWithHttpInfo(@jakarta.annotatio String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.createUsersWithListInput", "/user/createWithList", "POST", new ArrayList<>(), user, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false, localVarErrorTypes); + localVarAuthNames, null, false, localVarErrorTypes); } /** * Delete user @@ -219,10 +219,11 @@ public ApiResponse deleteUserWithHttpInfo(@jakarta.annotation.Nonnull Stri String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.deleteUser", localVarPath, "DELETE", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false, localVarErrorTypes); + localVarAuthNames, null, false, localVarErrorTypes); } /** * Get user by user name @@ -287,7 +288,7 @@ public ApiResponse getUserByNameWithHttpInfo(@jakarta.annotation.Nonnull S - +
Response Details
Status Code Description Response Headers
200 successful operation * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
200 successful operation * Set-Cookie - Cookie authentication key for use with the `api_key` apiKey authentication.
* X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
400 Invalid username/password supplied -
*/ @@ -306,7 +307,7 @@ public String loginUser(@jakarta.annotation.Nonnull String username, @jakarta.an - +
Response Details
Status Code Description Response Headers
200 successful operation * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
200 successful operation * Set-Cookie - Cookie authentication key for use with the `api_key` apiKey authentication.
* X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
400 Invalid username/password supplied -
*/ @@ -363,10 +364,11 @@ public void logoutUser() throws ApiException { public ApiResponse logoutUserWithHttpInfo() throws ApiException { String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); + String[] localVarAuthNames = new String[] {"api_key"}; final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.logoutUser", "/user/logout", "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false, localVarErrorTypes); + localVarAuthNames, null, false, localVarErrorTypes); } /** * Updated user @@ -416,9 +418,10 @@ public ApiResponse updateUserWithHttpInfo(@jakarta.annotation.Nonnull Stri String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + String[] localVarAuthNames = new String[] {"api_key"}; final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.updateUser", localVarPath, "PUT", new ArrayList<>(), user, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false, localVarErrorTypes); + localVarAuthNames, null, false, localVarErrorTypes); } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java index 7b72097c5a1e..7e635a97084d 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/Authentication.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/Authentication.java index 1c01f1d57fdb..725cf9846e46 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/Authentication.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/Authentication.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public interface Authentication { /** * Apply authentication settings to header and query params. diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index 53cc18f1dcd8..4c7b6219d05d 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -23,7 +23,7 @@ import java.util.Map; import java.util.List; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class HttpBasicAuth implements Authentication { private String username; private String password; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java index d1247f8d27b6..9e0ee2cfe275 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class HttpBearerAuth implements Authentication { private final String scheme; private String bearerToken; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/OAuth.java index cb7caf2b89f3..fbbeab4d1b22 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/OAuth.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/OAuth.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -31,7 +31,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class OAuth implements Authentication { private static final Logger log = Logger.getLogger(OAuth.class.getName()); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/OAuthFlow.java index dab6bf989ea7..d2c72bc9a822 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/OAuthFlow.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java index 8165ca55bbde..1b0e5f5ca756 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -24,7 +24,7 @@ /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Category.java index 421d03b37a66..27a90a1f0b52 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Category.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,27 +23,25 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; /** - * Category + * A category for a pet */ @JsonPropertyOrder({ Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class Category { public static final String JSON_PROPERTY_ID = "id"; @jakarta.annotation.Nullable private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @jakarta.annotation.Nonnull - private String name = "default-name"; + @jakarta.annotation.Nullable + private String name; public Category() { } @@ -60,7 +56,6 @@ public Category id(@jakarta.annotation.Nullable Long id) { * @return id */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -76,7 +71,7 @@ public void setId(@jakarta.annotation.Nullable Long id) { } - public Category name(@jakarta.annotation.Nonnull String name) { + public Category name(@jakarta.annotation.Nullable String name) { this.name = name; return this; } @@ -85,20 +80,18 @@ public Category name(@jakarta.annotation.Nonnull String name) { * Get name * @return name */ - @jakarta.annotation.Nonnull - @NotNull - - @JsonProperty(value = JSON_PROPERTY_NAME, required = true) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getName() { return name; } - @JsonProperty(value = JSON_PROPERTY_NAME, required = true) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(@jakarta.annotation.Nonnull String name) { + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@jakarta.annotation.Nullable String name) { this.name = name; } @@ -108,12 +101,20 @@ public void setName(@jakarta.annotation.Nonnull String name) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Category category = (Category) o; + return Objects.equals(this.id, category.id) && + Objects.equals(this.name, category.name); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(id, name); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java index dc90edbd32a3..ac30fd9e6666 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,13 +23,11 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; /** - * ModelApiResponse + * Describes the result of uploading an image resource */ @JsonPropertyOrder({ ModelApiResponse.JSON_PROPERTY_CODE, @@ -39,7 +35,7 @@ ModelApiResponse.JSON_PROPERTY_MESSAGE }) @JsonTypeName("ApiResponse") -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; @jakarta.annotation.Nullable @@ -66,7 +62,6 @@ public ModelApiResponse code(@jakarta.annotation.Nullable Integer code) { * @return code */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_CODE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -92,7 +87,6 @@ public ModelApiResponse type(@jakarta.annotation.Nullable String type) { * @return type */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -118,7 +112,6 @@ public ModelApiResponse message(@jakarta.annotation.Nullable String message) { * @return message */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -139,12 +132,21 @@ public void setMessage(@jakarta.annotation.Nullable String message) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelApiResponse _apiResponse = (ModelApiResponse) o; + return Objects.equals(this.code, _apiResponse.code) && + Objects.equals(this.type, _apiResponse.type) && + Objects.equals(this.message, _apiResponse.message); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(code, type, message); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java index 1a8521382d8b..eca37b22ae3f 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -26,13 +24,11 @@ import java.time.OffsetDateTime; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; /** - * Order + * An order for a pets from the pet store */ @JsonPropertyOrder({ Order.JSON_PROPERTY_ID, @@ -42,7 +38,7 @@ Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class Order { public static final String JSON_PROPERTY_ID = "id"; @jakarta.annotation.Nullable @@ -118,7 +114,6 @@ public Order id(@jakarta.annotation.Nullable Long id) { * @return id */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -144,7 +139,6 @@ public Order petId(@jakarta.annotation.Nullable Long petId) { * @return petId */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PET_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -170,7 +164,6 @@ public Order quantity(@jakarta.annotation.Nullable Integer quantity) { * @return quantity */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_QUANTITY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -196,8 +189,6 @@ public Order shipDate(@jakarta.annotation.Nullable OffsetDateTime shipDate) { * @return shipDate */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_SHIP_DATE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -223,7 +214,6 @@ public Order status(@jakarta.annotation.Nullable StatusEnum status) { * @return status */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -249,7 +239,6 @@ public Order complete(@jakarta.annotation.Nullable Boolean complete) { * @return complete */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_COMPLETE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -270,12 +259,24 @@ public void setComplete(@jakarta.annotation.Nullable Boolean complete) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Order order = (Order) o; + return Objects.equals(this.id, order.id) && + Objects.equals(this.petId, order.petId) && + Objects.equals(this.quantity, order.quantity) && + Objects.equals(this.shipDate, order.shipDate) && + Objects.equals(this.status, order.status) && + Objects.equals(this.complete, order.complete); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(id, petId, quantity, shipDate, status, complete); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java index 57bc29549b05..bf671ce33ab0 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -29,13 +27,11 @@ import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; /** - * Pet + * A pet for sale in the pet store */ @JsonPropertyOrder({ Pet.JSON_PROPERTY_ID, @@ -45,7 +41,7 @@ Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class Pet { public static final String JSON_PROPERTY_ID = "id"; @jakarta.annotation.Nullable @@ -65,7 +61,7 @@ public class Pet { public static final String JSON_PROPERTY_TAGS = "tags"; @jakarta.annotation.Nullable - private List<@Valid Tag> tags = new ArrayList<>(); + private List tags = new ArrayList<>(); /** * pet status in the store @@ -105,6 +101,7 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; + @Deprecated @jakarta.annotation.Nullable private StatusEnum status; @@ -121,7 +118,6 @@ public Pet id(@jakarta.annotation.Nullable Long id) { * @return id */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -147,8 +143,6 @@ public Pet category(@jakarta.annotation.Nullable Category category) { * @return category */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_CATEGORY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -174,8 +168,6 @@ public Pet name(@jakarta.annotation.Nonnull String name) { * @return name */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -209,8 +201,6 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_PHOTO_URLS, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -226,7 +216,7 @@ public void setPhotoUrls(@jakarta.annotation.Nonnull List photoUrls) { } - public Pet tags(@jakarta.annotation.Nullable List<@Valid Tag> tags) { + public Pet tags(@jakarta.annotation.Nullable List tags) { this.tags = tags; return this; } @@ -244,23 +234,22 @@ public Pet addTagsItem(Tag tagsItem) { * @return tags */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_TAGS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List<@Valid Tag> getTags() { + public List getTags() { return tags; } @JsonProperty(value = JSON_PROPERTY_TAGS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTags(@jakarta.annotation.Nullable List<@Valid Tag> tags) { + public void setTags(@jakarta.annotation.Nullable List tags) { this.tags = tags; } + @Deprecated public Pet status(@jakarta.annotation.Nullable StatusEnum status) { this.status = status; return this; @@ -269,9 +258,10 @@ public Pet status(@jakarta.annotation.Nullable StatusEnum status) { /** * pet status in the store * @return status + * @deprecated */ + @Deprecated @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -280,6 +270,7 @@ public StatusEnum getStatus() { } + @Deprecated @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(@jakarta.annotation.Nullable StatusEnum status) { @@ -292,12 +283,24 @@ public void setStatus(@jakarta.annotation.Nullable StatusEnum status) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(this.id, pet.id) && + Objects.equals(this.category, pet.category) && + Objects.equals(this.name, pet.name) && + Objects.equals(this.photoUrls, pet.photoUrls) && + Objects.equals(this.tags, pet.tags) && + Objects.equals(this.status, pet.status); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(id, category, name, photoUrls, tags, status); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java index a81f7ff44082..175e3db90bef 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,19 +23,17 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; /** - * Tag + * A tag for a pet */ @JsonPropertyOrder({ Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class Tag { public static final String JSON_PROPERTY_ID = "id"; @jakarta.annotation.Nullable @@ -60,7 +56,6 @@ public Tag id(@jakarta.annotation.Nullable Long id) { * @return id */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -86,7 +81,6 @@ public Tag name(@jakarta.annotation.Nullable String name) { * @return name */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -107,12 +101,20 @@ public void setName(@jakarta.annotation.Nullable String name) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tag tag = (Tag) o; + return Objects.equals(this.id, tag.id) && + Objects.equals(this.name, tag.name); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(id, name); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java index 4702efc203d1..94b1603e6ec0 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -24,18 +22,12 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; -import org.openapitools.jackson.nullable.JsonNullable; -import com.fasterxml.jackson.annotation.JsonIgnore; -import org.openapitools.jackson.nullable.JsonNullable; -import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; /** - * User + * A User who is purchasing from the pet store */ @JsonPropertyOrder({ User.JSON_PROPERTY_ID, @@ -45,13 +37,9 @@ User.JSON_PROPERTY_EMAIL, User.JSON_PROPERTY_PASSWORD, User.JSON_PROPERTY_PHONE, - User.JSON_PROPERTY_USER_STATUS, - User.JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS, - User.JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE, - User.JSON_PROPERTY_ANY_TYPE_PROP, - User.JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE + User.JSON_PROPERTY_USER_STATUS }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") public class User { public static final String JSON_PROPERTY_ID = "id"; @jakarta.annotation.Nullable @@ -85,19 +73,6 @@ public class User { @jakarta.annotation.Nullable private Integer userStatus; - public static final String JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS = "objectWithNoDeclaredProps"; - @jakarta.annotation.Nullable - private Object objectWithNoDeclaredProps; - - public static final String JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE = "objectWithNoDeclaredPropsNullable"; - private JsonNullable objectWithNoDeclaredPropsNullable = JsonNullable.undefined(); - - public static final String JSON_PROPERTY_ANY_TYPE_PROP = "anyTypeProp"; - private JsonNullable anyTypeProp = JsonNullable.of(null); - - public static final String JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE = "anyTypePropNullable"; - private JsonNullable anyTypePropNullable = JsonNullable.of(null); - public User() { } @@ -111,7 +86,6 @@ public User id(@jakarta.annotation.Nullable Long id) { * @return id */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -137,7 +111,6 @@ public User username(@jakarta.annotation.Nullable String username) { * @return username */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_USERNAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -163,7 +136,6 @@ public User firstName(@jakarta.annotation.Nullable String firstName) { * @return firstName */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_FIRST_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -189,7 +161,6 @@ public User lastName(@jakarta.annotation.Nullable String lastName) { * @return lastName */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_LAST_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -215,7 +186,6 @@ public User email(@jakarta.annotation.Nullable String email) { * @return email */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_EMAIL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -241,7 +211,6 @@ public User password(@jakarta.annotation.Nullable String password) { * @return password */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -267,7 +236,6 @@ public User phone(@jakarta.annotation.Nullable String phone) { * @return phone */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PHONE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -293,7 +261,6 @@ public User userStatus(@jakarta.annotation.Nullable Integer userStatus) { * @return userStatus */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_USER_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -309,156 +276,31 @@ public void setUserStatus(@jakarta.annotation.Nullable Integer userStatus) { } - public User objectWithNoDeclaredProps(@jakarta.annotation.Nullable Object objectWithNoDeclaredProps) { - this.objectWithNoDeclaredProps = objectWithNoDeclaredProps; - return this; - } - - /** - * test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. - * @return objectWithNoDeclaredProps - */ - @jakarta.annotation.Nullable - - @JsonProperty(value = JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Object getObjectWithNoDeclaredProps() { - return objectWithNoDeclaredProps; - } - - - @JsonProperty(value = JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setObjectWithNoDeclaredProps(@jakarta.annotation.Nullable Object objectWithNoDeclaredProps) { - this.objectWithNoDeclaredProps = objectWithNoDeclaredProps; - } - - - public User objectWithNoDeclaredPropsNullable(@jakarta.annotation.Nullable Object objectWithNoDeclaredPropsNullable) { - this.objectWithNoDeclaredPropsNullable = JsonNullable.of(objectWithNoDeclaredPropsNullable); - return this; - } - - /** - * test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. - * @return objectWithNoDeclaredPropsNullable - */ - @jakarta.annotation.Nullable - - @JsonIgnore - - public Object getObjectWithNoDeclaredPropsNullable() { - return objectWithNoDeclaredPropsNullable.orElse(null); - } - - @JsonProperty(value = JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public JsonNullable getObjectWithNoDeclaredPropsNullable_JsonNullable() { - return objectWithNoDeclaredPropsNullable; - } - - @JsonProperty(JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE) - public void setObjectWithNoDeclaredPropsNullable_JsonNullable(JsonNullable objectWithNoDeclaredPropsNullable) { - this.objectWithNoDeclaredPropsNullable = objectWithNoDeclaredPropsNullable; - } - - public void setObjectWithNoDeclaredPropsNullable(@jakarta.annotation.Nullable Object objectWithNoDeclaredPropsNullable) { - this.objectWithNoDeclaredPropsNullable = JsonNullable.of(objectWithNoDeclaredPropsNullable); - } - - - public User anyTypeProp(@jakarta.annotation.Nullable Object anyTypeProp) { - this.anyTypeProp = JsonNullable.of(anyTypeProp); - return this; - } - - /** - * test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 - * @return anyTypeProp - */ - @jakarta.annotation.Nullable - - @JsonIgnore - - public Object getAnyTypeProp() { - return anyTypeProp.orElse(null); - } - - @JsonProperty(value = JSON_PROPERTY_ANY_TYPE_PROP, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public JsonNullable getAnyTypeProp_JsonNullable() { - return anyTypeProp; - } - - @JsonProperty(JSON_PROPERTY_ANY_TYPE_PROP) - public void setAnyTypeProp_JsonNullable(JsonNullable anyTypeProp) { - this.anyTypeProp = anyTypeProp; - } - - public void setAnyTypeProp(@jakarta.annotation.Nullable Object anyTypeProp) { - this.anyTypeProp = JsonNullable.of(anyTypeProp); - } - - - public User anyTypePropNullable(@jakarta.annotation.Nullable Object anyTypePropNullable) { - this.anyTypePropNullable = JsonNullable.of(anyTypePropNullable); - return this; - } - - /** - * test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. - * @return anyTypePropNullable - */ - @jakarta.annotation.Nullable - - @JsonIgnore - - public Object getAnyTypePropNullable() { - return anyTypePropNullable.orElse(null); - } - - @JsonProperty(value = JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public JsonNullable getAnyTypePropNullable_JsonNullable() { - return anyTypePropNullable; - } - - @JsonProperty(JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE) - public void setAnyTypePropNullable_JsonNullable(JsonNullable anyTypePropNullable) { - this.anyTypePropNullable = anyTypePropNullable; - } - - public void setAnyTypePropNullable(@jakarta.annotation.Nullable Object anyTypePropNullable) { - this.anyTypePropNullable = JsonNullable.of(anyTypePropNullable); - } - - /** * Return true if this User object is equal to o. */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(this.id, user.id) && + Objects.equals(this.username, user.username) && + Objects.equals(this.firstName, user.firstName) && + Objects.equals(this.lastName, user.lastName) && + Objects.equals(this.email, user.email) && + Objects.equals(this.password, user.password) && + Objects.equals(this.phone, user.phone) && + Objects.equals(this.userStatus, user.userStatus); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } @Override @@ -473,10 +315,6 @@ public String toString() { sb.append(" password: ").append(toIndentedString(password)).append("\n"); sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); - sb.append(" objectWithNoDeclaredProps: ").append(toIndentedString(objectWithNoDeclaredProps)).append("\n"); - sb.append(" objectWithNoDeclaredPropsNullable: ").append(toIndentedString(objectWithNoDeclaredPropsNullable)).append("\n"); - sb.append(" anyTypeProp: ").append(toIndentedString(anyTypeProp)).append("\n"); - sb.append(" anyTypePropNullable: ").append(toIndentedString(anyTypePropNullable)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey3/src/test/java/org/openapitools/client/ErrorEntityIntegrationTest.java b/samples/client/petstore/java/jersey3/src/test/java/org/openapitools/client/ErrorEntityIntegrationTest.java new file mode 100644 index 000000000000..c3664007e4c7 --- /dev/null +++ b/samples/client/petstore/java/jersey3/src/test/java/org/openapitools/client/ErrorEntityIntegrationTest.java @@ -0,0 +1,150 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.client; + +import org.junit.jupiter.api.Test; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.*; + +/** + * Integration test for errorEntity feature. + * + * This test verifies that the ApiException class with errorEntity + * works correctly without requiring a live server. + */ +public class ErrorEntityIntegrationTest { + + /** + * Test errorEntity is correctly populated in ApiException + */ + @Test + public void testErrorEntityIsCorrectlyPopulated() { + // Simulate error response from server + Map errorResponse = new HashMap<>(); + errorResponse.put("code", 400); + errorResponse.put("message", "Bad Request"); + errorResponse.put("details", List.of("Field 'name' is required")); + + // Create ApiException as if it came from a 400 response + Map> headers = new HashMap<>(); + headers.put("Content-Type", List.of("application/json")); + headers.put("X-Request-Id", List.of("abc-123")); + + String responseBody = "{\"code\":400,\"message\":\"Bad Request\",\"details\":[\"Field 'name' is required\"]}"; + + ApiException exception = new ApiException( + 400, + "Bad Request", + headers, + responseBody, + errorResponse + ); + + // Verify basic properties + assertEquals(400, exception.getCode()); + assertEquals("Bad Request", exception.getMessage()); + + // Verify headers are preserved + assertEquals("application/json", exception.getResponseHeaders().get("Content-Type").get(0)); + assertEquals("abc-123", exception.getResponseHeaders().get("X-Request-Id").get(0)); + + // Verify raw response body is preserved + assertEquals(responseBody, exception.getResponseBody()); + + // Verify errorEntity is correctly deserialized + assertNotNull(exception.getErrorEntity()); + assertTrue(exception.getErrorEntity() instanceof Map); + + Map errorEntity = (Map) exception.getErrorEntity(); + assertEquals(400, errorEntity.get("code")); + assertEquals("Bad Request", errorEntity.get("message")); + assertNotNull(errorEntity.get("details")); + } + + /** + * Test errorEntity is null when not provided (backward compatibility) + */ + @Test + public void testErrorEntityIsNullWhenNotProvided() { + Map> headers = new HashMap<>(); + + ApiException exception = new ApiException( + 500, + "Internal Server Error", + headers, + "Server error occurred" + // No errorEntity passed + ); + + assertEquals(500, exception.getCode()); + assertEquals("Internal Server Error", exception.getMessage()); + assertEquals("Server error occurred", exception.getResponseBody()); + assertNull(exception.getErrorEntity(), "errorEntity should be null when not provided"); + } + + /** + * Test errorEntity is null when deserialization fails + */ + @Test + public void testErrorEntityIsNullOnDeserializationFailure() { + Map> headers = new HashMap<>(); + + // Simulate case where deserialization failed and returned null + ApiException exception = new ApiException( + 500, + "Internal Server Error", + headers, + "invalid json{", + null // errorEntity is null because deserialization failed + ); + + assertEquals(500, exception.getCode()); + assertNull(exception.getErrorEntity(), "errorEntity should be null on deserialization failure"); + } + + /** + * Test that errorEntity can hold any type of object + */ + @Test + public void testErrorEntitySupportsAnyType() { + // Test with a custom error wrapper object structure + Map customError = new HashMap<>(); + Map innerError = new HashMap<>(); + innerError.put("code", "VALIDATION_ERROR"); + innerError.put("message", "Validation failed"); + innerError.put("fields", List.of("email", "password")); + customError.put("error", innerError); + + Map> headers = new HashMap<>(); + + ApiException exception = new ApiException( + 422, + "Validation Error", + headers, + "{}", + customError + ); + + assertNotNull(exception.getErrorEntity()); + assertTrue(exception.getErrorEntity() instanceof Map); + } +} \ No newline at end of file From 3dbdad63afa77ee2e981f3a5920ef006384596cd Mon Sep 17 00:00:00 2001 From: Chhida <44230565+Chhida@users.noreply.github.com> Date: Fri, 17 Apr 2026 16:16:42 +0100 Subject: [PATCH 11/17] chore: regenerate samples without generation timestamp Regenerate jersey3 and jersey3-oneOf samples with hideGenerationTimestamp=true to fix P2 non-deterministic timestamp issues in @Generated annotations. --- samples/client/petstore/java/jersey3-oneOf/README.md | 2 -- .../src/main/java/org/openapitools/client/ApiClient.java | 2 +- .../src/main/java/org/openapitools/client/ApiException.java | 2 +- .../src/main/java/org/openapitools/client/Configuration.java | 2 +- .../src/main/java/org/openapitools/client/JSON.java | 2 +- .../main/java/org/openapitools/client/JavaTimeFormatter.java | 2 +- .../src/main/java/org/openapitools/client/Pair.java | 2 +- .../main/java/org/openapitools/client/RFC3339DateFormat.java | 2 +- .../org/openapitools/client/RFC3339InstantDeserializer.java | 2 +- .../java/org/openapitools/client/RFC3339JavaTimeModule.java | 2 +- .../main/java/org/openapitools/client/ServerConfiguration.java | 2 +- .../src/main/java/org/openapitools/client/ServerVariable.java | 2 +- .../src/main/java/org/openapitools/client/StringUtil.java | 2 +- .../src/main/java/org/openapitools/client/api/DefaultApi.java | 2 +- .../src/main/java/org/openapitools/client/auth/ApiKeyAuth.java | 2 +- .../main/java/org/openapitools/client/auth/Authentication.java | 2 +- .../main/java/org/openapitools/client/auth/HttpBasicAuth.java | 2 +- .../main/java/org/openapitools/client/auth/HttpBearerAuth.java | 2 +- .../org/openapitools/client/model/AbstractOpenApiSchema.java | 2 +- .../main/java/org/openapitools/client/model/PostRequest.java | 2 +- .../src/main/java/org/openapitools/client/model/SchemaA.java | 2 +- samples/client/petstore/java/jersey3/README.md | 2 -- .../src/main/java/org/openapitools/client/ApiClient.java | 2 +- .../src/main/java/org/openapitools/client/ApiException.java | 2 +- .../src/main/java/org/openapitools/client/Configuration.java | 2 +- .../jersey3/src/main/java/org/openapitools/client/JSON.java | 2 +- .../main/java/org/openapitools/client/JavaTimeFormatter.java | 2 +- .../jersey3/src/main/java/org/openapitools/client/Pair.java | 2 +- .../main/java/org/openapitools/client/RFC3339DateFormat.java | 2 +- .../org/openapitools/client/RFC3339InstantDeserializer.java | 2 +- .../java/org/openapitools/client/RFC3339JavaTimeModule.java | 2 +- .../main/java/org/openapitools/client/ServerConfiguration.java | 2 +- .../src/main/java/org/openapitools/client/ServerVariable.java | 2 +- .../src/main/java/org/openapitools/client/StringUtil.java | 2 +- .../src/main/java/org/openapitools/client/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/client/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/client/api/UserApi.java | 2 +- .../src/main/java/org/openapitools/client/auth/ApiKeyAuth.java | 2 +- .../main/java/org/openapitools/client/auth/Authentication.java | 2 +- .../main/java/org/openapitools/client/auth/HttpBasicAuth.java | 2 +- .../main/java/org/openapitools/client/auth/HttpBearerAuth.java | 2 +- .../src/main/java/org/openapitools/client/auth/OAuth.java | 2 +- .../org/openapitools/client/model/AbstractOpenApiSchema.java | 2 +- .../src/main/java/org/openapitools/client/model/Category.java | 2 +- .../java/org/openapitools/client/model/ModelApiResponse.java | 2 +- .../src/main/java/org/openapitools/client/model/Order.java | 2 +- .../src/main/java/org/openapitools/client/model/Pet.java | 2 +- .../src/main/java/org/openapitools/client/model/Tag.java | 2 +- .../src/main/java/org/openapitools/client/model/User.java | 2 +- 49 files changed, 47 insertions(+), 51 deletions(-) diff --git a/samples/client/petstore/java/jersey3-oneOf/README.md b/samples/client/petstore/java/jersey3-oneOf/README.md index 8e1e795008c9..c7dbd9a9e43e 100644 --- a/samples/client/petstore/java/jersey3-oneOf/README.md +++ b/samples/client/petstore/java/jersey3-oneOf/README.md @@ -4,8 +4,6 @@ dummy - API version: 1.0.0 -- Build date: 2026-04-17T15:47:39.012811104+01:00[Africa/Tunis] - - Generator version: 7.22.0-SNAPSHOT No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiClient.java index c71d1385b3f0..83834edcf4b2 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiClient.java @@ -84,7 +84,7 @@ /** *

ApiClient class.

*/ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class ApiClient extends JavaTimeFormatter { protected static final Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiException.java index ae795d72a2a2..ec49f50d4456 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiException.java @@ -19,7 +19,7 @@ /** * API Exception */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class ApiException extends Exception { private static final long serialVersionUID = 1L; diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/Configuration.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/Configuration.java index f6e884d7eeb3..683fa9fc78c3 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/Configuration.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/Configuration.java @@ -17,7 +17,7 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.function.Supplier; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class Configuration { public static final String VERSION = "1.0.0"; diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/JSON.java index 2668ff720072..e35c75be0fcb 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/JSON.java @@ -27,7 +27,7 @@ import jakarta.ws.rs.core.GenericType; import jakarta.ws.rs.ext.ContextResolver; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class JSON implements ContextResolver { private ObjectMapper mapper; diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/JavaTimeFormatter.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/JavaTimeFormatter.java index 74ccf4693084..9ab7362409ad 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/JavaTimeFormatter.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/JavaTimeFormatter.java @@ -20,7 +20,7 @@ * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class JavaTimeFormatter { private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/Pair.java index 03fdb31b83d3..bcc1c5f09813 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/Pair.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/Pair.java @@ -13,7 +13,7 @@ package org.openapitools.client; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class Pair { private final String name; private final String value; diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/RFC3339DateFormat.java index 8fa69ea3a5f5..4b782bc49570 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/RFC3339DateFormat.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -21,7 +21,7 @@ import java.util.TimeZone; import com.fasterxml.jackson.databind.util.StdDateFormat; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class RFC3339DateFormat extends DateFormat { private static final long serialVersionUID = 1L; private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java index 49da33d9618c..2b8b576746c1 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java @@ -28,7 +28,7 @@ import com.fasterxml.jackson.datatype.jsr310.JavaTimeFeature; import com.fasterxml.jackson.datatype.jsr310.deser.InstantDeserializer; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class RFC3339InstantDeserializer extends InstantDeserializer { private static final long serialVersionUID = 1L; private final static boolean DEFAULT_NORMALIZE_ZONE_ID = JavaTimeFeature.NORMALIZE_DESERIALIZED_ZONE_ID.enabledByDefault(); diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java index 3bb4c4057f83..cd27a4aaf08d 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java @@ -19,7 +19,7 @@ import com.fasterxml.jackson.databind.module.SimpleModule; import com.fasterxml.jackson.databind.Module.SetupContext; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class RFC3339JavaTimeModule extends SimpleModule { private static final long serialVersionUID = 1L; diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ServerConfiguration.java index 8e88871b96c1..13ec59741bb8 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -18,7 +18,7 @@ /** * Representing a Server configuration. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class ServerConfiguration { public String URL; public String description; diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ServerVariable.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ServerVariable.java index 0f4465bd1ac1..6ce8e931b2ba 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ServerVariable.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ServerVariable.java @@ -18,7 +18,7 @@ /** * Representing a Server Variable for server URL template substitution. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class ServerVariable { public String description; public String defaultValue; diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/StringUtil.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/StringUtil.java index cf3cc8225c8e..2538096534e3 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/StringUtil.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/StringUtil.java @@ -16,7 +16,7 @@ import java.util.Collection; import java.util.Iterator; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/api/DefaultApi.java index 8d3d10ddd6c1..30e535d164ba 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/api/DefaultApi.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -16,7 +16,7 @@ import java.util.List; import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class DefaultApi { private ApiClient apiClient; diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java index 3ea2c6536d6d..7625ae6727eb 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/Authentication.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/Authentication.java index 5f5bc87ba67f..48b99023df75 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/Authentication.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/Authentication.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public interface Authentication { /** * Apply authentication settings to header and query params. diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index 985c9e556769..0699b668ab3b 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -23,7 +23,7 @@ import java.util.Map; import java.util.List; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class HttpBasicAuth implements Authentication { private String username; private String password; diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java index b520f8b3a296..6a5e89f59f73 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class HttpBearerAuth implements Authentication { private final String scheme; private String bearerToken; diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java index d1087f8c53e2..a353f29aa97c 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -24,7 +24,7 @@ /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/model/PostRequest.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/model/PostRequest.java index 6dfb452cb48d..759030964846 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/model/PostRequest.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/model/PostRequest.java @@ -54,7 +54,7 @@ import com.fasterxml.jackson.databind.ser.std.StdSerializer; import org.openapitools.client.JSON; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") @JsonDeserialize(using = PostRequest.PostRequestDeserializer.class) @JsonSerialize(using = PostRequest.PostRequestSerializer.class) public class PostRequest extends AbstractOpenApiSchema { diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/model/SchemaA.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/model/SchemaA.java index 70fd25eb27b6..016a9b1e6993 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/model/SchemaA.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/model/SchemaA.java @@ -33,7 +33,7 @@ SchemaA.JSON_PROPERTY_PROP_A }) @JsonTypeName("schemaA") -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:39.012811104+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class SchemaA { public static final String JSON_PROPERTY_PROP_A = "propA"; @jakarta.annotation.Nullable diff --git a/samples/client/petstore/java/jersey3/README.md b/samples/client/petstore/java/jersey3/README.md index cfe021b18e96..87f724206011 100644 --- a/samples/client/petstore/java/jersey3/README.md +++ b/samples/client/petstore/java/jersey3/README.md @@ -4,8 +4,6 @@ OpenAPI Petstore - API version: 1.0.0 -- Build date: 2026-04-17T15:47:19.299596738+01:00[Africa/Tunis] - - Generator version: 7.22.0-SNAPSHOT This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java index 4007f3e3a924..b2b426b31cef 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java @@ -86,7 +86,7 @@ /** *

ApiClient class.

*/ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class ApiClient extends JavaTimeFormatter { protected static final Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiException.java index 26926496675e..548b47795887 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiException.java @@ -19,7 +19,7 @@ /** * API Exception */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class ApiException extends Exception { private static final long serialVersionUID = 1L; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/Configuration.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/Configuration.java index f26d4c1b8846..cc873fcffa26 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/Configuration.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/Configuration.java @@ -17,7 +17,7 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.function.Supplier; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class Configuration { public static final String VERSION = "1.0.0"; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JSON.java index bdf8a6976fd7..e324754b1b20 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JSON.java @@ -27,7 +27,7 @@ import jakarta.ws.rs.core.GenericType; import jakarta.ws.rs.ext.ContextResolver; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class JSON implements ContextResolver { private ObjectMapper mapper; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JavaTimeFormatter.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JavaTimeFormatter.java index 91f956accf9f..a6a98a3c977c 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JavaTimeFormatter.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JavaTimeFormatter.java @@ -20,7 +20,7 @@ * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class JavaTimeFormatter { private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/Pair.java index 9fe424d226e4..b6e281625252 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/Pair.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/Pair.java @@ -13,7 +13,7 @@ package org.openapitools.client; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class Pair { private final String name; private final String value; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339DateFormat.java index d16943642078..1cfd0952cb7a 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339DateFormat.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -21,7 +21,7 @@ import java.util.TimeZone; import com.fasterxml.jackson.databind.util.StdDateFormat; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class RFC3339DateFormat extends DateFormat { private static final long serialVersionUID = 1L; private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java index 0e655ad3ed49..990f28e45c70 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java @@ -28,7 +28,7 @@ import com.fasterxml.jackson.datatype.jsr310.JavaTimeFeature; import com.fasterxml.jackson.datatype.jsr310.deser.InstantDeserializer; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class RFC3339InstantDeserializer extends InstantDeserializer { private static final long serialVersionUID = 1L; private final static boolean DEFAULT_NORMALIZE_ZONE_ID = JavaTimeFeature.NORMALIZE_DESERIALIZED_ZONE_ID.enabledByDefault(); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java index 5a0fcd91c5c3..cf17fadadcf2 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java @@ -19,7 +19,7 @@ import com.fasterxml.jackson.databind.module.SimpleModule; import com.fasterxml.jackson.databind.Module.SetupContext; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class RFC3339JavaTimeModule extends SimpleModule { private static final long serialVersionUID = 1L; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ServerConfiguration.java index de7996ce2180..0ddf8f31a832 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -18,7 +18,7 @@ /** * Representing a Server configuration. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class ServerConfiguration { public String URL; public String description; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ServerVariable.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ServerVariable.java index 2cd34261d444..2276f1e9ea37 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ServerVariable.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ServerVariable.java @@ -18,7 +18,7 @@ /** * Representing a Server Variable for server URL template substitution. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class ServerVariable { public String description; public String defaultValue; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/StringUtil.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/StringUtil.java index 5c3fef9b4ec1..97fc1858a3ef 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/StringUtil.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/StringUtil.java @@ -16,7 +16,7 @@ import java.util.Collection; import java.util.Iterator; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/PetApi.java index 3ac16c3c556f..acb20ae5fc3a 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/PetApi.java @@ -18,7 +18,7 @@ import java.util.List; import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class PetApi { private ApiClient apiClient; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java index fb816b6f4a51..7b64b0ef3f66 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java @@ -16,7 +16,7 @@ import java.util.List; import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class StoreApi { private ApiClient apiClient; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java index 1f640bb84465..c3f0d9661e6d 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java @@ -17,7 +17,7 @@ import java.util.List; import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class UserApi { private ApiClient apiClient; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java index 7e635a97084d..c9616e92f590 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/Authentication.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/Authentication.java index 725cf9846e46..49ffa7d0fd81 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/Authentication.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/Authentication.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public interface Authentication { /** * Apply authentication settings to header and query params. diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index 4c7b6219d05d..98af5ab2ab17 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -23,7 +23,7 @@ import java.util.Map; import java.util.List; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class HttpBasicAuth implements Authentication { private String username; private String password; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java index 9e0ee2cfe275..d2fc73e31228 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.List; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class HttpBearerAuth implements Authentication { private final String scheme; private String bearerToken; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/OAuth.java index fbbeab4d1b22..a7860b365f4c 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/OAuth.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/OAuth.java @@ -31,7 +31,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class OAuth implements Authentication { private static final Logger log = Logger.getLogger(OAuth.class.getName()); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java index 1b0e5f5ca756..9c4aed4ca567 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -24,7 +24,7 @@ /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public abstract class AbstractOpenApiSchema { // store the actual instance of the schema/object diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Category.java index 27a90a1f0b52..9f4945670ab6 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Category.java @@ -33,7 +33,7 @@ Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class Category { public static final String JSON_PROPERTY_ID = "id"; @jakarta.annotation.Nullable diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java index ac30fd9e6666..92734d3ee39d 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -35,7 +35,7 @@ ModelApiResponse.JSON_PROPERTY_MESSAGE }) @JsonTypeName("ApiResponse") -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; @jakarta.annotation.Nullable diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java index eca37b22ae3f..030fc0183063 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java @@ -38,7 +38,7 @@ Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class Order { public static final String JSON_PROPERTY_ID = "id"; @jakarta.annotation.Nullable diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java index bf671ce33ab0..d8e5f1169a9c 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java @@ -41,7 +41,7 @@ Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class Pet { public static final String JSON_PROPERTY_ID = "id"; @jakarta.annotation.Nullable diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java index 175e3db90bef..82eebe5cffd9 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java @@ -33,7 +33,7 @@ Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class Tag { public static final String JSON_PROPERTY_ID = "id"; @jakarta.annotation.Nullable diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java index 94b1603e6ec0..3c5ce26a745c 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java @@ -39,7 +39,7 @@ User.JSON_PROPERTY_PHONE, User.JSON_PROPERTY_USER_STATUS }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-04-17T15:47:19.299596738+01:00[Africa/Tunis]", comments = "Generator version: 7.22.0-SNAPSHOT") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class User { public static final String JSON_PROPERTY_ID = "id"; @jakarta.annotation.Nullable From f7194897540b0c1370cd9c108082edba9cb0bcfb Mon Sep 17 00:00:00 2001 From: Chhida <44230565+Chhida@users.noreply.github.com> Date: Fri, 17 Apr 2026 16:41:51 +0100 Subject: [PATCH 12/17] fix: add missing dependencies for jersey3 samples Add jakarta.validation-api and commons-lang3 dependencies to fix compilation errors in Quadrilateral, SimpleQuadrilateral, and ComplexQuadrilateral models. --- samples/client/petstore/java/jersey3-oneOf/pom.xml | 14 ++++++++++++++ samples/client/petstore/java/jersey3/pom.xml | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/samples/client/petstore/java/jersey3-oneOf/pom.xml b/samples/client/petstore/java/jersey3-oneOf/pom.xml index 94aea8af5e82..37a95f700b3e 100644 --- a/samples/client/petstore/java/jersey3-oneOf/pom.xml +++ b/samples/client/petstore/java/jersey3-oneOf/pom.xml @@ -318,6 +318,19 @@ jersey-apache-connector ${jersey-version} + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + @@ -336,6 +349,7 @@ 0.2.10 2.1.1 3.0.2 + 3.12.0 5.10.0 2.21.0 diff --git a/samples/client/petstore/java/jersey3/pom.xml b/samples/client/petstore/java/jersey3/pom.xml index ead06c423bae..5942d006370d 100644 --- a/samples/client/petstore/java/jersey3/pom.xml +++ b/samples/client/petstore/java/jersey3/pom.xml @@ -323,6 +323,19 @@ jersey-apache-connector ${jersey-version} + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + @@ -341,6 +354,7 @@ 0.2.10 2.1.1 3.0.2 + 3.12.0 5.10.0 8.3.3 2.21.0 From 5bc693d8a012c2291d30929b45ccd445bedc21b7 Mon Sep 17 00:00:00 2001 From: Chhida <44230565+Chhida@users.noreply.github.com> Date: Fri, 17 Apr 2026 18:33:52 +0100 Subject: [PATCH 13/17] feat(jersey3): add error entity deserialization support - Add errorEntity field and getErrorEntity() method to ApiException - Add deserializeErrorEntity() method to ApiClient for error deserialization - Update API methods to pass errorTypes map for automatic error handling - Add unit tests for errorEntity feature - Regenerate jersey3 and jersey3-oneOf samples - Fix sample pom.xml to include required dependencies (validation, commons-lang3, http-signature) --- .../petstore/java/jersey3-oneOf/pom.xml | 6 + .../java/jersey3/.openapi-generator/FILES | 153 ++ .../client/petstore/java/jersey3/README.md | 147 +- .../petstore/java/jersey3/api/openapi.yaml | 2080 +++++++++++++++-- .../client/petstore/java/jersey3/build.gradle | 2 + .../client/petstore/java/jersey3/build.sbt | 1 + .../petstore/java/jersey3/docs/ArrayTest.md | 2 +- .../petstore/java/jersey3/docs/Category.md | 3 +- .../petstore/java/jersey3/docs/FakeApi.md | 2 +- .../java/jersey3/docs/ModelApiResponse.md | 1 - .../petstore/java/jersey3/docs/Order.md | 1 - .../client/petstore/java/jersey3/docs/Pet.md | 1 - .../petstore/java/jersey3/docs/PetApi.md | 126 +- .../petstore/java/jersey3/docs/StoreApi.md | 14 +- .../client/petstore/java/jersey3/docs/Tag.md | 1 - .../client/petstore/java/jersey3/docs/User.md | 5 +- .../petstore/java/jersey3/docs/UserApi.md | 74 +- samples/client/petstore/java/jersey3/pom.xml | 6 + .../org/openapitools/client/ApiClient.java | 110 +- .../org/openapitools/client/ApiException.java | 2 +- .../org/openapitools/client/ApiResponse.java | 2 +- .../openapitools/client/Configuration.java | 2 +- .../java/org/openapitools/client/JSON.java | 2 +- .../client/JavaTimeFormatter.java | 2 +- .../java/org/openapitools/client/Pair.java | 2 +- .../client/RFC3339DateFormat.java | 2 +- .../client/RFC3339InstantDeserializer.java | 2 +- .../client/RFC3339JavaTimeModule.java | 2 +- .../client/ServerConfiguration.java | 2 +- .../openapitools/client/ServerVariable.java | 2 +- .../org/openapitools/client/StringUtil.java | 2 +- .../client/api/AnotherFakeApi.java | 3 - .../openapitools/client/api/DefaultApi.java | 3 - .../org/openapitools/client/api/FakeApi.java | 7 +- .../client/api/FakeClassnameTags123Api.java | 3 - .../org/openapitools/client/api/PetApi.java | 107 +- .../org/openapitools/client/api/StoreApi.java | 8 +- .../org/openapitools/client/api/UserApi.java | 22 +- .../openapitools/client/auth/ApiKeyAuth.java | 2 +- .../client/auth/Authentication.java | 2 +- .../client/auth/HttpBasicAuth.java | 2 +- .../client/auth/HttpBearerAuth.java | 2 +- .../org/openapitools/client/auth/OAuth.java | 2 +- .../openapitools/client/auth/OAuthFlow.java | 2 +- .../client/model/AbstractOpenApiSchema.java | 2 +- .../model/AdditionalPropertiesClass.java | 31 +- .../client/model/AllOfRefToDouble.java | 16 +- .../client/model/AllOfRefToFloat.java | 16 +- .../client/model/AllOfRefToLong.java | 16 +- .../org/openapitools/client/model/Animal.java | 19 +- .../org/openapitools/client/model/Apple.java | 18 +- .../openapitools/client/model/AppleReq.java | 19 +- .../model/ArrayOfArrayOfNumberOnly.java | 17 +- .../client/model/ArrayOfNumberOnly.java | 17 +- .../openapitools/client/model/ArrayTest.java | 32 +- .../org/openapitools/client/model/Banana.java | 17 +- .../openapitools/client/model/BananaReq.java | 20 +- .../openapitools/client/model/BasquePig.java | 17 +- .../client/model/Capitalization.java | 26 +- .../org/openapitools/client/model/Cat.java | 59 +- .../openapitools/client/model/Category.java | 22 +- .../openapitools/client/model/ChildCat.java | 61 +- .../openapitools/client/model/ClassModel.java | 16 +- .../org/openapitools/client/model/Client.java | 16 +- .../client/model/ComplexQuadrilateral.java | 62 +- .../openapitools/client/model/DanishPig.java | 17 +- .../client/model/DeprecatedObject.java | 16 +- .../org/openapitools/client/model/Dog.java | 59 +- .../openapitools/client/model/Drawing.java | 27 +- .../openapitools/client/model/EnumArrays.java | 18 +- .../openapitools/client/model/EnumClass.java | 4 - .../openapitools/client/model/EnumTest.java | 37 +- .../client/model/EquilateralTriangle.java | 62 +- .../client/model/FileSchemaTestClass.java | 28 +- .../org/openapitools/client/model/Foo.java | 16 +- .../client/model/FooGetDefaultResponse.java | 17 +- .../openapitools/client/model/FormatTest.java | 56 +- .../org/openapitools/client/model/Fruit.java | 4 - .../openapitools/client/model/FruitReq.java | 4 - .../openapitools/client/model/GmFruit.java | 4 - .../client/model/GrandparentAnimal.java | 17 +- .../client/model/HasOnlyReadOnly.java | 18 +- .../client/model/HealthCheckResult.java | 16 +- .../client/model/IsoscelesTriangle.java | 20 +- .../org/openapitools/client/model/Mammal.java | 77 - .../client/model/MammalAnyof.java | 57 - .../openapitools/client/model/MapTest.java | 23 +- ...ropertiesAndAdditionalPropertiesClass.java | 23 +- .../client/model/Model200Response.java | 18 +- .../client/model/ModelApiResponse.java | 4 +- .../openapitools/client/model/ModelFile.java | 16 +- .../openapitools/client/model/ModelList.java | 16 +- .../client/model/ModelReturn.java | 16 +- .../org/openapitools/client/model/Name.java | 23 +- .../client/model/NullableClass.java | 42 +- .../client/model/NullableShape.java | 73 - .../openapitools/client/model/NumberOnly.java | 17 +- .../model/ObjectWithDeprecatedFields.java | 24 +- .../org/openapitools/client/model/Order.java | 4 +- .../client/model/OuterComposite.java | 21 +- .../openapitools/client/model/OuterEnum.java | 4 - .../client/model/OuterEnumDefaultValue.java | 4 - .../client/model/OuterEnumInteger.java | 4 - .../model/OuterEnumIntegerDefaultValue.java | 4 - .../openapitools/client/model/ParentPet.java | 56 +- .../org/openapitools/client/model/Pet.java | 9 +- .../org/openapitools/client/model/Pig.java | 73 - .../client/model/Quadrilateral.java | 73 - .../client/model/QuadrilateralInterface.java | 17 +- .../client/model/ReadOnlyFirst.java | 18 +- .../client/model/ScaleneTriangle.java | 62 +- .../org/openapitools/client/model/Shape.java | 73 - .../client/model/ShapeInterface.java | 17 +- .../client/model/ShapeOrNull.java | 73 - .../client/model/SimpleQuadrilateral.java | 62 +- .../client/model/SpecialModelName.java | 18 +- .../org/openapitools/client/model/Tag.java | 4 +- ...neFreeformAdditionalPropertiesRequest.java | 17 +- .../openapitools/client/model/Triangle.java | 77 - .../client/model/TriangleInterface.java | 17 +- .../org/openapitools/client/model/User.java | 174 +- .../org/openapitools/client/model/Whale.java | 21 +- .../org/openapitools/client/model/Zebra.java | 20 +- 123 files changed, 3297 insertions(+), 1937 deletions(-) diff --git a/samples/client/petstore/java/jersey3-oneOf/pom.xml b/samples/client/petstore/java/jersey3-oneOf/pom.xml index 37a95f700b3e..16bf4f771acc 100644 --- a/samples/client/petstore/java/jersey3-oneOf/pom.xml +++ b/samples/client/petstore/java/jersey3-oneOf/pom.xml @@ -318,6 +318,11 @@ jersey-apache-connector ${jersey-version} + + org.tomitribe + tomitribe-http-signatures + ${http-signature-version} + jakarta.validation @@ -350,6 +355,7 @@ 2.1.1 3.0.2 3.12.0 + 1.8 5.10.0 2.21.0 diff --git a/samples/client/petstore/java/jersey3/.openapi-generator/FILES b/samples/client/petstore/java/jersey3/.openapi-generator/FILES index 88201794d5a7..a5e9fa6f120e 100644 --- a/samples/client/petstore/java/jersey3/.openapi-generator/FILES +++ b/samples/client/petstore/java/jersey3/.openapi-generator/FILES @@ -5,15 +5,91 @@ README.md api/openapi.yaml build.gradle build.sbt +docs/AdditionalPropertiesClass.md +docs/AllOfRefToDouble.md +docs/AllOfRefToFloat.md +docs/AllOfRefToLong.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/Apple.md +docs/AppleReq.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/Banana.md +docs/BananaReq.md +docs/BasquePig.md +docs/Capitalization.md +docs/Cat.md docs/Category.md +docs/ChildCat.md +docs/ClassModel.md +docs/Client.md +docs/ComplexQuadrilateral.md +docs/DanishPig.md +docs/DefaultApi.md +docs/DeprecatedObject.md +docs/Dog.md +docs/Drawing.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/EquilateralTriangle.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/Foo.md +docs/FooGetDefaultResponse.md +docs/FormatTest.md +docs/Fruit.md +docs/FruitReq.md +docs/GmFruit.md +docs/GrandparentAnimal.md +docs/HasOnlyReadOnly.md +docs/HealthCheckResult.md +docs/IsoscelesTriangle.md +docs/Mammal.md +docs/MammalAnyof.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md docs/ModelApiResponse.md +docs/ModelFile.md +docs/ModelList.md +docs/ModelReturn.md +docs/Name.md +docs/NullableClass.md +docs/NullableShape.md +docs/NumberOnly.md +docs/ObjectWithDeprecatedFields.md docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/OuterEnumDefaultValue.md +docs/OuterEnumInteger.md +docs/OuterEnumIntegerDefaultValue.md +docs/ParentPet.md docs/Pet.md docs/PetApi.md +docs/Pig.md +docs/Quadrilateral.md +docs/QuadrilateralInterface.md +docs/ReadOnlyFirst.md +docs/ScaleneTriangle.md +docs/Shape.md +docs/ShapeInterface.md +docs/ShapeOrNull.md +docs/SimpleQuadrilateral.md +docs/SpecialModelName.md docs/StoreApi.md docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md +docs/Triangle.md +docs/TriangleInterface.md docs/User.md docs/UserApi.md +docs/Whale.md +docs/Zebra.md git_push.sh gradle.properties gradle/wrapper/gradle-wrapper.jar @@ -36,6 +112,10 @@ src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java src/main/java/org/openapitools/client/ServerConfiguration.java src/main/java/org/openapitools/client/ServerVariable.java src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java src/main/java/org/openapitools/client/api/PetApi.java src/main/java/org/openapitools/client/api/StoreApi.java src/main/java/org/openapitools/client/api/UserApi.java @@ -43,12 +123,85 @@ src/main/java/org/openapitools/client/auth/ApiKeyAuth.java src/main/java/org/openapitools/client/auth/Authentication.java src/main/java/org/openapitools/client/auth/HttpBasicAuth.java src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java src/main/java/org/openapitools/client/auth/OAuth.java src/main/java/org/openapitools/client/auth/OAuthFlow.java src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AllOfRefToDouble.java +src/main/java/org/openapitools/client/model/AllOfRefToFloat.java +src/main/java/org/openapitools/client/model/AllOfRefToLong.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/Apple.java +src/main/java/org/openapitools/client/model/AppleReq.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/Banana.java +src/main/java/org/openapitools/client/model/BananaReq.java +src/main/java/org/openapitools/client/model/BasquePig.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ChildCat.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java +src/main/java/org/openapitools/client/model/DanishPig.java +src/main/java/org/openapitools/client/model/DeprecatedObject.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/Drawing.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/EquilateralTriangle.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/Foo.java +src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/Fruit.java +src/main/java/org/openapitools/client/model/FruitReq.java +src/main/java/org/openapitools/client/model/GmFruit.java +src/main/java/org/openapitools/client/model/GrandparentAnimal.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/HealthCheckResult.java +src/main/java/org/openapitools/client/model/IsoscelesTriangle.java +src/main/java/org/openapitools/client/model/Mammal.java +src/main/java/org/openapitools/client/model/MammalAnyof.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelFile.java +src/main/java/org/openapitools/client/model/ModelList.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NullableClass.java +src/main/java/org/openapitools/client/model/NullableShape.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java +src/main/java/org/openapitools/client/model/OuterEnumInteger.java +src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java +src/main/java/org/openapitools/client/model/ParentPet.java src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/Pig.java +src/main/java/org/openapitools/client/model/Quadrilateral.java +src/main/java/org/openapitools/client/model/QuadrilateralInterface.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/ScaleneTriangle.java +src/main/java/org/openapitools/client/model/Shape.java +src/main/java/org/openapitools/client/model/ShapeInterface.java +src/main/java/org/openapitools/client/model/ShapeOrNull.java +src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +src/main/java/org/openapitools/client/model/Triangle.java +src/main/java/org/openapitools/client/model/TriangleInterface.java src/main/java/org/openapitools/client/model/User.java +src/main/java/org/openapitools/client/model/Whale.java +src/main/java/org/openapitools/client/model/Zebra.java diff --git a/samples/client/petstore/java/jersey3/README.md b/samples/client/petstore/java/jersey3/README.md index 87f724206011..e1421b2e789b 100644 --- a/samples/client/petstore/java/jersey3/README.md +++ b/samples/client/petstore/java/jersey3/README.md @@ -6,7 +6,7 @@ OpenAPI Petstore - Generator version: 7.22.0-SNAPSHOT -This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* @@ -84,25 +84,21 @@ Please follow the [installation](#installation) instruction and execute the foll import org.openapitools.client.*; import org.openapitools.client.auth.*; import org.openapitools.client.model.*; -import org.openapitools.client.api.PetApi; +import org.openapitools.client.api.AnotherFakeApi; -public class PetApiExample { +public class AnotherFakeApiExample { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - // Configure OAuth2 access token for authorization: petstore_auth - OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); - petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - - PetApi apiInstance = new PetApi(defaultClient); - Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); + Client client = new Client(); // Client | client model try { - Pet result = apiInstance.addPet(pet); + Client result = apiInstance.call123testSpecialTags(client); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling PetApi#addPet"); + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -115,10 +111,32 @@ public class PetApiExample { ## Documentation for API Endpoints -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +*DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooGet) | **GET** /foo | +*FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint +*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +*FakeApi* | [**getArrayOfEnums**](docs/FakeApi.md#getArrayOfEnums) | **GET** /fake/array-of-enums | Array of Enums +*FakeApi* | [**postArrayOfString**](docs/FakeApi.md#postArrayOfString) | **POST** /fake/request-array-string | Array of string +*FakeApi* | [**testAdditionalPropertiesReference**](docs/FakeApi.md#testAdditionalPropertiesReference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties +*FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | +*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | +*FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testInlineFreeformAdditionalProperties**](docs/FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties +*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | +*FakeApi* | [**testStringMapReference**](docs/FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map +*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet *PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status @@ -127,9 +145,10 @@ Class | Method | HTTP request | Description *PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet *PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID *StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID *StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet *UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user *UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array @@ -143,12 +162,84 @@ Class | Method | HTTP request | Description ## Documentation for Models + - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [AllOfRefToDouble](docs/AllOfRefToDouble.md) + - [AllOfRefToFloat](docs/AllOfRefToFloat.md) + - [AllOfRefToLong](docs/AllOfRefToLong.md) + - [Animal](docs/Animal.md) + - [Apple](docs/Apple.md) + - [AppleReq](docs/AppleReq.md) + - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [ArrayTest](docs/ArrayTest.md) + - [Banana](docs/Banana.md) + - [BananaReq](docs/BananaReq.md) + - [BasquePig](docs/BasquePig.md) + - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) - [Category](docs/Category.md) + - [ChildCat](docs/ChildCat.md) + - [ClassModel](docs/ClassModel.md) + - [Client](docs/Client.md) + - [ComplexQuadrilateral](docs/ComplexQuadrilateral.md) + - [DanishPig](docs/DanishPig.md) + - [DeprecatedObject](docs/DeprecatedObject.md) + - [Dog](docs/Dog.md) + - [Drawing](docs/Drawing.md) + - [EnumArrays](docs/EnumArrays.md) + - [EnumClass](docs/EnumClass.md) + - [EnumTest](docs/EnumTest.md) + - [EquilateralTriangle](docs/EquilateralTriangle.md) + - [FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [Foo](docs/Foo.md) + - [FooGetDefaultResponse](docs/FooGetDefaultResponse.md) + - [FormatTest](docs/FormatTest.md) + - [Fruit](docs/Fruit.md) + - [FruitReq](docs/FruitReq.md) + - [GmFruit](docs/GmFruit.md) + - [GrandparentAnimal](docs/GrandparentAnimal.md) + - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [HealthCheckResult](docs/HealthCheckResult.md) + - [IsoscelesTriangle](docs/IsoscelesTriangle.md) + - [Mammal](docs/Mammal.md) + - [MammalAnyof](docs/MammalAnyof.md) + - [MapTest](docs/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](docs/Model200Response.md) - [ModelApiResponse](docs/ModelApiResponse.md) + - [ModelFile](docs/ModelFile.md) + - [ModelList](docs/ModelList.md) + - [ModelReturn](docs/ModelReturn.md) + - [Name](docs/Name.md) + - [NullableClass](docs/NullableClass.md) + - [NullableShape](docs/NullableShape.md) + - [NumberOnly](docs/NumberOnly.md) + - [ObjectWithDeprecatedFields](docs/ObjectWithDeprecatedFields.md) - [Order](docs/Order.md) + - [OuterComposite](docs/OuterComposite.md) + - [OuterEnum](docs/OuterEnum.md) + - [OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [OuterEnumInteger](docs/OuterEnumInteger.md) + - [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) + - [ParentPet](docs/ParentPet.md) - [Pet](docs/Pet.md) + - [Pig](docs/Pig.md) + - [Quadrilateral](docs/Quadrilateral.md) + - [QuadrilateralInterface](docs/QuadrilateralInterface.md) + - [ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [ScaleneTriangle](docs/ScaleneTriangle.md) + - [Shape](docs/Shape.md) + - [ShapeInterface](docs/ShapeInterface.md) + - [ShapeOrNull](docs/ShapeOrNull.md) + - [SimpleQuadrilateral](docs/SimpleQuadrilateral.md) + - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) + - [TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) + - [Triangle](docs/Triangle.md) + - [TriangleInterface](docs/TriangleInterface.md) - [User](docs/User.md) + - [Whale](docs/Whale.md) + - [Zebra](docs/Zebra.md) @@ -175,6 +266,32 @@ Authentication schemes defined for the API: - **API key parameter name**: api_key - **Location**: HTTP header + +### api_key_query + + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + + +### http_basic_test + + +- **Type**: HTTP basic authentication + + +### bearer_test + + +- **Type**: HTTP Bearer Token authentication (JWT) + + +### http_signature_test + + +- **Type**: HTTP signature authentication + ## Recommendation diff --git a/samples/client/petstore/java/jersey3/api/openapi.yaml b/samples/client/petstore/java/jersey3/api/openapi.yaml index c3c0afb36f74..724ee694f1f2 100644 --- a/samples/client/petstore/java/jersey3/api/openapi.yaml +++ b/samples/client/petstore/java/jersey3/api/openapi.yaml @@ -1,17 +1,38 @@ openapi: 3.0.0 info: - description: "This is a sample server Petstore server. For this sample, you can\ - \ use the api key `special-key` to test the authorization filters." + description: "This spec is mainly for testing Petstore server and contains fake\ + \ endpoints, models. Please do not use this for any other purpose. Special characters:\ + \ \" \\" license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html title: OpenAPI Petstore version: 1.0.0 -externalDocs: - description: Find out more about Swagger - url: http://swagger.io servers: -- url: http://petstore.swagger.io/v2 +- description: petstore server + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: "https://localhost:8080/{version}" + variables: + version: + default: v2 + enum: + - v1 + - v2 +- description: The local server without variables + url: https://127.0.0.1/no_variable tags: - description: Everything about your Pets name: pet @@ -20,6 +41,17 @@ tags: - description: Operations about user name: user paths: + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: "#/components/schemas/_foo_get_default_response" + description: response + x-accepts: + - application/json /pet: post: description: "" @@ -27,18 +59,10 @@ paths: requestBody: $ref: "#/components/requestBodies/Pet" responses: - "200": - content: - application/xml: - schema: - $ref: "#/components/schemas/Pet" - application/json: - schema: - $ref: "#/components/schemas/Pet" - description: successful operation "405": description: Invalid input security: + - http_signature_test: [] - petstore_auth: - write:pets - read:pets @@ -48,25 +72,12 @@ paths: x-content-type: application/json x-accepts: - application/json - - application/xml put: description: "" - externalDocs: - description: API documentation for the updatePet operation - url: http://petstore.swagger.io/v2/doc/updatePet operationId: updatePet requestBody: $ref: "#/components/requestBodies/Pet" responses: - "200": - content: - application/xml: - schema: - $ref: "#/components/schemas/Pet" - application/json: - schema: - $ref: "#/components/schemas/Pet" - description: successful operation "400": description: Invalid ID supplied "404": @@ -74,6 +85,7 @@ paths: "405": description: Validation exception security: + - http_signature_test: [] - petstore_auth: - write:pets - read:pets @@ -83,7 +95,9 @@ paths: x-content-type: application/json x-accepts: - application/json - - application/xml + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 /pet/findByStatus: get: description: Multiple status values can be provided with comma separated strings @@ -122,7 +136,9 @@ paths: "400": description: Invalid status value security: + - http_signature_test: [] - petstore_auth: + - write:pets - read:pets summary: Finds Pets by status tags: @@ -164,7 +180,9 @@ paths: "400": description: Invalid tag value security: + - http_signature_test: [] - petstore_auth: + - write:pets - read:pets summary: Finds Pets by tags tags: @@ -358,7 +376,7 @@ paths: x-accepts: - application/json - application/xml - /store/order/{orderId}: + /store/order/{order_id}: delete: description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -367,7 +385,7 @@ paths: - description: ID of the order that needs to be deleted explode: false in: path - name: orderId + name: order_id required: true schema: type: string @@ -390,7 +408,7 @@ paths: - description: ID of pet that needs to be fetched explode: false in: path - name: orderId + name: order_id required: true schema: format: int64 @@ -432,8 +450,6 @@ paths: responses: default: description: successful operation - security: - - api_key: [] summary: Create user tags: - user @@ -449,8 +465,6 @@ paths: responses: default: description: successful operation - security: - - api_key: [] summary: Creates list of users with given input array tags: - user @@ -466,8 +480,6 @@ paths: responses: default: description: successful operation - security: - - api_key: [] summary: Creates list of users with given input array tags: - user @@ -485,7 +497,6 @@ paths: name: username required: true schema: - pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" type: string style: form - description: The password for login in clear text @@ -507,14 +518,6 @@ paths: type: string description: successful operation headers: - Set-Cookie: - description: Cookie authentication key for use with the `api_key` apiKey - authentication. - explode: false - schema: - example: AUTH_KEY=abcde12345; Path=/; HttpOnly - type: string - style: simple X-Rate-Limit: description: calls per hour allowed by the user explode: false @@ -544,8 +547,6 @@ paths: responses: default: description: successful operation - security: - - api_key: [] summary: Logs out current logged in user session tags: - user @@ -569,8 +570,6 @@ paths: description: Invalid username supplied "404": description: User not found - security: - - api_key: [] summary: Delete user tags: - user @@ -632,208 +631,1711 @@ paths: description: Invalid user supplied "404": description: User not found - security: - - api_key: [] summary: Updated user tags: - user x-content-type: application/json x-accepts: - application/json -components: - requestBodies: - UserArray: - content: - application/json: - schema: - items: - $ref: "#/components/schemas/User" - type: array - description: List of user object - required: true - Pet: - content: - application/json: - schema: - $ref: "#/components/schemas/Pet" - application/xml: - schema: - $ref: "#/components/schemas/Pet" - description: Pet object that needs to be added to the store - required: true - schemas: - Order: - description: An order for a pets from the pet store - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + $ref: "#/components/requestBodies/Client" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/Client" + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + x-content-type: application/json + x-accepts: + - application/json + /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + explode: true + in: query + name: required_string_group + required: true + schema: type: integer - shipDate: - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false + style: form + - description: Required Boolean in group parameters + explode: false + in: header + name: required_boolean_group + required: true + schema: type: boolean - title: Pet Order - type: object - xml: - name: Order - Category: - description: A category for a pet - example: - name: name - id: 6 - properties: - id: - format: int64 - type: integer - name: - pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" - type: string - title: Pet category - type: object - xml: - name: Category - User: - description: A User who is purchasing from the pet store - example: - firstName: firstName - lastName: lastName - password: password - userStatus: 6 - phone: phone - id: 0 - email: email - username: username - properties: - id: + style: simple + - description: Required Integer in group parameters + explode: true + in: query + name: required_int64_group + required: true + schema: format: int64 type: integer - username: - type: string - firstName: - type: string - lastName: - type: string - email: - type: string - password: - type: string - phone: - type: string - userStatus: - description: User Status - format: int32 - type: integer - title: a User - type: object - xml: - name: User - Tag: - description: A tag for a pet - example: - name: name - id: 1 - properties: - id: - format: int64 + style: form + - description: String in group parameters + explode: true + in: query + name: string_group + required: false + schema: type: integer - name: - type: string - title: Pet Tag - type: object - xml: - name: Tag - Pet: - description: A pet for sale in the pet store - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available - properties: - id: + style: form + - description: Boolean in group parameters + explode: false + in: header + name: boolean_group + required: false + schema: + type: boolean + style: simple + - description: Integer in group parameters + explode: true + in: query + name: int64_group + required: false + schema: format: int64 type: integer - category: - $ref: "#/components/schemas/Category" - name: - example: doggie - type: string - photoUrls: + style: form + responses: + "400": + description: Something wrong + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + x-accepts: + - application/json + get: + description: To test enum parameters + operationId: testEnumParameters + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + required: false + schema: items: + default: $ + enum: + - '>' + - $ type: string type: array - xml: - name: photoUrl - wrapped: true - tags: + style: simple + - description: Header parameter enum test (string) + explode: false + in: header + name: enum_header_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: simple + - description: Query parameter enum test (string array) + explode: true + in: query + name: enum_query_string_array + required: false + schema: items: - $ref: "#/components/schemas/Tag" + default: $ + enum: + - '>' + - $ + type: string type: array - xml: + style: form + - description: Query parameter enum test (string) + explode: true + in: query + name: enum_query_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_integer + required: false + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_double + required: false + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + style: form + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: "#/components/schemas/testEnumParameters_request" + responses: + "400": + description: Invalid request + "404": + description: Not found + summary: To test enum parameters + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + $ref: "#/components/requestBodies/Client" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/Client" + description: successful operation + summary: To test "client" model + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + post: + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: "#/components/schemas/testEndpointParameters_request" + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + security: + - http_basic_test: [] + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + /fake/outer/number: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/OuterNumber" + description: Input number as post body + responses: + "200": + content: + '*/*': + schema: + $ref: "#/components/schemas/OuterNumber" + description: Output number + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/OuterString" + description: Input string as post body + responses: + "200": + content: + '*/*': + schema: + $ref: "#/components/schemas/OuterString" + description: Output string + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/OuterBoolean" + description: Input boolean as post body + responses: + "200": + content: + '*/*': + schema: + $ref: "#/components/schemas/OuterBoolean" + description: Output boolean + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/OuterComposite" + description: Input composite as post body + responses: + "200": + content: + '*/*': + schema: + $ref: "#/components/schemas/OuterComposite" + description: Output composite + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + /fake/jsonFormData: + get: + description: "" + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: "#/components/schemas/testJsonFormData_request" + responses: + "200": + description: successful operation + summary: test json serialization of form data + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + /fake/additionalProperties-reference: + post: + description: "" + operationId: testAdditionalPropertiesReference + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/FreeFormObject" + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/MapOfString" + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/inline-additionalProperties: + post: + description: "" + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/testInlineFreeformAdditionalProperties_request" + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams + parameters: + - explode: true + in: query + name: query + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/User" + required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /another-fake/dummy: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + $ref: "#/components/requestBodies/Client" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/Client" + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-content-type: application/json + x-accepts: + - application/json + /fake/body-with-file-schema: + put: + description: "For this test, the body for this request much reference a schema\ + \ named `File`." + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/FileSchemaTestClass" + required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/test-query-parameters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: true + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - explode: false + in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + style: form + - explode: false + in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + description: Success + tags: + - fake + x-accepts: + - application/json + /fake/{petId}/uploadImageWithRequiredFile: + post: + description: "" + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: "#/components/schemas/uploadFileWithRequiredFile_request" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ApiResponse" + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + x-content-type: multipart/form-data + x-accepts: + - application/json + /fake/health: + get: + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/HealthCheckResult" + description: The instance started successfully + summary: Health check endpoint + tags: + - fake + x-accepts: + - application/json + /fake/array-of-enums: + get: + operationId: getArrayOfEnums + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ArrayOfEnums" + description: Got named array of enums + summary: Array of Enums + tags: + - fake + x-accepts: + - application/json + /fake/request-array-string: + post: + operationId: postArrayOfString + requestBody: + content: + application/json: + schema: + items: + pattern: "[A-Z0-9]+" + type: string + type: array + responses: + "200": + description: ok + summary: Array of string + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json +components: + requestBodies: + UserArray: + content: + application/json: + examples: + simple-list: + description: Should not get into code examples + summary: Simple list example + value: + - username: foo + - username: bar + schema: + items: + $ref: "#/components/schemas/User" + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: "#/components/schemas/Client" + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: "#/components/schemas/Pet" + application/xml: + schema: + $ref: "#/components/schemas/Pet" + description: Pet object that needs to be added to the store + required: true + schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2020-02-02T20:20:20.000222Z + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + example: 2020-02-02T20:20:20.000222Z + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order + Category: + example: + name: default-name + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + objectWithNoDeclaredPropsNullable: "{}" + phone: phone + objectWithNoDeclaredProps: "{}" + id: 0 + anyTypePropNullable: "" + email: email + anyTypeProp: "" + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + objectWithNoDeclaredProps: + description: test code generation for objects Value must be a map of strings + to values. It cannot be the 'null' value. + type: object + objectWithNoDeclaredPropsNullable: + description: test code generation for nullable objects. Value must be a + map of strings to values or the 'null' value. + nullable: true + type: object + anyTypeProp: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389" + anyTypePropNullable: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. The 'nullable'\ + \ attribute does not change the allowed values." + nullable: true + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: "#/components/schemas/Category" + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: "#/components/schemas/Tag" + type: array + xml: name: tag wrapped: true status: - deprecated: true description: pet status in the store enum: - - available - - pending - - sold + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + xml: + name: Return + Name: + description: Model for testing model name same as property name + properties: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: "#/components/schemas/Animal" + - properties: + breed: + type: string + type: object + Cat: + allOf: + - $ref: "#/components/schemas/Animal" + - $ref: "#/components/schemas/Address" + - properties: + declawed: + type: boolean + type: object + Address: + additionalProperties: + type: integer + type: object + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: "#/components/schemas/Animal" + type: array + format_test: + properties: + integer: + maximum: 100 + minimum: 10 + multipleOf: 2 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + format: int64 + type: integer + number: + maximum: 543.2 + minimum: 32.1 + multipleOf: 32.5 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + decimal: + format: number + type: string + string: + pattern: "/[a-z]/i" + type: string + byte: + format: byte + type: string + binary: + format: binary + type: string + date: + example: 2020-02-02 + format: date + type: string + dateTime: + example: 2007-12-03T10:15:30+01:00 + format: date-time + type: string + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: "^\\d{10}$" + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: "/^image_\\d{1,3}$/i" + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + Enum_Test: + properties: + enum_string: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_integer_only: + enum: + - 2 + - -2 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: "#/components/schemas/OuterEnum" + outerEnumInteger: + $ref: "#/components/schemas/OuterEnumInteger" + outerEnumDefaultValue: + $ref: "#/components/schemas/OuterEnumDefaultValue" + outerEnumIntegerDefaultValue: + $ref: "#/components/schemas/OuterEnumIntegerDefaultValue" required: - - name - - photoUrls - title: a Pet + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_property: + additionalProperties: + type: string + type: object + map_of_map_property: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + anytype_1: {} + map_with_undeclared_properties_anytype_1: + type: object + map_with_undeclared_properties_anytype_2: + properties: {} + type: object + map_with_undeclared_properties_anytype_3: + additionalProperties: true + type: object + empty_map: + additionalProperties: false + description: "an object with no declared properties and no undeclared properties,\ + \ hence it's an empty map." + type: object + map_with_undeclared_properties_string: + additionalProperties: + type: string + type: object + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: "#/components/schemas/Animal" + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: "#/components/schemas/ReadOnlyFirst" + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + FreeFormObject: + additionalProperties: true + description: A schema consisting only of additional properties + type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + nullable: true + type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + type: integer + OuterEnumDefaultValue: + default: placed + enum: + - placed + - approved + - delivered + type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: "#/components/schemas/File" + files: + items: + $ref: "#/components/schemas/File" + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string type: object + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + _special_model.name_: + type: string xml: - name: Pet - ApiResponse: - description: Describes the result of uploading an image resource + name: "$special[model.name]" + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. example: - code: 0 - type: type - message: message + NullableMessage: NullableMessage properties: - code: - format: int32 + NullableMessage: + nullable: true + type: string + type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + fruit: + additionalProperties: false + oneOf: + - $ref: "#/components/schemas/apple" + - $ref: "#/components/schemas/banana" + properties: + color: + type: string + apple: + nullable: true + properties: + cultivar: + pattern: "^[a-zA-Z\\s]*$" + type: string + origin: + pattern: "/^[A-Z\\s]*$/i" + type: string + type: object + banana: + properties: + lengthCm: + type: number + type: object + mammal: + discriminator: + propertyName: className + oneOf: + - $ref: "#/components/schemas/whale" + - $ref: "#/components/schemas/zebra" + - $ref: "#/components/schemas/Pig" + mammal_anyof: + anyOf: + - $ref: "#/components/schemas/whale" + - $ref: "#/components/schemas/zebra" + - $ref: "#/components/schemas/Pig" + discriminator: + propertyName: className + whale: + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + required: + - className + type: object + zebra: + additionalProperties: true + properties: type: + enum: + - plains + - mountain + - grevys type: string - message: + className: + type: string + required: + - className + type: object + Pig: + discriminator: + propertyName: className + oneOf: + - $ref: "#/components/schemas/BasquePig" + - $ref: "#/components/schemas/DanishPig" + BasquePig: + properties: + className: + type: string + required: + - className + type: object + DanishPig: + properties: + className: + type: string + required: + - className + type: object + gmFruit: + additionalProperties: false + anyOf: + - $ref: "#/components/schemas/apple" + - $ref: "#/components/schemas/banana" + properties: + color: + type: string + fruitReq: + additionalProperties: false + nullable: true + oneOf: + - $ref: "#/components/schemas/appleReq" + - $ref: "#/components/schemas/bananaReq" + appleReq: + additionalProperties: false + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + type: object + bananaReq: + additionalProperties: false + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + type: object + Drawing: + additionalProperties: + $ref: "#/components/schemas/fruit" + properties: + mainShape: + $ref: "#/components/schemas/Shape" + shapeOrNull: + $ref: "#/components/schemas/ShapeOrNull" + nullableShape: + $ref: "#/components/schemas/NullableShape" + shapes: + items: + $ref: "#/components/schemas/Shape" + type: array + type: object + Shape: + discriminator: + propertyName: shapeType + oneOf: + - $ref: "#/components/schemas/Triangle" + - $ref: "#/components/schemas/Quadrilateral" + ShapeOrNull: + description: The value may be a shape or the 'null' value. This is introduced + in OAS schema >= 3.1. + discriminator: + propertyName: shapeType + nullable: true + oneOf: + - $ref: "#/components/schemas/Triangle" + - $ref: "#/components/schemas/Quadrilateral" + NullableShape: + description: The value may be a shape or the 'null' value. The 'nullable' attribute + was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema + >= 3.1. + discriminator: + propertyName: shapeType + nullable: true + oneOf: + - $ref: "#/components/schemas/Triangle" + - $ref: "#/components/schemas/Quadrilateral" + ShapeInterface: + properties: + shapeType: + type: string + required: + - shapeType + TriangleInterface: + properties: + triangleType: + type: string + required: + - triangleType + Triangle: + discriminator: + propertyName: triangleType + oneOf: + - $ref: "#/components/schemas/EquilateralTriangle" + - $ref: "#/components/schemas/IsoscelesTriangle" + - $ref: "#/components/schemas/ScaleneTriangle" + EquilateralTriangle: + allOf: + - $ref: "#/components/schemas/ShapeInterface" + - $ref: "#/components/schemas/TriangleInterface" + IsoscelesTriangle: + additionalProperties: false + allOf: + - $ref: "#/components/schemas/ShapeInterface" + - $ref: "#/components/schemas/TriangleInterface" + ScaleneTriangle: + allOf: + - $ref: "#/components/schemas/ShapeInterface" + - $ref: "#/components/schemas/TriangleInterface" + QuadrilateralInterface: + properties: + quadrilateralType: + type: string + required: + - quadrilateralType + Quadrilateral: + discriminator: + propertyName: quadrilateralType + oneOf: + - $ref: "#/components/schemas/SimpleQuadrilateral" + - $ref: "#/components/schemas/ComplexQuadrilateral" + SimpleQuadrilateral: + allOf: + - $ref: "#/components/schemas/ShapeInterface" + - $ref: "#/components/schemas/QuadrilateralInterface" + ComplexQuadrilateral: + allOf: + - $ref: "#/components/schemas/ShapeInterface" + - $ref: "#/components/schemas/QuadrilateralInterface" + GrandparentAnimal: + discriminator: + propertyName: pet_type + properties: + pet_type: + type: string + required: + - pet_type + type: object + ParentPet: + allOf: + - $ref: "#/components/schemas/GrandparentAnimal" + type: object + ChildCat: + allOf: + - $ref: "#/components/schemas/ParentPet" + - properties: + name: + type: string + pet_type: + default: ChildCat + enum: + - ChildCat + type: string + x-enum-as-string: true + type: object + ArrayOfEnums: + items: + $ref: "#/components/schemas/OuterEnum" + type: array + DateTimeTest: + default: 2010-01-01T10:10:10.000111+01:00 + example: 2010-01-01T10:10:10.000111+01:00 + format: date-time + type: string + DeprecatedObject: + deprecated: true + properties: + name: + type: string + type: object + ObjectWithDeprecatedFields: + properties: + uuid: type: string - title: An uploaded response + id: + deprecated: true + type: number + deprecatedRef: + $ref: "#/components/schemas/DeprecatedObject" + bars: + deprecated: true + items: + $ref: "#/components/schemas/Bar" + type: array + type: object + LongId: + description: Id as long + format: int64 + type: integer + Weight: + description: Weight as float + format: float + type: number + Height: + description: Height as double + format: double + type: number + AllOfRefToLong: + description: Object with allOf ref to long + properties: + id: + allOf: + - $ref: "#/components/schemas/LongId" + default: 10 + type: object + AllOfRefToFloat: + description: Object with allOf ref to float + properties: + weight: + allOf: + - $ref: "#/components/schemas/Weight" + default: 7.89 + type: object + AllOfRefToDouble: + description: Object with allOf ref to double + properties: + height: + allOf: + - $ref: "#/components/schemas/Height" + default: 32.1 + type: object + _foo_get_default_response: + example: + string: + bar: bar + properties: + string: + $ref: "#/components/schemas/Foo" type: object updatePetWithForm_request: properties: @@ -854,6 +2356,130 @@ components: format: binary type: string type: object + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + testEndpointParameters_request: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + default: 2010-02-01T10:20:10.11111+01:00 + description: None + example: 2020-02-02T20:20:20.22222Z + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object securitySchemes: petstore_auth: flows: @@ -867,4 +2493,18 @@ components: in: header name: api_key type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http + http_signature_test: + scheme: signature + type: http diff --git a/samples/client/petstore/java/jersey3/build.gradle b/samples/client/petstore/java/jersey3/build.gradle index 088b31f1a211..6f430b1f248d 100644 --- a/samples/client/petstore/java/jersey3/build.gradle +++ b/samples/client/petstore/java/jersey3/build.gradle @@ -107,6 +107,7 @@ ext { jersey_version = "3.0.4" junit_version = "5.8.2" scribejava_apis_version = "8.3.1" + tomitribe_http_signatures_version = "1.7" } dependencies { @@ -123,6 +124,7 @@ dependencies { implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "com.github.scribejava:scribejava-apis:$scribejava_apis_version" + implementation "org.tomitribe:tomitribe-http-signatures:$tomitribe_http_signatures_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" diff --git a/samples/client/petstore/java/jersey3/build.sbt b/samples/client/petstore/java/jersey3/build.sbt index 82ca0f5317ba..57ccccb87052 100644 --- a/samples/client/petstore/java/jersey3/build.sbt +++ b/samples/client/petstore/java/jersey3/build.sbt @@ -22,6 +22,7 @@ lazy val root = (project in file(".")). "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.21.1" % "compile", "org.openapitools" % "jackson-databind-nullable" % "0.2.10" % "compile", "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", + "org.tomitribe" % "tomitribe-http-signatures" % "1.7" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "2.1.0" % "compile", "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" ) diff --git a/samples/client/petstore/java/jersey3/docs/ArrayTest.md b/samples/client/petstore/java/jersey3/docs/ArrayTest.md index ae2672809aa9..36077c9df300 100644 --- a/samples/client/petstore/java/jersey3/docs/ArrayTest.md +++ b/samples/client/petstore/java/jersey3/docs/ArrayTest.md @@ -9,7 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**arrayOfString** | **List<String>** | | [optional] | |**arrayArrayOfInteger** | **List<List<Long>>** | | [optional] | -|**arrayArrayOfModel** | **List<List<@Valid ReadOnlyFirst>>** | | [optional] | +|**arrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] | diff --git a/samples/client/petstore/java/jersey3/docs/Category.md b/samples/client/petstore/java/jersey3/docs/Category.md index a7fc939d252e..ab6d1ec334dc 100644 --- a/samples/client/petstore/java/jersey3/docs/Category.md +++ b/samples/client/petstore/java/jersey3/docs/Category.md @@ -2,14 +2,13 @@ # Category -A category for a pet ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**id** | **Long** | | [optional] | -|**name** | **String** | | [optional] | +|**name** | **String** | | | diff --git a/samples/client/petstore/java/jersey3/docs/FakeApi.md b/samples/client/petstore/java/jersey3/docs/FakeApi.md index 7d45cd6a51b8..3816afc1ce7c 100644 --- a/samples/client/petstore/java/jersey3/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey3/docs/FakeApi.md @@ -427,7 +427,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); FakeApi apiInstance = new FakeApi(defaultClient); - List<@Pattern(regexp = "[A-Z0-9]+")String> requestBody = Arrays.asList(); // List<@Pattern(regexp = "[A-Z0-9]+")String> | + List requestBody = Arrays.asList(); // List | try { apiInstance.postArrayOfString(requestBody); } catch (ApiException e) { diff --git a/samples/client/petstore/java/jersey3/docs/ModelApiResponse.md b/samples/client/petstore/java/jersey3/docs/ModelApiResponse.md index cd7e3c400be6..e374c2dd2dec 100644 --- a/samples/client/petstore/java/jersey3/docs/ModelApiResponse.md +++ b/samples/client/petstore/java/jersey3/docs/ModelApiResponse.md @@ -2,7 +2,6 @@ # ModelApiResponse -Describes the result of uploading an image resource ## Properties diff --git a/samples/client/petstore/java/jersey3/docs/Order.md b/samples/client/petstore/java/jersey3/docs/Order.md index 0c33059b8b6a..27af32855c5c 100644 --- a/samples/client/petstore/java/jersey3/docs/Order.md +++ b/samples/client/petstore/java/jersey3/docs/Order.md @@ -2,7 +2,6 @@ # Order -An order for a pets from the pet store ## Properties diff --git a/samples/client/petstore/java/jersey3/docs/Pet.md b/samples/client/petstore/java/jersey3/docs/Pet.md index 8bb363301232..08dfd8623602 100644 --- a/samples/client/petstore/java/jersey3/docs/Pet.md +++ b/samples/client/petstore/java/jersey3/docs/Pet.md @@ -2,7 +2,6 @@ # Pet -A pet for sale in the pet store ## Properties diff --git a/samples/client/petstore/java/jersey3/docs/PetApi.md b/samples/client/petstore/java/jersey3/docs/PetApi.md index cde9058fb771..b6096623c133 100644 --- a/samples/client/petstore/java/jersey3/docs/PetApi.md +++ b/samples/client/petstore/java/jersey3/docs/PetApi.md @@ -1,6 +1,6 @@ # PetApi -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | |------------- | ------------- | -------------| @@ -12,12 +12,13 @@ All URIs are relative to *http://petstore.swagger.io/v2* | [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet | | [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data | | [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image | +| [**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) | ## addPet -> Pet addPet(pet) +> addPet(pet) Add a new pet to the store @@ -37,17 +38,17 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + PetApi apiInstance = new PetApi(defaultClient); Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - Pet result = apiInstance.addPet(pet); - System.out.println(result); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); System.err.println("Status code: " + e.getCode()); @@ -68,21 +69,20 @@ public class Example { ### Return type -[**Pet**](Pet.md) +null (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) ### HTTP request headers - **Content-Type**: application/json, application/xml -- **Accept**: application/xml, application/json +- **Accept**: Not defined ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | successful operation | - | | **405** | Invalid input | - | @@ -108,7 +108,7 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); @@ -179,12 +179,13 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + PetApi apiInstance = new PetApi(defaultClient); List status = Arrays.asList("available"); // List | Status values that need to be considered for filter try { @@ -214,7 +215,7 @@ public class Example { ### Authorization -[petstore_auth](../README.md#petstore_auth) +[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) ### HTTP request headers @@ -250,12 +251,13 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + PetApi apiInstance = new PetApi(defaultClient); List tags = Arrays.asList(); // List | Tags to filter by try { @@ -285,7 +287,7 @@ public class Example { ### Authorization -[petstore_auth](../README.md#petstore_auth) +[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) ### HTTP request headers @@ -321,7 +323,7 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure API key authorization: api_key ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); @@ -375,7 +377,7 @@ public class Example { ## updatePet -> Pet updatePet(pet) +> updatePet(pet) Update an existing pet @@ -395,17 +397,17 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + PetApi apiInstance = new PetApi(defaultClient); Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - Pet result = apiInstance.updatePet(pet); - System.out.println(result); + apiInstance.updatePet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); System.err.println("Status code: " + e.getCode()); @@ -426,21 +428,20 @@ public class Example { ### Return type -[**Pet**](Pet.md) +null (empty response body) ### Authorization -[petstore_auth](../README.md#petstore_auth) +[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) ### HTTP request headers - **Content-Type**: application/json, application/xml -- **Accept**: application/xml, application/json +- **Accept**: Not defined ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | successful operation | - | | **400** | Invalid ID supplied | - | | **404** | Pet not found | - | | **405** | Validation exception | - | @@ -468,7 +469,7 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); @@ -542,7 +543,7 @@ import org.openapitools.client.api.PetApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure OAuth2 access token for authorization: petstore_auth OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); @@ -593,3 +594,78 @@ public class Example { |-------------|-------------|------------------| | **200** | successful operation | - | + +## uploadFileWithRequiredFile + +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + + + +### Example + +```java +import java.io.File; +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.model.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to update + File requiredFile = new File("/path/to/file"); // File | file to upload + String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server + try { + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet to update | | +| **requiredFile** | **File**| file to upload | | +| **additionalMetadata** | **String**| Additional data to pass to server | [optional] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java/jersey3/docs/StoreApi.md b/samples/client/petstore/java/jersey3/docs/StoreApi.md index a88a09d61ec2..6eab555ee029 100644 --- a/samples/client/petstore/java/jersey3/docs/StoreApi.md +++ b/samples/client/petstore/java/jersey3/docs/StoreApi.md @@ -1,12 +1,12 @@ # StoreApi -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | |------------- | ------------- | -------------| -| [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID | +| [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID | | [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status | -| [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID | +| [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID | | [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet | @@ -32,7 +32,7 @@ import org.openapitools.client.api.StoreApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); StoreApi apiInstance = new StoreApi(defaultClient); String orderId = "orderId_example"; // String | ID of the order that needs to be deleted @@ -98,7 +98,7 @@ import org.openapitools.client.api.StoreApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); // Configure API key authorization: api_key ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); @@ -165,7 +165,7 @@ import org.openapitools.client.api.StoreApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); StoreApi apiInstance = new StoreApi(defaultClient); Long orderId = 56L; // Long | ID of pet that needs to be fetched @@ -232,7 +232,7 @@ import org.openapitools.client.api.StoreApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); StoreApi apiInstance = new StoreApi(defaultClient); Order order = new Order(); // Order | order placed for purchasing the pet diff --git a/samples/client/petstore/java/jersey3/docs/Tag.md b/samples/client/petstore/java/jersey3/docs/Tag.md index abfde4afb501..5088b2dd1c31 100644 --- a/samples/client/petstore/java/jersey3/docs/Tag.md +++ b/samples/client/petstore/java/jersey3/docs/Tag.md @@ -2,7 +2,6 @@ # Tag -A tag for a pet ## Properties diff --git a/samples/client/petstore/java/jersey3/docs/User.md b/samples/client/petstore/java/jersey3/docs/User.md index 426845227bd3..9e97dc35485f 100644 --- a/samples/client/petstore/java/jersey3/docs/User.md +++ b/samples/client/petstore/java/jersey3/docs/User.md @@ -2,7 +2,6 @@ # User -A User who is purchasing from the pet store ## Properties @@ -16,6 +15,10 @@ A User who is purchasing from the pet store |**password** | **String** | | [optional] | |**phone** | **String** | | [optional] | |**userStatus** | **Integer** | User Status | [optional] | +|**objectWithNoDeclaredProps** | **Object** | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | [optional] | +|**objectWithNoDeclaredPropsNullable** | **Object** | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional] | +|**anyTypeProp** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 | [optional] | +|**anyTypePropNullable** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. | [optional] | diff --git a/samples/client/petstore/java/jersey3/docs/UserApi.md b/samples/client/petstore/java/jersey3/docs/UserApi.md index bb5adf10b8d7..6df604acce37 100644 --- a/samples/client/petstore/java/jersey3/docs/UserApi.md +++ b/samples/client/petstore/java/jersey3/docs/UserApi.md @@ -1,6 +1,6 @@ # UserApi -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://petstore.swagger.io:80/v2* | Method | HTTP request | Description | |------------- | ------------- | -------------| @@ -30,20 +30,13 @@ This can only be done by the logged in user. import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; import org.openapitools.client.model.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); - - // Configure API key authorization: api_key - ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); - api_key.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //api_key.setApiKeyPrefix("Token"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); User user = new User(); // User | Created user object @@ -73,7 +66,7 @@ null (empty response body) ### Authorization -[api_key](../README.md#api_key) +No authorization required ### HTTP request headers @@ -101,20 +94,13 @@ Creates list of users with given input array import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; import org.openapitools.client.model.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); - - // Configure API key authorization: api_key - ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); - api_key.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //api_key.setApiKeyPrefix("Token"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); List user = Arrays.asList(); // List | List of user object @@ -144,7 +130,7 @@ null (empty response body) ### Authorization -[api_key](../README.md#api_key) +No authorization required ### HTTP request headers @@ -172,20 +158,13 @@ Creates list of users with given input array import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; import org.openapitools.client.model.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); - - // Configure API key authorization: api_key - ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); - api_key.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //api_key.setApiKeyPrefix("Token"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); List user = Arrays.asList(); // List | List of user object @@ -215,7 +194,7 @@ null (empty response body) ### Authorization -[api_key](../README.md#api_key) +No authorization required ### HTTP request headers @@ -243,20 +222,13 @@ This can only be done by the logged in user. import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; import org.openapitools.client.model.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); - - // Configure API key authorization: api_key - ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); - api_key.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //api_key.setApiKeyPrefix("Token"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); String username = "username_example"; // String | The name that needs to be deleted @@ -286,7 +258,7 @@ null (empty response body) ### Authorization -[api_key](../README.md#api_key) +No authorization required ### HTTP request headers @@ -321,7 +293,7 @@ import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. @@ -388,7 +360,7 @@ import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); String username = "username_example"; // String | The user name for login @@ -431,7 +403,7 @@ No authorization required ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | successful operation | * Set-Cookie - Cookie authentication key for use with the `api_key` apiKey authentication.
* X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| | **400** | Invalid username/password supplied | - | @@ -450,20 +422,13 @@ Logs out current logged in user session import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; import org.openapitools.client.model.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); - - // Configure API key authorization: api_key - ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); - api_key.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //api_key.setApiKeyPrefix("Token"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); try { @@ -489,7 +454,7 @@ null (empty response body) ### Authorization -[api_key](../README.md#api_key) +No authorization required ### HTTP request headers @@ -517,20 +482,13 @@ This can only be done by the logged in user. import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; -import org.openapitools.client.auth.*; import org.openapitools.client.model.*; import org.openapitools.client.api.UserApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io/v2"); - - // Configure API key authorization: api_key - ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); - api_key.setApiKey("YOUR API KEY"); - // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) - //api_key.setApiKeyPrefix("Token"); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); String username = "username_example"; // String | name that need to be deleted @@ -562,7 +520,7 @@ null (empty response body) ### Authorization -[api_key](../README.md#api_key) +No authorization required ### HTTP request headers diff --git a/samples/client/petstore/java/jersey3/pom.xml b/samples/client/petstore/java/jersey3/pom.xml index 5942d006370d..ba2fa0a780ab 100644 --- a/samples/client/petstore/java/jersey3/pom.xml +++ b/samples/client/petstore/java/jersey3/pom.xml @@ -307,6 +307,11 @@ jackson-datatype-jsr310 ${jackson-version}
+ + org.tomitribe + tomitribe-http-signatures + ${http-signature-version} + com.github.scribejava scribejava-apis @@ -356,6 +361,7 @@ 3.0.2 3.12.0 5.10.0 + 1.8 8.3.3 2.21.0 diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java index b2b426b31cef..8d0deb2d886b 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -80,6 +80,7 @@ import org.openapitools.client.auth.Authentication; import org.openapitools.client.auth.HttpBasicAuth; import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.HttpSignatureAuth; import org.openapitools.client.auth.ApiKeyAuth; import org.openapitools.client.auth.OAuth; @@ -92,20 +93,87 @@ public class ApiClient extends JavaTimeFormatter { protected Map defaultHeaderMap = new HashMap<>(); protected Map defaultCookieMap = new HashMap<>(); - protected String basePath = "http://petstore.swagger.io/v2"; + protected String basePath = "http://petstore.swagger.io:80/v2"; protected String userAgent; protected static final Logger log = Logger.getLogger(ApiClient.class.getName()); protected List servers = new ArrayList<>(Arrays.asList( new ServerConfiguration( - "http://petstore.swagger.io/v2", - "No description provided", + "http://{server}.swagger.io:{port}/v2", + "petstore server", + Stream.>of( + new SimpleEntry<>("server", new ServerVariable( + "No description provided", + "petstore", + new LinkedHashSet<>(Arrays.asList( + "petstore", + "qa-petstore", + "dev-petstore" + )) + )), + new SimpleEntry<>("port", new ServerVariable( + "No description provided", + "80", + new LinkedHashSet<>(Arrays.asList( + "80", + "8080" + )) + )) + ).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (a, b) -> a, LinkedHashMap::new)) + ), + new ServerConfiguration( + "https://localhost:8080/{version}", + "The local server", + Stream.>of( + new SimpleEntry<>("version", new ServerVariable( + "No description provided", + "v2", + new LinkedHashSet<>(Arrays.asList( + "v1", + "v2" + )) + )) + ).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (a, b) -> a, LinkedHashMap::new)) + ), + new ServerConfiguration( + "https://127.0.0.1/no_variable", + "The local server without variables", new LinkedHashMap<>() ) )); protected Integer serverIndex = 0; protected Map serverVariables = null; - protected Map> operationServers = new HashMap<>(); + protected Map> operationServers; + + { + Map> operationServers = new HashMap<>(); + operationServers.put("PetApi.addPet", new ArrayList<>(Arrays.asList( + new ServerConfiguration( + "http://petstore.swagger.io/v2", + "No description provided", + new LinkedHashMap<>() + ), + new ServerConfiguration( + "http://path-server-test.petstore.local/v2", + "No description provided", + new LinkedHashMap<>() + ) + ))); + operationServers.put("PetApi.updatePet", new ArrayList<>(Arrays.asList( + new ServerConfiguration( + "http://petstore.swagger.io/v2", + "No description provided", + new LinkedHashMap<>() + ), + new ServerConfiguration( + "http://path-server-test.petstore.local/v2", + "No description provided", + new LinkedHashMap<>() + ) + ))); + this.operationServers = operationServers; + } + protected Map operationServerIndex = new HashMap<>(); protected Map> operationServerVariables = new HashMap<>(); protected boolean debugging = false; @@ -162,6 +230,36 @@ public ApiClient(Map authMap) { } else { authentications.put("api_key", new ApiKeyAuth("header", "api_key")); } + if (authMap != null) { + auth = authMap.get("api_key_query"); + } + if (auth instanceof ApiKeyAuth) { + authentications.put("api_key_query", auth); + } else { + authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query")); + } + if (authMap != null) { + auth = authMap.get("http_basic_test"); + } + if (auth instanceof HttpBasicAuth) { + authentications.put("http_basic_test", auth); + } else { + authentications.put("http_basic_test", new HttpBasicAuth()); + } + if (authMap != null) { + auth = authMap.get("bearer_test"); + } + if (auth instanceof HttpBearerAuth) { + authentications.put("bearer_test", auth); + } else { + authentications.put("bearer_test", new HttpBearerAuth("bearer")); + } + if (authMap != null) { + auth = authMap.get("http_signature_test"); + } + if (auth instanceof HttpSignatureAuth) { + authentications.put("http_signature_test", auth); + } // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); @@ -1153,7 +1251,7 @@ public ApiResponse invokeAPI( queryParams, allHeaderParams, cookieParams, - null, + serializeToString(body, formParams, contentType, isBodyNullable), method, target.getUri()); } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiException.java index 548b47795887..6ac40b5d75c3 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiException.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiResponse.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiResponse.java index 38f1eafec1be..5f3daf26600c 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiResponse.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiResponse.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/Configuration.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/Configuration.java index cc873fcffa26..074ea717ed45 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/Configuration.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/Configuration.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JSON.java index e324754b1b20..7136d534da1a 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JSON.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JavaTimeFormatter.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JavaTimeFormatter.java index a6a98a3c977c..5375be2a037c 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JavaTimeFormatter.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JavaTimeFormatter.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/Pair.java index b6e281625252..97a87096fe20 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/Pair.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/Pair.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339DateFormat.java index 1cfd0952cb7a..bfff3e4ea117 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339DateFormat.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java index 990f28e45c70..5f72d6da8e8e 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java index cf17fadadcf2..040afc32fa43 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ServerConfiguration.java index 0ddf8f31a832..f2cfbff656d7 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ServerVariable.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ServerVariable.java index 2276f1e9ea37..6bf7f946d8d0 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ServerVariable.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ServerVariable.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/StringUtil.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/StringUtil.java index 97fc1858a3ef..dc3dd02c79a4 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/StringUtil.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/StringUtil.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 775c9633615e..81e46331fd74 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -10,9 +10,6 @@ import org.openapitools.client.model.Client; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; - import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/DefaultApi.java index 4802ac3bad94..f9c2a8baa065 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/DefaultApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -10,9 +10,6 @@ import org.openapitools.client.model.FooGetDefaultResponse; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; - import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeApi.java index 18d3c98b6bc6..69ee6b19482b 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeApi.java @@ -20,9 +20,6 @@ import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.client.model.User; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; - import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; @@ -301,7 +298,7 @@ public ApiResponse> getArrayOfEnumsWithHttpInfo() throws ApiExce 200 ok - */ - public void postArrayOfString(@jakarta.annotation.Nullable List<@Pattern(regexp = "[A-Z0-9]+")String> requestBody) throws ApiException { + public void postArrayOfString(@jakarta.annotation.Nullable List requestBody) throws ApiException { postArrayOfStringWithHttpInfo(requestBody); } @@ -318,7 +315,7 @@ public void postArrayOfString(@jakarta.annotation.Nullable List<@Pattern(regexp 200 ok - */ - public ApiResponse postArrayOfStringWithHttpInfo(@jakarta.annotation.Nullable List<@Pattern(regexp = "[A-Z0-9]+")String> requestBody) throws ApiException { + public ApiResponse postArrayOfStringWithHttpInfo(@jakarta.annotation.Nullable List requestBody) throws ApiException { String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); final Map localVarErrorTypes = new HashMap(); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 2f08544c2415..2c42ca2ced74 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -10,9 +10,6 @@ import org.openapitools.client.model.Client; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; - import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/PetApi.java index acb20ae5fc3a..c5603bb9ef84 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/PetApi.java @@ -52,48 +52,44 @@ public void setApiClient(ApiClient apiClient) { * Add a new pet to the store * * @param pet Pet object that needs to be added to the store (required) - * @return Pet * @throws ApiException if fails to make API call * @http.response.details -
Response Details
Status Code Description Response Headers
200 successful operation -
405 Invalid input -
*/ - public Pet addPet(@jakarta.annotation.Nonnull Pet pet) throws ApiException { - return addPetWithHttpInfo(pet).getData(); + public void addPet(@jakarta.annotation.Nonnull Pet pet) throws ApiException { + addPetWithHttpInfo(pet); } /** * Add a new pet to the store * * @param pet Pet object that needs to be added to the store (required) - * @return ApiResponse<Pet> + * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details -
Response Details
Status Code Description Response Headers
200 successful operation -
405 Invalid input -
*/ - public ApiResponse addPetWithHttpInfo(@jakarta.annotation.Nonnull Pet pet) throws ApiException { + public ApiResponse addPetWithHttpInfo(@jakarta.annotation.Nonnull Pet pet) throws ApiException { // Check required parameters if (pet == null) { throw new ApiException(400, "Missing the required parameter 'pet' when calling addPet"); } - String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json", "application/xml"); - String[] localVarAuthNames = new String[] {"petstore_auth"}; + String[] localVarAuthNames = new String[] {"petstore_auth", "http_signature_test"}; final Map localVarErrorTypes = new HashMap(); - GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("PetApi.addPet", "/pet", "POST", new ArrayList<>(), pet, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false, localVarErrorTypes); + localVarAuthNames, null, false, localVarErrorTypes); } /** * Deletes a pet @@ -195,7 +191,7 @@ public ApiResponse> findPetsByStatusWithHttpInfo(@jakarta.annotation.N String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"petstore_auth"}; + String[] localVarAuthNames = new String[] {"petstore_auth", "http_signature_test"}; final Map localVarErrorTypes = new HashMap(); GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI("PetApi.findPetsByStatus", "/pet/findByStatus", "GET", localVarQueryParams, null, @@ -251,7 +247,7 @@ public ApiResponse> findPetsByTagsWithHttpInfo(@jakarta.annotation.Non String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"petstore_auth"}; + String[] localVarAuthNames = new String[] {"petstore_auth", "http_signature_test"}; final Map localVarErrorTypes = new HashMap(); GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI("PetApi.findPetsByTags", "/pet/findByTags", "GET", localVarQueryParams, null, @@ -315,56 +311,48 @@ public ApiResponse getPetByIdWithHttpInfo(@jakarta.annotation.Nonnull Long * Update an existing pet * * @param pet Pet object that needs to be added to the store (required) - * @return Pet * @throws ApiException if fails to make API call * @http.response.details -
Response Details
Status Code Description Response Headers
200 successful operation -
400 Invalid ID supplied -
404 Pet not found -
405 Validation exception -
- * API documentation for the updatePet operation - * @see Update an existing pet Documentation */ - public Pet updatePet(@jakarta.annotation.Nonnull Pet pet) throws ApiException { - return updatePetWithHttpInfo(pet).getData(); + public void updatePet(@jakarta.annotation.Nonnull Pet pet) throws ApiException { + updatePetWithHttpInfo(pet); } /** * Update an existing pet * * @param pet Pet object that needs to be added to the store (required) - * @return ApiResponse<Pet> + * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details -
Response Details
Status Code Description Response Headers
200 successful operation -
400 Invalid ID supplied -
404 Pet not found -
405 Validation exception -
- * API documentation for the updatePet operation - * @see Update an existing pet Documentation */ - public ApiResponse updatePetWithHttpInfo(@jakarta.annotation.Nonnull Pet pet) throws ApiException { + public ApiResponse updatePetWithHttpInfo(@jakarta.annotation.Nonnull Pet pet) throws ApiException { // Check required parameters if (pet == null) { throw new ApiException(400, "Missing the required parameter 'pet' when calling updatePet"); } - String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); + String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json", "application/xml"); - String[] localVarAuthNames = new String[] {"petstore_auth"}; + String[] localVarAuthNames = new String[] {"petstore_auth", "http_signature_test"}; final Map localVarErrorTypes = new HashMap(); - GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("PetApi.updatePet", "/pet", "PUT", new ArrayList<>(), pet, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false, localVarErrorTypes); + localVarAuthNames, null, false, localVarErrorTypes); } /** * Updates a pet in the store with form data @@ -488,4 +476,67 @@ public ApiResponse uploadFileWithHttpInfo(@jakarta.annotation. new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false, localVarErrorTypes); } + /** + * uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return ModelApiResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 successful operation -
+ */ + public ModelApiResponse uploadFileWithRequiredFile(@jakarta.annotation.Nonnull Long petId, @jakarta.annotation.Nonnull File requiredFile, @jakarta.annotation.Nullable String additionalMetadata) throws ApiException { + return uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata).getData(); + } + + /** + * uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return ApiResponse<ModelApiResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Response Details
Status Code Description Response Headers
200 successful operation -
+ */ + public ApiResponse uploadFileWithRequiredFileWithHttpInfo(@jakarta.annotation.Nonnull Long petId, @jakarta.annotation.Nonnull File requiredFile, @jakarta.annotation.Nullable String additionalMetadata) throws ApiException { + // Check required parameters + if (petId == null) { + throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile"); + } + if (requiredFile == null) { + throw new ApiException(400, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile"); + } + + // Path parameters + String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile" + .replaceAll("\\{petId}", apiClient.escapeString(petId.toString())); + + // Form parameters + Map localVarFormParams = new LinkedHashMap<>(); + if (additionalMetadata != null) { + localVarFormParams.put("additionalMetadata", additionalMetadata); + } + localVarFormParams.put("requiredFile", requiredFile); + + String localVarAccept = apiClient.selectHeaderAccept("application/json"); + String localVarContentType = apiClient.selectHeaderContentType("multipart/form-data"); + String[] localVarAuthNames = new String[] {"petstore_auth"}; + final Map localVarErrorTypes = new HashMap(); + GenericType localVarReturnType = new GenericType() {}; + return apiClient.invokeAPI("PetApi.uploadFileWithRequiredFile", localVarPath, "POST", new ArrayList<>(), null, + new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, false, localVarErrorTypes); + } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java index 7b64b0ef3f66..43c8f799fff8 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java @@ -84,8 +84,8 @@ public ApiResponse deleteOrderWithHttpInfo(@jakarta.annotation.Nonnull Str } // Path parameters - String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{orderId}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{order_id}", apiClient.escapeString(orderId.toString())); String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); @@ -173,8 +173,8 @@ public ApiResponse getOrderByIdWithHttpInfo(@jakarta.annotation.Nonnull L } // Path parameters - String localVarPath = "/store/order/{orderId}" - .replaceAll("\\{orderId}", apiClient.escapeString(orderId.toString())); + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{order_id}", apiClient.escapeString(orderId.toString())); String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java index c3f0d9661e6d..10cf03612f4c 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java @@ -84,11 +84,10 @@ public ApiResponse createUserWithHttpInfo(@jakarta.annotation.Nonnull User String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); - String[] localVarAuthNames = new String[] {"api_key"}; final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.createUser", "/user", "POST", new ArrayList<>(), user, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, null, false, localVarErrorTypes); + null, null, false, localVarErrorTypes); } /** * Creates list of users with given input array @@ -127,11 +126,10 @@ public ApiResponse createUsersWithArrayInputWithHttpInfo(@jakarta.annotati String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); - String[] localVarAuthNames = new String[] {"api_key"}; final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.createUsersWithArrayInput", "/user/createWithArray", "POST", new ArrayList<>(), user, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, null, false, localVarErrorTypes); + null, null, false, localVarErrorTypes); } /** * Creates list of users with given input array @@ -170,11 +168,10 @@ public ApiResponse createUsersWithListInputWithHttpInfo(@jakarta.annotatio String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); - String[] localVarAuthNames = new String[] {"api_key"}; final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.createUsersWithListInput", "/user/createWithList", "POST", new ArrayList<>(), user, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, null, false, localVarErrorTypes); + null, null, false, localVarErrorTypes); } /** * Delete user @@ -219,11 +216,10 @@ public ApiResponse deleteUserWithHttpInfo(@jakarta.annotation.Nonnull Stri String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key"}; final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.deleteUser", localVarPath, "DELETE", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, null, false, localVarErrorTypes); + null, null, false, localVarErrorTypes); } /** * Get user by user name @@ -288,7 +284,7 @@ public ApiResponse getUserByNameWithHttpInfo(@jakarta.annotation.Nonnull S - +
Response Details
Status Code Description Response Headers
200 successful operation * Set-Cookie - Cookie authentication key for use with the `api_key` apiKey authentication.
* X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
200 successful operation * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
400 Invalid username/password supplied -
*/ @@ -307,7 +303,7 @@ public String loginUser(@jakarta.annotation.Nonnull String username, @jakarta.an - +
Response Details
Status Code Description Response Headers
200 successful operation * Set-Cookie - Cookie authentication key for use with the `api_key` apiKey authentication.
* X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
200 successful operation * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
400 Invalid username/password supplied -
*/ @@ -364,11 +360,10 @@ public void logoutUser() throws ApiException { public ApiResponse logoutUserWithHttpInfo() throws ApiException { String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] {"api_key"}; final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.logoutUser", "/user/logout", "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, null, false, localVarErrorTypes); + null, null, false, localVarErrorTypes); } /** * Updated user @@ -418,10 +413,9 @@ public ApiResponse updateUserWithHttpInfo(@jakarta.annotation.Nonnull Stri String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); - String[] localVarAuthNames = new String[] {"api_key"}; final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.updateUser", localVarPath, "PUT", new ArrayList<>(), user, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, null, false, localVarErrorTypes); + null, null, false, localVarErrorTypes); } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java index c9616e92f590..7b72097c5a1e 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/Authentication.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/Authentication.java index 49ffa7d0fd81..1c01f1d57fdb 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/Authentication.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/Authentication.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index 98af5ab2ab17..53cc18f1dcd8 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java index d2fc73e31228..d1247f8d27b6 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/OAuth.java index a7860b365f4c..cb7caf2b89f3 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/OAuth.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/OAuth.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/OAuthFlow.java index d2c72bc9a822..dab6bf989ea7 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/OAuthFlow.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java index 9c4aed4ca567..8165ca55bbde 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 8f963ffe984c..d2dda62fbca2 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -31,8 +29,6 @@ import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -103,7 +99,6 @@ public AdditionalPropertiesClass putMapPropertyItem(String key, String mapProper * @return mapProperty */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_MAP_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -137,8 +132,6 @@ public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -348,7 +349,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(mapProperty, mapOfMapProperty, hashCodeNullable(anytype1), mapWithUndeclaredPropertiesAnytype1, mapWithUndeclaredPropertiesAnytype2, mapWithUndeclaredPropertiesAnytype3, emptyMap, mapWithUndeclaredPropertiesString); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToDouble.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToDouble.java index 06a183bab28a..2a1ae9517d3d 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToDouble.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToDouble.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -55,7 +51,6 @@ public AllOfRefToDouble height(@jakarta.annotation.Nullable Double height) { * @return height */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_HEIGHT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -76,12 +71,19 @@ public void setHeight(@jakarta.annotation.Nullable Double height) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AllOfRefToDouble allOfRefToDouble = (AllOfRefToDouble) o; + return Objects.equals(this.height, allOfRefToDouble.height); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(height); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToFloat.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToFloat.java index fcd09ee8fba7..409f4b9d48c2 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToFloat.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToFloat.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -55,7 +51,6 @@ public AllOfRefToFloat weight(@jakarta.annotation.Nullable Float weight) { * @return weight */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_WEIGHT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -76,12 +71,19 @@ public void setWeight(@jakarta.annotation.Nullable Float weight) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AllOfRefToFloat allOfRefToFloat = (AllOfRefToFloat) o; + return Objects.equals(this.weight, allOfRefToFloat.weight); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(weight); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToLong.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToLong.java index 49f3142993cc..d7867ce60bcf 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToLong.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToLong.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -55,7 +51,6 @@ public AllOfRefToLong id(@jakarta.annotation.Nullable Long id) { * @return id */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -76,12 +71,19 @@ public void setId(@jakarta.annotation.Nullable Long id) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AllOfRefToLong allOfRefToLong = (AllOfRefToLong) o; + return Objects.equals(this.id, allOfRefToLong.id); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(id); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Animal.java index 4c5d8da8455b..ff46c6e1de27 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Animal.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -28,8 +26,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -73,8 +69,6 @@ public Animal className(@jakarta.annotation.Nonnull String className) { * @return className */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -100,7 +94,6 @@ public Animal color(@jakarta.annotation.Nullable String color) { * @return color */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_COLOR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -121,12 +114,20 @@ public void setColor(@jakarta.annotation.Nullable String color) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Animal animal = (Animal) o; + return Objects.equals(this.className, animal.className) && + Objects.equals(this.color, animal.color); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(className, color); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Apple.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Apple.java index bde79bb52b47..4a5445b9932e 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Apple.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Apple.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -61,7 +57,6 @@ public Apple cultivar(@jakarta.annotation.Nullable String cultivar) { * @return cultivar */ @jakarta.annotation.Nullable - @Pattern(regexp="^[a-zA-Z\\s]*$") @JsonProperty(value = JSON_PROPERTY_CULTIVAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -87,7 +82,6 @@ public Apple origin(@jakarta.annotation.Nullable String origin) { * @return origin */ @jakarta.annotation.Nullable - @Pattern(regexp="/^[A-Z\\s]*$/i") @JsonProperty(value = JSON_PROPERTY_ORIGIN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -108,12 +102,20 @@ public void setOrigin(@jakarta.annotation.Nullable String origin) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Apple apple = (Apple) o; + return Objects.equals(this.cultivar, apple.cultivar) && + Objects.equals(this.origin, apple.origin); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(cultivar, origin); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AppleReq.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AppleReq.java index f93945bf4dd4..ba85e3fcefec 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AppleReq.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AppleReq.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -61,8 +57,6 @@ public AppleReq cultivar(@jakarta.annotation.Nonnull String cultivar) { * @return cultivar */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_CULTIVAR, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -88,7 +82,6 @@ public AppleReq mealy(@jakarta.annotation.Nullable Boolean mealy) { * @return mealy */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_MEALY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -109,12 +102,20 @@ public void setMealy(@jakarta.annotation.Nullable Boolean mealy) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AppleReq appleReq = (AppleReq) o; + return Objects.equals(this.cultivar, appleReq.cultivar) && + Objects.equals(this.mealy, appleReq.mealy); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(cultivar, mealy); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index b0479da02655..08dffa4a12d1 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -28,8 +26,6 @@ import java.util.Arrays; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -66,8 +62,6 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr * @return arrayArrayNumber */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -88,12 +82,19 @@ public void setArrayArrayNumber(@jakarta.annotation.Nullable List arrayNu */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; + return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(arrayNumber); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayTest.java index fdb5acbad989..c97ec69e0138 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -28,8 +26,6 @@ import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -53,7 +49,7 @@ public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; @jakarta.annotation.Nullable - private List> arrayArrayOfModel = new ArrayList<>(); + private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest() { } @@ -76,7 +72,6 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { * @return arrayOfString */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ARRAY_OF_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -110,8 +105,6 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) * @return arrayArrayOfInteger */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -127,12 +120,12 @@ public void setArrayArrayOfInteger(@jakarta.annotation.Nullable List> } - public ArrayTest arrayArrayOfModel(@jakarta.annotation.Nullable List> arrayArrayOfModel) { + public ArrayTest arrayArrayOfModel(@jakarta.annotation.Nullable List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; return this; } - public ArrayTest addArrayArrayOfModelItem(List<@Valid ReadOnlyFirst> arrayArrayOfModelItem) { + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { this.arrayArrayOfModel = new ArrayList<>(); } @@ -145,19 +138,17 @@ public ArrayTest addArrayArrayOfModelItem(List<@Valid ReadOnlyFirst> arrayArrayO * @return arrayArrayOfModel */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List> getArrayArrayOfModel() { + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setArrayArrayOfModel(@jakarta.annotation.Nullable List> arrayArrayOfModel) { + public void setArrayArrayOfModel(@jakarta.annotation.Nullable List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } @@ -167,12 +158,21 @@ public void setArrayArrayOfModel(@jakarta.annotation.Nullable List additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public Cat putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } /** * Return true if this Cat object is equal to o. */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Cat cat = (Cat) o; + return Objects.equals(this.declawed, cat.declawed) && + super.equals(o); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(declawed, super.hashCode()); } @Override @@ -142,7 +104,6 @@ public String toString() { sb.append("class Cat {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Category.java index 9f4945670ab6..a5ae86785d81 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Category.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -27,7 +27,7 @@ /** - * A category for a pet + * Category */ @JsonPropertyOrder({ Category.JSON_PROPERTY_ID, @@ -40,8 +40,8 @@ public class Category { private Long id; public static final String JSON_PROPERTY_NAME = "name"; - @jakarta.annotation.Nullable - private String name; + @jakarta.annotation.Nonnull + private String name = "default-name"; public Category() { } @@ -71,7 +71,7 @@ public void setId(@jakarta.annotation.Nullable Long id) { } - public Category name(@jakarta.annotation.Nullable String name) { + public Category name(@jakarta.annotation.Nonnull String name) { this.name = name; return this; } @@ -80,18 +80,18 @@ public Category name(@jakarta.annotation.Nullable String name) { * Get name * @return name */ - @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_NAME, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @jakarta.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_NAME, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getName() { return name; } - @JsonProperty(value = JSON_PROPERTY_NAME, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(@jakarta.annotation.Nullable String name) { + @JsonProperty(value = JSON_PROPERTY_NAME, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(@jakarta.annotation.Nonnull String name) { this.name = name; } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ChildCat.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ChildCat.java index 2fa67b9ecbc7..8eed54f4bf96 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ChildCat.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ChildCat.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -35,8 +29,6 @@ import java.util.Set; import java.util.HashSet; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -76,7 +68,6 @@ public ChildCat name(@jakarta.annotation.Nullable String name) { * @return name */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -110,7 +101,6 @@ public ChildCat petType(@jakarta.annotation.Nullable String petType) { * @return petType */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PET_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -129,55 +119,27 @@ public void setPetType(@jakarta.annotation.Nullable String petType) { this.petType = petType; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public ChildCat putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } /** * Return true if this ChildCat object is equal to o. */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChildCat childCat = (ChildCat) o; + return Objects.equals(this.name, childCat.name) && + Objects.equals(this.petType, childCat.petType) && + super.equals(o); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(name, petType, super.hashCode()); } @Override @@ -187,7 +149,6 @@ public String toString() { sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" petType: ").append(toIndentedString(petType)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ClassModel.java index bc166beabb59..8693a5882be2 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ClassModel.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -55,7 +51,6 @@ public ClassModel propertyClass(@jakarta.annotation.Nullable String propertyClas * @return propertyClass */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PROPERTY_CLASS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -76,12 +71,19 @@ public void setPropertyClass(@jakarta.annotation.Nullable String propertyClass) */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClassModel classModel = (ClassModel) o; + return Objects.equals(this.propertyClass, classModel.propertyClass); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(propertyClass); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Client.java index 236f860787a3..bdfb834d467c 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Client.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -55,7 +51,6 @@ public Client client(@jakarta.annotation.Nullable String client) { * @return client */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_CLIENT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -76,12 +71,19 @@ public void setClient(@jakarta.annotation.Nullable String client) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Client client = (Client) o; + return Objects.equals(this.client, client.client); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(client); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java index dcb9e8af81c0..6b5a00ae4eb4 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -29,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -64,8 +56,6 @@ public ComplexQuadrilateral shapeType(@jakarta.annotation.Nonnull String shapeTy * @return shapeType */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -91,8 +81,6 @@ public ComplexQuadrilateral quadrilateralType(@jakarta.annotation.Nonnull String * @return quadrilateralType */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -107,55 +95,26 @@ public void setQuadrilateralType(@jakarta.annotation.Nonnull String quadrilatera this.quadrilateralType = quadrilateralType; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public ComplexQuadrilateral putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } /** * Return true if this ComplexQuadrilateral object is equal to o. */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ComplexQuadrilateral complexQuadrilateral = (ComplexQuadrilateral) o; + return Objects.equals(this.shapeType, complexQuadrilateral.shapeType) && + Objects.equals(this.quadrilateralType, complexQuadrilateral.quadrilateralType); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(shapeType, quadrilateralType); } @Override @@ -164,7 +123,6 @@ public String toString() { sb.append("class ComplexQuadrilateral {\n"); sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); sb.append(" quadrilateralType: ").append(toIndentedString(quadrilateralType)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DanishPig.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DanishPig.java index dcfe14c45d0e..c1e02bbba79a 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DanishPig.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DanishPig.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -55,8 +51,6 @@ public DanishPig className(@jakarta.annotation.Nonnull String className) { * @return className */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -77,12 +71,19 @@ public void setClassName(@jakarta.annotation.Nonnull String className) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DanishPig danishPig = (DanishPig) o; + return Objects.equals(this.className, danishPig.className); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(className); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DeprecatedObject.java index 0b27bb0ee5ed..6201aa7056ba 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -57,7 +53,6 @@ public DeprecatedObject name(@jakarta.annotation.Nullable String name) { * @return name */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -78,12 +73,19 @@ public void setName(@jakarta.annotation.Nullable String name) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeprecatedObject deprecatedObject = (DeprecatedObject) o; + return Objects.equals(this.name, deprecatedObject.name); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(name); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Dog.java index c03044cca8cc..5b8083f36212 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Dog.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -33,8 +27,6 @@ import java.util.Arrays; import org.openapitools.client.model.Animal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -69,7 +61,6 @@ public Dog breed(@jakarta.annotation.Nullable String breed) { * @return breed */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_BREED, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -84,55 +75,26 @@ public void setBreed(@jakarta.annotation.Nullable String breed) { this.breed = breed; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public Dog putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } /** * Return true if this Dog object is equal to o. */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Dog dog = (Dog) o; + return Objects.equals(this.breed, dog.breed) && + super.equals(o); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(breed, super.hashCode()); } @Override @@ -141,7 +103,6 @@ public String toString() { sb.append("class Dog {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Drawing.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Drawing.java index 9ef7f0fa4116..7bb91d138adf 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Drawing.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Drawing.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -39,8 +37,6 @@ import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -82,8 +78,6 @@ public Drawing mainShape(@jakarta.annotation.Nullable Shape mainShape) { * @return mainShape */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_MAIN_SHAPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -109,8 +103,6 @@ public Drawing shapeOrNull(@jakarta.annotation.Nullable ShapeOrNull shapeOrNull) * @return shapeOrNull */ @jakarta.annotation.Nullable - @Valid - @JsonIgnore public ShapeOrNull getShapeOrNull() { @@ -144,8 +136,6 @@ public Drawing nullableShape(@jakarta.annotation.Nullable NullableShape nullable * @return nullableShape */ @jakarta.annotation.Nullable - @Valid - @JsonIgnore public NullableShape getNullableShape() { @@ -187,8 +177,6 @@ public Drawing addShapesItem(Shape shapesItem) { * @return shapes */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_SHAPES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -246,7 +234,18 @@ public Fruit getAdditionalProperty(String key) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Drawing drawing = (Drawing) o; + return Objects.equals(this.mainShape, drawing.mainShape) && + equalsNullable(this.shapeOrNull, drawing.shapeOrNull) && + equalsNullable(this.nullableShape, drawing.nullableShape) && + Objects.equals(this.shapes, drawing.shapes)&& + Objects.equals(this.additionalProperties, drawing.additionalProperties); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -255,7 +254,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(mainShape, hashCodeNullable(shapeOrNull), hashCodeNullable(nullableShape), shapes, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumArrays.java index 72f8efccb8dd..4d5dca83868f 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -27,8 +25,6 @@ import java.util.Arrays; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -132,7 +128,6 @@ public EnumArrays justSymbol(@jakarta.annotation.Nullable JustSymbolEnum justSym * @return justSymbol */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_JUST_SYMBOL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -166,7 +161,6 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { * @return arrayEnum */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ARRAY_ENUM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -187,12 +181,20 @@ public void setArrayEnum(@jakarta.annotation.Nullable List arrayE */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumArrays enumArrays = (EnumArrays) o; + return Objects.equals(this.justSymbol, enumArrays.justSymbol) && + Objects.equals(this.arrayEnum, enumArrays.arrayEnum); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(justSymbol, arrayEnum); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumClass.java index a8d97ff8d03d..0150ebe31b41 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumClass.java @@ -13,14 +13,10 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumTest.java index fcc40c915885..509c9f5481a3 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumTest.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -33,8 +31,6 @@ import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -282,7 +278,6 @@ public EnumTest enumString(@jakarta.annotation.Nullable EnumStringEnum enumStrin * @return enumString */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ENUM_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -308,8 +303,6 @@ public EnumTest enumStringRequired(@jakarta.annotation.Nonnull EnumStringRequire * @return enumStringRequired */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_ENUM_STRING_REQUIRED, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -335,7 +328,6 @@ public EnumTest enumInteger(@jakarta.annotation.Nullable EnumIntegerEnum enumInt * @return enumInteger */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ENUM_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -361,7 +353,6 @@ public EnumTest enumIntegerOnly(@jakarta.annotation.Nullable EnumIntegerOnlyEnum * @return enumIntegerOnly */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ENUM_INTEGER_ONLY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -387,7 +378,6 @@ public EnumTest enumNumber(@jakarta.annotation.Nullable EnumNumberEnum enumNumbe * @return enumNumber */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ENUM_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -413,8 +403,6 @@ public EnumTest outerEnum(@jakarta.annotation.Nullable OuterEnum outerEnum) { * @return outerEnum */ @jakarta.annotation.Nullable - @Valid - @JsonIgnore public OuterEnum getOuterEnum() { @@ -448,8 +436,6 @@ public EnumTest outerEnumInteger(@jakarta.annotation.Nullable OuterEnumInteger o * @return outerEnumInteger */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -475,8 +461,6 @@ public EnumTest outerEnumDefaultValue(@jakarta.annotation.Nullable OuterEnumDefa * @return outerEnumDefaultValue */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -502,8 +486,6 @@ public EnumTest outerEnumIntegerDefaultValue(@jakarta.annotation.Nullable OuterE * @return outerEnumIntegerDefaultValue */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -524,7 +506,22 @@ public void setOuterEnumIntegerDefaultValue(@jakarta.annotation.Nullable OuterEn */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumTest enumTest = (EnumTest) o; + return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && + Objects.equals(this.enumInteger, enumTest.enumInteger) && + Objects.equals(this.enumIntegerOnly, enumTest.enumIntegerOnly) && + Objects.equals(this.enumNumber, enumTest.enumNumber) && + equalsNullable(this.outerEnum, enumTest.outerEnum) && + Objects.equals(this.outerEnumInteger, enumTest.outerEnumInteger) && + Objects.equals(this.outerEnumDefaultValue, enumTest.outerEnumDefaultValue) && + Objects.equals(this.outerEnumIntegerDefaultValue, enumTest.outerEnumIntegerDefaultValue); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -533,7 +530,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(enumString, enumStringRequired, enumInteger, enumIntegerOnly, enumNumber, hashCodeNullable(outerEnum), outerEnumInteger, outerEnumDefaultValue, outerEnumIntegerDefaultValue); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java index 597609111f84..662ade9ad613 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -29,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -64,8 +56,6 @@ public EquilateralTriangle shapeType(@jakarta.annotation.Nonnull String shapeTyp * @return shapeType */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -91,8 +81,6 @@ public EquilateralTriangle triangleType(@jakarta.annotation.Nonnull String trian * @return triangleType */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -107,55 +95,26 @@ public void setTriangleType(@jakarta.annotation.Nonnull String triangleType) { this.triangleType = triangleType; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public EquilateralTriangle putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } /** * Return true if this EquilateralTriangle object is equal to o. */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EquilateralTriangle equilateralTriangle = (EquilateralTriangle) o; + return Objects.equals(this.shapeType, equilateralTriangle.shapeType) && + Objects.equals(this.triangleType, equilateralTriangle.triangleType); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(shapeType, triangleType); } @Override @@ -164,7 +123,6 @@ public String toString() { sb.append("class EquilateralTriangle {\n"); sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); sb.append(" triangleType: ").append(toIndentedString(triangleType)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index a67cdded729a..579b4efa21ed 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -28,8 +26,6 @@ import java.util.List; import org.openapitools.client.model.ModelFile; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -48,7 +44,7 @@ public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILES = "files"; @jakarta.annotation.Nullable - private List<@Valid ModelFile> files = new ArrayList<>(); + private List files = new ArrayList<>(); public FileSchemaTestClass() { } @@ -63,8 +59,6 @@ public FileSchemaTestClass _file(@jakarta.annotation.Nullable ModelFile _file) { * @return _file */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_FILE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -80,7 +74,7 @@ public void setFile(@jakarta.annotation.Nullable ModelFile _file) { } - public FileSchemaTestClass files(@jakarta.annotation.Nullable List<@Valid ModelFile> files) { + public FileSchemaTestClass files(@jakarta.annotation.Nullable List files) { this.files = files; return this; } @@ -98,19 +92,17 @@ public FileSchemaTestClass addFilesItem(ModelFile filesItem) { * @return files */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_FILES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List<@Valid ModelFile> getFiles() { + public List getFiles() { return files; } @JsonProperty(value = JSON_PROPERTY_FILES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(@jakarta.annotation.Nullable List<@Valid ModelFile> files) { + public void setFiles(@jakarta.annotation.Nullable List files) { this.files = files; } @@ -120,12 +112,20 @@ public void setFiles(@jakarta.annotation.Nullable List<@Valid ModelFile> files) */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; + return Objects.equals(this._file, fileSchemaTestClass._file) && + Objects.equals(this.files, fileSchemaTestClass.files); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(_file, files); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Foo.java index aa2b92e4e805..f3fc062a1da9 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Foo.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -55,7 +51,6 @@ public Foo bar(@jakarta.annotation.Nullable String bar) { * @return bar */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_BAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -76,12 +71,19 @@ public void setBar(@jakarta.annotation.Nullable String bar) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Foo foo = (Foo) o; + return Objects.equals(this.bar, foo.bar); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(bar); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index c490fde0486e..e216f393a4e9 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -26,8 +24,6 @@ import java.util.Arrays; import org.openapitools.client.model.Foo; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -57,8 +53,6 @@ public FooGetDefaultResponse string(@jakarta.annotation.Nullable Foo string) { * @return string */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -79,12 +73,19 @@ public void setString(@jakarta.annotation.Nullable Foo string) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FooGetDefaultResponse fooGetDefaultResponse = (FooGetDefaultResponse) o; + return Objects.equals(this.string, fooGetDefaultResponse.string); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(string); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FormatTest.java index 90fea3fd5cdf..6dbf825a882e 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FormatTest.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -30,8 +28,6 @@ import java.util.Arrays; import java.util.UUID; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -138,7 +134,6 @@ public FormatTest integer(@jakarta.annotation.Nullable Integer integer) { * @return integer */ @jakarta.annotation.Nullable - @Min(10) @Max(100) @JsonProperty(value = JSON_PROPERTY_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -166,7 +161,6 @@ public FormatTest int32(@jakarta.annotation.Nullable Integer int32) { * @return int32 */ @jakarta.annotation.Nullable - @Min(20) @Max(200) @JsonProperty(value = JSON_PROPERTY_INT32, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -192,7 +186,6 @@ public FormatTest int64(@jakarta.annotation.Nullable Long int64) { * @return int64 */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_INT64, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -220,9 +213,6 @@ public FormatTest number(@jakarta.annotation.Nonnull BigDecimal number) { * @return number */ @jakarta.annotation.Nonnull - @NotNull - @Valid - @DecimalMin("32.1") @DecimalMax("543.2") @JsonProperty(value = JSON_PROPERTY_NUMBER, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -250,7 +240,6 @@ public FormatTest _float(@jakarta.annotation.Nullable Float _float) { * @return _float */ @jakarta.annotation.Nullable - @DecimalMin("54.3") @DecimalMax("987.6") @JsonProperty(value = JSON_PROPERTY_FLOAT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -278,7 +267,6 @@ public FormatTest _double(@jakarta.annotation.Nullable Double _double) { * @return _double */ @jakarta.annotation.Nullable - @DecimalMin("67.8") @DecimalMax("123.4") @JsonProperty(value = JSON_PROPERTY_DOUBLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -304,8 +292,6 @@ public FormatTest decimal(@jakarta.annotation.Nullable BigDecimal decimal) { * @return decimal */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_DECIMAL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -331,7 +317,6 @@ public FormatTest string(@jakarta.annotation.Nullable String string) { * @return string */ @jakarta.annotation.Nullable - @Pattern(regexp="/[a-z]/i") @JsonProperty(value = JSON_PROPERTY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -357,8 +342,6 @@ public FormatTest _byte(@jakarta.annotation.Nonnull byte[] _byte) { * @return _byte */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_BYTE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -384,8 +367,6 @@ public FormatTest binary(@jakarta.annotation.Nullable File binary) { * @return binary */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_BINARY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -411,9 +392,6 @@ public FormatTest date(@jakarta.annotation.Nonnull LocalDate date) { * @return date */ @jakarta.annotation.Nonnull - @NotNull - @Valid - @JsonProperty(value = JSON_PROPERTY_DATE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -439,8 +417,6 @@ public FormatTest dateTime(@jakarta.annotation.Nullable OffsetDateTime dateTime) * @return dateTime */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_DATE_TIME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -466,8 +442,6 @@ public FormatTest uuid(@jakarta.annotation.Nullable UUID uuid) { * @return uuid */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -493,8 +467,6 @@ public FormatTest password(@jakarta.annotation.Nonnull String password) { * @return password */ @jakarta.annotation.Nonnull - @NotNull - @Size(min=10,max=64) @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -520,7 +492,6 @@ public FormatTest patternWithDigits(@jakarta.annotation.Nullable String patternW * @return patternWithDigits */ @jakarta.annotation.Nullable - @Pattern(regexp="^\\d{10}$") @JsonProperty(value = JSON_PROPERTY_PATTERN_WITH_DIGITS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -546,7 +517,6 @@ public FormatTest patternWithDigitsAndDelimiter(@jakarta.annotation.Nullable Str * @return patternWithDigitsAndDelimiter */ @jakarta.annotation.Nullable - @Pattern(regexp="/^image_\\d{1,3}$/i") @JsonProperty(value = JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -567,12 +537,34 @@ public void setPatternWithDigitsAndDelimiter(@jakarta.annotation.Nullable String */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FormatTest formatTest = (FormatTest) o; + return Objects.equals(this.integer, formatTest.integer) && + Objects.equals(this.int32, formatTest.int32) && + Objects.equals(this.int64, formatTest.int64) && + Objects.equals(this.number, formatTest.number) && + Objects.equals(this._float, formatTest._float) && + Objects.equals(this._double, formatTest._double) && + Objects.equals(this.decimal, formatTest.decimal) && + Objects.equals(this.string, formatTest.string) && + Arrays.equals(this._byte, formatTest._byte) && + Objects.equals(this.binary, formatTest.binary) && + Objects.equals(this.date, formatTest.date) && + Objects.equals(this.dateTime, formatTest.dateTime) && + Objects.equals(this.uuid, formatTest.uuid) && + Objects.equals(this.password, formatTest.password) && + Objects.equals(this.patternWithDigits, formatTest.patternWithDigits) && + Objects.equals(this.patternWithDigitsAndDelimiter, formatTest.patternWithDigitsAndDelimiter); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(integer, int32, int64, number, _float, _double, decimal, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, patternWithDigits, patternWithDigitsAndDelimiter); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Fruit.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Fruit.java index c8849fe3a11f..3bf4681b7c3b 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Fruit.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -28,8 +26,6 @@ import org.openapitools.client.model.Apple; import org.openapitools.client.model.Banana; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FruitReq.java index fdea804b7b23..c7b5a4f590da 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FruitReq.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -28,8 +26,6 @@ import org.openapitools.client.model.AppleReq; import org.openapitools.client.model.BananaReq; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java index 93954725a450..c6567bd814d7 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -28,8 +26,6 @@ import org.openapitools.client.model.Apple; import org.openapitools.client.model.Banana; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java index bb272cde7d6e..b221d2acb7ca 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -28,8 +26,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -68,8 +64,6 @@ public GrandparentAnimal petType(@jakarta.annotation.Nonnull String petType) { * @return petType */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_PET_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -90,12 +84,19 @@ public void setPetType(@jakarta.annotation.Nonnull String petType) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GrandparentAnimal grandparentAnimal = (GrandparentAnimal) o; + return Objects.equals(this.petType, grandparentAnimal.petType); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(petType); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 65d4a06592c9..391848b281b4 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -66,7 +62,6 @@ public HasOnlyReadOnly( * @return bar */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_BAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -82,7 +77,6 @@ public String getBar() { * @return foo */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_FOO, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -98,12 +92,20 @@ public String getFoo() { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; + return Objects.equals(this.bar, hasOnlyReadOnly.bar) && + Objects.equals(this.foo, hasOnlyReadOnly.foo); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(bar, foo); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HealthCheckResult.java index d03284e7a21e..db1ea005cbb2 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -29,8 +27,6 @@ import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -58,7 +54,6 @@ public HealthCheckResult nullableMessage(@jakarta.annotation.Nullable String nul * @return nullableMessage */ @jakarta.annotation.Nullable - @JsonIgnore public String getNullableMessage() { @@ -87,7 +82,14 @@ public void setNullableMessage(@jakarta.annotation.Nullable String nullableMessa */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HealthCheckResult healthCheckResult = (HealthCheckResult) o; + return equalsNullable(this.nullableMessage, healthCheckResult.nullableMessage); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -96,7 +98,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(hashCodeNullable(nullableMessage)); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java index 571e606d968b..fa712f06f261 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -60,8 +56,6 @@ public IsoscelesTriangle shapeType(@jakarta.annotation.Nonnull String shapeType) * @return shapeType */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -87,8 +81,6 @@ public IsoscelesTriangle triangleType(@jakarta.annotation.Nonnull String triangl * @return triangleType */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -109,12 +101,20 @@ public void setTriangleType(@jakarta.annotation.Nonnull String triangleType) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IsoscelesTriangle isoscelesTriangle = (IsoscelesTriangle) o; + return Objects.equals(this.shapeType, isoscelesTriangle.shapeType) && + Objects.equals(this.triangleType, isoscelesTriangle.triangleType); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(shapeType, triangleType); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Mammal.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Mammal.java index 25de7885e9b3..07f6206606d4 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Mammal.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -35,8 +29,6 @@ import org.openapitools.client.model.Whale; import org.openapitools.client.model.Zebra; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -100,26 +92,6 @@ public MammalDeserializer(Class vc) { public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { JsonNode tree = ctxt.readTree(jp); Object deserialized = null; - Mammal newMammal = new Mammal(); - Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); - String discriminatorValue = (String)result2.get("className"); - switch (discriminatorValue) { - case "Pig": - deserialized = tree.traverse(jp.getCodec()).readValueAs(Pig.class); - newMammal.setActualInstance(deserialized); - return newMammal; - case "whale": - deserialized = tree.traverse(jp.getCodec()).readValueAs(Whale.class); - newMammal.setActualInstance(deserialized); - return newMammal; - case "zebra": - deserialized = tree.traverse(jp.getCodec()).readValueAs(Zebra.class); - newMammal.setActualInstance(deserialized); - return newMammal; - default: - log.log(Level.WARNING, String.format(java.util.Locale.ROOT, "Failed to lookup discriminator value `%s` for Mammal. Possible values: Pig whale zebra", discriminatorValue)); - } - boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; JsonToken token = tree.traverse(jp.getCodec()).nextToken(); @@ -194,56 +166,7 @@ public Mammal getNullValue(DeserializationContext ctxt) throws JsonMappingExcept public Mammal() { super("oneOf", Boolean.FALSE); } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public Mammal putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - /** - * Return true if this mammal object is equal to o. - */ - @Override - public boolean equals(Object o) { - return super.equals(o) && Objects.equals(this.additionalProperties, ((Mammal)o).additionalProperties); - } - @Override - public int hashCode() { - return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); - } public Mammal(Whale o) { super("oneOf", Boolean.FALSE); setActualInstance(o); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MammalAnyof.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MammalAnyof.java index f65a02a0ed03..e97298aa75bb 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MammalAnyof.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MammalAnyof.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -35,8 +29,6 @@ import org.openapitools.client.model.Whale; import org.openapitools.client.model.Zebra; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -159,56 +151,7 @@ public MammalAnyof getNullValue(DeserializationContext ctxt) throws JsonMappingE public MammalAnyof() { super("anyOf", Boolean.FALSE); } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public MammalAnyof putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - /** - * Return true if this mammal_anyof object is equal to o. - */ - @Override - public boolean equals(Object o) { - return super.equals(o) && Objects.equals(this.additionalProperties, ((MammalAnyof)o).additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); - } public MammalAnyof(Whale o) { super("anyOf", Boolean.FALSE); setActualInstance(o); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MapTest.java index 2b24222db2e9..dfb9497f0353 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MapTest.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -27,8 +25,6 @@ import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -115,8 +111,6 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr * @return mapMapOfString */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_MAP_MAP_OF_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -150,7 +144,6 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) * @return mapOfEnumString */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_MAP_OF_ENUM_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -184,7 +177,6 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { * @return directMap */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DIRECT_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -218,7 +210,6 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { * @return indirectMap */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_INDIRECT_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -239,12 +230,22 @@ public void setIndirectMap(@jakarta.annotation.Nullable Map ind */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MapTest mapTest = (MapTest) o; + return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 8565aa43bdf5..719ca8e7ef3a 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -30,8 +28,6 @@ import java.util.UUID; import org.openapitools.client.model.Animal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -70,8 +66,6 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(@jakarta.annotation.Null * @return uuid */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,8 +91,6 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(@jakarta.annotation. * @return dateTime */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_DATE_TIME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -132,8 +124,6 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * @return map */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -154,12 +144,21 @@ public void setMap(@jakarta.annotation.Nullable Map map) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; + return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && + Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && + Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(uuid, dateTime, map); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Model200Response.java index 21f893609303..4aa9b96ddb19 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Model200Response.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -61,7 +57,6 @@ public Model200Response name(@jakarta.annotation.Nullable Integer name) { * @return name */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -87,7 +82,6 @@ public Model200Response propertyClass(@jakarta.annotation.Nullable String proper * @return propertyClass */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PROPERTY_CLASS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -108,12 +102,20 @@ public void setPropertyClass(@jakarta.annotation.Nullable String propertyClass) */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(name, propertyClass); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 92734d3ee39d..13d502025a50 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -27,7 +27,7 @@ /** - * Describes the result of uploading an image resource + * ModelApiResponse */ @JsonPropertyOrder({ ModelApiResponse.JSON_PROPERTY_CODE, diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelFile.java index 8d72f2cea260..cfd98539ff7b 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelFile.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -56,7 +52,6 @@ public ModelFile sourceURI(@jakarta.annotation.Nullable String sourceURI) { * @return sourceURI */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SOURCE_U_R_I, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -77,12 +72,19 @@ public void setSourceURI(@jakarta.annotation.Nullable String sourceURI) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(sourceURI); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelList.java index 3548ff1c07eb..e3e79bdacdad 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelList.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -56,7 +52,6 @@ public ModelList _123list(@jakarta.annotation.Nullable String _123list) { * @return _123list */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_123LIST, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -77,12 +72,19 @@ public void set123list(@jakarta.annotation.Nullable String _123list) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(_123list); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelReturn.java index 4ad10dc0a037..2c074bd3a0b0 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -56,7 +52,6 @@ public ModelReturn _return(@jakarta.annotation.Nullable Integer _return) { * @return _return */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_RETURN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -77,12 +72,19 @@ public void setReturn(@jakarta.annotation.Nullable Integer _return) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelReturn _return = (ModelReturn) o; + return Objects.equals(this._return, _return._return); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(_return); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Name.java index e70b16384063..cc1f0253f8ea 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Name.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -80,8 +76,6 @@ public Name name(@jakarta.annotation.Nonnull Integer name) { * @return name */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -102,7 +96,6 @@ public void setName(@jakarta.annotation.Nonnull Integer name) { * @return snakeCase */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SNAKE_CASE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -123,7 +116,6 @@ public Name property(@jakarta.annotation.Nullable String property) { * @return property */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -144,7 +136,6 @@ public void setProperty(@jakarta.annotation.Nullable String property) { * @return _123number */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_123NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -160,12 +151,22 @@ public Integer get123number() { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Name name = (Name) o; + return Objects.equals(this.name, name.name) && + Objects.equals(this.snakeCase, name.snakeCase) && + Objects.equals(this.property, name.property) && + Objects.equals(this._123number, name._123number); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(name, snakeCase, property, _123number); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableClass.java index 60cb4a0740be..dc8b80a2a03c 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableClass.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -40,8 +38,6 @@ import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -115,7 +111,6 @@ public NullableClass integerProp(@jakarta.annotation.Nullable Integer integerPro * @return integerProp */ @jakarta.annotation.Nullable - @JsonIgnore public Integer getIntegerProp() { @@ -149,8 +144,6 @@ public NullableClass numberProp(@jakarta.annotation.Nullable BigDecimal numberPr * @return numberProp */ @jakarta.annotation.Nullable - @Valid - @JsonIgnore public BigDecimal getNumberProp() { @@ -184,7 +177,6 @@ public NullableClass booleanProp(@jakarta.annotation.Nullable Boolean booleanPro * @return booleanProp */ @jakarta.annotation.Nullable - @JsonIgnore public Boolean getBooleanProp() { @@ -218,7 +210,6 @@ public NullableClass stringProp(@jakarta.annotation.Nullable String stringProp) * @return stringProp */ @jakarta.annotation.Nullable - @JsonIgnore public String getStringProp() { @@ -252,8 +243,6 @@ public NullableClass dateProp(@jakarta.annotation.Nullable LocalDate dateProp) { * @return dateProp */ @jakarta.annotation.Nullable - @Valid - @JsonIgnore public LocalDate getDateProp() { @@ -287,8 +276,6 @@ public NullableClass datetimeProp(@jakarta.annotation.Nullable OffsetDateTime da * @return datetimeProp */ @jakarta.annotation.Nullable - @Valid - @JsonIgnore public OffsetDateTime getDatetimeProp() { @@ -334,7 +321,6 @@ public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) { * @return arrayNullableProp */ @jakarta.annotation.Nullable - @JsonIgnore public List getArrayNullableProp() { @@ -380,7 +366,6 @@ public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullab * @return arrayAndItemsNullableProp */ @jakarta.annotation.Nullable - @JsonIgnore public List getArrayAndItemsNullableProp() { @@ -422,7 +407,6 @@ public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) { * @return arrayItemsNullable */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ARRAY_ITEMS_NULLABLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -460,7 +444,6 @@ public NullableClass putObjectNullablePropItem(String key, Object objectNullable * @return objectNullableProp */ @jakarta.annotation.Nullable - @JsonIgnore public Map getObjectNullableProp() { @@ -506,7 +489,6 @@ public NullableClass putObjectAndItemsNullablePropItem(String key, Object object * @return objectAndItemsNullableProp */ @jakarta.annotation.Nullable - @JsonIgnore public Map getObjectAndItemsNullableProp() { @@ -548,7 +530,6 @@ public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNu * @return objectItemsNullable */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_OBJECT_ITEMS_NULLABLE, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -606,7 +587,26 @@ public Object getAdditionalProperty(String key) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NullableClass nullableClass = (NullableClass) o; + return equalsNullable(this.integerProp, nullableClass.integerProp) && + equalsNullable(this.numberProp, nullableClass.numberProp) && + equalsNullable(this.booleanProp, nullableClass.booleanProp) && + equalsNullable(this.stringProp, nullableClass.stringProp) && + equalsNullable(this.dateProp, nullableClass.dateProp) && + equalsNullable(this.datetimeProp, nullableClass.datetimeProp) && + equalsNullable(this.arrayNullableProp, nullableClass.arrayNullableProp) && + equalsNullable(this.arrayAndItemsNullableProp, nullableClass.arrayAndItemsNullableProp) && + Objects.equals(this.arrayItemsNullable, nullableClass.arrayItemsNullable) && + equalsNullable(this.objectNullableProp, nullableClass.objectNullableProp) && + equalsNullable(this.objectAndItemsNullableProp, nullableClass.objectAndItemsNullableProp) && + Objects.equals(this.objectItemsNullable, nullableClass.objectItemsNullable)&& + Objects.equals(this.additionalProperties, nullableClass.additionalProperties); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -615,7 +615,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(hashCodeNullable(integerProp), hashCodeNullable(numberProp), hashCodeNullable(booleanProp), hashCodeNullable(stringProp), hashCodeNullable(dateProp), hashCodeNullable(datetimeProp), hashCodeNullable(arrayNullableProp), hashCodeNullable(arrayAndItemsNullableProp), arrayItemsNullable, hashCodeNullable(objectNullableProp), hashCodeNullable(objectAndItemsNullableProp), objectItemsNullable, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableShape.java index f37075699d82..3a76d17e8872 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableShape.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -34,8 +28,6 @@ import org.openapitools.client.model.Quadrilateral; import org.openapitools.client.model.Triangle; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -99,22 +91,6 @@ public NullableShapeDeserializer(Class vc) { public NullableShape deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { JsonNode tree = ctxt.readTree(jp); Object deserialized = null; - NullableShape newNullableShape = new NullableShape(); - Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); - String discriminatorValue = (String)result2.get("shapeType"); - switch (discriminatorValue) { - case "Quadrilateral": - deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class); - newNullableShape.setActualInstance(deserialized); - return newNullableShape; - case "Triangle": - deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class); - newNullableShape.setActualInstance(deserialized); - return newNullableShape; - default: - log.log(Level.WARNING, String.format(java.util.Locale.ROOT, "Failed to lookup discriminator value `%s` for NullableShape. Possible values: Quadrilateral Triangle", discriminatorValue)); - } - boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; JsonToken token = tree.traverse(jp.getCodec()).nextToken(); @@ -173,56 +149,7 @@ public NullableShape getNullValue(DeserializationContext ctxt) throws JsonMappin public NullableShape() { super("oneOf", Boolean.TRUE); } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public NullableShape putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - /** - * Return true if this NullableShape object is equal to o. - */ - @Override - public boolean equals(Object o) { - return super.equals(o) && Objects.equals(this.additionalProperties, ((NullableShape)o).additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); - } public NullableShape(Triangle o) { super("oneOf", Boolean.FALSE); setActualInstance(o); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NumberOnly.java index 366223248587..2f00a1bdf036 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -26,8 +24,6 @@ import java.math.BigDecimal; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -56,8 +52,6 @@ public NumberOnly justNumber(@jakarta.annotation.Nullable BigDecimal justNumber) * @return justNumber */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_JUST_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -78,12 +72,19 @@ public void setJustNumber(@jakarta.annotation.Nullable BigDecimal justNumber) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NumberOnly numberOnly = (NumberOnly) o; + return Objects.equals(this.justNumber, numberOnly.justNumber); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(justNumber); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index a999ac4fd377..0494242b4b5d 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -29,8 +27,6 @@ import java.util.List; import org.openapitools.client.model.DeprecatedObject; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -77,7 +73,6 @@ public ObjectWithDeprecatedFields uuid(@jakarta.annotation.Nullable String uuid) * @return uuid */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -106,8 +101,6 @@ public ObjectWithDeprecatedFields id(@jakarta.annotation.Nullable BigDecimal id) */ @Deprecated @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -137,8 +130,6 @@ public ObjectWithDeprecatedFields deprecatedRef(@jakarta.annotation.Nullable Dep */ @Deprecated @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_DEPRECATED_REF, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -176,7 +167,6 @@ public ObjectWithDeprecatedFields addBarsItem(String barsItem) { */ @Deprecated @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_BARS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -198,12 +188,22 @@ public void setBars(@jakarta.annotation.Nullable List bars) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObjectWithDeprecatedFields objectWithDeprecatedFields = (ObjectWithDeprecatedFields) o; + return Objects.equals(this.uuid, objectWithDeprecatedFields.uuid) && + Objects.equals(this.id, objectWithDeprecatedFields.id) && + Objects.equals(this.deprecatedRef, objectWithDeprecatedFields.deprecatedRef) && + Objects.equals(this.bars, objectWithDeprecatedFields.bars); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(uuid, id, deprecatedRef, bars); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java index 030fc0183063..628154f7ef8f 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -28,7 +28,7 @@ /** - * An order for a pets from the pet store + * Order */ @JsonPropertyOrder({ Order.JSON_PROPERTY_ID, diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterComposite.java index abbab8cdc38d..fda5badcecb7 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -26,8 +24,6 @@ import java.math.BigDecimal; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -66,8 +62,6 @@ public OuterComposite myNumber(@jakarta.annotation.Nullable BigDecimal myNumber) * @return myNumber */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_MY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -93,7 +87,6 @@ public OuterComposite myString(@jakarta.annotation.Nullable String myString) { * @return myString */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_MY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -119,7 +112,6 @@ public OuterComposite myBoolean(@jakarta.annotation.Nullable Boolean myBoolean) * @return myBoolean */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_MY_BOOLEAN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -140,12 +132,21 @@ public void setMyBoolean(@jakarta.annotation.Nullable Boolean myBoolean) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterComposite outerComposite = (OuterComposite) o; + return Objects.equals(this.myNumber, outerComposite.myNumber) && + Objects.equals(this.myString, outerComposite.myString) && + Objects.equals(this.myBoolean, outerComposite.myBoolean); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(myNumber, myString, myBoolean); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnum.java index ff6b4dff8e97..d50018b999d5 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -13,14 +13,10 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java index 55e81d230056..73020e1e3b87 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java @@ -13,14 +13,10 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumInteger.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumInteger.java index 55c38bd319f2..a83925c58695 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumInteger.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumInteger.java @@ -13,14 +13,10 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java index b6156de0ce6a..383ca4227422 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java @@ -13,14 +13,10 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ParentPet.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ParentPet.java index d7f2b66ce113..d69986aadc73 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ParentPet.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ParentPet.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -33,8 +27,6 @@ import java.util.Arrays; import org.openapitools.client.model.GrandparentAnimal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -56,55 +48,24 @@ public class ParentPet extends GrandparentAnimal { public ParentPet() { } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public ParentPet putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } /** * Return true if this ParentPet object is equal to o. */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(super.hashCode()); } @Override @@ -112,7 +73,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ParentPet {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java index d8e5f1169a9c..9dcc1af2c993 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -31,7 +31,7 @@ /** - * A pet for sale in the pet store + * Pet */ @JsonPropertyOrder({ Pet.JSON_PROPERTY_ID, @@ -101,7 +101,6 @@ public static StatusEnum fromValue(String value) { } public static final String JSON_PROPERTY_STATUS = "status"; - @Deprecated @jakarta.annotation.Nullable private StatusEnum status; @@ -249,7 +248,6 @@ public void setTags(@jakarta.annotation.Nullable List tags) { } - @Deprecated public Pet status(@jakarta.annotation.Nullable StatusEnum status) { this.status = status; return this; @@ -258,9 +256,7 @@ public Pet status(@jakarta.annotation.Nullable StatusEnum status) { /** * pet status in the store * @return status - * @deprecated */ - @Deprecated @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -270,7 +266,6 @@ public StatusEnum getStatus() { } - @Deprecated @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(@jakarta.annotation.Nullable StatusEnum status) { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pig.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pig.java index acc3ab45717a..ef25a4326b5c 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pig.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -34,8 +28,6 @@ import org.openapitools.client.model.BasquePig; import org.openapitools.client.model.DanishPig; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -99,22 +91,6 @@ public PigDeserializer(Class vc) { public Pig deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { JsonNode tree = ctxt.readTree(jp); Object deserialized = null; - Pig newPig = new Pig(); - Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); - String discriminatorValue = (String)result2.get("className"); - switch (discriminatorValue) { - case "BasquePig": - deserialized = tree.traverse(jp.getCodec()).readValueAs(BasquePig.class); - newPig.setActualInstance(deserialized); - return newPig; - case "DanishPig": - deserialized = tree.traverse(jp.getCodec()).readValueAs(DanishPig.class); - newPig.setActualInstance(deserialized); - return newPig; - default: - log.log(Level.WARNING, String.format(java.util.Locale.ROOT, "Failed to lookup discriminator value `%s` for Pig. Possible values: BasquePig DanishPig", discriminatorValue)); - } - boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; JsonToken token = tree.traverse(jp.getCodec()).nextToken(); @@ -173,56 +149,7 @@ public Pig getNullValue(DeserializationContext ctxt) throws JsonMappingException public Pig() { super("oneOf", Boolean.FALSE); } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public Pig putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - /** - * Return true if this Pig object is equal to o. - */ - @Override - public boolean equals(Object o) { - return super.equals(o) && Objects.equals(this.additionalProperties, ((Pig)o).additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); - } public Pig(BasquePig o) { super("oneOf", Boolean.FALSE); setActualInstance(o); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Quadrilateral.java index ad90ab7a8a47..4e23ab92c036 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -34,8 +28,6 @@ import org.openapitools.client.model.ComplexQuadrilateral; import org.openapitools.client.model.SimpleQuadrilateral; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -99,22 +91,6 @@ public QuadrilateralDeserializer(Class vc) { public Quadrilateral deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { JsonNode tree = ctxt.readTree(jp); Object deserialized = null; - Quadrilateral newQuadrilateral = new Quadrilateral(); - Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); - String discriminatorValue = (String)result2.get("quadrilateralType"); - switch (discriminatorValue) { - case "ComplexQuadrilateral": - deserialized = tree.traverse(jp.getCodec()).readValueAs(ComplexQuadrilateral.class); - newQuadrilateral.setActualInstance(deserialized); - return newQuadrilateral; - case "SimpleQuadrilateral": - deserialized = tree.traverse(jp.getCodec()).readValueAs(SimpleQuadrilateral.class); - newQuadrilateral.setActualInstance(deserialized); - return newQuadrilateral; - default: - log.log(Level.WARNING, String.format(java.util.Locale.ROOT, "Failed to lookup discriminator value `%s` for Quadrilateral. Possible values: ComplexQuadrilateral SimpleQuadrilateral", discriminatorValue)); - } - boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; JsonToken token = tree.traverse(jp.getCodec()).nextToken(); @@ -173,56 +149,7 @@ public Quadrilateral getNullValue(DeserializationContext ctxt) throws JsonMappin public Quadrilateral() { super("oneOf", Boolean.FALSE); } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public Quadrilateral putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - /** - * Return true if this Quadrilateral object is equal to o. - */ - @Override - public boolean equals(Object o) { - return super.equals(o) && Objects.equals(this.additionalProperties, ((Quadrilateral)o).additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); - } public Quadrilateral(SimpleQuadrilateral o) { super("oneOf", Boolean.FALSE); setActualInstance(o); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java index a2a89a484fa5..688d3ee7e161 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -55,8 +51,6 @@ public QuadrilateralInterface quadrilateralType(@jakarta.annotation.Nonnull Stri * @return quadrilateralType */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -77,12 +71,19 @@ public void setQuadrilateralType(@jakarta.annotation.Nonnull String quadrilatera */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QuadrilateralInterface quadrilateralInterface = (QuadrilateralInterface) o; + return Objects.equals(this.quadrilateralType, quadrilateralInterface.quadrilateralType); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(quadrilateralType); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 806041d468e4..f277c0153703 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -63,7 +59,6 @@ public ReadOnlyFirst( * @return bar */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_BAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -84,7 +79,6 @@ public ReadOnlyFirst baz(@jakarta.annotation.Nullable String baz) { * @return baz */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_BAZ, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -105,12 +99,20 @@ public void setBaz(@jakarta.annotation.Nullable String baz) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; + return Objects.equals(this.bar, readOnlyFirst.bar) && + Objects.equals(this.baz, readOnlyFirst.baz); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(bar, baz); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java index 6d54c432e85d..530ccd181d6a 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -29,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -64,8 +56,6 @@ public ScaleneTriangle shapeType(@jakarta.annotation.Nonnull String shapeType) { * @return shapeType */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -91,8 +81,6 @@ public ScaleneTriangle triangleType(@jakarta.annotation.Nonnull String triangleT * @return triangleType */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -107,55 +95,26 @@ public void setTriangleType(@jakarta.annotation.Nonnull String triangleType) { this.triangleType = triangleType; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public ScaleneTriangle putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } /** * Return true if this ScaleneTriangle object is equal to o. */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScaleneTriangle scaleneTriangle = (ScaleneTriangle) o; + return Objects.equals(this.shapeType, scaleneTriangle.shapeType) && + Objects.equals(this.triangleType, scaleneTriangle.triangleType); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(shapeType, triangleType); } @Override @@ -164,7 +123,6 @@ public String toString() { sb.append("class ScaleneTriangle {\n"); sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); sb.append(" triangleType: ").append(toIndentedString(triangleType)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Shape.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Shape.java index dedc0fc269df..2b1671eb9115 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Shape.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -34,8 +28,6 @@ import org.openapitools.client.model.Quadrilateral; import org.openapitools.client.model.Triangle; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -99,22 +91,6 @@ public ShapeDeserializer(Class vc) { public Shape deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { JsonNode tree = ctxt.readTree(jp); Object deserialized = null; - Shape newShape = new Shape(); - Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); - String discriminatorValue = (String)result2.get("shapeType"); - switch (discriminatorValue) { - case "Quadrilateral": - deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class); - newShape.setActualInstance(deserialized); - return newShape; - case "Triangle": - deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class); - newShape.setActualInstance(deserialized); - return newShape; - default: - log.log(Level.WARNING, String.format(java.util.Locale.ROOT, "Failed to lookup discriminator value `%s` for Shape. Possible values: Quadrilateral Triangle", discriminatorValue)); - } - boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; JsonToken token = tree.traverse(jp.getCodec()).nextToken(); @@ -173,56 +149,7 @@ public Shape getNullValue(DeserializationContext ctxt) throws JsonMappingExcepti public Shape() { super("oneOf", Boolean.FALSE); } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public Shape putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - /** - * Return true if this Shape object is equal to o. - */ - @Override - public boolean equals(Object o) { - return super.equals(o) && Objects.equals(this.additionalProperties, ((Shape)o).additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); - } public Shape(Triangle o) { super("oneOf", Boolean.FALSE); setActualInstance(o); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeInterface.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeInterface.java index 40b2f50b212c..275fbc6644bf 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeInterface.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeInterface.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -55,8 +51,6 @@ public ShapeInterface shapeType(@jakarta.annotation.Nonnull String shapeType) { * @return shapeType */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -77,12 +71,19 @@ public void setShapeType(@jakarta.annotation.Nonnull String shapeType) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ShapeInterface shapeInterface = (ShapeInterface) o; + return Objects.equals(this.shapeType, shapeInterface.shapeType); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(shapeType); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeOrNull.java index 0f92751d55bd..c7f385c28183 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -34,8 +28,6 @@ import org.openapitools.client.model.Quadrilateral; import org.openapitools.client.model.Triangle; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -99,22 +91,6 @@ public ShapeOrNullDeserializer(Class vc) { public ShapeOrNull deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { JsonNode tree = ctxt.readTree(jp); Object deserialized = null; - ShapeOrNull newShapeOrNull = new ShapeOrNull(); - Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); - String discriminatorValue = (String)result2.get("shapeType"); - switch (discriminatorValue) { - case "Quadrilateral": - deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class); - newShapeOrNull.setActualInstance(deserialized); - return newShapeOrNull; - case "Triangle": - deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class); - newShapeOrNull.setActualInstance(deserialized); - return newShapeOrNull; - default: - log.log(Level.WARNING, String.format(java.util.Locale.ROOT, "Failed to lookup discriminator value `%s` for ShapeOrNull. Possible values: Quadrilateral Triangle", discriminatorValue)); - } - boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; JsonToken token = tree.traverse(jp.getCodec()).nextToken(); @@ -173,56 +149,7 @@ public ShapeOrNull getNullValue(DeserializationContext ctxt) throws JsonMappingE public ShapeOrNull() { super("oneOf", Boolean.TRUE); } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public ShapeOrNull putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - /** - * Return true if this ShapeOrNull object is equal to o. - */ - @Override - public boolean equals(Object o) { - return super.equals(o) && Objects.equals(this.additionalProperties, ((ShapeOrNull)o).additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); - } public ShapeOrNull(Triangle o) { super("oneOf", Boolean.FALSE); setActualInstance(o); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java index d56925add207..ab81d8d4201a 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -29,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -64,8 +56,6 @@ public SimpleQuadrilateral shapeType(@jakarta.annotation.Nonnull String shapeTyp * @return shapeType */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -91,8 +81,6 @@ public SimpleQuadrilateral quadrilateralType(@jakarta.annotation.Nonnull String * @return quadrilateralType */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -107,55 +95,26 @@ public void setQuadrilateralType(@jakarta.annotation.Nonnull String quadrilatera this.quadrilateralType = quadrilateralType; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public SimpleQuadrilateral putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } /** * Return true if this SimpleQuadrilateral object is equal to o. */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SimpleQuadrilateral simpleQuadrilateral = (SimpleQuadrilateral) o; + return Objects.equals(this.shapeType, simpleQuadrilateral.shapeType) && + Objects.equals(this.quadrilateralType, simpleQuadrilateral.quadrilateralType); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(shapeType, quadrilateralType); } @Override @@ -164,7 +123,6 @@ public String toString() { sb.append("class SimpleQuadrilateral {\n"); sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); sb.append(" quadrilateralType: ").append(toIndentedString(quadrilateralType)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SpecialModelName.java index e34277354af2..e1537ebd15b5 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -61,7 +57,6 @@ public SpecialModelName() { * @return $specialPropertyName */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -87,7 +82,6 @@ public SpecialModelName specialModelName(@jakarta.annotation.Nullable String spe * @return specialModelName */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SPECIAL_MODEL_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -108,12 +102,20 @@ public void setSpecialModelName(@jakarta.annotation.Nullable String specialModel */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName) && + Objects.equals(this.specialModelName, specialModelName.specialModelName); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash($specialPropertyName, specialModelName); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java index 82eebe5cffd9..07817e57d16b 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -27,7 +27,7 @@ /** - * A tag for a pet + * Tag */ @JsonPropertyOrder({ Tag.JSON_PROPERTY_ID, diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index 218650c2a1e8..05cdd86840ab 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -29,8 +27,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -60,7 +56,6 @@ public TestInlineFreeformAdditionalPropertiesRequest someProperty(@jakarta.annot * @return someProperty */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SOME_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -118,12 +113,20 @@ public Object getAdditionalProperty(String key) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; + return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty)&& + Objects.equals(this.additionalProperties, testInlineFreeformAdditionalPropertiesRequest.additionalProperties); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(someProperty, additionalProperties); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Triangle.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Triangle.java index 7d2130da4415..db2db396b9f9 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Triangle.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -35,8 +29,6 @@ import org.openapitools.client.model.IsoscelesTriangle; import org.openapitools.client.model.ScaleneTriangle; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -100,26 +92,6 @@ public TriangleDeserializer(Class vc) { public Triangle deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { JsonNode tree = ctxt.readTree(jp); Object deserialized = null; - Triangle newTriangle = new Triangle(); - Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); - String discriminatorValue = (String)result2.get("triangleType"); - switch (discriminatorValue) { - case "EquilateralTriangle": - deserialized = tree.traverse(jp.getCodec()).readValueAs(EquilateralTriangle.class); - newTriangle.setActualInstance(deserialized); - return newTriangle; - case "IsoscelesTriangle": - deserialized = tree.traverse(jp.getCodec()).readValueAs(IsoscelesTriangle.class); - newTriangle.setActualInstance(deserialized); - return newTriangle; - case "ScaleneTriangle": - deserialized = tree.traverse(jp.getCodec()).readValueAs(ScaleneTriangle.class); - newTriangle.setActualInstance(deserialized); - return newTriangle; - default: - log.log(Level.WARNING, String.format(java.util.Locale.ROOT, "Failed to lookup discriminator value `%s` for Triangle. Possible values: EquilateralTriangle IsoscelesTriangle ScaleneTriangle", discriminatorValue)); - } - boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; JsonToken token = tree.traverse(jp.getCodec()).nextToken(); @@ -194,56 +166,7 @@ public Triangle getNullValue(DeserializationContext ctxt) throws JsonMappingExce public Triangle() { super("oneOf", Boolean.FALSE); } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public Triangle putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - /** - * Return true if this Triangle object is equal to o. - */ - @Override - public boolean equals(Object o) { - return super.equals(o) && Objects.equals(this.additionalProperties, ((Triangle)o).additionalProperties); - } - @Override - public int hashCode() { - return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); - } public Triangle(EquilateralTriangle o) { super("oneOf", Boolean.FALSE); setActualInstance(o); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TriangleInterface.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TriangleInterface.java index 3920d3fb5447..c6fc7baab0ee 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TriangleInterface.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TriangleInterface.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -55,8 +51,6 @@ public TriangleInterface triangleType(@jakarta.annotation.Nonnull String triangl * @return triangleType */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -77,12 +71,19 @@ public void setTriangleType(@jakarta.annotation.Nonnull String triangleType) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TriangleInterface triangleInterface = (TriangleInterface) o; + return Objects.equals(this.triangleType, triangleInterface.triangleType); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(triangleType); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java index 3c5ce26a745c..e003616ccee0 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java @@ -1,6 +1,6 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 * @@ -22,12 +22,16 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.openapitools.client.JSON; /** - * A User who is purchasing from the pet store + * User */ @JsonPropertyOrder({ User.JSON_PROPERTY_ID, @@ -37,7 +41,11 @@ User.JSON_PROPERTY_EMAIL, User.JSON_PROPERTY_PASSWORD, User.JSON_PROPERTY_PHONE, - User.JSON_PROPERTY_USER_STATUS + User.JSON_PROPERTY_USER_STATUS, + User.JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS, + User.JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE, + User.JSON_PROPERTY_ANY_TYPE_PROP, + User.JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.22.0-SNAPSHOT") public class User { @@ -73,6 +81,19 @@ public class User { @jakarta.annotation.Nullable private Integer userStatus; + public static final String JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS = "objectWithNoDeclaredProps"; + @jakarta.annotation.Nullable + private Object objectWithNoDeclaredProps; + + public static final String JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE = "objectWithNoDeclaredPropsNullable"; + private JsonNullable objectWithNoDeclaredPropsNullable = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_ANY_TYPE_PROP = "anyTypeProp"; + private JsonNullable anyTypeProp = JsonNullable.of(null); + + public static final String JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE = "anyTypePropNullable"; + private JsonNullable anyTypePropNullable = JsonNullable.of(null); + public User() { } @@ -276,6 +297,130 @@ public void setUserStatus(@jakarta.annotation.Nullable Integer userStatus) { } + public User objectWithNoDeclaredProps(@jakarta.annotation.Nullable Object objectWithNoDeclaredProps) { + this.objectWithNoDeclaredProps = objectWithNoDeclaredProps; + return this; + } + + /** + * test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + * @return objectWithNoDeclaredProps + */ + @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Object getObjectWithNoDeclaredProps() { + return objectWithNoDeclaredProps; + } + + + @JsonProperty(value = JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setObjectWithNoDeclaredProps(@jakarta.annotation.Nullable Object objectWithNoDeclaredProps) { + this.objectWithNoDeclaredProps = objectWithNoDeclaredProps; + } + + + public User objectWithNoDeclaredPropsNullable(@jakarta.annotation.Nullable Object objectWithNoDeclaredPropsNullable) { + this.objectWithNoDeclaredPropsNullable = JsonNullable.of(objectWithNoDeclaredPropsNullable); + return this; + } + + /** + * test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + * @return objectWithNoDeclaredPropsNullable + */ + @jakarta.annotation.Nullable + @JsonIgnore + + public Object getObjectWithNoDeclaredPropsNullable() { + return objectWithNoDeclaredPropsNullable.orElse(null); + } + + @JsonProperty(value = JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getObjectWithNoDeclaredPropsNullable_JsonNullable() { + return objectWithNoDeclaredPropsNullable; + } + + @JsonProperty(JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE) + public void setObjectWithNoDeclaredPropsNullable_JsonNullable(JsonNullable objectWithNoDeclaredPropsNullable) { + this.objectWithNoDeclaredPropsNullable = objectWithNoDeclaredPropsNullable; + } + + public void setObjectWithNoDeclaredPropsNullable(@jakarta.annotation.Nullable Object objectWithNoDeclaredPropsNullable) { + this.objectWithNoDeclaredPropsNullable = JsonNullable.of(objectWithNoDeclaredPropsNullable); + } + + + public User anyTypeProp(@jakarta.annotation.Nullable Object anyTypeProp) { + this.anyTypeProp = JsonNullable.of(anyTypeProp); + return this; + } + + /** + * test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + * @return anyTypeProp + */ + @jakarta.annotation.Nullable + @JsonIgnore + + public Object getAnyTypeProp() { + return anyTypeProp.orElse(null); + } + + @JsonProperty(value = JSON_PROPERTY_ANY_TYPE_PROP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getAnyTypeProp_JsonNullable() { + return anyTypeProp; + } + + @JsonProperty(JSON_PROPERTY_ANY_TYPE_PROP) + public void setAnyTypeProp_JsonNullable(JsonNullable anyTypeProp) { + this.anyTypeProp = anyTypeProp; + } + + public void setAnyTypeProp(@jakarta.annotation.Nullable Object anyTypeProp) { + this.anyTypeProp = JsonNullable.of(anyTypeProp); + } + + + public User anyTypePropNullable(@jakarta.annotation.Nullable Object anyTypePropNullable) { + this.anyTypePropNullable = JsonNullable.of(anyTypePropNullable); + return this; + } + + /** + * test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. + * @return anyTypePropNullable + */ + @jakarta.annotation.Nullable + @JsonIgnore + + public Object getAnyTypePropNullable() { + return anyTypePropNullable.orElse(null); + } + + @JsonProperty(value = JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getAnyTypePropNullable_JsonNullable() { + return anyTypePropNullable; + } + + @JsonProperty(JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE) + public void setAnyTypePropNullable_JsonNullable(JsonNullable anyTypePropNullable) { + this.anyTypePropNullable = anyTypePropNullable; + } + + public void setAnyTypePropNullable(@jakarta.annotation.Nullable Object anyTypePropNullable) { + this.anyTypePropNullable = JsonNullable.of(anyTypePropNullable); + } + + /** * Return true if this User object is equal to o. */ @@ -295,12 +440,27 @@ public boolean equals(Object o) { Objects.equals(this.email, user.email) && Objects.equals(this.password, user.password) && Objects.equals(this.phone, user.phone) && - Objects.equals(this.userStatus, user.userStatus); + Objects.equals(this.userStatus, user.userStatus) && + Objects.equals(this.objectWithNoDeclaredProps, user.objectWithNoDeclaredProps) && + equalsNullable(this.objectWithNoDeclaredPropsNullable, user.objectWithNoDeclaredPropsNullable) && + equalsNullable(this.anyTypeProp, user.anyTypeProp) && + equalsNullable(this.anyTypePropNullable, user.anyTypePropNullable); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus, objectWithNoDeclaredProps, hashCodeNullable(objectWithNoDeclaredPropsNullable), hashCodeNullable(anyTypeProp), hashCodeNullable(anyTypePropNullable)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override @@ -315,6 +475,10 @@ public String toString() { sb.append(" password: ").append(toIndentedString(password)).append("\n"); sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append(" objectWithNoDeclaredProps: ").append(toIndentedString(objectWithNoDeclaredProps)).append("\n"); + sb.append(" objectWithNoDeclaredPropsNullable: ").append(toIndentedString(objectWithNoDeclaredPropsNullable)).append("\n"); + sb.append(" anyTypeProp: ").append(toIndentedString(anyTypeProp)).append("\n"); + sb.append(" anyTypePropNullable: ").append(toIndentedString(anyTypePropNullable)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Whale.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Whale.java index 965b4cd7c5ab..a74efed93661 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Whale.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Whale.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -66,7 +62,6 @@ public Whale hasBaleen(@jakarta.annotation.Nullable Boolean hasBaleen) { * @return hasBaleen */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_HAS_BALEEN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -92,7 +87,6 @@ public Whale hasTeeth(@jakarta.annotation.Nullable Boolean hasTeeth) { * @return hasTeeth */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_HAS_TEETH, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -118,8 +112,6 @@ public Whale className(@jakarta.annotation.Nonnull String className) { * @return className */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -140,12 +132,21 @@ public void setClassName(@jakarta.annotation.Nonnull String className) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Whale whale = (Whale) o; + return Objects.equals(this.hasBaleen, whale.hasBaleen) && + Objects.equals(this.hasTeeth, whale.hasTeeth) && + Objects.equals(this.className, whale.className); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(hasBaleen, hasTeeth, className); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Zebra.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Zebra.java index 209104fdfc82..50e06af9e38f 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Zebra.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Zebra.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -29,8 +27,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -102,7 +98,6 @@ public Zebra type(@jakarta.annotation.Nullable TypeEnum type) { * @return type */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -128,8 +123,6 @@ public Zebra className(@jakarta.annotation.Nonnull String className) { * @return className */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -187,12 +180,21 @@ public Object getAdditionalProperty(String key) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Zebra zebra = (Zebra) o; + return Objects.equals(this.type, zebra.type) && + Objects.equals(this.className, zebra.className)&& + Objects.equals(this.additionalProperties, zebra.additionalProperties); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(type, className, additionalProperties); } @Override From a967b5144899fc744d42a793a212ed4b09a149f3 Mon Sep 17 00:00:00 2001 From: Chhida <44230565+Chhida@users.noreply.github.com> Date: Fri, 17 Apr 2026 19:44:35 +0100 Subject: [PATCH 14/17] feat(jersey3): add error entity deserialization support - Add errorEntity field and getErrorEntity() method to ApiException - Add deserializeErrorEntity() method to ApiClient for error deserialization - Update API methods to pass errorTypes map for automatic error handling - Add unit tests for errorEntity feature --- .../petstore/java/jersey3-oneOf/pom.xml | 20 ----- .../org/openapitools/client/ApiClient.java | 38 +-------- .../org/openapitools/client/ApiException.java | 15 ---- .../openapitools/client/api/DefaultApi.java | 3 +- .../client/petstore/java/jersey3/README.md | 12 +-- .../client/petstore/java/jersey3/build.gradle | 6 +- .../client/petstore/java/jersey3/build.sbt | 3 +- .../petstore/java/jersey3/docs/ArrayTest.md | 2 +- .../petstore/java/jersey3/docs/FakeApi.md | 2 +- .../petstore/java/jersey3/docs/UserApi.md | 4 +- .../petstore/java/jersey3/gradle.properties | 7 ++ samples/client/petstore/java/jersey3/pom.xml | 20 ++--- .../petstore/java/jersey3/settings.gradle | 2 +- .../org/openapitools/client/ApiClient.java | 38 +-------- .../org/openapitools/client/ApiException.java | 15 ---- .../java/org/openapitools/client/JSON.java | 2 +- .../client/api/AnotherFakeApi.java | 6 +- .../openapitools/client/api/DefaultApi.java | 6 +- .../org/openapitools/client/api/FakeApi.java | 64 ++++++--------- .../client/api/FakeClassnameTags123Api.java | 6 +- .../org/openapitools/client/api/PetApi.java | 30 +++----- .../org/openapitools/client/api/StoreApi.java | 15 ++-- .../org/openapitools/client/api/UserApi.java | 35 ++++----- .../model/AdditionalPropertiesClass.java | 31 ++++---- .../client/model/AllOfRefToDouble.java | 16 ++-- .../client/model/AllOfRefToFloat.java | 16 ++-- .../client/model/AllOfRefToLong.java | 16 ++-- .../org/openapitools/client/model/Animal.java | 19 +++-- .../org/openapitools/client/model/Apple.java | 18 ++--- .../openapitools/client/model/AppleReq.java | 19 +++-- .../model/ArrayOfArrayOfNumberOnly.java | 17 ++-- .../client/model/ArrayOfNumberOnly.java | 17 ++-- .../openapitools/client/model/ArrayTest.java | 32 ++++---- .../org/openapitools/client/model/Banana.java | 17 ++-- .../openapitools/client/model/BananaReq.java | 20 ++--- .../openapitools/client/model/BasquePig.java | 17 ++-- .../client/model/Capitalization.java | 26 +++---- .../org/openapitools/client/model/Cat.java | 59 +++++++++++--- .../openapitools/client/model/Category.java | 19 +++-- .../openapitools/client/model/ChildCat.java | 61 ++++++++++++--- .../openapitools/client/model/ClassModel.java | 16 ++-- .../org/openapitools/client/model/Client.java | 16 ++-- .../client/model/ComplexQuadrilateral.java | 62 ++++++++++++--- .../openapitools/client/model/DanishPig.java | 17 ++-- .../client/model/DeprecatedObject.java | 16 ++-- .../org/openapitools/client/model/Dog.java | 59 +++++++++++--- .../openapitools/client/model/Drawing.java | 27 +++---- .../openapitools/client/model/EnumArrays.java | 18 ++--- .../openapitools/client/model/EnumClass.java | 4 + .../openapitools/client/model/EnumTest.java | 37 +++++---- .../client/model/EquilateralTriangle.java | 62 ++++++++++++--- .../client/model/FileSchemaTestClass.java | 28 +++---- .../org/openapitools/client/model/Foo.java | 16 ++-- .../client/model/FooGetDefaultResponse.java | 17 ++-- .../openapitools/client/model/FormatTest.java | 56 ++++++++------ .../org/openapitools/client/model/Fruit.java | 4 + .../openapitools/client/model/FruitReq.java | 4 + .../openapitools/client/model/GmFruit.java | 4 + .../client/model/GrandparentAnimal.java | 17 ++-- .../client/model/HasOnlyReadOnly.java | 18 ++--- .../client/model/HealthCheckResult.java | 16 ++-- .../client/model/IsoscelesTriangle.java | 20 ++--- .../org/openapitools/client/model/Mammal.java | 77 +++++++++++++++++++ .../client/model/MammalAnyof.java | 57 ++++++++++++++ .../openapitools/client/model/MapTest.java | 23 +++--- ...ropertiesAndAdditionalPropertiesClass.java | 23 +++--- .../client/model/Model200Response.java | 18 ++--- .../client/model/ModelApiResponse.java | 20 +++-- .../openapitools/client/model/ModelFile.java | 16 ++-- .../openapitools/client/model/ModelList.java | 16 ++-- .../client/model/ModelReturn.java | 16 ++-- .../org/openapitools/client/model/Name.java | 23 +++--- .../client/model/NullableClass.java | 42 +++++----- .../client/model/NullableShape.java | 73 ++++++++++++++++++ .../openapitools/client/model/NumberOnly.java | 17 ++-- .../model/ObjectWithDeprecatedFields.java | 24 +++--- .../org/openapitools/client/model/Order.java | 27 ++++--- .../client/model/OuterComposite.java | 21 +++-- .../openapitools/client/model/OuterEnum.java | 4 + .../client/model/OuterEnumDefaultValue.java | 4 + .../client/model/OuterEnumInteger.java | 4 + .../model/OuterEnumIntegerDefaultValue.java | 4 + .../openapitools/client/model/ParentPet.java | 56 ++++++++++++-- .../org/openapitools/client/model/Pet.java | 38 ++++----- .../org/openapitools/client/model/Pig.java | 73 ++++++++++++++++++ .../client/model/Quadrilateral.java | 73 ++++++++++++++++++ .../client/model/QuadrilateralInterface.java | 17 ++-- .../client/model/ReadOnlyFirst.java | 18 ++--- .../client/model/ScaleneTriangle.java | 62 ++++++++++++--- .../org/openapitools/client/model/Shape.java | 73 ++++++++++++++++++ .../client/model/ShapeInterface.java | 17 ++-- .../client/model/ShapeOrNull.java | 73 ++++++++++++++++++ .../client/model/SimpleQuadrilateral.java | 62 ++++++++++++--- .../client/model/SpecialModelName.java | 18 ++--- .../org/openapitools/client/model/Tag.java | 18 ++--- ...neFreeformAdditionalPropertiesRequest.java | 17 ++-- .../openapitools/client/model/Triangle.java | 77 +++++++++++++++++++ .../client/model/TriangleInterface.java | 17 ++-- .../org/openapitools/client/model/User.java | 38 +++++---- .../org/openapitools/client/model/Whale.java | 21 +++-- .../org/openapitools/client/model/Zebra.java | 20 +++-- 101 files changed, 1681 insertions(+), 921 deletions(-) diff --git a/samples/client/petstore/java/jersey3-oneOf/pom.xml b/samples/client/petstore/java/jersey3-oneOf/pom.xml index 16bf4f771acc..94aea8af5e82 100644 --- a/samples/client/petstore/java/jersey3-oneOf/pom.xml +++ b/samples/client/petstore/java/jersey3-oneOf/pom.xml @@ -318,24 +318,6 @@ jersey-apache-connector ${jersey-version} - - org.tomitribe - tomitribe-http-signatures - ${http-signature-version} - - - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - provided - - - - org.apache.commons - commons-lang3 - ${commons-lang3-version} - @@ -354,8 +336,6 @@ 0.2.10 2.1.1 3.0.2 - 3.12.0 - 1.8 5.10.0 2.21.0 diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiClient.java index 83834edcf4b2..bbebf6553cd2 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiClient.java @@ -62,7 +62,6 @@ import java.util.Arrays; import java.util.ArrayList; import java.util.Date; -import java.util.Locale; import java.util.stream.Collectors; import java.util.stream.Stream; import java.time.OffsetDateTime; @@ -975,7 +974,6 @@ public File prepareDownloadFile(Response response) throws IOException { * @param authNames The authentications to apply * @param returnType The return type into which to deserialize the response * @param isBodyNullable True if the body is nullable - * @param errorTypes Mapping of error codes to types into which to deserialize the response * @return The response body in type of string * @throws ApiException API exception */ @@ -992,9 +990,7 @@ public ApiResponse invokeAPI( String contentType, String[] authNames, GenericType returnType, - boolean isBodyNullable, - Map errorTypes - ) + boolean isBodyNullable) throws ApiException { String targetURL; @@ -1005,7 +1001,7 @@ public ApiResponse invokeAPI( if (index < 0 || index >= serverConfigurations.size()) { throw new ArrayIndexOutOfBoundsException( String.format( - Locale.ROOT, + java.util.Locale.ROOT, "Invalid index %d when selecting the host settings. Must be less than %d", index, serverConfigurations.size())); } @@ -1092,8 +1088,6 @@ public ApiResponse invokeAPI( String respBody = null; if (response.hasEntity()) { try { - // call bufferEntity, so that a subsequent call to `readEntity` in `deserialize` doesn't fail - response.bufferEntity(); respBody = String.valueOf(response.readEntity(String.class)); message = respBody; } catch (RuntimeException e) { @@ -1101,7 +1095,7 @@ public ApiResponse invokeAPI( } } throw new ApiException( - response.getStatus(), message, buildResponseHeaders(response), respBody, deserializeErrorEntity(errorTypes, response)); + response.getStatus(), message, buildResponseHeaders(response), respBody); } } finally { try { @@ -1112,30 +1106,6 @@ public ApiResponse invokeAPI( } } } - - /** - * Deserialize the response body into an error entity based on HTTP status code. - * Looks up the error type from the errorTypes map using the response status code, - * or falls back to the "default" error type if no match is found. - * - * @param errorTypes Map of status code strings to GenericType for deserialization - * @param response The HTTP response - * @return The deserialized error entity, or null if not found or deserialization fails - */ - private Object deserializeErrorEntity(Map errorTypes, Response response) { - if (errorTypes == null) { - return null; - } - GenericType errorType = errorTypes.get(String.valueOf(response.getStatus())); - if (errorType == null) { - errorType = errorTypes.get("0"); // "0" is the "default" response - } - try { - return deserialize(response, errorType); - } catch (Exception e) { - return null; - } - } protected Response sendRequest(String method, Invocation.Builder invocationBuilder, Entity entity) { Response response; @@ -1162,7 +1132,7 @@ protected Response sendRequest(String method, Invocation.Builder invocationBuild */ @Deprecated public ApiResponse invokeAPI(String path, String method, List queryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String accept, String contentType, String[] authNames, GenericType returnType, boolean isBodyNullable) throws ApiException { - return invokeAPI(null, path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType, isBodyNullable, null/*TODO SME manage*/); + return invokeAPI(null, path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType, isBodyNullable); } /** diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiException.java index ec49f50d4456..21d1a3d7b956 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiException.java @@ -26,7 +26,6 @@ public class ApiException extends Exception { private int code = 0; private Map> responseHeaders = null; private String responseBody = null; - private Object errorEntity = null; public ApiException() {} @@ -68,11 +67,6 @@ public ApiException(int code, String message, Map> response this.responseBody = responseBody; } - public ApiException(int code, String message, Map> responseHeaders, String responseBody, Object errorEntity) { - this(code, message, responseHeaders, responseBody); - this.errorEntity = errorEntity; - } - /** * Get the HTTP status code. * @@ -99,13 +93,4 @@ public Map> getResponseHeaders() { public String getResponseBody() { return responseBody; } - - /** - * Get the deserialized error entity (or null if this error doesn't have a model associated). - * - * @return Deserialized error entity - */ - public Object getErrorEntity() { - return errorEntity; - } } diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/api/DefaultApi.java index 30e535d164ba..77eee862c4d9 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/api/DefaultApi.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -78,9 +78,8 @@ public void rootPost(@jakarta.annotation.Nullable PostRequest postRequest) throw public ApiResponse rootPostWithHttpInfo(@jakarta.annotation.Nullable PostRequest postRequest) throws ApiException { String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); - final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("DefaultApi.rootPost", "/", "POST", new ArrayList<>(), postRequest, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false, localVarErrorTypes); + null, null, false); } } diff --git a/samples/client/petstore/java/jersey3/README.md b/samples/client/petstore/java/jersey3/README.md index e1421b2e789b..0ff5521aaadb 100644 --- a/samples/client/petstore/java/jersey3/README.md +++ b/samples/client/petstore/java/jersey3/README.md @@ -1,4 +1,4 @@ -# openapi-java-client +# petstore-jersey3 OpenAPI Petstore @@ -41,7 +41,7 @@ Add this dependency to your project's POM: ```xml org.openapitools - openapi-java-client + petstore-jersey3 1.0.0 compile @@ -53,12 +53,12 @@ Add this dependency to your project's build file: ```groovy repositories { - mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. - mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. + mavenCentral() // Needed if the 'petstore-jersey3' jar has been published to maven central. + mavenLocal() // Needed if the 'petstore-jersey3' jar has been published to the local maven repo. } dependencies { - implementation "org.openapitools:openapi-java-client:1.0.0" + implementation "org.openapitools:petstore-jersey3:1.0.0" } ``` @@ -72,7 +72,7 @@ mvn clean package Then manually install the following JARs: -- `target/openapi-java-client-1.0.0.jar` +- `target/petstore-jersey3-1.0.0.jar` - `target/lib/*.jar` ## Getting Started diff --git a/samples/client/petstore/java/jersey3/build.gradle b/samples/client/petstore/java/jersey3/build.gradle index 6f430b1f248d..0b26c0545286 100644 --- a/samples/client/petstore/java/jersey3/build.gradle +++ b/samples/client/petstore/java/jersey3/build.gradle @@ -84,7 +84,7 @@ if(hasProperty('target') && target == 'android') { publishing { publications { maven(MavenPublication) { - artifactId = 'openapi-java-client' + artifactId = 'petstore-jersey3' from components.java } @@ -104,10 +104,12 @@ ext { jackson_databind_version = "2.21.1" jackson_databind_nullable_version = "0.2.10" jakarta_annotation_version = "2.1.0" + bean_validation_version = "3.0.2" jersey_version = "3.0.4" junit_version = "5.8.2" scribejava_apis_version = "8.3.1" tomitribe_http_signatures_version = "1.7" + commons_lang3_version = "3.17.0" } dependencies { @@ -126,6 +128,8 @@ dependencies { implementation "com.github.scribejava:scribejava-apis:$scribejava_apis_version" implementation "org.tomitribe:tomitribe-http-signatures:$tomitribe_http_signatures_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + implementation "jakarta.validation:jakarta.validation-api:$bean_validation_version" + implementation "org.apache.commons:commons-lang3:$commons_lang3_version" testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" } diff --git a/samples/client/petstore/java/jersey3/build.sbt b/samples/client/petstore/java/jersey3/build.sbt index 57ccccb87052..ef9f97ebb175 100644 --- a/samples/client/petstore/java/jersey3/build.sbt +++ b/samples/client/petstore/java/jersey3/build.sbt @@ -1,7 +1,7 @@ lazy val root = (project in file(".")). settings( organization := "org.openapitools", - name := "openapi-java-client", + name := "petstore-jersey3", version := "1.0.0", scalaVersion := "2.11.12", scalacOptions ++= Seq("-feature"), @@ -24,6 +24,7 @@ lazy val root = (project in file(".")). "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", "org.tomitribe" % "tomitribe-http-signatures" % "1.7" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "2.1.0" % "compile", + "org.apache.commons" % "commons-lang3" % "3.17.0" % "compile", "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" ) ) diff --git a/samples/client/petstore/java/jersey3/docs/ArrayTest.md b/samples/client/petstore/java/jersey3/docs/ArrayTest.md index 36077c9df300..ae2672809aa9 100644 --- a/samples/client/petstore/java/jersey3/docs/ArrayTest.md +++ b/samples/client/petstore/java/jersey3/docs/ArrayTest.md @@ -9,7 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**arrayOfString** | **List<String>** | | [optional] | |**arrayArrayOfInteger** | **List<List<Long>>** | | [optional] | -|**arrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] | +|**arrayArrayOfModel** | **List<List<@Valid ReadOnlyFirst>>** | | [optional] | diff --git a/samples/client/petstore/java/jersey3/docs/FakeApi.md b/samples/client/petstore/java/jersey3/docs/FakeApi.md index 3816afc1ce7c..7d45cd6a51b8 100644 --- a/samples/client/petstore/java/jersey3/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey3/docs/FakeApi.md @@ -427,7 +427,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); FakeApi apiInstance = new FakeApi(defaultClient); - List requestBody = Arrays.asList(); // List | + List<@Pattern(regexp = "[A-Z0-9]+")String> requestBody = Arrays.asList(); // List<@Pattern(regexp = "[A-Z0-9]+")String> | try { apiInstance.postArrayOfString(requestBody); } catch (ApiException e) { diff --git a/samples/client/petstore/java/jersey3/docs/UserApi.md b/samples/client/petstore/java/jersey3/docs/UserApi.md index 6df604acce37..091549fc7c8f 100644 --- a/samples/client/petstore/java/jersey3/docs/UserApi.md +++ b/samples/client/petstore/java/jersey3/docs/UserApi.md @@ -103,7 +103,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List user = Arrays.asList(); // List | List of user object + List<@Valid User> user = Arrays.asList(); // List<@Valid User> | List of user object try { apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { @@ -167,7 +167,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List user = Arrays.asList(); // List | List of user object + List<@Valid User> user = Arrays.asList(); // List<@Valid User> | List of user object try { apiInstance.createUsersWithListInput(user); } catch (ApiException e) { diff --git a/samples/client/petstore/java/jersey3/gradle.properties b/samples/client/petstore/java/jersey3/gradle.properties index a3408578278a..d3e8e41ba6fb 100644 --- a/samples/client/petstore/java/jersey3/gradle.properties +++ b/samples/client/petstore/java/jersey3/gradle.properties @@ -4,3 +4,10 @@ # Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties # For example, uncomment below to build for Android #target = android + +# JVM arguments +org.gradle.jvmargs=-Xmx2024m -XX:MaxPermSize=512m +# set timeout +org.gradle.daemon.idletimeout=3600000 +# show all warnings +org.gradle.warning.mode=all diff --git a/samples/client/petstore/java/jersey3/pom.xml b/samples/client/petstore/java/jersey3/pom.xml index ba2fa0a780ab..faf628278687 100644 --- a/samples/client/petstore/java/jersey3/pom.xml +++ b/samples/client/petstore/java/jersey3/pom.xml @@ -2,9 +2,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 org.openapitools - openapi-java-client + petstore-jersey3 jar - openapi-java-client + petstore-jersey3 1.0.0 https://github.com/openapitools/openapi-generator OpenAPI Java @@ -317,6 +317,13 @@ scribejava-apis ${scribejava-apis-version} + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + jakarta.annotation jakarta.annotation-api @@ -328,13 +335,6 @@ jersey-apache-connector ${jersey-version} - - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - provided - org.apache.commons @@ -359,10 +359,10 @@ 0.2.10 2.1.1 3.0.2 - 3.12.0 5.10.0 1.8 8.3.3 + 3.17.0 2.21.0 diff --git a/samples/client/petstore/java/jersey3/settings.gradle b/samples/client/petstore/java/jersey3/settings.gradle index 369ba54a9e06..b50c71ae7985 100644 --- a/samples/client/petstore/java/jersey3/settings.gradle +++ b/samples/client/petstore/java/jersey3/settings.gradle @@ -1 +1 @@ -rootProject.name = "openapi-java-client" \ No newline at end of file +rootProject.name = "petstore-jersey3" \ No newline at end of file diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java index 8d0deb2d886b..2d13159dbe2d 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java @@ -63,7 +63,6 @@ import java.util.Arrays; import java.util.ArrayList; import java.util.Date; -import java.util.Locale; import java.util.stream.Collectors; import java.util.stream.Stream; import java.time.OffsetDateTime; @@ -1198,7 +1197,6 @@ public File prepareDownloadFile(Response response) throws IOException { * @param authNames The authentications to apply * @param returnType The return type into which to deserialize the response * @param isBodyNullable True if the body is nullable - * @param errorTypes Mapping of error codes to types into which to deserialize the response * @return The response body in type of string * @throws ApiException API exception */ @@ -1215,9 +1213,7 @@ public ApiResponse invokeAPI( String contentType, String[] authNames, GenericType returnType, - boolean isBodyNullable, - Map errorTypes - ) + boolean isBodyNullable) throws ApiException { String targetURL; @@ -1228,7 +1224,7 @@ public ApiResponse invokeAPI( if (index < 0 || index >= serverConfigurations.size()) { throw new ArrayIndexOutOfBoundsException( String.format( - Locale.ROOT, + java.util.Locale.ROOT, "Invalid index %d when selecting the host settings. Must be less than %d", index, serverConfigurations.size())); } @@ -1331,8 +1327,6 @@ public ApiResponse invokeAPI( String respBody = null; if (response.hasEntity()) { try { - // call bufferEntity, so that a subsequent call to `readEntity` in `deserialize` doesn't fail - response.bufferEntity(); respBody = String.valueOf(response.readEntity(String.class)); message = respBody; } catch (RuntimeException e) { @@ -1340,7 +1334,7 @@ public ApiResponse invokeAPI( } } throw new ApiException( - response.getStatus(), message, buildResponseHeaders(response), respBody, deserializeErrorEntity(errorTypes, response)); + response.getStatus(), message, buildResponseHeaders(response), respBody); } } finally { try { @@ -1351,30 +1345,6 @@ public ApiResponse invokeAPI( } } } - - /** - * Deserialize the response body into an error entity based on HTTP status code. - * Looks up the error type from the errorTypes map using the response status code, - * or falls back to the "default" error type if no match is found. - * - * @param errorTypes Map of status code strings to GenericType for deserialization - * @param response The HTTP response - * @return The deserialized error entity, or null if not found or deserialization fails - */ - private Object deserializeErrorEntity(Map errorTypes, Response response) { - if (errorTypes == null) { - return null; - } - GenericType errorType = errorTypes.get(String.valueOf(response.getStatus())); - if (errorType == null) { - errorType = errorTypes.get("0"); // "0" is the "default" response - } - try { - return deserialize(response, errorType); - } catch (Exception e) { - return null; - } - } protected Response sendRequest(String method, Invocation.Builder invocationBuilder, Entity entity) { Response response; @@ -1401,7 +1371,7 @@ protected Response sendRequest(String method, Invocation.Builder invocationBuild */ @Deprecated public ApiResponse invokeAPI(String path, String method, List queryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String accept, String contentType, String[] authNames, GenericType returnType, boolean isBodyNullable) throws ApiException { - return invokeAPI(null, path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType, isBodyNullable, null/*TODO SME manage*/); + return invokeAPI(null, path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType, isBodyNullable); } /** diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiException.java index 6ac40b5d75c3..70d3b0f5a071 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiException.java @@ -26,7 +26,6 @@ public class ApiException extends Exception { private int code = 0; private Map> responseHeaders = null; private String responseBody = null; - private Object errorEntity = null; public ApiException() {} @@ -68,11 +67,6 @@ public ApiException(int code, String message, Map> response this.responseBody = responseBody; } - public ApiException(int code, String message, Map> responseHeaders, String responseBody, Object errorEntity) { - this(code, message, responseHeaders, responseBody); - this.errorEntity = errorEntity; - } - /** * Get the HTTP status code. * @@ -99,13 +93,4 @@ public Map> getResponseHeaders() { public String getResponseBody() { return responseBody; } - - /** - * Get the deserialized error entity (or null if this error doesn't have a model associated). - * - * @return Deserialized error entity - */ - public Object getErrorEntity() { - return errorEntity; - } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JSON.java index 7136d534da1a..d08e35ad2406 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JSON.java @@ -35,7 +35,7 @@ public JSON() { mapper = JsonMapper.builder() .serializationInclusion(JsonInclude.Include.NON_NULL) .configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false) - .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true) .configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true) .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) .enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 81e46331fd74..315aa5a06d8c 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -10,6 +10,9 @@ import org.openapitools.client.model.Client; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; @@ -84,10 +87,9 @@ public ApiResponse call123testSpecialTagsWithHttpInfo(@jakarta.annotatio String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType("application/json"); - final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("AnotherFakeApi.call123testSpecialTags", "/another-fake/dummy", "PATCH", new ArrayList<>(), client, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false, localVarErrorTypes); + null, localVarReturnType, false); } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/DefaultApi.java index f9c2a8baa065..8e310f45b0ff 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/DefaultApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -10,6 +10,9 @@ import org.openapitools.client.model.FooGetDefaultResponse; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; @@ -77,10 +80,9 @@ public FooGetDefaultResponse fooGet() throws ApiException { public ApiResponse fooGetWithHttpInfo() throws ApiException { String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType(); - final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("DefaultApi.fooGet", "/foo", "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false, localVarErrorTypes); + null, localVarReturnType, false); } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeApi.java index 69ee6b19482b..227bae0f78f2 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeApi.java @@ -20,6 +20,9 @@ import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.client.model.User; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; @@ -87,11 +90,10 @@ public HealthCheckResult fakeHealthGet() throws ApiException { public ApiResponse fakeHealthGetWithHttpInfo() throws ApiException { String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType(); - final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("FakeApi.fakeHealthGet", "/fake/health", "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false, localVarErrorTypes); + null, localVarReturnType, false); } /** * @@ -126,11 +128,10 @@ public Boolean fakeOuterBooleanSerialize(@jakarta.annotation.Nullable Boolean bo public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(@jakarta.annotation.Nullable Boolean body) throws ApiException { String localVarAccept = apiClient.selectHeaderAccept("*/*"); String localVarContentType = apiClient.selectHeaderContentType("application/json"); - final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("FakeApi.fakeOuterBooleanSerialize", "/fake/outer/boolean", "POST", new ArrayList<>(), body, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false, localVarErrorTypes); + null, localVarReturnType, false); } /** * @@ -165,11 +166,10 @@ public OuterComposite fakeOuterCompositeSerialize(@jakarta.annotation.Nullable O public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(@jakarta.annotation.Nullable OuterComposite outerComposite) throws ApiException { String localVarAccept = apiClient.selectHeaderAccept("*/*"); String localVarContentType = apiClient.selectHeaderContentType("application/json"); - final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("FakeApi.fakeOuterCompositeSerialize", "/fake/outer/composite", "POST", new ArrayList<>(), outerComposite, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false, localVarErrorTypes); + null, localVarReturnType, false); } /** * @@ -204,11 +204,10 @@ public BigDecimal fakeOuterNumberSerialize(@jakarta.annotation.Nullable BigDecim public ApiResponse fakeOuterNumberSerializeWithHttpInfo(@jakarta.annotation.Nullable BigDecimal body) throws ApiException { String localVarAccept = apiClient.selectHeaderAccept("*/*"); String localVarContentType = apiClient.selectHeaderContentType("application/json"); - final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("FakeApi.fakeOuterNumberSerialize", "/fake/outer/number", "POST", new ArrayList<>(), body, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false, localVarErrorTypes); + null, localVarReturnType, false); } /** * @@ -243,11 +242,10 @@ public String fakeOuterStringSerialize(@jakarta.annotation.Nullable String body) public ApiResponse fakeOuterStringSerializeWithHttpInfo(@jakarta.annotation.Nullable String body) throws ApiException { String localVarAccept = apiClient.selectHeaderAccept("*/*"); String localVarContentType = apiClient.selectHeaderContentType("application/json"); - final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("FakeApi.fakeOuterStringSerialize", "/fake/outer/string", "POST", new ArrayList<>(), body, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false, localVarErrorTypes); + null, localVarReturnType, false); } /** * Array of Enums @@ -280,11 +278,10 @@ public List getArrayOfEnums() throws ApiException { public ApiResponse> getArrayOfEnumsWithHttpInfo() throws ApiException { String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType(); - final Map localVarErrorTypes = new HashMap(); GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI("FakeApi.getArrayOfEnums", "/fake/array-of-enums", "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false, localVarErrorTypes); + null, localVarReturnType, false); } /** * Array of string @@ -298,7 +295,7 @@ public ApiResponse> getArrayOfEnumsWithHttpInfo() throws ApiExce 200 ok - */ - public void postArrayOfString(@jakarta.annotation.Nullable List requestBody) throws ApiException { + public void postArrayOfString(@jakarta.annotation.Nullable List<@Pattern(regexp = "[A-Z0-9]+")String> requestBody) throws ApiException { postArrayOfStringWithHttpInfo(requestBody); } @@ -315,13 +312,12 @@ public void postArrayOfString(@jakarta.annotation.Nullable List requestB 200 ok - */ - public ApiResponse postArrayOfStringWithHttpInfo(@jakarta.annotation.Nullable List requestBody) throws ApiException { + public ApiResponse postArrayOfStringWithHttpInfo(@jakarta.annotation.Nullable List<@Pattern(regexp = "[A-Z0-9]+")String> requestBody) throws ApiException { String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); - final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.postArrayOfString", "/fake/request-array-string", "POST", new ArrayList<>(), requestBody, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false, localVarErrorTypes); + null, null, false); } /** * test referenced additionalProperties @@ -360,10 +356,9 @@ public ApiResponse testAdditionalPropertiesReferenceWithHttpInfo(@jakarta. String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); - final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testAdditionalPropertiesReference", "/fake/additionalProperties-reference", "POST", new ArrayList<>(), requestBody, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false, localVarErrorTypes); + null, null, false); } /** * @@ -402,10 +397,9 @@ public ApiResponse testBodyWithFileSchemaWithHttpInfo(@jakarta.annotation. String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); - final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testBodyWithFileSchema", "/fake/body-with-file-schema", "PUT", new ArrayList<>(), fileSchemaTestClass, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false, localVarErrorTypes); + null, null, false); } /** * @@ -454,10 +448,9 @@ public ApiResponse testBodyWithQueryParamsWithHttpInfo(@jakarta.annotation String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); - final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testBodyWithQueryParams", "/fake/body-with-query-params", "PUT", localVarQueryParams, user, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false, localVarErrorTypes); + null, null, false); } /** * To test \"client\" model @@ -497,11 +490,10 @@ public ApiResponse testClientModelWithHttpInfo(@jakarta.annotation.Nonnu String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType("application/json"); - final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("FakeApi.testClientModel", "/fake", "PATCH", new ArrayList<>(), client, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false, localVarErrorTypes); + null, localVarReturnType, false); } /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -615,10 +607,9 @@ public ApiResponse testEndpointParametersWithHttpInfo(@jakarta.annotation. String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); String[] localVarAuthNames = new String[] {"http_basic_test"}; - final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testEndpointParameters", "/fake", "POST", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false, localVarErrorTypes); + localVarAuthNames, null, false); } /** * To test enum parameters @@ -694,10 +685,9 @@ public ApiResponse testEnumParametersWithHttpInfo(@jakarta.annotation.Null String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); - final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testEnumParameters", "/fake", "GET", localVarQueryParams, null, localVarHeaderParams, new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, - null, null, false, localVarErrorTypes); + null, null, false); } private ApiResponse testGroupParametersWithHttpInfo(@jakarta.annotation.Nonnull Integer requiredStringGroup, @jakarta.annotation.Nonnull Boolean requiredBooleanGroup, @jakarta.annotation.Nonnull Long requiredInt64Group, @jakarta.annotation.Nullable Integer stringGroup, @jakarta.annotation.Nullable Boolean booleanGroup, @jakarta.annotation.Nullable Long int64Group) throws ApiException { @@ -730,10 +720,9 @@ private ApiResponse testGroupParametersWithHttpInfo(@jakarta.annotation.No String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); String[] localVarAuthNames = new String[] {"bearer_test"}; - final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testGroupParameters", "/fake", "DELETE", localVarQueryParams, null, localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, null, false, localVarErrorTypes); + localVarAuthNames, null, false); } public class APItestGroupParametersRequest { @@ -895,10 +884,9 @@ public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(@jakarta.ann String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); - final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testInlineAdditionalProperties", "/fake/inline-additionalProperties", "POST", new ArrayList<>(), requestBody, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false, localVarErrorTypes); + null, null, false); } /** * test inline free-form additionalProperties @@ -937,10 +925,9 @@ public ApiResponse testInlineFreeformAdditionalPropertiesWithHttpInfo(@jak String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); - final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testInlineFreeformAdditionalProperties", "/fake/inline-freeform-additionalProperties", "POST", new ArrayList<>(), testInlineFreeformAdditionalPropertiesRequest, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false, localVarErrorTypes); + null, null, false); } /** * test json serialization of form data @@ -989,10 +976,9 @@ public ApiResponse testJsonFormDataWithHttpInfo(@jakarta.annotation.Nonnul String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); - final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testJsonFormData", "/fake/jsonFormData", "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, - null, null, false, localVarErrorTypes); + null, null, false); } /** * @@ -1060,10 +1046,9 @@ public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(@jakarta String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); - final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testQueryParameterCollectionFormat", "/fake/test-query-parameters", "PUT", localVarQueryParams, null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false, localVarErrorTypes); + null, null, false); } /** * test referenced string map @@ -1102,9 +1087,8 @@ public ApiResponse testStringMapReferenceWithHttpInfo(@jakarta.annotation. String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); - final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testStringMapReference", "/fake/stringMap-reference", "POST", new ArrayList<>(), requestBody, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false, localVarErrorTypes); + null, null, false); } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 2c42ca2ced74..215ee4d24166 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -10,6 +10,9 @@ import org.openapitools.client.model.Client; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; @@ -85,10 +88,9 @@ public ApiResponse testClassnameWithHttpInfo(@jakarta.annotation.Nonnull String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType("application/json"); String[] localVarAuthNames = new String[] {"api_key_query"}; - final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("FakeClassnameTags123Api.testClassname", "/fake_classname_test", "PATCH", new ArrayList<>(), client, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false, localVarErrorTypes); + localVarAuthNames, localVarReturnType, false); } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/PetApi.java index c5603bb9ef84..21eea42ee48b 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/PetApi.java @@ -12,6 +12,9 @@ import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; @@ -86,10 +89,9 @@ public ApiResponse addPetWithHttpInfo(@jakarta.annotation.Nonnull Pet pet) String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json", "application/xml"); String[] localVarAuthNames = new String[] {"petstore_auth", "http_signature_test"}; - final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("PetApi.addPet", "/pet", "POST", new ArrayList<>(), pet, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, null, false, localVarErrorTypes); + localVarAuthNames, null, false); } /** * Deletes a pet @@ -141,10 +143,9 @@ public ApiResponse deletePetWithHttpInfo(@jakarta.annotation.Nonnull Long String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); String[] localVarAuthNames = new String[] {"petstore_auth"}; - final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("PetApi.deletePet", localVarPath, "DELETE", new ArrayList<>(), null, localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, null, false, localVarErrorTypes); + localVarAuthNames, null, false); } /** * Finds Pets by status @@ -192,11 +193,10 @@ public ApiResponse> findPetsByStatusWithHttpInfo(@jakarta.annotation.N String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); String[] localVarAuthNames = new String[] {"petstore_auth", "http_signature_test"}; - final Map localVarErrorTypes = new HashMap(); GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI("PetApi.findPetsByStatus", "/pet/findByStatus", "GET", localVarQueryParams, null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false, localVarErrorTypes); + localVarAuthNames, localVarReturnType, false); } /** * Finds Pets by tags @@ -248,11 +248,10 @@ public ApiResponse> findPetsByTagsWithHttpInfo(@jakarta.annotation.Non String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); String[] localVarAuthNames = new String[] {"petstore_auth", "http_signature_test"}; - final Map localVarErrorTypes = new HashMap(); GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI("PetApi.findPetsByTags", "/pet/findByTags", "GET", localVarQueryParams, null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false, localVarErrorTypes); + localVarAuthNames, localVarReturnType, false); } /** * Find pet by ID @@ -301,11 +300,10 @@ public ApiResponse getPetByIdWithHttpInfo(@jakarta.annotation.Nonnull Long String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); String[] localVarAuthNames = new String[] {"api_key"}; - final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("PetApi.getPetById", localVarPath, "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false, localVarErrorTypes); + localVarAuthNames, localVarReturnType, false); } /** * Update an existing pet @@ -349,10 +347,9 @@ public ApiResponse updatePetWithHttpInfo(@jakarta.annotation.Nonnull Pet p String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json", "application/xml"); String[] localVarAuthNames = new String[] {"petstore_auth", "http_signature_test"}; - final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("PetApi.updatePet", "/pet", "PUT", new ArrayList<>(), pet, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, null, false, localVarErrorTypes); + localVarAuthNames, null, false); } /** * Updates a pet in the store with form data @@ -409,10 +406,9 @@ public ApiResponse updatePetWithFormWithHttpInfo(@jakarta.annotation.Nonnu String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); String[] localVarAuthNames = new String[] {"petstore_auth"}; - final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("PetApi.updatePetWithForm", localVarPath, "POST", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false, localVarErrorTypes); + localVarAuthNames, null, false); } /** * uploads an image @@ -470,11 +466,10 @@ public ApiResponse uploadFileWithHttpInfo(@jakarta.annotation. String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType("multipart/form-data"); String[] localVarAuthNames = new String[] {"petstore_auth"}; - final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("PetApi.uploadFile", localVarPath, "POST", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false, localVarErrorTypes); + localVarAuthNames, localVarReturnType, false); } /** * uploads an image (required) @@ -533,10 +528,9 @@ public ApiResponse uploadFileWithRequiredFileWithHttpInfo(@jak String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType("multipart/form-data"); String[] localVarAuthNames = new String[] {"petstore_auth"}; - final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("PetApi.uploadFileWithRequiredFile", localVarPath, "POST", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false, localVarErrorTypes); + localVarAuthNames, localVarReturnType, false); } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java index 43c8f799fff8..696ee2619e0b 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java @@ -10,6 +10,9 @@ import org.openapitools.client.model.Order; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; @@ -89,10 +92,9 @@ public ApiResponse deleteOrderWithHttpInfo(@jakarta.annotation.Nonnull Str String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); - final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("StoreApi.deleteOrder", localVarPath, "DELETE", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false, localVarErrorTypes); + null, null, false); } /** * Returns pet inventories by status @@ -126,11 +128,10 @@ public ApiResponse> getInventoryWithHttpInfo() throws ApiEx String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType(); String[] localVarAuthNames = new String[] {"api_key"}; - final Map localVarErrorTypes = new HashMap(); GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI("StoreApi.getInventory", "/store/inventory", "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false, localVarErrorTypes); + localVarAuthNames, localVarReturnType, false); } /** * Find purchase order by ID @@ -178,11 +179,10 @@ public ApiResponse getOrderByIdWithHttpInfo(@jakarta.annotation.Nonnull L String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); - final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("StoreApi.getOrderById", localVarPath, "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false, localVarErrorTypes); + null, localVarReturnType, false); } /** * Place an order for a pet @@ -224,10 +224,9 @@ public ApiResponse placeOrderWithHttpInfo(@jakarta.annotation.Nonnull Ord String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType("application/json"); - final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("StoreApi.placeOrder", "/store/order", "POST", new ArrayList<>(), order, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false, localVarErrorTypes); + null, localVarReturnType, false); } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java index 10cf03612f4c..e23d2cddac66 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java @@ -11,6 +11,9 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.User; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; @@ -84,10 +87,9 @@ public ApiResponse createUserWithHttpInfo(@jakarta.annotation.Nonnull User String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); - final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.createUser", "/user", "POST", new ArrayList<>(), user, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false, localVarErrorTypes); + null, null, false); } /** * Creates list of users with given input array @@ -101,7 +103,7 @@ public ApiResponse createUserWithHttpInfo(@jakarta.annotation.Nonnull User 0 successful operation - */ - public void createUsersWithArrayInput(@jakarta.annotation.Nonnull List user) throws ApiException { + public void createUsersWithArrayInput(@jakarta.annotation.Nonnull List<@Valid User> user) throws ApiException { createUsersWithArrayInputWithHttpInfo(user); } @@ -118,7 +120,7 @@ public void createUsersWithArrayInput(@jakarta.annotation.Nonnull List use 0 successful operation - */ - public ApiResponse createUsersWithArrayInputWithHttpInfo(@jakarta.annotation.Nonnull List user) throws ApiException { + public ApiResponse createUsersWithArrayInputWithHttpInfo(@jakarta.annotation.Nonnull List<@Valid User> user) throws ApiException { // Check required parameters if (user == null) { throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput"); @@ -126,10 +128,9 @@ public ApiResponse createUsersWithArrayInputWithHttpInfo(@jakarta.annotati String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); - final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.createUsersWithArrayInput", "/user/createWithArray", "POST", new ArrayList<>(), user, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false, localVarErrorTypes); + null, null, false); } /** * Creates list of users with given input array @@ -143,7 +144,7 @@ public ApiResponse createUsersWithArrayInputWithHttpInfo(@jakarta.annotati 0 successful operation - */ - public void createUsersWithListInput(@jakarta.annotation.Nonnull List user) throws ApiException { + public void createUsersWithListInput(@jakarta.annotation.Nonnull List<@Valid User> user) throws ApiException { createUsersWithListInputWithHttpInfo(user); } @@ -160,7 +161,7 @@ public void createUsersWithListInput(@jakarta.annotation.Nonnull List user 0 successful operation - */ - public ApiResponse createUsersWithListInputWithHttpInfo(@jakarta.annotation.Nonnull List user) throws ApiException { + public ApiResponse createUsersWithListInputWithHttpInfo(@jakarta.annotation.Nonnull List<@Valid User> user) throws ApiException { // Check required parameters if (user == null) { throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput"); @@ -168,10 +169,9 @@ public ApiResponse createUsersWithListInputWithHttpInfo(@jakarta.annotatio String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); - final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.createUsersWithListInput", "/user/createWithList", "POST", new ArrayList<>(), user, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false, localVarErrorTypes); + null, null, false); } /** * Delete user @@ -216,10 +216,9 @@ public ApiResponse deleteUserWithHttpInfo(@jakarta.annotation.Nonnull Stri String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); - final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.deleteUser", localVarPath, "DELETE", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false, localVarErrorTypes); + null, null, false); } /** * Get user by user name @@ -267,11 +266,10 @@ public ApiResponse getUserByNameWithHttpInfo(@jakarta.annotation.Nonnull S String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); - final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("UserApi.getUserByName", localVarPath, "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false, localVarErrorTypes); + null, localVarReturnType, false); } /** * Logs user into the system @@ -324,11 +322,10 @@ public ApiResponse loginUserWithHttpInfo(@jakarta.annotation.Nonnull Str String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); - final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("UserApi.loginUser", "/user/login", "GET", localVarQueryParams, null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false, localVarErrorTypes); + null, localVarReturnType, false); } /** * Logs out current logged in user session @@ -360,10 +357,9 @@ public void logoutUser() throws ApiException { public ApiResponse logoutUserWithHttpInfo() throws ApiException { String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); - final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.logoutUser", "/user/logout", "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false, localVarErrorTypes); + null, null, false); } /** * Updated user @@ -413,9 +409,8 @@ public ApiResponse updateUserWithHttpInfo(@jakarta.annotation.Nonnull Stri String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); - final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.updateUser", localVarPath, "PUT", new ArrayList<>(), user, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false, localVarErrorTypes); + null, null, false); } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index d2dda62fbca2..8f963ffe984c 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -29,6 +31,8 @@ import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -99,6 +103,7 @@ public AdditionalPropertiesClass putMapPropertyItem(String key, String mapProper * @return mapProperty */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MAP_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -132,6 +137,8 @@ public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -349,7 +348,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(mapProperty, mapOfMapProperty, hashCodeNullable(anytype1), mapWithUndeclaredPropertiesAnytype1, mapWithUndeclaredPropertiesAnytype2, mapWithUndeclaredPropertiesAnytype3, emptyMap, mapWithUndeclaredPropertiesString); + return HashCodeBuilder.reflectionHashCode(this); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToDouble.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToDouble.java index 2a1ae9517d3d..06a183bab28a 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToDouble.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToDouble.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -51,6 +55,7 @@ public AllOfRefToDouble height(@jakarta.annotation.Nullable Double height) { * @return height */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HEIGHT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -71,19 +76,12 @@ public void setHeight(@jakarta.annotation.Nullable Double height) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AllOfRefToDouble allOfRefToDouble = (AllOfRefToDouble) o; - return Objects.equals(this.height, allOfRefToDouble.height); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(height); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToFloat.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToFloat.java index 409f4b9d48c2..fcd09ee8fba7 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToFloat.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToFloat.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -51,6 +55,7 @@ public AllOfRefToFloat weight(@jakarta.annotation.Nullable Float weight) { * @return weight */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_WEIGHT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -71,19 +76,12 @@ public void setWeight(@jakarta.annotation.Nullable Float weight) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AllOfRefToFloat allOfRefToFloat = (AllOfRefToFloat) o; - return Objects.equals(this.weight, allOfRefToFloat.weight); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(weight); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToLong.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToLong.java index d7867ce60bcf..49f3142993cc 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToLong.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToLong.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -51,6 +55,7 @@ public AllOfRefToLong id(@jakarta.annotation.Nullable Long id) { * @return id */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -71,19 +76,12 @@ public void setId(@jakarta.annotation.Nullable Long id) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AllOfRefToLong allOfRefToLong = (AllOfRefToLong) o; - return Objects.equals(this.id, allOfRefToLong.id); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(id); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Animal.java index ff46c6e1de27..4c5d8da8455b 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Animal.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -26,6 +28,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -69,6 +73,8 @@ public Animal className(@jakarta.annotation.Nonnull String className) { * @return className */ @jakarta.annotation.Nonnull + @NotNull + @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -94,6 +100,7 @@ public Animal color(@jakarta.annotation.Nullable String color) { * @return color */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_COLOR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -114,20 +121,12 @@ public void setColor(@jakarta.annotation.Nullable String color) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Animal animal = (Animal) o; - return Objects.equals(this.className, animal.className) && - Objects.equals(this.color, animal.color); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(className, color); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Apple.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Apple.java index 4a5445b9932e..bde79bb52b47 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Apple.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Apple.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -57,6 +61,7 @@ public Apple cultivar(@jakarta.annotation.Nullable String cultivar) { * @return cultivar */ @jakarta.annotation.Nullable + @Pattern(regexp="^[a-zA-Z\\s]*$") @JsonProperty(value = JSON_PROPERTY_CULTIVAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -82,6 +87,7 @@ public Apple origin(@jakarta.annotation.Nullable String origin) { * @return origin */ @jakarta.annotation.Nullable + @Pattern(regexp="/^[A-Z\\s]*$/i") @JsonProperty(value = JSON_PROPERTY_ORIGIN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,20 +108,12 @@ public void setOrigin(@jakarta.annotation.Nullable String origin) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Apple apple = (Apple) o; - return Objects.equals(this.cultivar, apple.cultivar) && - Objects.equals(this.origin, apple.origin); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(cultivar, origin); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AppleReq.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AppleReq.java index ba85e3fcefec..f93945bf4dd4 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AppleReq.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AppleReq.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -57,6 +61,8 @@ public AppleReq cultivar(@jakarta.annotation.Nonnull String cultivar) { * @return cultivar */ @jakarta.annotation.Nonnull + @NotNull + @JsonProperty(value = JSON_PROPERTY_CULTIVAR, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -82,6 +88,7 @@ public AppleReq mealy(@jakarta.annotation.Nullable Boolean mealy) { * @return mealy */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MEALY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,20 +109,12 @@ public void setMealy(@jakarta.annotation.Nullable Boolean mealy) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AppleReq appleReq = (AppleReq) o; - return Objects.equals(this.cultivar, appleReq.cultivar) && - Objects.equals(this.mealy, appleReq.mealy); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(cultivar, mealy); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 08dffa4a12d1..b0479da02655 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -26,6 +28,8 @@ import java.util.Arrays; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -62,6 +66,8 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr * @return arrayArrayNumber */ @jakarta.annotation.Nullable + @Valid + @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -82,19 +88,12 @@ public void setArrayArrayNumber(@jakarta.annotation.Nullable List arrayNu */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; - return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(arrayNumber); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayTest.java index c97ec69e0138..fdb5acbad989 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -26,6 +28,8 @@ import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -49,7 +53,7 @@ public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; @jakarta.annotation.Nullable - private List> arrayArrayOfModel = new ArrayList<>(); + private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest() { } @@ -72,6 +76,7 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { * @return arrayOfString */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ARRAY_OF_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -105,6 +110,8 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) * @return arrayArrayOfInteger */ @jakarta.annotation.Nullable + @Valid + @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -120,12 +127,12 @@ public void setArrayArrayOfInteger(@jakarta.annotation.Nullable List> } - public ArrayTest arrayArrayOfModel(@jakarta.annotation.Nullable List> arrayArrayOfModel) { + public ArrayTest arrayArrayOfModel(@jakarta.annotation.Nullable List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; return this; } - public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + public ArrayTest addArrayArrayOfModelItem(List<@Valid ReadOnlyFirst> arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { this.arrayArrayOfModel = new ArrayList<>(); } @@ -138,17 +145,19 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI * @return arrayArrayOfModel */ @jakarta.annotation.Nullable + @Valid + @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List> getArrayArrayOfModel() { + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setArrayArrayOfModel(@jakarta.annotation.Nullable List> arrayArrayOfModel) { + public void setArrayArrayOfModel(@jakarta.annotation.Nullable List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } @@ -158,21 +167,12 @@ public void setArrayArrayOfModel(@jakarta.annotation.Nullable List additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public Cat putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } /** * Return true if this Cat object is equal to o. */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && - super.equals(o); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(declawed, super.hashCode()); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -104,6 +142,7 @@ public String toString() { sb.append("class Cat {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Category.java index a5ae86785d81..421d03b37a66 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Category.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -56,6 +60,7 @@ public Category id(@jakarta.annotation.Nullable Long id) { * @return id */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -81,6 +86,8 @@ public Category name(@jakarta.annotation.Nonnull String name) { * @return name */ @jakarta.annotation.Nonnull + @NotNull + @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -101,20 +108,12 @@ public void setName(@jakarta.annotation.Nonnull String name) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Category category = (Category) o; - return Objects.equals(this.id, category.id) && - Objects.equals(this.name, category.name); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(id, name); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ChildCat.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ChildCat.java index 8eed54f4bf96..2fa67b9ecbc7 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ChildCat.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ChildCat.java @@ -13,6 +13,12 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -29,6 +35,8 @@ import java.util.Set; import java.util.HashSet; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -68,6 +76,7 @@ public ChildCat name(@jakarta.annotation.Nullable String name) { * @return name */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -101,6 +110,7 @@ public ChildCat petType(@jakarta.annotation.Nullable String petType) { * @return petType */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PET_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -119,27 +129,55 @@ public void setPetType(@jakarta.annotation.Nullable String petType) { this.petType = petType; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public ChildCat putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } /** * Return true if this ChildCat object is equal to o. */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ChildCat childCat = (ChildCat) o; - return Objects.equals(this.name, childCat.name) && - Objects.equals(this.petType, childCat.petType) && - super.equals(o); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, petType, super.hashCode()); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -149,6 +187,7 @@ public String toString() { sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" petType: ").append(toIndentedString(petType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ClassModel.java index 8693a5882be2..bc166beabb59 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ClassModel.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -51,6 +55,7 @@ public ClassModel propertyClass(@jakarta.annotation.Nullable String propertyClas * @return propertyClass */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PROPERTY_CLASS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -71,19 +76,12 @@ public void setPropertyClass(@jakarta.annotation.Nullable String propertyClass) */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ClassModel classModel = (ClassModel) o; - return Objects.equals(this.propertyClass, classModel.propertyClass); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(propertyClass); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Client.java index bdfb834d467c..236f860787a3 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Client.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -51,6 +55,7 @@ public Client client(@jakarta.annotation.Nullable String client) { * @return client */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CLIENT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -71,19 +76,12 @@ public void setClient(@jakarta.annotation.Nullable String client) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Client client = (Client) o; - return Objects.equals(this.client, client.client); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(client); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java index 6b5a00ae4eb4..dcb9e8af81c0 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java @@ -13,6 +13,12 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +29,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -56,6 +64,8 @@ public ComplexQuadrilateral shapeType(@jakarta.annotation.Nonnull String shapeTy * @return shapeType */ @jakarta.annotation.Nonnull + @NotNull + @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -81,6 +91,8 @@ public ComplexQuadrilateral quadrilateralType(@jakarta.annotation.Nonnull String * @return quadrilateralType */ @jakarta.annotation.Nonnull + @NotNull + @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -95,26 +107,55 @@ public void setQuadrilateralType(@jakarta.annotation.Nonnull String quadrilatera this.quadrilateralType = quadrilateralType; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public ComplexQuadrilateral putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } /** * Return true if this ComplexQuadrilateral object is equal to o. */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ComplexQuadrilateral complexQuadrilateral = (ComplexQuadrilateral) o; - return Objects.equals(this.shapeType, complexQuadrilateral.shapeType) && - Objects.equals(this.quadrilateralType, complexQuadrilateral.quadrilateralType); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(shapeType, quadrilateralType); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -123,6 +164,7 @@ public String toString() { sb.append("class ComplexQuadrilateral {\n"); sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); sb.append(" quadrilateralType: ").append(toIndentedString(quadrilateralType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DanishPig.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DanishPig.java index c1e02bbba79a..dcfe14c45d0e 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DanishPig.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DanishPig.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -51,6 +55,8 @@ public DanishPig className(@jakarta.annotation.Nonnull String className) { * @return className */ @jakarta.annotation.Nonnull + @NotNull + @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -71,19 +77,12 @@ public void setClassName(@jakarta.annotation.Nonnull String className) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DanishPig danishPig = (DanishPig) o; - return Objects.equals(this.className, danishPig.className); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(className); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DeprecatedObject.java index 6201aa7056ba..0b27bb0ee5ed 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -53,6 +57,7 @@ public DeprecatedObject name(@jakarta.annotation.Nullable String name) { * @return name */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -73,19 +78,12 @@ public void setName(@jakarta.annotation.Nullable String name) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DeprecatedObject deprecatedObject = (DeprecatedObject) o; - return Objects.equals(this.name, deprecatedObject.name); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Dog.java index 5b8083f36212..c03044cca8cc 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Dog.java @@ -13,6 +13,12 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -27,6 +33,8 @@ import java.util.Arrays; import org.openapitools.client.model.Animal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -61,6 +69,7 @@ public Dog breed(@jakarta.annotation.Nullable String breed) { * @return breed */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BREED, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -75,26 +84,55 @@ public void setBreed(@jakarta.annotation.Nullable String breed) { this.breed = breed; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public Dog putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } /** * Return true if this Dog object is equal to o. */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && - super.equals(o); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(breed, super.hashCode()); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -103,6 +141,7 @@ public String toString() { sb.append("class Dog {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Drawing.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Drawing.java index 7bb91d138adf..9ef7f0fa4116 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Drawing.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Drawing.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -37,6 +39,8 @@ import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -78,6 +82,8 @@ public Drawing mainShape(@jakarta.annotation.Nullable Shape mainShape) { * @return mainShape */ @jakarta.annotation.Nullable + @Valid + @JsonProperty(value = JSON_PROPERTY_MAIN_SHAPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -103,6 +109,8 @@ public Drawing shapeOrNull(@jakarta.annotation.Nullable ShapeOrNull shapeOrNull) * @return shapeOrNull */ @jakarta.annotation.Nullable + @Valid + @JsonIgnore public ShapeOrNull getShapeOrNull() { @@ -136,6 +144,8 @@ public Drawing nullableShape(@jakarta.annotation.Nullable NullableShape nullable * @return nullableShape */ @jakarta.annotation.Nullable + @Valid + @JsonIgnore public NullableShape getNullableShape() { @@ -177,6 +187,8 @@ public Drawing addShapesItem(Shape shapesItem) { * @return shapes */ @jakarta.annotation.Nullable + @Valid + @JsonProperty(value = JSON_PROPERTY_SHAPES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -234,18 +246,7 @@ public Fruit getAdditionalProperty(String key) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Drawing drawing = (Drawing) o; - return Objects.equals(this.mainShape, drawing.mainShape) && - equalsNullable(this.shapeOrNull, drawing.shapeOrNull) && - equalsNullable(this.nullableShape, drawing.nullableShape) && - Objects.equals(this.shapes, drawing.shapes)&& - Objects.equals(this.additionalProperties, drawing.additionalProperties); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -254,7 +255,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(mainShape, hashCodeNullable(shapeOrNull), hashCodeNullable(nullableShape), shapes, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumArrays.java index 4d5dca83868f..72f8efccb8dd 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,6 +27,8 @@ import java.util.Arrays; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -128,6 +132,7 @@ public EnumArrays justSymbol(@jakarta.annotation.Nullable JustSymbolEnum justSym * @return justSymbol */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_JUST_SYMBOL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -161,6 +166,7 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { * @return arrayEnum */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ARRAY_ENUM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -181,20 +187,12 @@ public void setArrayEnum(@jakarta.annotation.Nullable List arrayE */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumArrays enumArrays = (EnumArrays) o; - return Objects.equals(this.justSymbol, enumArrays.justSymbol) && - Objects.equals(this.arrayEnum, enumArrays.arrayEnum); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(justSymbol, arrayEnum); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumClass.java index 0150ebe31b41..a8d97ff8d03d 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumClass.java @@ -13,10 +13,14 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumTest.java index 509c9f5481a3..fcc40c915885 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumTest.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -31,6 +33,8 @@ import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -278,6 +282,7 @@ public EnumTest enumString(@jakarta.annotation.Nullable EnumStringEnum enumStrin * @return enumString */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENUM_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -303,6 +308,8 @@ public EnumTest enumStringRequired(@jakarta.annotation.Nonnull EnumStringRequire * @return enumStringRequired */ @jakarta.annotation.Nonnull + @NotNull + @JsonProperty(value = JSON_PROPERTY_ENUM_STRING_REQUIRED, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -328,6 +335,7 @@ public EnumTest enumInteger(@jakarta.annotation.Nullable EnumIntegerEnum enumInt * @return enumInteger */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENUM_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -353,6 +361,7 @@ public EnumTest enumIntegerOnly(@jakarta.annotation.Nullable EnumIntegerOnlyEnum * @return enumIntegerOnly */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENUM_INTEGER_ONLY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -378,6 +387,7 @@ public EnumTest enumNumber(@jakarta.annotation.Nullable EnumNumberEnum enumNumbe * @return enumNumber */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENUM_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -403,6 +413,8 @@ public EnumTest outerEnum(@jakarta.annotation.Nullable OuterEnum outerEnum) { * @return outerEnum */ @jakarta.annotation.Nullable + @Valid + @JsonIgnore public OuterEnum getOuterEnum() { @@ -436,6 +448,8 @@ public EnumTest outerEnumInteger(@jakarta.annotation.Nullable OuterEnumInteger o * @return outerEnumInteger */ @jakarta.annotation.Nullable + @Valid + @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -461,6 +475,8 @@ public EnumTest outerEnumDefaultValue(@jakarta.annotation.Nullable OuterEnumDefa * @return outerEnumDefaultValue */ @jakarta.annotation.Nullable + @Valid + @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -486,6 +502,8 @@ public EnumTest outerEnumIntegerDefaultValue(@jakarta.annotation.Nullable OuterE * @return outerEnumIntegerDefaultValue */ @jakarta.annotation.Nullable + @Valid + @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -506,22 +524,7 @@ public void setOuterEnumIntegerDefaultValue(@jakarta.annotation.Nullable OuterEn */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumTest enumTest = (EnumTest) o; - return Objects.equals(this.enumString, enumTest.enumString) && - Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && - Objects.equals(this.enumInteger, enumTest.enumInteger) && - Objects.equals(this.enumIntegerOnly, enumTest.enumIntegerOnly) && - Objects.equals(this.enumNumber, enumTest.enumNumber) && - equalsNullable(this.outerEnum, enumTest.outerEnum) && - Objects.equals(this.outerEnumInteger, enumTest.outerEnumInteger) && - Objects.equals(this.outerEnumDefaultValue, enumTest.outerEnumDefaultValue) && - Objects.equals(this.outerEnumIntegerDefaultValue, enumTest.outerEnumIntegerDefaultValue); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -530,7 +533,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(enumString, enumStringRequired, enumInteger, enumIntegerOnly, enumNumber, hashCodeNullable(outerEnum), outerEnumInteger, outerEnumDefaultValue, outerEnumIntegerDefaultValue); + return HashCodeBuilder.reflectionHashCode(this); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java index 662ade9ad613..597609111f84 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java @@ -13,6 +13,12 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +29,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -56,6 +64,8 @@ public EquilateralTriangle shapeType(@jakarta.annotation.Nonnull String shapeTyp * @return shapeType */ @jakarta.annotation.Nonnull + @NotNull + @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -81,6 +91,8 @@ public EquilateralTriangle triangleType(@jakarta.annotation.Nonnull String trian * @return triangleType */ @jakarta.annotation.Nonnull + @NotNull + @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -95,26 +107,55 @@ public void setTriangleType(@jakarta.annotation.Nonnull String triangleType) { this.triangleType = triangleType; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public EquilateralTriangle putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } /** * Return true if this EquilateralTriangle object is equal to o. */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EquilateralTriangle equilateralTriangle = (EquilateralTriangle) o; - return Objects.equals(this.shapeType, equilateralTriangle.shapeType) && - Objects.equals(this.triangleType, equilateralTriangle.triangleType); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(shapeType, triangleType); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -123,6 +164,7 @@ public String toString() { sb.append("class EquilateralTriangle {\n"); sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); sb.append(" triangleType: ").append(toIndentedString(triangleType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 579b4efa21ed..a67cdded729a 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -26,6 +28,8 @@ import java.util.List; import org.openapitools.client.model.ModelFile; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -44,7 +48,7 @@ public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILES = "files"; @jakarta.annotation.Nullable - private List files = new ArrayList<>(); + private List<@Valid ModelFile> files = new ArrayList<>(); public FileSchemaTestClass() { } @@ -59,6 +63,8 @@ public FileSchemaTestClass _file(@jakarta.annotation.Nullable ModelFile _file) { * @return _file */ @jakarta.annotation.Nullable + @Valid + @JsonProperty(value = JSON_PROPERTY_FILE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -74,7 +80,7 @@ public void setFile(@jakarta.annotation.Nullable ModelFile _file) { } - public FileSchemaTestClass files(@jakarta.annotation.Nullable List files) { + public FileSchemaTestClass files(@jakarta.annotation.Nullable List<@Valid ModelFile> files) { this.files = files; return this; } @@ -92,17 +98,19 @@ public FileSchemaTestClass addFilesItem(ModelFile filesItem) { * @return files */ @jakarta.annotation.Nullable + @Valid + @JsonProperty(value = JSON_PROPERTY_FILES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFiles() { + public List<@Valid ModelFile> getFiles() { return files; } @JsonProperty(value = JSON_PROPERTY_FILES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(@jakarta.annotation.Nullable List files) { + public void setFiles(@jakarta.annotation.Nullable List<@Valid ModelFile> files) { this.files = files; } @@ -112,20 +120,12 @@ public void setFiles(@jakarta.annotation.Nullable List files) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; - return Objects.equals(this._file, fileSchemaTestClass._file) && - Objects.equals(this.files, fileSchemaTestClass.files); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(_file, files); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Foo.java index f3fc062a1da9..aa2b92e4e805 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Foo.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -51,6 +55,7 @@ public Foo bar(@jakarta.annotation.Nullable String bar) { * @return bar */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -71,19 +76,12 @@ public void setBar(@jakarta.annotation.Nullable String bar) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Foo foo = (Foo) o; - return Objects.equals(this.bar, foo.bar); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(bar); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index e216f393a4e9..c490fde0486e 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -24,6 +26,8 @@ import java.util.Arrays; import org.openapitools.client.model.Foo; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -53,6 +57,8 @@ public FooGetDefaultResponse string(@jakarta.annotation.Nullable Foo string) { * @return string */ @jakarta.annotation.Nullable + @Valid + @JsonProperty(value = JSON_PROPERTY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -73,19 +79,12 @@ public void setString(@jakarta.annotation.Nullable Foo string) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FooGetDefaultResponse fooGetDefaultResponse = (FooGetDefaultResponse) o; - return Objects.equals(this.string, fooGetDefaultResponse.string); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(string); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FormatTest.java index 6dbf825a882e..90fea3fd5cdf 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FormatTest.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -28,6 +30,8 @@ import java.util.Arrays; import java.util.UUID; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -134,6 +138,7 @@ public FormatTest integer(@jakarta.annotation.Nullable Integer integer) { * @return integer */ @jakarta.annotation.Nullable + @Min(10) @Max(100) @JsonProperty(value = JSON_PROPERTY_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -161,6 +166,7 @@ public FormatTest int32(@jakarta.annotation.Nullable Integer int32) { * @return int32 */ @jakarta.annotation.Nullable + @Min(20) @Max(200) @JsonProperty(value = JSON_PROPERTY_INT32, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -186,6 +192,7 @@ public FormatTest int64(@jakarta.annotation.Nullable Long int64) { * @return int64 */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_INT64, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -213,6 +220,9 @@ public FormatTest number(@jakarta.annotation.Nonnull BigDecimal number) { * @return number */ @jakarta.annotation.Nonnull + @NotNull + @Valid + @DecimalMin("32.1") @DecimalMax("543.2") @JsonProperty(value = JSON_PROPERTY_NUMBER, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -240,6 +250,7 @@ public FormatTest _float(@jakarta.annotation.Nullable Float _float) { * @return _float */ @jakarta.annotation.Nullable + @DecimalMin("54.3") @DecimalMax("987.6") @JsonProperty(value = JSON_PROPERTY_FLOAT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -267,6 +278,7 @@ public FormatTest _double(@jakarta.annotation.Nullable Double _double) { * @return _double */ @jakarta.annotation.Nullable + @DecimalMin("67.8") @DecimalMax("123.4") @JsonProperty(value = JSON_PROPERTY_DOUBLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -292,6 +304,8 @@ public FormatTest decimal(@jakarta.annotation.Nullable BigDecimal decimal) { * @return decimal */ @jakarta.annotation.Nullable + @Valid + @JsonProperty(value = JSON_PROPERTY_DECIMAL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -317,6 +331,7 @@ public FormatTest string(@jakarta.annotation.Nullable String string) { * @return string */ @jakarta.annotation.Nullable + @Pattern(regexp="/[a-z]/i") @JsonProperty(value = JSON_PROPERTY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -342,6 +357,8 @@ public FormatTest _byte(@jakarta.annotation.Nonnull byte[] _byte) { * @return _byte */ @jakarta.annotation.Nonnull + @NotNull + @JsonProperty(value = JSON_PROPERTY_BYTE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -367,6 +384,8 @@ public FormatTest binary(@jakarta.annotation.Nullable File binary) { * @return binary */ @jakarta.annotation.Nullable + @Valid + @JsonProperty(value = JSON_PROPERTY_BINARY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -392,6 +411,9 @@ public FormatTest date(@jakarta.annotation.Nonnull LocalDate date) { * @return date */ @jakarta.annotation.Nonnull + @NotNull + @Valid + @JsonProperty(value = JSON_PROPERTY_DATE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -417,6 +439,8 @@ public FormatTest dateTime(@jakarta.annotation.Nullable OffsetDateTime dateTime) * @return dateTime */ @jakarta.annotation.Nullable + @Valid + @JsonProperty(value = JSON_PROPERTY_DATE_TIME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -442,6 +466,8 @@ public FormatTest uuid(@jakarta.annotation.Nullable UUID uuid) { * @return uuid */ @jakarta.annotation.Nullable + @Valid + @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -467,6 +493,8 @@ public FormatTest password(@jakarta.annotation.Nonnull String password) { * @return password */ @jakarta.annotation.Nonnull + @NotNull + @Size(min=10,max=64) @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -492,6 +520,7 @@ public FormatTest patternWithDigits(@jakarta.annotation.Nullable String patternW * @return patternWithDigits */ @jakarta.annotation.Nullable + @Pattern(regexp="^\\d{10}$") @JsonProperty(value = JSON_PROPERTY_PATTERN_WITH_DIGITS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -517,6 +546,7 @@ public FormatTest patternWithDigitsAndDelimiter(@jakarta.annotation.Nullable Str * @return patternWithDigitsAndDelimiter */ @jakarta.annotation.Nullable + @Pattern(regexp="/^image_\\d{1,3}$/i") @JsonProperty(value = JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -537,34 +567,12 @@ public void setPatternWithDigitsAndDelimiter(@jakarta.annotation.Nullable String */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FormatTest formatTest = (FormatTest) o; - return Objects.equals(this.integer, formatTest.integer) && - Objects.equals(this.int32, formatTest.int32) && - Objects.equals(this.int64, formatTest.int64) && - Objects.equals(this.number, formatTest.number) && - Objects.equals(this._float, formatTest._float) && - Objects.equals(this._double, formatTest._double) && - Objects.equals(this.decimal, formatTest.decimal) && - Objects.equals(this.string, formatTest.string) && - Arrays.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && - Objects.equals(this.date, formatTest.date) && - Objects.equals(this.dateTime, formatTest.dateTime) && - Objects.equals(this.uuid, formatTest.uuid) && - Objects.equals(this.password, formatTest.password) && - Objects.equals(this.patternWithDigits, formatTest.patternWithDigits) && - Objects.equals(this.patternWithDigitsAndDelimiter, formatTest.patternWithDigitsAndDelimiter); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, decimal, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, patternWithDigits, patternWithDigitsAndDelimiter); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Fruit.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Fruit.java index 3bf4681b7c3b..c8849fe3a11f 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Fruit.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -26,6 +28,8 @@ import org.openapitools.client.model.Apple; import org.openapitools.client.model.Banana; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FruitReq.java index c7b5a4f590da..fdea804b7b23 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FruitReq.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -26,6 +28,8 @@ import org.openapitools.client.model.AppleReq; import org.openapitools.client.model.BananaReq; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java index c6567bd814d7..93954725a450 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -26,6 +28,8 @@ import org.openapitools.client.model.Apple; import org.openapitools.client.model.Banana; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java index b221d2acb7ca..bb272cde7d6e 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -26,6 +28,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -64,6 +68,8 @@ public GrandparentAnimal petType(@jakarta.annotation.Nonnull String petType) { * @return petType */ @jakarta.annotation.Nonnull + @NotNull + @JsonProperty(value = JSON_PROPERTY_PET_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -84,19 +90,12 @@ public void setPetType(@jakarta.annotation.Nonnull String petType) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GrandparentAnimal grandparentAnimal = (GrandparentAnimal) o; - return Objects.equals(this.petType, grandparentAnimal.petType); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(petType); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 391848b281b4..65d4a06592c9 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -62,6 +66,7 @@ public HasOnlyReadOnly( * @return bar */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -77,6 +82,7 @@ public String getBar() { * @return foo */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FOO, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -92,20 +98,12 @@ public String getFoo() { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; - return Objects.equals(this.bar, hasOnlyReadOnly.bar) && - Objects.equals(this.foo, hasOnlyReadOnly.foo); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(bar, foo); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HealthCheckResult.java index db1ea005cbb2..d03284e7a21e 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -27,6 +29,8 @@ import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -54,6 +58,7 @@ public HealthCheckResult nullableMessage(@jakarta.annotation.Nullable String nul * @return nullableMessage */ @jakarta.annotation.Nullable + @JsonIgnore public String getNullableMessage() { @@ -82,14 +87,7 @@ public void setNullableMessage(@jakarta.annotation.Nullable String nullableMessa */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HealthCheckResult healthCheckResult = (HealthCheckResult) o; - return equalsNullable(this.nullableMessage, healthCheckResult.nullableMessage); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -98,7 +96,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(hashCodeNullable(nullableMessage)); + return HashCodeBuilder.reflectionHashCode(this); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java index fa712f06f261..571e606d968b 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -56,6 +60,8 @@ public IsoscelesTriangle shapeType(@jakarta.annotation.Nonnull String shapeType) * @return shapeType */ @jakarta.annotation.Nonnull + @NotNull + @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -81,6 +87,8 @@ public IsoscelesTriangle triangleType(@jakarta.annotation.Nonnull String triangl * @return triangleType */ @jakarta.annotation.Nonnull + @NotNull + @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -101,20 +109,12 @@ public void setTriangleType(@jakarta.annotation.Nonnull String triangleType) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IsoscelesTriangle isoscelesTriangle = (IsoscelesTriangle) o; - return Objects.equals(this.shapeType, isoscelesTriangle.shapeType) && - Objects.equals(this.triangleType, isoscelesTriangle.triangleType); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(shapeType, triangleType); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Mammal.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Mammal.java index 07f6206606d4..25de7885e9b3 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Mammal.java @@ -13,6 +13,12 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -29,6 +35,8 @@ import org.openapitools.client.model.Whale; import org.openapitools.client.model.Zebra; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -92,6 +100,26 @@ public MammalDeserializer(Class vc) { public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { JsonNode tree = ctxt.readTree(jp); Object deserialized = null; + Mammal newMammal = new Mammal(); + Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); + String discriminatorValue = (String)result2.get("className"); + switch (discriminatorValue) { + case "Pig": + deserialized = tree.traverse(jp.getCodec()).readValueAs(Pig.class); + newMammal.setActualInstance(deserialized); + return newMammal; + case "whale": + deserialized = tree.traverse(jp.getCodec()).readValueAs(Whale.class); + newMammal.setActualInstance(deserialized); + return newMammal; + case "zebra": + deserialized = tree.traverse(jp.getCodec()).readValueAs(Zebra.class); + newMammal.setActualInstance(deserialized); + return newMammal; + default: + log.log(Level.WARNING, String.format(java.util.Locale.ROOT, "Failed to lookup discriminator value `%s` for Mammal. Possible values: Pig whale zebra", discriminatorValue)); + } + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; JsonToken token = tree.traverse(jp.getCodec()).nextToken(); @@ -166,7 +194,56 @@ public Mammal getNullValue(DeserializationContext ctxt) throws JsonMappingExcept public Mammal() { super("oneOf", Boolean.FALSE); } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public Mammal putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this mammal object is equal to o. + */ + @Override + public boolean equals(Object o) { + return super.equals(o) && Objects.equals(this.additionalProperties, ((Mammal)o).additionalProperties); + } + @Override + public int hashCode() { + return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); + } public Mammal(Whale o) { super("oneOf", Boolean.FALSE); setActualInstance(o); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MammalAnyof.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MammalAnyof.java index e97298aa75bb..f65a02a0ed03 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MammalAnyof.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MammalAnyof.java @@ -13,6 +13,12 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -29,6 +35,8 @@ import org.openapitools.client.model.Whale; import org.openapitools.client.model.Zebra; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -151,7 +159,56 @@ public MammalAnyof getNullValue(DeserializationContext ctxt) throws JsonMappingE public MammalAnyof() { super("anyOf", Boolean.FALSE); } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public MammalAnyof putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + /** + * Return true if this mammal_anyof object is equal to o. + */ + @Override + public boolean equals(Object o) { + return super.equals(o) && Objects.equals(this.additionalProperties, ((MammalAnyof)o).additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); + } public MammalAnyof(Whale o) { super("anyOf", Boolean.FALSE); setActualInstance(o); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MapTest.java index dfb9497f0353..2b24222db2e9 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MapTest.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,6 +27,8 @@ import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -111,6 +115,8 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr * @return mapMapOfString */ @jakarta.annotation.Nullable + @Valid + @JsonProperty(value = JSON_PROPERTY_MAP_MAP_OF_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -144,6 +150,7 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) * @return mapOfEnumString */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MAP_OF_ENUM_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -177,6 +184,7 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { * @return directMap */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DIRECT_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -210,6 +218,7 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { * @return indirectMap */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_INDIRECT_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -230,22 +239,12 @@ public void setIndirectMap(@jakarta.annotation.Nullable Map ind */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MapTest mapTest = (MapTest) o; - return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && - Objects.equals(this.directMap, mapTest.directMap) && - Objects.equals(this.indirectMap, mapTest.indirectMap); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 719ca8e7ef3a..8565aa43bdf5 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -28,6 +30,8 @@ import java.util.UUID; import org.openapitools.client.model.Animal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -66,6 +70,8 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(@jakarta.annotation.Null * @return uuid */ @jakarta.annotation.Nullable + @Valid + @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -91,6 +97,8 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(@jakarta.annotation. * @return dateTime */ @jakarta.annotation.Nullable + @Valid + @JsonProperty(value = JSON_PROPERTY_DATE_TIME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -124,6 +132,8 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * @return map */ @jakarta.annotation.Nullable + @Valid + @JsonProperty(value = JSON_PROPERTY_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -144,21 +154,12 @@ public void setMap(@jakarta.annotation.Nullable Map map) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; - return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && - Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && - Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(uuid, dateTime, map); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Model200Response.java index 4aa9b96ddb19..21f893609303 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Model200Response.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -57,6 +61,7 @@ public Model200Response name(@jakarta.annotation.Nullable Integer name) { * @return name */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -82,6 +87,7 @@ public Model200Response propertyClass(@jakarta.annotation.Nullable String proper * @return propertyClass */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PROPERTY_CLASS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,20 +108,12 @@ public void setPropertyClass(@jakarta.annotation.Nullable String propertyClass) */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Model200Response _200response = (Model200Response) o; - return Objects.equals(this.name, _200response.name) && - Objects.equals(this.propertyClass, _200response.propertyClass); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, propertyClass); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 13d502025a50..dc90edbd32a3 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -62,6 +66,7 @@ public ModelApiResponse code(@jakarta.annotation.Nullable Integer code) { * @return code */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CODE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -87,6 +92,7 @@ public ModelApiResponse type(@jakarta.annotation.Nullable String type) { * @return type */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -112,6 +118,7 @@ public ModelApiResponse message(@jakarta.annotation.Nullable String message) { * @return message */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -132,21 +139,12 @@ public void setMessage(@jakarta.annotation.Nullable String message) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(this.code, _apiResponse.code) && - Objects.equals(this.type, _apiResponse.type) && - Objects.equals(this.message, _apiResponse.message); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(code, type, message); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelFile.java index cfd98539ff7b..8d72f2cea260 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelFile.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -52,6 +56,7 @@ public ModelFile sourceURI(@jakarta.annotation.Nullable String sourceURI) { * @return sourceURI */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SOURCE_U_R_I, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,19 +77,12 @@ public void setSourceURI(@jakarta.annotation.Nullable String sourceURI) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelFile _file = (ModelFile) o; - return Objects.equals(this.sourceURI, _file.sourceURI); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(sourceURI); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelList.java index e3e79bdacdad..3548ff1c07eb 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelList.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -52,6 +56,7 @@ public ModelList _123list(@jakarta.annotation.Nullable String _123list) { * @return _123list */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_123LIST, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,19 +77,12 @@ public void set123list(@jakarta.annotation.Nullable String _123list) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelList _list = (ModelList) o; - return Objects.equals(this._123list, _list._123list); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(_123list); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelReturn.java index 2c074bd3a0b0..4ad10dc0a037 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -52,6 +56,7 @@ public ModelReturn _return(@jakarta.annotation.Nullable Integer _return) { * @return _return */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RETURN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,19 +77,12 @@ public void setReturn(@jakarta.annotation.Nullable Integer _return) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelReturn _return = (ModelReturn) o; - return Objects.equals(this._return, _return._return); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(_return); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Name.java index cc1f0253f8ea..e70b16384063 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Name.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -76,6 +80,8 @@ public Name name(@jakarta.annotation.Nonnull Integer name) { * @return name */ @jakarta.annotation.Nonnull + @NotNull + @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -96,6 +102,7 @@ public void setName(@jakarta.annotation.Nonnull Integer name) { * @return snakeCase */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SNAKE_CASE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -116,6 +123,7 @@ public Name property(@jakarta.annotation.Nullable String property) { * @return property */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -136,6 +144,7 @@ public void setProperty(@jakarta.annotation.Nullable String property) { * @return _123number */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_123NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -151,22 +160,12 @@ public Integer get123number() { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Name name = (Name) o; - return Objects.equals(this.name, name.name) && - Objects.equals(this.snakeCase, name.snakeCase) && - Objects.equals(this.property, name.property) && - Objects.equals(this._123number, name._123number); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, snakeCase, property, _123number); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableClass.java index dc8b80a2a03c..60cb4a0740be 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableClass.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -38,6 +40,8 @@ import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -111,6 +115,7 @@ public NullableClass integerProp(@jakarta.annotation.Nullable Integer integerPro * @return integerProp */ @jakarta.annotation.Nullable + @JsonIgnore public Integer getIntegerProp() { @@ -144,6 +149,8 @@ public NullableClass numberProp(@jakarta.annotation.Nullable BigDecimal numberPr * @return numberProp */ @jakarta.annotation.Nullable + @Valid + @JsonIgnore public BigDecimal getNumberProp() { @@ -177,6 +184,7 @@ public NullableClass booleanProp(@jakarta.annotation.Nullable Boolean booleanPro * @return booleanProp */ @jakarta.annotation.Nullable + @JsonIgnore public Boolean getBooleanProp() { @@ -210,6 +218,7 @@ public NullableClass stringProp(@jakarta.annotation.Nullable String stringProp) * @return stringProp */ @jakarta.annotation.Nullable + @JsonIgnore public String getStringProp() { @@ -243,6 +252,8 @@ public NullableClass dateProp(@jakarta.annotation.Nullable LocalDate dateProp) { * @return dateProp */ @jakarta.annotation.Nullable + @Valid + @JsonIgnore public LocalDate getDateProp() { @@ -276,6 +287,8 @@ public NullableClass datetimeProp(@jakarta.annotation.Nullable OffsetDateTime da * @return datetimeProp */ @jakarta.annotation.Nullable + @Valid + @JsonIgnore public OffsetDateTime getDatetimeProp() { @@ -321,6 +334,7 @@ public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) { * @return arrayNullableProp */ @jakarta.annotation.Nullable + @JsonIgnore public List getArrayNullableProp() { @@ -366,6 +380,7 @@ public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullab * @return arrayAndItemsNullableProp */ @jakarta.annotation.Nullable + @JsonIgnore public List getArrayAndItemsNullableProp() { @@ -407,6 +422,7 @@ public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) { * @return arrayItemsNullable */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ARRAY_ITEMS_NULLABLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -444,6 +460,7 @@ public NullableClass putObjectNullablePropItem(String key, Object objectNullable * @return objectNullableProp */ @jakarta.annotation.Nullable + @JsonIgnore public Map getObjectNullableProp() { @@ -489,6 +506,7 @@ public NullableClass putObjectAndItemsNullablePropItem(String key, Object object * @return objectAndItemsNullableProp */ @jakarta.annotation.Nullable + @JsonIgnore public Map getObjectAndItemsNullableProp() { @@ -530,6 +548,7 @@ public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNu * @return objectItemsNullable */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_OBJECT_ITEMS_NULLABLE, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -587,26 +606,7 @@ public Object getAdditionalProperty(String key) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - NullableClass nullableClass = (NullableClass) o; - return equalsNullable(this.integerProp, nullableClass.integerProp) && - equalsNullable(this.numberProp, nullableClass.numberProp) && - equalsNullable(this.booleanProp, nullableClass.booleanProp) && - equalsNullable(this.stringProp, nullableClass.stringProp) && - equalsNullable(this.dateProp, nullableClass.dateProp) && - equalsNullable(this.datetimeProp, nullableClass.datetimeProp) && - equalsNullable(this.arrayNullableProp, nullableClass.arrayNullableProp) && - equalsNullable(this.arrayAndItemsNullableProp, nullableClass.arrayAndItemsNullableProp) && - Objects.equals(this.arrayItemsNullable, nullableClass.arrayItemsNullable) && - equalsNullable(this.objectNullableProp, nullableClass.objectNullableProp) && - equalsNullable(this.objectAndItemsNullableProp, nullableClass.objectAndItemsNullableProp) && - Objects.equals(this.objectItemsNullable, nullableClass.objectItemsNullable)&& - Objects.equals(this.additionalProperties, nullableClass.additionalProperties); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -615,7 +615,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(hashCodeNullable(integerProp), hashCodeNullable(numberProp), hashCodeNullable(booleanProp), hashCodeNullable(stringProp), hashCodeNullable(dateProp), hashCodeNullable(datetimeProp), hashCodeNullable(arrayNullableProp), hashCodeNullable(arrayAndItemsNullableProp), arrayItemsNullable, hashCodeNullable(objectNullableProp), hashCodeNullable(objectAndItemsNullableProp), objectItemsNullable, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableShape.java index 3a76d17e8872..f37075699d82 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableShape.java @@ -13,6 +13,12 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -28,6 +34,8 @@ import org.openapitools.client.model.Quadrilateral; import org.openapitools.client.model.Triangle; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -91,6 +99,22 @@ public NullableShapeDeserializer(Class vc) { public NullableShape deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { JsonNode tree = ctxt.readTree(jp); Object deserialized = null; + NullableShape newNullableShape = new NullableShape(); + Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); + String discriminatorValue = (String)result2.get("shapeType"); + switch (discriminatorValue) { + case "Quadrilateral": + deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class); + newNullableShape.setActualInstance(deserialized); + return newNullableShape; + case "Triangle": + deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class); + newNullableShape.setActualInstance(deserialized); + return newNullableShape; + default: + log.log(Level.WARNING, String.format(java.util.Locale.ROOT, "Failed to lookup discriminator value `%s` for NullableShape. Possible values: Quadrilateral Triangle", discriminatorValue)); + } + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; JsonToken token = tree.traverse(jp.getCodec()).nextToken(); @@ -149,7 +173,56 @@ public NullableShape getNullValue(DeserializationContext ctxt) throws JsonMappin public NullableShape() { super("oneOf", Boolean.TRUE); } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public NullableShape putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + /** + * Return true if this NullableShape object is equal to o. + */ + @Override + public boolean equals(Object o) { + return super.equals(o) && Objects.equals(this.additionalProperties, ((NullableShape)o).additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); + } public NullableShape(Triangle o) { super("oneOf", Boolean.FALSE); setActualInstance(o); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NumberOnly.java index 2f00a1bdf036..366223248587 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -24,6 +26,8 @@ import java.math.BigDecimal; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -52,6 +56,8 @@ public NumberOnly justNumber(@jakarta.annotation.Nullable BigDecimal justNumber) * @return justNumber */ @jakarta.annotation.Nullable + @Valid + @JsonProperty(value = JSON_PROPERTY_JUST_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -72,19 +78,12 @@ public void setJustNumber(@jakarta.annotation.Nullable BigDecimal justNumber) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - NumberOnly numberOnly = (NumberOnly) o; - return Objects.equals(this.justNumber, numberOnly.justNumber); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(justNumber); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index 0494242b4b5d..a999ac4fd377 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -27,6 +29,8 @@ import java.util.List; import org.openapitools.client.model.DeprecatedObject; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -73,6 +77,7 @@ public ObjectWithDeprecatedFields uuid(@jakarta.annotation.Nullable String uuid) * @return uuid */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -101,6 +106,8 @@ public ObjectWithDeprecatedFields id(@jakarta.annotation.Nullable BigDecimal id) */ @Deprecated @jakarta.annotation.Nullable + @Valid + @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -130,6 +137,8 @@ public ObjectWithDeprecatedFields deprecatedRef(@jakarta.annotation.Nullable Dep */ @Deprecated @jakarta.annotation.Nullable + @Valid + @JsonProperty(value = JSON_PROPERTY_DEPRECATED_REF, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -167,6 +176,7 @@ public ObjectWithDeprecatedFields addBarsItem(String barsItem) { */ @Deprecated @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BARS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -188,22 +198,12 @@ public void setBars(@jakarta.annotation.Nullable List bars) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ObjectWithDeprecatedFields objectWithDeprecatedFields = (ObjectWithDeprecatedFields) o; - return Objects.equals(this.uuid, objectWithDeprecatedFields.uuid) && - Objects.equals(this.id, objectWithDeprecatedFields.id) && - Objects.equals(this.deprecatedRef, objectWithDeprecatedFields.deprecatedRef) && - Objects.equals(this.bars, objectWithDeprecatedFields.bars); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(uuid, id, deprecatedRef, bars); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java index 628154f7ef8f..1a8521382d8b 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -24,6 +26,8 @@ import java.time.OffsetDateTime; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -114,6 +118,7 @@ public Order id(@jakarta.annotation.Nullable Long id) { * @return id */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -139,6 +144,7 @@ public Order petId(@jakarta.annotation.Nullable Long petId) { * @return petId */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PET_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -164,6 +170,7 @@ public Order quantity(@jakarta.annotation.Nullable Integer quantity) { * @return quantity */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_QUANTITY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -189,6 +196,8 @@ public Order shipDate(@jakarta.annotation.Nullable OffsetDateTime shipDate) { * @return shipDate */ @jakarta.annotation.Nullable + @Valid + @JsonProperty(value = JSON_PROPERTY_SHIP_DATE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -214,6 +223,7 @@ public Order status(@jakarta.annotation.Nullable StatusEnum status) { * @return status */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -239,6 +249,7 @@ public Order complete(@jakarta.annotation.Nullable Boolean complete) { * @return complete */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_COMPLETE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -259,24 +270,12 @@ public void setComplete(@jakarta.annotation.Nullable Boolean complete) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Order order = (Order) o; - return Objects.equals(this.id, order.id) && - Objects.equals(this.petId, order.petId) && - Objects.equals(this.quantity, order.quantity) && - Objects.equals(this.shipDate, order.shipDate) && - Objects.equals(this.status, order.status) && - Objects.equals(this.complete, order.complete); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(id, petId, quantity, shipDate, status, complete); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterComposite.java index fda5badcecb7..abbab8cdc38d 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -24,6 +26,8 @@ import java.math.BigDecimal; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -62,6 +66,8 @@ public OuterComposite myNumber(@jakarta.annotation.Nullable BigDecimal myNumber) * @return myNumber */ @jakarta.annotation.Nullable + @Valid + @JsonProperty(value = JSON_PROPERTY_MY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -87,6 +93,7 @@ public OuterComposite myString(@jakarta.annotation.Nullable String myString) { * @return myString */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -112,6 +119,7 @@ public OuterComposite myBoolean(@jakarta.annotation.Nullable Boolean myBoolean) * @return myBoolean */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MY_BOOLEAN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -132,21 +140,12 @@ public void setMyBoolean(@jakarta.annotation.Nullable Boolean myBoolean) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OuterComposite outerComposite = (OuterComposite) o; - return Objects.equals(this.myNumber, outerComposite.myNumber) && - Objects.equals(this.myString, outerComposite.myString) && - Objects.equals(this.myBoolean, outerComposite.myBoolean); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(myNumber, myString, myBoolean); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnum.java index d50018b999d5..ff6b4dff8e97 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -13,10 +13,14 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java index 73020e1e3b87..55e81d230056 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java @@ -13,10 +13,14 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumInteger.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumInteger.java index a83925c58695..55c38bd319f2 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumInteger.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumInteger.java @@ -13,10 +13,14 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java index 383ca4227422..b6156de0ce6a 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java @@ -13,10 +13,14 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ParentPet.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ParentPet.java index d69986aadc73..d7f2b66ce113 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ParentPet.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ParentPet.java @@ -13,6 +13,12 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -27,6 +33,8 @@ import java.util.Arrays; import org.openapitools.client.model.GrandparentAnimal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -48,24 +56,55 @@ public class ParentPet extends GrandparentAnimal { public ParentPet() { } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public ParentPet putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } /** * Return true if this ParentPet object is equal to o. */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(super.hashCode()); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -73,6 +112,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ParentPet {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java index 9dcc1af2c993..57bc29549b05 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -27,6 +29,8 @@ import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -61,7 +65,7 @@ public class Pet { public static final String JSON_PROPERTY_TAGS = "tags"; @jakarta.annotation.Nullable - private List tags = new ArrayList<>(); + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -117,6 +121,7 @@ public Pet id(@jakarta.annotation.Nullable Long id) { * @return id */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -142,6 +147,8 @@ public Pet category(@jakarta.annotation.Nullable Category category) { * @return category */ @jakarta.annotation.Nullable + @Valid + @JsonProperty(value = JSON_PROPERTY_CATEGORY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -167,6 +174,8 @@ public Pet name(@jakarta.annotation.Nonnull String name) { * @return name */ @jakarta.annotation.Nonnull + @NotNull + @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -200,6 +209,8 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls */ @jakarta.annotation.Nonnull + @NotNull + @JsonProperty(value = JSON_PROPERTY_PHOTO_URLS, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -215,7 +226,7 @@ public void setPhotoUrls(@jakarta.annotation.Nonnull List photoUrls) { } - public Pet tags(@jakarta.annotation.Nullable List tags) { + public Pet tags(@jakarta.annotation.Nullable List<@Valid Tag> tags) { this.tags = tags; return this; } @@ -233,17 +244,19 @@ public Pet addTagsItem(Tag tagsItem) { * @return tags */ @jakarta.annotation.Nullable + @Valid + @JsonProperty(value = JSON_PROPERTY_TAGS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getTags() { + public List<@Valid Tag> getTags() { return tags; } @JsonProperty(value = JSON_PROPERTY_TAGS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTags(@jakarta.annotation.Nullable List tags) { + public void setTags(@jakarta.annotation.Nullable List<@Valid Tag> tags) { this.tags = tags; } @@ -258,6 +271,7 @@ public Pet status(@jakarta.annotation.Nullable StatusEnum status) { * @return status */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -278,24 +292,12 @@ public void setStatus(@jakarta.annotation.Nullable StatusEnum status) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Pet pet = (Pet) o; - return Objects.equals(this.id, pet.id) && - Objects.equals(this.category, pet.category) && - Objects.equals(this.name, pet.name) && - Objects.equals(this.photoUrls, pet.photoUrls) && - Objects.equals(this.tags, pet.tags) && - Objects.equals(this.status, pet.status); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(id, category, name, photoUrls, tags, status); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pig.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pig.java index ef25a4326b5c..acc3ab45717a 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pig.java @@ -13,6 +13,12 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -28,6 +34,8 @@ import org.openapitools.client.model.BasquePig; import org.openapitools.client.model.DanishPig; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -91,6 +99,22 @@ public PigDeserializer(Class vc) { public Pig deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { JsonNode tree = ctxt.readTree(jp); Object deserialized = null; + Pig newPig = new Pig(); + Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); + String discriminatorValue = (String)result2.get("className"); + switch (discriminatorValue) { + case "BasquePig": + deserialized = tree.traverse(jp.getCodec()).readValueAs(BasquePig.class); + newPig.setActualInstance(deserialized); + return newPig; + case "DanishPig": + deserialized = tree.traverse(jp.getCodec()).readValueAs(DanishPig.class); + newPig.setActualInstance(deserialized); + return newPig; + default: + log.log(Level.WARNING, String.format(java.util.Locale.ROOT, "Failed to lookup discriminator value `%s` for Pig. Possible values: BasquePig DanishPig", discriminatorValue)); + } + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; JsonToken token = tree.traverse(jp.getCodec()).nextToken(); @@ -149,7 +173,56 @@ public Pig getNullValue(DeserializationContext ctxt) throws JsonMappingException public Pig() { super("oneOf", Boolean.FALSE); } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public Pig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + /** + * Return true if this Pig object is equal to o. + */ + @Override + public boolean equals(Object o) { + return super.equals(o) && Objects.equals(this.additionalProperties, ((Pig)o).additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); + } public Pig(BasquePig o) { super("oneOf", Boolean.FALSE); setActualInstance(o); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Quadrilateral.java index 4e23ab92c036..ad90ab7a8a47 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -13,6 +13,12 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -28,6 +34,8 @@ import org.openapitools.client.model.ComplexQuadrilateral; import org.openapitools.client.model.SimpleQuadrilateral; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -91,6 +99,22 @@ public QuadrilateralDeserializer(Class vc) { public Quadrilateral deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { JsonNode tree = ctxt.readTree(jp); Object deserialized = null; + Quadrilateral newQuadrilateral = new Quadrilateral(); + Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); + String discriminatorValue = (String)result2.get("quadrilateralType"); + switch (discriminatorValue) { + case "ComplexQuadrilateral": + deserialized = tree.traverse(jp.getCodec()).readValueAs(ComplexQuadrilateral.class); + newQuadrilateral.setActualInstance(deserialized); + return newQuadrilateral; + case "SimpleQuadrilateral": + deserialized = tree.traverse(jp.getCodec()).readValueAs(SimpleQuadrilateral.class); + newQuadrilateral.setActualInstance(deserialized); + return newQuadrilateral; + default: + log.log(Level.WARNING, String.format(java.util.Locale.ROOT, "Failed to lookup discriminator value `%s` for Quadrilateral. Possible values: ComplexQuadrilateral SimpleQuadrilateral", discriminatorValue)); + } + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; JsonToken token = tree.traverse(jp.getCodec()).nextToken(); @@ -149,7 +173,56 @@ public Quadrilateral getNullValue(DeserializationContext ctxt) throws JsonMappin public Quadrilateral() { super("oneOf", Boolean.FALSE); } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public Quadrilateral putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + /** + * Return true if this Quadrilateral object is equal to o. + */ + @Override + public boolean equals(Object o) { + return super.equals(o) && Objects.equals(this.additionalProperties, ((Quadrilateral)o).additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); + } public Quadrilateral(SimpleQuadrilateral o) { super("oneOf", Boolean.FALSE); setActualInstance(o); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java index 688d3ee7e161..a2a89a484fa5 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -51,6 +55,8 @@ public QuadrilateralInterface quadrilateralType(@jakarta.annotation.Nonnull Stri * @return quadrilateralType */ @jakarta.annotation.Nonnull + @NotNull + @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -71,19 +77,12 @@ public void setQuadrilateralType(@jakarta.annotation.Nonnull String quadrilatera */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - QuadrilateralInterface quadrilateralInterface = (QuadrilateralInterface) o; - return Objects.equals(this.quadrilateralType, quadrilateralInterface.quadrilateralType); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(quadrilateralType); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index f277c0153703..806041d468e4 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -59,6 +63,7 @@ public ReadOnlyFirst( * @return bar */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -79,6 +84,7 @@ public ReadOnlyFirst baz(@jakarta.annotation.Nullable String baz) { * @return baz */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BAZ, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -99,20 +105,12 @@ public void setBaz(@jakarta.annotation.Nullable String baz) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; - return Objects.equals(this.bar, readOnlyFirst.bar) && - Objects.equals(this.baz, readOnlyFirst.baz); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(bar, baz); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java index 530ccd181d6a..6d54c432e85d 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java @@ -13,6 +13,12 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +29,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -56,6 +64,8 @@ public ScaleneTriangle shapeType(@jakarta.annotation.Nonnull String shapeType) { * @return shapeType */ @jakarta.annotation.Nonnull + @NotNull + @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -81,6 +91,8 @@ public ScaleneTriangle triangleType(@jakarta.annotation.Nonnull String triangleT * @return triangleType */ @jakarta.annotation.Nonnull + @NotNull + @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -95,26 +107,55 @@ public void setTriangleType(@jakarta.annotation.Nonnull String triangleType) { this.triangleType = triangleType; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public ScaleneTriangle putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } /** * Return true if this ScaleneTriangle object is equal to o. */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ScaleneTriangle scaleneTriangle = (ScaleneTriangle) o; - return Objects.equals(this.shapeType, scaleneTriangle.shapeType) && - Objects.equals(this.triangleType, scaleneTriangle.triangleType); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(shapeType, triangleType); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -123,6 +164,7 @@ public String toString() { sb.append("class ScaleneTriangle {\n"); sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); sb.append(" triangleType: ").append(toIndentedString(triangleType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Shape.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Shape.java index 2b1671eb9115..dedc0fc269df 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Shape.java @@ -13,6 +13,12 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -28,6 +34,8 @@ import org.openapitools.client.model.Quadrilateral; import org.openapitools.client.model.Triangle; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -91,6 +99,22 @@ public ShapeDeserializer(Class vc) { public Shape deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { JsonNode tree = ctxt.readTree(jp); Object deserialized = null; + Shape newShape = new Shape(); + Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); + String discriminatorValue = (String)result2.get("shapeType"); + switch (discriminatorValue) { + case "Quadrilateral": + deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class); + newShape.setActualInstance(deserialized); + return newShape; + case "Triangle": + deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class); + newShape.setActualInstance(deserialized); + return newShape; + default: + log.log(Level.WARNING, String.format(java.util.Locale.ROOT, "Failed to lookup discriminator value `%s` for Shape. Possible values: Quadrilateral Triangle", discriminatorValue)); + } + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; JsonToken token = tree.traverse(jp.getCodec()).nextToken(); @@ -149,7 +173,56 @@ public Shape getNullValue(DeserializationContext ctxt) throws JsonMappingExcepti public Shape() { super("oneOf", Boolean.FALSE); } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public Shape putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + /** + * Return true if this Shape object is equal to o. + */ + @Override + public boolean equals(Object o) { + return super.equals(o) && Objects.equals(this.additionalProperties, ((Shape)o).additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); + } public Shape(Triangle o) { super("oneOf", Boolean.FALSE); setActualInstance(o); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeInterface.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeInterface.java index 275fbc6644bf..40b2f50b212c 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeInterface.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeInterface.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -51,6 +55,8 @@ public ShapeInterface shapeType(@jakarta.annotation.Nonnull String shapeType) { * @return shapeType */ @jakarta.annotation.Nonnull + @NotNull + @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -71,19 +77,12 @@ public void setShapeType(@jakarta.annotation.Nonnull String shapeType) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ShapeInterface shapeInterface = (ShapeInterface) o; - return Objects.equals(this.shapeType, shapeInterface.shapeType); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(shapeType); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeOrNull.java index c7f385c28183..0f92751d55bd 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -13,6 +13,12 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -28,6 +34,8 @@ import org.openapitools.client.model.Quadrilateral; import org.openapitools.client.model.Triangle; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -91,6 +99,22 @@ public ShapeOrNullDeserializer(Class vc) { public ShapeOrNull deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { JsonNode tree = ctxt.readTree(jp); Object deserialized = null; + ShapeOrNull newShapeOrNull = new ShapeOrNull(); + Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); + String discriminatorValue = (String)result2.get("shapeType"); + switch (discriminatorValue) { + case "Quadrilateral": + deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class); + newShapeOrNull.setActualInstance(deserialized); + return newShapeOrNull; + case "Triangle": + deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class); + newShapeOrNull.setActualInstance(deserialized); + return newShapeOrNull; + default: + log.log(Level.WARNING, String.format(java.util.Locale.ROOT, "Failed to lookup discriminator value `%s` for ShapeOrNull. Possible values: Quadrilateral Triangle", discriminatorValue)); + } + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; JsonToken token = tree.traverse(jp.getCodec()).nextToken(); @@ -149,7 +173,56 @@ public ShapeOrNull getNullValue(DeserializationContext ctxt) throws JsonMappingE public ShapeOrNull() { super("oneOf", Boolean.TRUE); } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public ShapeOrNull putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + /** + * Return true if this ShapeOrNull object is equal to o. + */ + @Override + public boolean equals(Object o) { + return super.equals(o) && Objects.equals(this.additionalProperties, ((ShapeOrNull)o).additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); + } public ShapeOrNull(Triangle o) { super("oneOf", Boolean.FALSE); setActualInstance(o); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java index ab81d8d4201a..d56925add207 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java @@ -13,6 +13,12 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +29,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -56,6 +64,8 @@ public SimpleQuadrilateral shapeType(@jakarta.annotation.Nonnull String shapeTyp * @return shapeType */ @jakarta.annotation.Nonnull + @NotNull + @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -81,6 +91,8 @@ public SimpleQuadrilateral quadrilateralType(@jakarta.annotation.Nonnull String * @return quadrilateralType */ @jakarta.annotation.Nonnull + @NotNull + @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -95,26 +107,55 @@ public void setQuadrilateralType(@jakarta.annotation.Nonnull String quadrilatera this.quadrilateralType = quadrilateralType; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public SimpleQuadrilateral putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } /** * Return true if this SimpleQuadrilateral object is equal to o. */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SimpleQuadrilateral simpleQuadrilateral = (SimpleQuadrilateral) o; - return Objects.equals(this.shapeType, simpleQuadrilateral.shapeType) && - Objects.equals(this.quadrilateralType, simpleQuadrilateral.quadrilateralType); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(shapeType, quadrilateralType); + return HashCodeBuilder.reflectionHashCode(this); } @Override @@ -123,6 +164,7 @@ public String toString() { sb.append("class SimpleQuadrilateral {\n"); sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); sb.append(" quadrilateralType: ").append(toIndentedString(quadrilateralType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SpecialModelName.java index e1537ebd15b5..e34277354af2 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -57,6 +61,7 @@ public SpecialModelName() { * @return $specialPropertyName */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -82,6 +87,7 @@ public SpecialModelName specialModelName(@jakarta.annotation.Nullable String spe * @return specialModelName */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SPECIAL_MODEL_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -102,20 +108,12 @@ public void setSpecialModelName(@jakarta.annotation.Nullable String specialModel */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName) && - Objects.equals(this.specialModelName, specialModelName.specialModelName); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash($specialPropertyName, specialModelName); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java index 07817e57d16b..a81f7ff44082 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -56,6 +60,7 @@ public Tag id(@jakarta.annotation.Nullable Long id) { * @return id */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -81,6 +86,7 @@ public Tag name(@jakarta.annotation.Nullable String name) { * @return name */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -101,20 +107,12 @@ public void setName(@jakarta.annotation.Nullable String name) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Tag tag = (Tag) o; - return Objects.equals(this.id, tag.id) && - Objects.equals(this.name, tag.name); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(id, name); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index 05cdd86840ab..218650c2a1e8 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -27,6 +29,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -56,6 +60,7 @@ public TestInlineFreeformAdditionalPropertiesRequest someProperty(@jakarta.annot * @return someProperty */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SOME_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -113,20 +118,12 @@ public Object getAdditionalProperty(String key) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; - return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty)&& - Objects.equals(this.additionalProperties, testInlineFreeformAdditionalPropertiesRequest.additionalProperties); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(someProperty, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Triangle.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Triangle.java index db2db396b9f9..7d2130da4415 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Triangle.java @@ -13,6 +13,12 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -29,6 +35,8 @@ import org.openapitools.client.model.IsoscelesTriangle; import org.openapitools.client.model.ScaleneTriangle; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -92,6 +100,26 @@ public TriangleDeserializer(Class vc) { public Triangle deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { JsonNode tree = ctxt.readTree(jp); Object deserialized = null; + Triangle newTriangle = new Triangle(); + Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); + String discriminatorValue = (String)result2.get("triangleType"); + switch (discriminatorValue) { + case "EquilateralTriangle": + deserialized = tree.traverse(jp.getCodec()).readValueAs(EquilateralTriangle.class); + newTriangle.setActualInstance(deserialized); + return newTriangle; + case "IsoscelesTriangle": + deserialized = tree.traverse(jp.getCodec()).readValueAs(IsoscelesTriangle.class); + newTriangle.setActualInstance(deserialized); + return newTriangle; + case "ScaleneTriangle": + deserialized = tree.traverse(jp.getCodec()).readValueAs(ScaleneTriangle.class); + newTriangle.setActualInstance(deserialized); + return newTriangle; + default: + log.log(Level.WARNING, String.format(java.util.Locale.ROOT, "Failed to lookup discriminator value `%s` for Triangle. Possible values: EquilateralTriangle IsoscelesTriangle ScaleneTriangle", discriminatorValue)); + } + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; JsonToken token = tree.traverse(jp.getCodec()).nextToken(); @@ -166,7 +194,56 @@ public Triangle getNullValue(DeserializationContext ctxt) throws JsonMappingExce public Triangle() { super("oneOf", Boolean.FALSE); } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public Triangle putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this Triangle object is equal to o. + */ + @Override + public boolean equals(Object o) { + return super.equals(o) && Objects.equals(this.additionalProperties, ((Triangle)o).additionalProperties); + } + @Override + public int hashCode() { + return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); + } public Triangle(EquilateralTriangle o) { super("oneOf", Boolean.FALSE); setActualInstance(o); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TriangleInterface.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TriangleInterface.java index c6fc7baab0ee..3920d3fb5447 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TriangleInterface.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TriangleInterface.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -51,6 +55,8 @@ public TriangleInterface triangleType(@jakarta.annotation.Nonnull String triangl * @return triangleType */ @jakarta.annotation.Nonnull + @NotNull + @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -71,19 +77,12 @@ public void setTriangleType(@jakarta.annotation.Nonnull String triangleType) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TriangleInterface triangleInterface = (TriangleInterface) o; - return Objects.equals(this.triangleType, triangleInterface.triangleType); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(triangleType); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java index e003616ccee0..4702efc203d1 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -27,6 +29,8 @@ import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -107,6 +111,7 @@ public User id(@jakarta.annotation.Nullable Long id) { * @return id */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -132,6 +137,7 @@ public User username(@jakarta.annotation.Nullable String username) { * @return username */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_USERNAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -157,6 +163,7 @@ public User firstName(@jakarta.annotation.Nullable String firstName) { * @return firstName */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FIRST_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -182,6 +189,7 @@ public User lastName(@jakarta.annotation.Nullable String lastName) { * @return lastName */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_LAST_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -207,6 +215,7 @@ public User email(@jakarta.annotation.Nullable String email) { * @return email */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EMAIL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -232,6 +241,7 @@ public User password(@jakarta.annotation.Nullable String password) { * @return password */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -257,6 +267,7 @@ public User phone(@jakarta.annotation.Nullable String phone) { * @return phone */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PHONE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -282,6 +293,7 @@ public User userStatus(@jakarta.annotation.Nullable Integer userStatus) { * @return userStatus */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_USER_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -307,6 +319,7 @@ public User objectWithNoDeclaredProps(@jakarta.annotation.Nullable Object object * @return objectWithNoDeclaredProps */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -332,6 +345,7 @@ public User objectWithNoDeclaredPropsNullable(@jakarta.annotation.Nullable Objec * @return objectWithNoDeclaredPropsNullable */ @jakarta.annotation.Nullable + @JsonIgnore public Object getObjectWithNoDeclaredPropsNullable() { @@ -365,6 +379,7 @@ public User anyTypeProp(@jakarta.annotation.Nullable Object anyTypeProp) { * @return anyTypeProp */ @jakarta.annotation.Nullable + @JsonIgnore public Object getAnyTypeProp() { @@ -398,6 +413,7 @@ public User anyTypePropNullable(@jakarta.annotation.Nullable Object anyTypePropN * @return anyTypePropNullable */ @jakarta.annotation.Nullable + @JsonIgnore public Object getAnyTypePropNullable() { @@ -426,25 +442,7 @@ public void setAnyTypePropNullable(@jakarta.annotation.Nullable Object anyTypePr */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - User user = (User) o; - return Objects.equals(this.id, user.id) && - Objects.equals(this.username, user.username) && - Objects.equals(this.firstName, user.firstName) && - Objects.equals(this.lastName, user.lastName) && - Objects.equals(this.email, user.email) && - Objects.equals(this.password, user.password) && - Objects.equals(this.phone, user.phone) && - Objects.equals(this.userStatus, user.userStatus) && - Objects.equals(this.objectWithNoDeclaredProps, user.objectWithNoDeclaredProps) && - equalsNullable(this.objectWithNoDeclaredPropsNullable, user.objectWithNoDeclaredPropsNullable) && - equalsNullable(this.anyTypeProp, user.anyTypeProp) && - equalsNullable(this.anyTypePropNullable, user.anyTypePropNullable); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -453,7 +451,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus, objectWithNoDeclaredProps, hashCodeNullable(objectWithNoDeclaredPropsNullable), hashCodeNullable(anyTypeProp), hashCodeNullable(anyTypePropNullable)); + return HashCodeBuilder.reflectionHashCode(this); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Whale.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Whale.java index a74efed93661..965b4cd7c5ab 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Whale.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Whale.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -23,6 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -62,6 +66,7 @@ public Whale hasBaleen(@jakarta.annotation.Nullable Boolean hasBaleen) { * @return hasBaleen */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HAS_BALEEN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -87,6 +92,7 @@ public Whale hasTeeth(@jakarta.annotation.Nullable Boolean hasTeeth) { * @return hasTeeth */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HAS_TEETH, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -112,6 +118,8 @@ public Whale className(@jakarta.annotation.Nonnull String className) { * @return className */ @jakarta.annotation.Nonnull + @NotNull + @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -132,21 +140,12 @@ public void setClassName(@jakarta.annotation.Nonnull String className) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Whale whale = (Whale) o; - return Objects.equals(this.hasBaleen, whale.hasBaleen) && - Objects.equals(this.hasTeeth, whale.hasTeeth) && - Objects.equals(this.className, whale.className); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(hasBaleen, hasTeeth, className); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Zebra.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Zebra.java index 50e06af9e38f..209104fdfc82 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Zebra.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Zebra.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -27,6 +29,8 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -98,6 +102,7 @@ public Zebra type(@jakarta.annotation.Nullable TypeEnum type) { * @return type */ @jakarta.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -123,6 +128,8 @@ public Zebra className(@jakarta.annotation.Nonnull String className) { * @return className */ @jakarta.annotation.Nonnull + @NotNull + @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -180,21 +187,12 @@ public Object getAdditionalProperty(String key) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Zebra zebra = (Zebra) o; - return Objects.equals(this.type, zebra.type) && - Objects.equals(this.className, zebra.className)&& - Objects.equals(this.additionalProperties, zebra.additionalProperties); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(type, className, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override From 5dedcc83a4a7e2e655e9cb9451d8c0ed3039ba30 Mon Sep 17 00:00:00 2001 From: Chhida <44230565+Chhida@users.noreply.github.com> Date: Fri, 17 Apr 2026 20:11:37 +0100 Subject: [PATCH 15/17] feat(jersey3): add error entity deserialization support - Add errorEntity field and getErrorEntity() method to ApiException - Add deserializeErrorEntity() method to ApiClient for error deserialization - Update API methods to pass errorTypes map for automatic error handling - Add unit tests for errorEntity feature - Regenerate jersey3 and jersey3-oneOf samples - Fix sample pom.xml to include required dependencies (validation, commons-lang3, http-signature) --- .../petstore/java/jersey3-oneOf/pom.xml | 21 +++++ .../org/openapitools/client/ApiClient.java | 38 ++++++++- .../org/openapitools/client/ApiException.java | 15 ++++ .../openapitools/client/api/DefaultApi.java | 3 +- .../client/petstore/java/jersey3/README.md | 12 +-- .../client/petstore/java/jersey3/build.gradle | 6 +- .../client/petstore/java/jersey3/build.sbt | 3 +- .../petstore/java/jersey3/docs/ArrayTest.md | 2 +- .../petstore/java/jersey3/docs/FakeApi.md | 2 +- .../petstore/java/jersey3/docs/UserApi.md | 4 +- .../petstore/java/jersey3/gradle.properties | 7 -- samples/client/petstore/java/jersey3/pom.xml | 20 ++--- .../petstore/java/jersey3/settings.gradle | 2 +- .../org/openapitools/client/ApiClient.java | 38 ++++++++- .../org/openapitools/client/ApiException.java | 15 ++++ .../java/org/openapitools/client/JSON.java | 2 +- .../client/api/AnotherFakeApi.java | 6 +- .../openapitools/client/api/DefaultApi.java | 6 +- .../org/openapitools/client/api/FakeApi.java | 64 +++++++++------ .../client/api/FakeClassnameTags123Api.java | 6 +- .../org/openapitools/client/api/PetApi.java | 30 +++++--- .../org/openapitools/client/api/StoreApi.java | 15 ++-- .../org/openapitools/client/api/UserApi.java | 35 +++++---- .../model/AdditionalPropertiesClass.java | 31 ++++---- .../client/model/AllOfRefToDouble.java | 16 ++-- .../client/model/AllOfRefToFloat.java | 16 ++-- .../client/model/AllOfRefToLong.java | 16 ++-- .../org/openapitools/client/model/Animal.java | 19 ++--- .../org/openapitools/client/model/Apple.java | 18 +++-- .../openapitools/client/model/AppleReq.java | 19 ++--- .../model/ArrayOfArrayOfNumberOnly.java | 17 ++-- .../client/model/ArrayOfNumberOnly.java | 17 ++-- .../openapitools/client/model/ArrayTest.java | 32 ++++---- .../org/openapitools/client/model/Banana.java | 17 ++-- .../openapitools/client/model/BananaReq.java | 20 ++--- .../openapitools/client/model/BasquePig.java | 17 ++-- .../client/model/Capitalization.java | 26 ++++--- .../org/openapitools/client/model/Cat.java | 59 +++----------- .../openapitools/client/model/Category.java | 19 ++--- .../openapitools/client/model/ChildCat.java | 61 +++------------ .../openapitools/client/model/ClassModel.java | 16 ++-- .../org/openapitools/client/model/Client.java | 16 ++-- .../client/model/ComplexQuadrilateral.java | 62 +++------------ .../openapitools/client/model/DanishPig.java | 17 ++-- .../client/model/DeprecatedObject.java | 16 ++-- .../org/openapitools/client/model/Dog.java | 59 +++----------- .../openapitools/client/model/Drawing.java | 27 ++++--- .../openapitools/client/model/EnumArrays.java | 18 +++-- .../openapitools/client/model/EnumClass.java | 4 - .../openapitools/client/model/EnumTest.java | 37 ++++----- .../client/model/EquilateralTriangle.java | 62 +++------------ .../client/model/FileSchemaTestClass.java | 28 +++---- .../org/openapitools/client/model/Foo.java | 16 ++-- .../client/model/FooGetDefaultResponse.java | 17 ++-- .../openapitools/client/model/FormatTest.java | 56 ++++++-------- .../org/openapitools/client/model/Fruit.java | 4 - .../openapitools/client/model/FruitReq.java | 4 - .../openapitools/client/model/GmFruit.java | 4 - .../client/model/GrandparentAnimal.java | 17 ++-- .../client/model/HasOnlyReadOnly.java | 18 +++-- .../client/model/HealthCheckResult.java | 16 ++-- .../client/model/IsoscelesTriangle.java | 20 ++--- .../org/openapitools/client/model/Mammal.java | 77 ------------------- .../client/model/MammalAnyof.java | 57 -------------- .../openapitools/client/model/MapTest.java | 23 +++--- ...ropertiesAndAdditionalPropertiesClass.java | 23 +++--- .../client/model/Model200Response.java | 18 +++-- .../client/model/ModelApiResponse.java | 20 ++--- .../openapitools/client/model/ModelFile.java | 16 ++-- .../openapitools/client/model/ModelList.java | 16 ++-- .../client/model/ModelReturn.java | 16 ++-- .../org/openapitools/client/model/Name.java | 23 +++--- .../client/model/NullableClass.java | 42 +++++----- .../client/model/NullableShape.java | 73 ------------------ .../openapitools/client/model/NumberOnly.java | 17 ++-- .../model/ObjectWithDeprecatedFields.java | 24 +++--- .../org/openapitools/client/model/Order.java | 27 +++---- .../client/model/OuterComposite.java | 21 ++--- .../openapitools/client/model/OuterEnum.java | 4 - .../client/model/OuterEnumDefaultValue.java | 4 - .../client/model/OuterEnumInteger.java | 4 - .../model/OuterEnumIntegerDefaultValue.java | 4 - .../openapitools/client/model/ParentPet.java | 56 ++------------ .../org/openapitools/client/model/Pet.java | 38 +++++---- .../org/openapitools/client/model/Pig.java | 73 ------------------ .../client/model/Quadrilateral.java | 73 ------------------ .../client/model/QuadrilateralInterface.java | 17 ++-- .../client/model/ReadOnlyFirst.java | 18 +++-- .../client/model/ScaleneTriangle.java | 62 +++------------ .../org/openapitools/client/model/Shape.java | 73 ------------------ .../client/model/ShapeInterface.java | 17 ++-- .../client/model/ShapeOrNull.java | 73 ------------------ .../client/model/SimpleQuadrilateral.java | 62 +++------------ .../client/model/SpecialModelName.java | 18 +++-- .../org/openapitools/client/model/Tag.java | 18 +++-- ...neFreeformAdditionalPropertiesRequest.java | 17 ++-- .../openapitools/client/model/Triangle.java | 77 ------------------- .../client/model/TriangleInterface.java | 17 ++-- .../org/openapitools/client/model/User.java | 38 ++++----- .../org/openapitools/client/model/Whale.java | 21 ++--- .../org/openapitools/client/model/Zebra.java | 20 ++--- 101 files changed, 922 insertions(+), 1681 deletions(-) diff --git a/samples/client/petstore/java/jersey3-oneOf/pom.xml b/samples/client/petstore/java/jersey3-oneOf/pom.xml index 94aea8af5e82..c0d7a05a48f2 100644 --- a/samples/client/petstore/java/jersey3-oneOf/pom.xml +++ b/samples/client/petstore/java/jersey3-oneOf/pom.xml @@ -318,6 +318,25 @@ jersey-apache-connector ${jersey-version} + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + + org.tomitribe + tomitribe-http-signatures + ${http-signature-version} + @@ -336,6 +355,8 @@ 0.2.10 2.1.1 3.0.2 + 3.12.0 + 1.8 5.10.0 2.21.0 diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiClient.java index bbebf6553cd2..83834edcf4b2 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiClient.java @@ -62,6 +62,7 @@ import java.util.Arrays; import java.util.ArrayList; import java.util.Date; +import java.util.Locale; import java.util.stream.Collectors; import java.util.stream.Stream; import java.time.OffsetDateTime; @@ -974,6 +975,7 @@ public File prepareDownloadFile(Response response) throws IOException { * @param authNames The authentications to apply * @param returnType The return type into which to deserialize the response * @param isBodyNullable True if the body is nullable + * @param errorTypes Mapping of error codes to types into which to deserialize the response * @return The response body in type of string * @throws ApiException API exception */ @@ -990,7 +992,9 @@ public ApiResponse invokeAPI( String contentType, String[] authNames, GenericType returnType, - boolean isBodyNullable) + boolean isBodyNullable, + Map errorTypes + ) throws ApiException { String targetURL; @@ -1001,7 +1005,7 @@ public ApiResponse invokeAPI( if (index < 0 || index >= serverConfigurations.size()) { throw new ArrayIndexOutOfBoundsException( String.format( - java.util.Locale.ROOT, + Locale.ROOT, "Invalid index %d when selecting the host settings. Must be less than %d", index, serverConfigurations.size())); } @@ -1088,6 +1092,8 @@ public ApiResponse invokeAPI( String respBody = null; if (response.hasEntity()) { try { + // call bufferEntity, so that a subsequent call to `readEntity` in `deserialize` doesn't fail + response.bufferEntity(); respBody = String.valueOf(response.readEntity(String.class)); message = respBody; } catch (RuntimeException e) { @@ -1095,7 +1101,7 @@ public ApiResponse invokeAPI( } } throw new ApiException( - response.getStatus(), message, buildResponseHeaders(response), respBody); + response.getStatus(), message, buildResponseHeaders(response), respBody, deserializeErrorEntity(errorTypes, response)); } } finally { try { @@ -1106,6 +1112,30 @@ public ApiResponse invokeAPI( } } } + + /** + * Deserialize the response body into an error entity based on HTTP status code. + * Looks up the error type from the errorTypes map using the response status code, + * or falls back to the "default" error type if no match is found. + * + * @param errorTypes Map of status code strings to GenericType for deserialization + * @param response The HTTP response + * @return The deserialized error entity, or null if not found or deserialization fails + */ + private Object deserializeErrorEntity(Map errorTypes, Response response) { + if (errorTypes == null) { + return null; + } + GenericType errorType = errorTypes.get(String.valueOf(response.getStatus())); + if (errorType == null) { + errorType = errorTypes.get("0"); // "0" is the "default" response + } + try { + return deserialize(response, errorType); + } catch (Exception e) { + return null; + } + } protected Response sendRequest(String method, Invocation.Builder invocationBuilder, Entity entity) { Response response; @@ -1132,7 +1162,7 @@ protected Response sendRequest(String method, Invocation.Builder invocationBuild */ @Deprecated public ApiResponse invokeAPI(String path, String method, List queryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String accept, String contentType, String[] authNames, GenericType returnType, boolean isBodyNullable) throws ApiException { - return invokeAPI(null, path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType, isBodyNullable); + return invokeAPI(null, path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType, isBodyNullable, null/*TODO SME manage*/); } /** diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiException.java index 21d1a3d7b956..ec49f50d4456 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/ApiException.java @@ -26,6 +26,7 @@ public class ApiException extends Exception { private int code = 0; private Map> responseHeaders = null; private String responseBody = null; + private Object errorEntity = null; public ApiException() {} @@ -67,6 +68,11 @@ public ApiException(int code, String message, Map> response this.responseBody = responseBody; } + public ApiException(int code, String message, Map> responseHeaders, String responseBody, Object errorEntity) { + this(code, message, responseHeaders, responseBody); + this.errorEntity = errorEntity; + } + /** * Get the HTTP status code. * @@ -93,4 +99,13 @@ public Map> getResponseHeaders() { public String getResponseBody() { return responseBody; } + + /** + * Get the deserialized error entity (or null if this error doesn't have a model associated). + * + * @return Deserialized error entity + */ + public Object getErrorEntity() { + return errorEntity; + } } diff --git a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/api/DefaultApi.java index 77eee862c4d9..30e535d164ba 100644 --- a/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/api/DefaultApi.java +++ b/samples/client/petstore/java/jersey3-oneOf/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -78,8 +78,9 @@ public void rootPost(@jakarta.annotation.Nullable PostRequest postRequest) throw public ApiResponse rootPostWithHttpInfo(@jakarta.annotation.Nullable PostRequest postRequest) throws ApiException { String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("DefaultApi.rootPost", "/", "POST", new ArrayList<>(), postRequest, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } } diff --git a/samples/client/petstore/java/jersey3/README.md b/samples/client/petstore/java/jersey3/README.md index 0ff5521aaadb..e1421b2e789b 100644 --- a/samples/client/petstore/java/jersey3/README.md +++ b/samples/client/petstore/java/jersey3/README.md @@ -1,4 +1,4 @@ -# petstore-jersey3 +# openapi-java-client OpenAPI Petstore @@ -41,7 +41,7 @@ Add this dependency to your project's POM: ```xml org.openapitools - petstore-jersey3 + openapi-java-client 1.0.0 compile @@ -53,12 +53,12 @@ Add this dependency to your project's build file: ```groovy repositories { - mavenCentral() // Needed if the 'petstore-jersey3' jar has been published to maven central. - mavenLocal() // Needed if the 'petstore-jersey3' jar has been published to the local maven repo. + mavenCentral() // Needed if the 'openapi-java-client' jar has been published to maven central. + mavenLocal() // Needed if the 'openapi-java-client' jar has been published to the local maven repo. } dependencies { - implementation "org.openapitools:petstore-jersey3:1.0.0" + implementation "org.openapitools:openapi-java-client:1.0.0" } ``` @@ -72,7 +72,7 @@ mvn clean package Then manually install the following JARs: -- `target/petstore-jersey3-1.0.0.jar` +- `target/openapi-java-client-1.0.0.jar` - `target/lib/*.jar` ## Getting Started diff --git a/samples/client/petstore/java/jersey3/build.gradle b/samples/client/petstore/java/jersey3/build.gradle index 0b26c0545286..6f430b1f248d 100644 --- a/samples/client/petstore/java/jersey3/build.gradle +++ b/samples/client/petstore/java/jersey3/build.gradle @@ -84,7 +84,7 @@ if(hasProperty('target') && target == 'android') { publishing { publications { maven(MavenPublication) { - artifactId = 'petstore-jersey3' + artifactId = 'openapi-java-client' from components.java } @@ -104,12 +104,10 @@ ext { jackson_databind_version = "2.21.1" jackson_databind_nullable_version = "0.2.10" jakarta_annotation_version = "2.1.0" - bean_validation_version = "3.0.2" jersey_version = "3.0.4" junit_version = "5.8.2" scribejava_apis_version = "8.3.1" tomitribe_http_signatures_version = "1.7" - commons_lang3_version = "3.17.0" } dependencies { @@ -128,8 +126,6 @@ dependencies { implementation "com.github.scribejava:scribejava-apis:$scribejava_apis_version" implementation "org.tomitribe:tomitribe-http-signatures:$tomitribe_http_signatures_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" - implementation "jakarta.validation:jakarta.validation-api:$bean_validation_version" - implementation "org.apache.commons:commons-lang3:$commons_lang3_version" testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" } diff --git a/samples/client/petstore/java/jersey3/build.sbt b/samples/client/petstore/java/jersey3/build.sbt index ef9f97ebb175..57ccccb87052 100644 --- a/samples/client/petstore/java/jersey3/build.sbt +++ b/samples/client/petstore/java/jersey3/build.sbt @@ -1,7 +1,7 @@ lazy val root = (project in file(".")). settings( organization := "org.openapitools", - name := "petstore-jersey3", + name := "openapi-java-client", version := "1.0.0", scalaVersion := "2.11.12", scalacOptions ++= Seq("-feature"), @@ -24,7 +24,6 @@ lazy val root = (project in file(".")). "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", "org.tomitribe" % "tomitribe-http-signatures" % "1.7" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "2.1.0" % "compile", - "org.apache.commons" % "commons-lang3" % "3.17.0" % "compile", "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" ) ) diff --git a/samples/client/petstore/java/jersey3/docs/ArrayTest.md b/samples/client/petstore/java/jersey3/docs/ArrayTest.md index ae2672809aa9..36077c9df300 100644 --- a/samples/client/petstore/java/jersey3/docs/ArrayTest.md +++ b/samples/client/petstore/java/jersey3/docs/ArrayTest.md @@ -9,7 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**arrayOfString** | **List<String>** | | [optional] | |**arrayArrayOfInteger** | **List<List<Long>>** | | [optional] | -|**arrayArrayOfModel** | **List<List<@Valid ReadOnlyFirst>>** | | [optional] | +|**arrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] | diff --git a/samples/client/petstore/java/jersey3/docs/FakeApi.md b/samples/client/petstore/java/jersey3/docs/FakeApi.md index 7d45cd6a51b8..3816afc1ce7c 100644 --- a/samples/client/petstore/java/jersey3/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey3/docs/FakeApi.md @@ -427,7 +427,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); FakeApi apiInstance = new FakeApi(defaultClient); - List<@Pattern(regexp = "[A-Z0-9]+")String> requestBody = Arrays.asList(); // List<@Pattern(regexp = "[A-Z0-9]+")String> | + List requestBody = Arrays.asList(); // List | try { apiInstance.postArrayOfString(requestBody); } catch (ApiException e) { diff --git a/samples/client/petstore/java/jersey3/docs/UserApi.md b/samples/client/petstore/java/jersey3/docs/UserApi.md index 091549fc7c8f..6df604acce37 100644 --- a/samples/client/petstore/java/jersey3/docs/UserApi.md +++ b/samples/client/petstore/java/jersey3/docs/UserApi.md @@ -103,7 +103,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List<@Valid User> user = Arrays.asList(); // List<@Valid User> | List of user object + List user = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { @@ -167,7 +167,7 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List<@Valid User> user = Arrays.asList(); // List<@Valid User> | List of user object + List user = Arrays.asList(); // List | List of user object try { apiInstance.createUsersWithListInput(user); } catch (ApiException e) { diff --git a/samples/client/petstore/java/jersey3/gradle.properties b/samples/client/petstore/java/jersey3/gradle.properties index d3e8e41ba6fb..a3408578278a 100644 --- a/samples/client/petstore/java/jersey3/gradle.properties +++ b/samples/client/petstore/java/jersey3/gradle.properties @@ -4,10 +4,3 @@ # Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties # For example, uncomment below to build for Android #target = android - -# JVM arguments -org.gradle.jvmargs=-Xmx2024m -XX:MaxPermSize=512m -# set timeout -org.gradle.daemon.idletimeout=3600000 -# show all warnings -org.gradle.warning.mode=all diff --git a/samples/client/petstore/java/jersey3/pom.xml b/samples/client/petstore/java/jersey3/pom.xml index faf628278687..ba2fa0a780ab 100644 --- a/samples/client/petstore/java/jersey3/pom.xml +++ b/samples/client/petstore/java/jersey3/pom.xml @@ -2,9 +2,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 org.openapitools - petstore-jersey3 + openapi-java-client jar - petstore-jersey3 + openapi-java-client 1.0.0 https://github.com/openapitools/openapi-generator OpenAPI Java @@ -317,13 +317,6 @@ scribejava-apis ${scribejava-apis-version} - - - jakarta.validation - jakarta.validation-api - ${beanvalidation-version} - provided - jakarta.annotation jakarta.annotation-api @@ -335,6 +328,13 @@ jersey-apache-connector ${jersey-version} + + + jakarta.validation + jakarta.validation-api + ${beanvalidation-version} + provided + org.apache.commons @@ -359,10 +359,10 @@ 0.2.10 2.1.1 3.0.2 + 3.12.0 5.10.0 1.8 8.3.3 - 3.17.0 2.21.0 diff --git a/samples/client/petstore/java/jersey3/settings.gradle b/samples/client/petstore/java/jersey3/settings.gradle index b50c71ae7985..369ba54a9e06 100644 --- a/samples/client/petstore/java/jersey3/settings.gradle +++ b/samples/client/petstore/java/jersey3/settings.gradle @@ -1 +1 @@ -rootProject.name = "petstore-jersey3" \ No newline at end of file +rootProject.name = "openapi-java-client" \ No newline at end of file diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java index 2d13159dbe2d..8d0deb2d886b 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiClient.java @@ -63,6 +63,7 @@ import java.util.Arrays; import java.util.ArrayList; import java.util.Date; +import java.util.Locale; import java.util.stream.Collectors; import java.util.stream.Stream; import java.time.OffsetDateTime; @@ -1197,6 +1198,7 @@ public File prepareDownloadFile(Response response) throws IOException { * @param authNames The authentications to apply * @param returnType The return type into which to deserialize the response * @param isBodyNullable True if the body is nullable + * @param errorTypes Mapping of error codes to types into which to deserialize the response * @return The response body in type of string * @throws ApiException API exception */ @@ -1213,7 +1215,9 @@ public ApiResponse invokeAPI( String contentType, String[] authNames, GenericType returnType, - boolean isBodyNullable) + boolean isBodyNullable, + Map errorTypes + ) throws ApiException { String targetURL; @@ -1224,7 +1228,7 @@ public ApiResponse invokeAPI( if (index < 0 || index >= serverConfigurations.size()) { throw new ArrayIndexOutOfBoundsException( String.format( - java.util.Locale.ROOT, + Locale.ROOT, "Invalid index %d when selecting the host settings. Must be less than %d", index, serverConfigurations.size())); } @@ -1327,6 +1331,8 @@ public ApiResponse invokeAPI( String respBody = null; if (response.hasEntity()) { try { + // call bufferEntity, so that a subsequent call to `readEntity` in `deserialize` doesn't fail + response.bufferEntity(); respBody = String.valueOf(response.readEntity(String.class)); message = respBody; } catch (RuntimeException e) { @@ -1334,7 +1340,7 @@ public ApiResponse invokeAPI( } } throw new ApiException( - response.getStatus(), message, buildResponseHeaders(response), respBody); + response.getStatus(), message, buildResponseHeaders(response), respBody, deserializeErrorEntity(errorTypes, response)); } } finally { try { @@ -1345,6 +1351,30 @@ public ApiResponse invokeAPI( } } } + + /** + * Deserialize the response body into an error entity based on HTTP status code. + * Looks up the error type from the errorTypes map using the response status code, + * or falls back to the "default" error type if no match is found. + * + * @param errorTypes Map of status code strings to GenericType for deserialization + * @param response The HTTP response + * @return The deserialized error entity, or null if not found or deserialization fails + */ + private Object deserializeErrorEntity(Map errorTypes, Response response) { + if (errorTypes == null) { + return null; + } + GenericType errorType = errorTypes.get(String.valueOf(response.getStatus())); + if (errorType == null) { + errorType = errorTypes.get("0"); // "0" is the "default" response + } + try { + return deserialize(response, errorType); + } catch (Exception e) { + return null; + } + } protected Response sendRequest(String method, Invocation.Builder invocationBuilder, Entity entity) { Response response; @@ -1371,7 +1401,7 @@ protected Response sendRequest(String method, Invocation.Builder invocationBuild */ @Deprecated public ApiResponse invokeAPI(String path, String method, List queryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String accept, String contentType, String[] authNames, GenericType returnType, boolean isBodyNullable) throws ApiException { - return invokeAPI(null, path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType, isBodyNullable); + return invokeAPI(null, path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType, isBodyNullable, null/*TODO SME manage*/); } /** diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiException.java index 70d3b0f5a071..6ac40b5d75c3 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/ApiException.java @@ -26,6 +26,7 @@ public class ApiException extends Exception { private int code = 0; private Map> responseHeaders = null; private String responseBody = null; + private Object errorEntity = null; public ApiException() {} @@ -67,6 +68,11 @@ public ApiException(int code, String message, Map> response this.responseBody = responseBody; } + public ApiException(int code, String message, Map> responseHeaders, String responseBody, Object errorEntity) { + this(code, message, responseHeaders, responseBody); + this.errorEntity = errorEntity; + } + /** * Get the HTTP status code. * @@ -93,4 +99,13 @@ public Map> getResponseHeaders() { public String getResponseBody() { return responseBody; } + + /** + * Get the deserialized error entity (or null if this error doesn't have a model associated). + * + * @return Deserialized error entity + */ + public Object getErrorEntity() { + return errorEntity; + } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JSON.java index d08e35ad2406..7136d534da1a 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/JSON.java @@ -35,7 +35,7 @@ public JSON() { mapper = JsonMapper.builder() .serializationInclusion(JsonInclude.Include.NON_NULL) .configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false) - .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true) + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) .configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true) .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) .enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING) diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 315aa5a06d8c..81e46331fd74 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -10,9 +10,6 @@ import org.openapitools.client.model.Client; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; - import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; @@ -87,9 +84,10 @@ public ApiResponse call123testSpecialTagsWithHttpInfo(@jakarta.annotatio String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("AnotherFakeApi.call123testSpecialTags", "/another-fake/dummy", "PATCH", new ArrayList<>(), client, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false); + null, localVarReturnType, false, localVarErrorTypes); } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/DefaultApi.java index 8e310f45b0ff..f9c2a8baa065 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/DefaultApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -10,9 +10,6 @@ import org.openapitools.client.model.FooGetDefaultResponse; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; - import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; @@ -80,9 +77,10 @@ public FooGetDefaultResponse fooGet() throws ApiException { public ApiResponse fooGetWithHttpInfo() throws ApiException { String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType(); + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("DefaultApi.fooGet", "/foo", "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false); + null, localVarReturnType, false, localVarErrorTypes); } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeApi.java index 227bae0f78f2..69ee6b19482b 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeApi.java @@ -20,9 +20,6 @@ import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.client.model.User; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; - import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; @@ -90,10 +87,11 @@ public HealthCheckResult fakeHealthGet() throws ApiException { public ApiResponse fakeHealthGetWithHttpInfo() throws ApiException { String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType(); + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("FakeApi.fakeHealthGet", "/fake/health", "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false); + null, localVarReturnType, false, localVarErrorTypes); } /** * @@ -128,10 +126,11 @@ public Boolean fakeOuterBooleanSerialize(@jakarta.annotation.Nullable Boolean bo public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(@jakarta.annotation.Nullable Boolean body) throws ApiException { String localVarAccept = apiClient.selectHeaderAccept("*/*"); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("FakeApi.fakeOuterBooleanSerialize", "/fake/outer/boolean", "POST", new ArrayList<>(), body, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false); + null, localVarReturnType, false, localVarErrorTypes); } /** * @@ -166,10 +165,11 @@ public OuterComposite fakeOuterCompositeSerialize(@jakarta.annotation.Nullable O public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(@jakarta.annotation.Nullable OuterComposite outerComposite) throws ApiException { String localVarAccept = apiClient.selectHeaderAccept("*/*"); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("FakeApi.fakeOuterCompositeSerialize", "/fake/outer/composite", "POST", new ArrayList<>(), outerComposite, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false); + null, localVarReturnType, false, localVarErrorTypes); } /** * @@ -204,10 +204,11 @@ public BigDecimal fakeOuterNumberSerialize(@jakarta.annotation.Nullable BigDecim public ApiResponse fakeOuterNumberSerializeWithHttpInfo(@jakarta.annotation.Nullable BigDecimal body) throws ApiException { String localVarAccept = apiClient.selectHeaderAccept("*/*"); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("FakeApi.fakeOuterNumberSerialize", "/fake/outer/number", "POST", new ArrayList<>(), body, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false); + null, localVarReturnType, false, localVarErrorTypes); } /** * @@ -242,10 +243,11 @@ public String fakeOuterStringSerialize(@jakarta.annotation.Nullable String body) public ApiResponse fakeOuterStringSerializeWithHttpInfo(@jakarta.annotation.Nullable String body) throws ApiException { String localVarAccept = apiClient.selectHeaderAccept("*/*"); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("FakeApi.fakeOuterStringSerialize", "/fake/outer/string", "POST", new ArrayList<>(), body, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false); + null, localVarReturnType, false, localVarErrorTypes); } /** * Array of Enums @@ -278,10 +280,11 @@ public List getArrayOfEnums() throws ApiException { public ApiResponse> getArrayOfEnumsWithHttpInfo() throws ApiException { String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType(); + final Map localVarErrorTypes = new HashMap(); GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI("FakeApi.getArrayOfEnums", "/fake/array-of-enums", "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false); + null, localVarReturnType, false, localVarErrorTypes); } /** * Array of string @@ -295,7 +298,7 @@ public ApiResponse> getArrayOfEnumsWithHttpInfo() throws ApiExce 200 ok - */ - public void postArrayOfString(@jakarta.annotation.Nullable List<@Pattern(regexp = "[A-Z0-9]+")String> requestBody) throws ApiException { + public void postArrayOfString(@jakarta.annotation.Nullable List requestBody) throws ApiException { postArrayOfStringWithHttpInfo(requestBody); } @@ -312,12 +315,13 @@ public void postArrayOfString(@jakarta.annotation.Nullable List<@Pattern(regexp 200 ok - */ - public ApiResponse postArrayOfStringWithHttpInfo(@jakarta.annotation.Nullable List<@Pattern(regexp = "[A-Z0-9]+")String> requestBody) throws ApiException { + public ApiResponse postArrayOfStringWithHttpInfo(@jakarta.annotation.Nullable List requestBody) throws ApiException { String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.postArrayOfString", "/fake/request-array-string", "POST", new ArrayList<>(), requestBody, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } /** * test referenced additionalProperties @@ -356,9 +360,10 @@ public ApiResponse testAdditionalPropertiesReferenceWithHttpInfo(@jakarta. String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testAdditionalPropertiesReference", "/fake/additionalProperties-reference", "POST", new ArrayList<>(), requestBody, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } /** * @@ -397,9 +402,10 @@ public ApiResponse testBodyWithFileSchemaWithHttpInfo(@jakarta.annotation. String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testBodyWithFileSchema", "/fake/body-with-file-schema", "PUT", new ArrayList<>(), fileSchemaTestClass, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } /** * @@ -448,9 +454,10 @@ public ApiResponse testBodyWithQueryParamsWithHttpInfo(@jakarta.annotation String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testBodyWithQueryParams", "/fake/body-with-query-params", "PUT", localVarQueryParams, user, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } /** * To test \"client\" model @@ -490,10 +497,11 @@ public ApiResponse testClientModelWithHttpInfo(@jakarta.annotation.Nonnu String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("FakeApi.testClientModel", "/fake", "PATCH", new ArrayList<>(), client, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false); + null, localVarReturnType, false, localVarErrorTypes); } /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -607,9 +615,10 @@ public ApiResponse testEndpointParametersWithHttpInfo(@jakarta.annotation. String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); String[] localVarAuthNames = new String[] {"http_basic_test"}; + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testEndpointParameters", "/fake", "POST", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + localVarAuthNames, null, false, localVarErrorTypes); } /** * To test enum parameters @@ -685,9 +694,10 @@ public ApiResponse testEnumParametersWithHttpInfo(@jakarta.annotation.Null String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testEnumParameters", "/fake", "GET", localVarQueryParams, null, localVarHeaderParams, new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } private ApiResponse testGroupParametersWithHttpInfo(@jakarta.annotation.Nonnull Integer requiredStringGroup, @jakarta.annotation.Nonnull Boolean requiredBooleanGroup, @jakarta.annotation.Nonnull Long requiredInt64Group, @jakarta.annotation.Nullable Integer stringGroup, @jakarta.annotation.Nullable Boolean booleanGroup, @jakarta.annotation.Nullable Long int64Group) throws ApiException { @@ -720,9 +730,10 @@ private ApiResponse testGroupParametersWithHttpInfo(@jakarta.annotation.No String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); String[] localVarAuthNames = new String[] {"bearer_test"}; + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testGroupParameters", "/fake", "DELETE", localVarQueryParams, null, localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, null, false); + localVarAuthNames, null, false, localVarErrorTypes); } public class APItestGroupParametersRequest { @@ -884,9 +895,10 @@ public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(@jakarta.ann String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testInlineAdditionalProperties", "/fake/inline-additionalProperties", "POST", new ArrayList<>(), requestBody, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } /** * test inline free-form additionalProperties @@ -925,9 +937,10 @@ public ApiResponse testInlineFreeformAdditionalPropertiesWithHttpInfo(@jak String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testInlineFreeformAdditionalProperties", "/fake/inline-freeform-additionalProperties", "POST", new ArrayList<>(), testInlineFreeformAdditionalPropertiesRequest, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } /** * test json serialization of form data @@ -976,9 +989,10 @@ public ApiResponse testJsonFormDataWithHttpInfo(@jakarta.annotation.Nonnul String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testJsonFormData", "/fake/jsonFormData", "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } /** * @@ -1046,9 +1060,10 @@ public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(@jakarta String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testQueryParameterCollectionFormat", "/fake/test-query-parameters", "PUT", localVarQueryParams, null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } /** * test referenced string map @@ -1087,8 +1102,9 @@ public ApiResponse testStringMapReferenceWithHttpInfo(@jakarta.annotation. String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("FakeApi.testStringMapReference", "/fake/stringMap-reference", "POST", new ArrayList<>(), requestBody, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 215ee4d24166..2c42ca2ced74 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -10,9 +10,6 @@ import org.openapitools.client.model.Client; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; - import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; @@ -88,9 +85,10 @@ public ApiResponse testClassnameWithHttpInfo(@jakarta.annotation.Nonnull String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType("application/json"); String[] localVarAuthNames = new String[] {"api_key_query"}; + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("FakeClassnameTags123Api.testClassname", "/fake_classname_test", "PATCH", new ArrayList<>(), client, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + localVarAuthNames, localVarReturnType, false, localVarErrorTypes); } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/PetApi.java index 21eea42ee48b..c5603bb9ef84 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/PetApi.java @@ -12,9 +12,6 @@ import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; - import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; @@ -89,9 +86,10 @@ public ApiResponse addPetWithHttpInfo(@jakarta.annotation.Nonnull Pet pet) String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json", "application/xml"); String[] localVarAuthNames = new String[] {"petstore_auth", "http_signature_test"}; + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("PetApi.addPet", "/pet", "POST", new ArrayList<>(), pet, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, null, false); + localVarAuthNames, null, false, localVarErrorTypes); } /** * Deletes a pet @@ -143,9 +141,10 @@ public ApiResponse deletePetWithHttpInfo(@jakarta.annotation.Nonnull Long String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); String[] localVarAuthNames = new String[] {"petstore_auth"}; + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("PetApi.deletePet", localVarPath, "DELETE", new ArrayList<>(), null, localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, null, false); + localVarAuthNames, null, false, localVarErrorTypes); } /** * Finds Pets by status @@ -193,10 +192,11 @@ public ApiResponse> findPetsByStatusWithHttpInfo(@jakarta.annotation.N String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); String[] localVarAuthNames = new String[] {"petstore_auth", "http_signature_test"}; + final Map localVarErrorTypes = new HashMap(); GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI("PetApi.findPetsByStatus", "/pet/findByStatus", "GET", localVarQueryParams, null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + localVarAuthNames, localVarReturnType, false, localVarErrorTypes); } /** * Finds Pets by tags @@ -248,10 +248,11 @@ public ApiResponse> findPetsByTagsWithHttpInfo(@jakarta.annotation.Non String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); String[] localVarAuthNames = new String[] {"petstore_auth", "http_signature_test"}; + final Map localVarErrorTypes = new HashMap(); GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI("PetApi.findPetsByTags", "/pet/findByTags", "GET", localVarQueryParams, null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + localVarAuthNames, localVarReturnType, false, localVarErrorTypes); } /** * Find pet by ID @@ -300,10 +301,11 @@ public ApiResponse getPetByIdWithHttpInfo(@jakarta.annotation.Nonnull Long String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); String[] localVarAuthNames = new String[] {"api_key"}; + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("PetApi.getPetById", localVarPath, "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + localVarAuthNames, localVarReturnType, false, localVarErrorTypes); } /** * Update an existing pet @@ -347,9 +349,10 @@ public ApiResponse updatePetWithHttpInfo(@jakarta.annotation.Nonnull Pet p String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json", "application/xml"); String[] localVarAuthNames = new String[] {"petstore_auth", "http_signature_test"}; + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("PetApi.updatePet", "/pet", "PUT", new ArrayList<>(), pet, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, null, false); + localVarAuthNames, null, false, localVarErrorTypes); } /** * Updates a pet in the store with form data @@ -406,9 +409,10 @@ public ApiResponse updatePetWithFormWithHttpInfo(@jakarta.annotation.Nonnu String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/x-www-form-urlencoded"); String[] localVarAuthNames = new String[] {"petstore_auth"}; + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("PetApi.updatePetWithForm", localVarPath, "POST", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + localVarAuthNames, null, false, localVarErrorTypes); } /** * uploads an image @@ -466,10 +470,11 @@ public ApiResponse uploadFileWithHttpInfo(@jakarta.annotation. String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType("multipart/form-data"); String[] localVarAuthNames = new String[] {"petstore_auth"}; + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("PetApi.uploadFile", localVarPath, "POST", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + localVarAuthNames, localVarReturnType, false, localVarErrorTypes); } /** * uploads an image (required) @@ -528,9 +533,10 @@ public ApiResponse uploadFileWithRequiredFileWithHttpInfo(@jak String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType("multipart/form-data"); String[] localVarAuthNames = new String[] {"petstore_auth"}; + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("PetApi.uploadFileWithRequiredFile", localVarPath, "POST", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + localVarAuthNames, localVarReturnType, false, localVarErrorTypes); } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java index 696ee2619e0b..43c8f799fff8 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/StoreApi.java @@ -10,9 +10,6 @@ import org.openapitools.client.model.Order; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; - import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; @@ -92,9 +89,10 @@ public ApiResponse deleteOrderWithHttpInfo(@jakarta.annotation.Nonnull Str String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("StoreApi.deleteOrder", localVarPath, "DELETE", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } /** * Returns pet inventories by status @@ -128,10 +126,11 @@ public ApiResponse> getInventoryWithHttpInfo() throws ApiEx String localVarAccept = apiClient.selectHeaderAccept("application/json"); String localVarContentType = apiClient.selectHeaderContentType(); String[] localVarAuthNames = new String[] {"api_key"}; + final Map localVarErrorTypes = new HashMap(); GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI("StoreApi.getInventory", "/store/inventory", "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + localVarAuthNames, localVarReturnType, false, localVarErrorTypes); } /** * Find purchase order by ID @@ -179,10 +178,11 @@ public ApiResponse getOrderByIdWithHttpInfo(@jakarta.annotation.Nonnull L String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("StoreApi.getOrderById", localVarPath, "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false); + null, localVarReturnType, false, localVarErrorTypes); } /** * Place an order for a pet @@ -224,9 +224,10 @@ public ApiResponse placeOrderWithHttpInfo(@jakarta.annotation.Nonnull Ord String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("StoreApi.placeOrder", "/store/order", "POST", new ArrayList<>(), order, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false); + null, localVarReturnType, false, localVarErrorTypes); } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java index e23d2cddac66..10cf03612f4c 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/api/UserApi.java @@ -11,9 +11,6 @@ import java.time.OffsetDateTime; import org.openapitools.client.model.User; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; - import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; @@ -87,9 +84,10 @@ public ApiResponse createUserWithHttpInfo(@jakarta.annotation.Nonnull User String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.createUser", "/user", "POST", new ArrayList<>(), user, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } /** * Creates list of users with given input array @@ -103,7 +101,7 @@ public ApiResponse createUserWithHttpInfo(@jakarta.annotation.Nonnull User 0 successful operation - */ - public void createUsersWithArrayInput(@jakarta.annotation.Nonnull List<@Valid User> user) throws ApiException { + public void createUsersWithArrayInput(@jakarta.annotation.Nonnull List user) throws ApiException { createUsersWithArrayInputWithHttpInfo(user); } @@ -120,7 +118,7 @@ public void createUsersWithArrayInput(@jakarta.annotation.Nonnull List<@Valid Us 0 successful operation - */ - public ApiResponse createUsersWithArrayInputWithHttpInfo(@jakarta.annotation.Nonnull List<@Valid User> user) throws ApiException { + public ApiResponse createUsersWithArrayInputWithHttpInfo(@jakarta.annotation.Nonnull List user) throws ApiException { // Check required parameters if (user == null) { throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput"); @@ -128,9 +126,10 @@ public ApiResponse createUsersWithArrayInputWithHttpInfo(@jakarta.annotati String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.createUsersWithArrayInput", "/user/createWithArray", "POST", new ArrayList<>(), user, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } /** * Creates list of users with given input array @@ -144,7 +143,7 @@ public ApiResponse createUsersWithArrayInputWithHttpInfo(@jakarta.annotati 0 successful operation - */ - public void createUsersWithListInput(@jakarta.annotation.Nonnull List<@Valid User> user) throws ApiException { + public void createUsersWithListInput(@jakarta.annotation.Nonnull List user) throws ApiException { createUsersWithListInputWithHttpInfo(user); } @@ -161,7 +160,7 @@ public void createUsersWithListInput(@jakarta.annotation.Nonnull List<@Valid Use 0 successful operation - */ - public ApiResponse createUsersWithListInputWithHttpInfo(@jakarta.annotation.Nonnull List<@Valid User> user) throws ApiException { + public ApiResponse createUsersWithListInputWithHttpInfo(@jakarta.annotation.Nonnull List user) throws ApiException { // Check required parameters if (user == null) { throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput"); @@ -169,9 +168,10 @@ public ApiResponse createUsersWithListInputWithHttpInfo(@jakarta.annotatio String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.createUsersWithListInput", "/user/createWithList", "POST", new ArrayList<>(), user, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } /** * Delete user @@ -216,9 +216,10 @@ public ApiResponse deleteUserWithHttpInfo(@jakarta.annotation.Nonnull Stri String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.deleteUser", localVarPath, "DELETE", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } /** * Get user by user name @@ -266,10 +267,11 @@ public ApiResponse getUserByNameWithHttpInfo(@jakarta.annotation.Nonnull S String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("UserApi.getUserByName", localVarPath, "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false); + null, localVarReturnType, false, localVarErrorTypes); } /** * Logs user into the system @@ -322,10 +324,11 @@ public ApiResponse loginUserWithHttpInfo(@jakarta.annotation.Nonnull Str String localVarAccept = apiClient.selectHeaderAccept("application/xml", "application/json"); String localVarContentType = apiClient.selectHeaderContentType(); + final Map localVarErrorTypes = new HashMap(); GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("UserApi.loginUser", "/user/login", "GET", localVarQueryParams, null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, localVarReturnType, false); + null, localVarReturnType, false, localVarErrorTypes); } /** * Logs out current logged in user session @@ -357,9 +360,10 @@ public void logoutUser() throws ApiException { public ApiResponse logoutUserWithHttpInfo() throws ApiException { String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType(); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.logoutUser", "/user/logout", "GET", new ArrayList<>(), null, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } /** * Updated user @@ -409,8 +413,9 @@ public ApiResponse updateUserWithHttpInfo(@jakarta.annotation.Nonnull Stri String localVarAccept = apiClient.selectHeaderAccept(); String localVarContentType = apiClient.selectHeaderContentType("application/json"); + final Map localVarErrorTypes = new HashMap(); return apiClient.invokeAPI("UserApi.updateUser", localVarPath, "PUT", new ArrayList<>(), user, new LinkedHashMap<>(), new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, - null, null, false); + null, null, false, localVarErrorTypes); } } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 8f963ffe984c..d2dda62fbca2 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -31,8 +29,6 @@ import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -103,7 +99,6 @@ public AdditionalPropertiesClass putMapPropertyItem(String key, String mapProper * @return mapProperty */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_MAP_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -137,8 +132,6 @@ public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -348,7 +349,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(mapProperty, mapOfMapProperty, hashCodeNullable(anytype1), mapWithUndeclaredPropertiesAnytype1, mapWithUndeclaredPropertiesAnytype2, mapWithUndeclaredPropertiesAnytype3, emptyMap, mapWithUndeclaredPropertiesString); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToDouble.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToDouble.java index 06a183bab28a..2a1ae9517d3d 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToDouble.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToDouble.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -55,7 +51,6 @@ public AllOfRefToDouble height(@jakarta.annotation.Nullable Double height) { * @return height */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_HEIGHT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -76,12 +71,19 @@ public void setHeight(@jakarta.annotation.Nullable Double height) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AllOfRefToDouble allOfRefToDouble = (AllOfRefToDouble) o; + return Objects.equals(this.height, allOfRefToDouble.height); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(height); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToFloat.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToFloat.java index fcd09ee8fba7..409f4b9d48c2 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToFloat.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToFloat.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -55,7 +51,6 @@ public AllOfRefToFloat weight(@jakarta.annotation.Nullable Float weight) { * @return weight */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_WEIGHT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -76,12 +71,19 @@ public void setWeight(@jakarta.annotation.Nullable Float weight) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AllOfRefToFloat allOfRefToFloat = (AllOfRefToFloat) o; + return Objects.equals(this.weight, allOfRefToFloat.weight); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(weight); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToLong.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToLong.java index 49f3142993cc..d7867ce60bcf 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToLong.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AllOfRefToLong.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -55,7 +51,6 @@ public AllOfRefToLong id(@jakarta.annotation.Nullable Long id) { * @return id */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -76,12 +71,19 @@ public void setId(@jakarta.annotation.Nullable Long id) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AllOfRefToLong allOfRefToLong = (AllOfRefToLong) o; + return Objects.equals(this.id, allOfRefToLong.id); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(id); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Animal.java index 4c5d8da8455b..ff46c6e1de27 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Animal.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -28,8 +26,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -73,8 +69,6 @@ public Animal className(@jakarta.annotation.Nonnull String className) { * @return className */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -100,7 +94,6 @@ public Animal color(@jakarta.annotation.Nullable String color) { * @return color */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_COLOR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -121,12 +114,20 @@ public void setColor(@jakarta.annotation.Nullable String color) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Animal animal = (Animal) o; + return Objects.equals(this.className, animal.className) && + Objects.equals(this.color, animal.color); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(className, color); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Apple.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Apple.java index bde79bb52b47..4a5445b9932e 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Apple.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Apple.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -61,7 +57,6 @@ public Apple cultivar(@jakarta.annotation.Nullable String cultivar) { * @return cultivar */ @jakarta.annotation.Nullable - @Pattern(regexp="^[a-zA-Z\\s]*$") @JsonProperty(value = JSON_PROPERTY_CULTIVAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -87,7 +82,6 @@ public Apple origin(@jakarta.annotation.Nullable String origin) { * @return origin */ @jakarta.annotation.Nullable - @Pattern(regexp="/^[A-Z\\s]*$/i") @JsonProperty(value = JSON_PROPERTY_ORIGIN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -108,12 +102,20 @@ public void setOrigin(@jakarta.annotation.Nullable String origin) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Apple apple = (Apple) o; + return Objects.equals(this.cultivar, apple.cultivar) && + Objects.equals(this.origin, apple.origin); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(cultivar, origin); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AppleReq.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AppleReq.java index f93945bf4dd4..ba85e3fcefec 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AppleReq.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AppleReq.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -61,8 +57,6 @@ public AppleReq cultivar(@jakarta.annotation.Nonnull String cultivar) { * @return cultivar */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_CULTIVAR, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -88,7 +82,6 @@ public AppleReq mealy(@jakarta.annotation.Nullable Boolean mealy) { * @return mealy */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_MEALY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -109,12 +102,20 @@ public void setMealy(@jakarta.annotation.Nullable Boolean mealy) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AppleReq appleReq = (AppleReq) o; + return Objects.equals(this.cultivar, appleReq.cultivar) && + Objects.equals(this.mealy, appleReq.mealy); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(cultivar, mealy); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index b0479da02655..08dffa4a12d1 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -28,8 +26,6 @@ import java.util.Arrays; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -66,8 +62,6 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr * @return arrayArrayNumber */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -88,12 +82,19 @@ public void setArrayArrayNumber(@jakarta.annotation.Nullable List arrayNu */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; + return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(arrayNumber); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayTest.java index fdb5acbad989..c97ec69e0138 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -28,8 +26,6 @@ import java.util.List; import org.openapitools.client.model.ReadOnlyFirst; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -53,7 +49,7 @@ public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; @jakarta.annotation.Nullable - private List> arrayArrayOfModel = new ArrayList<>(); + private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest() { } @@ -76,7 +72,6 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { * @return arrayOfString */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ARRAY_OF_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -110,8 +105,6 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) * @return arrayArrayOfInteger */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -127,12 +120,12 @@ public void setArrayArrayOfInteger(@jakarta.annotation.Nullable List> } - public ArrayTest arrayArrayOfModel(@jakarta.annotation.Nullable List> arrayArrayOfModel) { + public ArrayTest arrayArrayOfModel(@jakarta.annotation.Nullable List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; return this; } - public ArrayTest addArrayArrayOfModelItem(List<@Valid ReadOnlyFirst> arrayArrayOfModelItem) { + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { if (this.arrayArrayOfModel == null) { this.arrayArrayOfModel = new ArrayList<>(); } @@ -145,19 +138,17 @@ public ArrayTest addArrayArrayOfModelItem(List<@Valid ReadOnlyFirst> arrayArrayO * @return arrayArrayOfModel */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List> getArrayArrayOfModel() { + public List> getArrayArrayOfModel() { return arrayArrayOfModel; } @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setArrayArrayOfModel(@jakarta.annotation.Nullable List> arrayArrayOfModel) { + public void setArrayArrayOfModel(@jakarta.annotation.Nullable List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } @@ -167,12 +158,21 @@ public void setArrayArrayOfModel(@jakarta.annotation.Nullable List additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public Cat putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } /** * Return true if this Cat object is equal to o. */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Cat cat = (Cat) o; + return Objects.equals(this.declawed, cat.declawed) && + super.equals(o); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(declawed, super.hashCode()); } @Override @@ -142,7 +104,6 @@ public String toString() { sb.append("class Cat {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Category.java index 421d03b37a66..a5ae86785d81 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Category.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -60,7 +56,6 @@ public Category id(@jakarta.annotation.Nullable Long id) { * @return id */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -86,8 +81,6 @@ public Category name(@jakarta.annotation.Nonnull String name) { * @return name */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -108,12 +101,20 @@ public void setName(@jakarta.annotation.Nonnull String name) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Category category = (Category) o; + return Objects.equals(this.id, category.id) && + Objects.equals(this.name, category.name); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(id, name); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ChildCat.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ChildCat.java index 2fa67b9ecbc7..8eed54f4bf96 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ChildCat.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ChildCat.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -35,8 +29,6 @@ import java.util.Set; import java.util.HashSet; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -76,7 +68,6 @@ public ChildCat name(@jakarta.annotation.Nullable String name) { * @return name */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -110,7 +101,6 @@ public ChildCat petType(@jakarta.annotation.Nullable String petType) { * @return petType */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PET_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -129,55 +119,27 @@ public void setPetType(@jakarta.annotation.Nullable String petType) { this.petType = petType; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public ChildCat putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } /** * Return true if this ChildCat object is equal to o. */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChildCat childCat = (ChildCat) o; + return Objects.equals(this.name, childCat.name) && + Objects.equals(this.petType, childCat.petType) && + super.equals(o); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(name, petType, super.hashCode()); } @Override @@ -187,7 +149,6 @@ public String toString() { sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" petType: ").append(toIndentedString(petType)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ClassModel.java index bc166beabb59..8693a5882be2 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ClassModel.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -55,7 +51,6 @@ public ClassModel propertyClass(@jakarta.annotation.Nullable String propertyClas * @return propertyClass */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PROPERTY_CLASS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -76,12 +71,19 @@ public void setPropertyClass(@jakarta.annotation.Nullable String propertyClass) */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClassModel classModel = (ClassModel) o; + return Objects.equals(this.propertyClass, classModel.propertyClass); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(propertyClass); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Client.java index 236f860787a3..bdfb834d467c 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Client.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -55,7 +51,6 @@ public Client client(@jakarta.annotation.Nullable String client) { * @return client */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_CLIENT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -76,12 +71,19 @@ public void setClient(@jakarta.annotation.Nullable String client) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Client client = (Client) o; + return Objects.equals(this.client, client.client); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(client); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java index dcb9e8af81c0..6b5a00ae4eb4 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -29,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -64,8 +56,6 @@ public ComplexQuadrilateral shapeType(@jakarta.annotation.Nonnull String shapeTy * @return shapeType */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -91,8 +81,6 @@ public ComplexQuadrilateral quadrilateralType(@jakarta.annotation.Nonnull String * @return quadrilateralType */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -107,55 +95,26 @@ public void setQuadrilateralType(@jakarta.annotation.Nonnull String quadrilatera this.quadrilateralType = quadrilateralType; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public ComplexQuadrilateral putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } /** * Return true if this ComplexQuadrilateral object is equal to o. */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ComplexQuadrilateral complexQuadrilateral = (ComplexQuadrilateral) o; + return Objects.equals(this.shapeType, complexQuadrilateral.shapeType) && + Objects.equals(this.quadrilateralType, complexQuadrilateral.quadrilateralType); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(shapeType, quadrilateralType); } @Override @@ -164,7 +123,6 @@ public String toString() { sb.append("class ComplexQuadrilateral {\n"); sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); sb.append(" quadrilateralType: ").append(toIndentedString(quadrilateralType)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DanishPig.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DanishPig.java index dcfe14c45d0e..c1e02bbba79a 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DanishPig.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DanishPig.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -55,8 +51,6 @@ public DanishPig className(@jakarta.annotation.Nonnull String className) { * @return className */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -77,12 +71,19 @@ public void setClassName(@jakarta.annotation.Nonnull String className) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DanishPig danishPig = (DanishPig) o; + return Objects.equals(this.className, danishPig.className); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(className); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DeprecatedObject.java index 0b27bb0ee5ed..6201aa7056ba 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -57,7 +53,6 @@ public DeprecatedObject name(@jakarta.annotation.Nullable String name) { * @return name */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -78,12 +73,19 @@ public void setName(@jakarta.annotation.Nullable String name) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeprecatedObject deprecatedObject = (DeprecatedObject) o; + return Objects.equals(this.name, deprecatedObject.name); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(name); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Dog.java index c03044cca8cc..5b8083f36212 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Dog.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -33,8 +27,6 @@ import java.util.Arrays; import org.openapitools.client.model.Animal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -69,7 +61,6 @@ public Dog breed(@jakarta.annotation.Nullable String breed) { * @return breed */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_BREED, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -84,55 +75,26 @@ public void setBreed(@jakarta.annotation.Nullable String breed) { this.breed = breed; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public Dog putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } /** * Return true if this Dog object is equal to o. */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Dog dog = (Dog) o; + return Objects.equals(this.breed, dog.breed) && + super.equals(o); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(breed, super.hashCode()); } @Override @@ -141,7 +103,6 @@ public String toString() { sb.append("class Dog {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Drawing.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Drawing.java index 9ef7f0fa4116..7bb91d138adf 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Drawing.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Drawing.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -39,8 +37,6 @@ import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -82,8 +78,6 @@ public Drawing mainShape(@jakarta.annotation.Nullable Shape mainShape) { * @return mainShape */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_MAIN_SHAPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -109,8 +103,6 @@ public Drawing shapeOrNull(@jakarta.annotation.Nullable ShapeOrNull shapeOrNull) * @return shapeOrNull */ @jakarta.annotation.Nullable - @Valid - @JsonIgnore public ShapeOrNull getShapeOrNull() { @@ -144,8 +136,6 @@ public Drawing nullableShape(@jakarta.annotation.Nullable NullableShape nullable * @return nullableShape */ @jakarta.annotation.Nullable - @Valid - @JsonIgnore public NullableShape getNullableShape() { @@ -187,8 +177,6 @@ public Drawing addShapesItem(Shape shapesItem) { * @return shapes */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_SHAPES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -246,7 +234,18 @@ public Fruit getAdditionalProperty(String key) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Drawing drawing = (Drawing) o; + return Objects.equals(this.mainShape, drawing.mainShape) && + equalsNullable(this.shapeOrNull, drawing.shapeOrNull) && + equalsNullable(this.nullableShape, drawing.nullableShape) && + Objects.equals(this.shapes, drawing.shapes)&& + Objects.equals(this.additionalProperties, drawing.additionalProperties); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -255,7 +254,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(mainShape, hashCodeNullable(shapeOrNull), hashCodeNullable(nullableShape), shapes, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumArrays.java index 72f8efccb8dd..4d5dca83868f 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -27,8 +25,6 @@ import java.util.Arrays; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -132,7 +128,6 @@ public EnumArrays justSymbol(@jakarta.annotation.Nullable JustSymbolEnum justSym * @return justSymbol */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_JUST_SYMBOL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -166,7 +161,6 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { * @return arrayEnum */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ARRAY_ENUM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -187,12 +181,20 @@ public void setArrayEnum(@jakarta.annotation.Nullable List arrayE */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumArrays enumArrays = (EnumArrays) o; + return Objects.equals(this.justSymbol, enumArrays.justSymbol) && + Objects.equals(this.arrayEnum, enumArrays.arrayEnum); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(justSymbol, arrayEnum); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumClass.java index a8d97ff8d03d..0150ebe31b41 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumClass.java @@ -13,14 +13,10 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumTest.java index fcc40c915885..509c9f5481a3 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumTest.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -33,8 +31,6 @@ import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -282,7 +278,6 @@ public EnumTest enumString(@jakarta.annotation.Nullable EnumStringEnum enumStrin * @return enumString */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ENUM_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -308,8 +303,6 @@ public EnumTest enumStringRequired(@jakarta.annotation.Nonnull EnumStringRequire * @return enumStringRequired */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_ENUM_STRING_REQUIRED, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -335,7 +328,6 @@ public EnumTest enumInteger(@jakarta.annotation.Nullable EnumIntegerEnum enumInt * @return enumInteger */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ENUM_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -361,7 +353,6 @@ public EnumTest enumIntegerOnly(@jakarta.annotation.Nullable EnumIntegerOnlyEnum * @return enumIntegerOnly */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ENUM_INTEGER_ONLY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -387,7 +378,6 @@ public EnumTest enumNumber(@jakarta.annotation.Nullable EnumNumberEnum enumNumbe * @return enumNumber */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ENUM_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -413,8 +403,6 @@ public EnumTest outerEnum(@jakarta.annotation.Nullable OuterEnum outerEnum) { * @return outerEnum */ @jakarta.annotation.Nullable - @Valid - @JsonIgnore public OuterEnum getOuterEnum() { @@ -448,8 +436,6 @@ public EnumTest outerEnumInteger(@jakarta.annotation.Nullable OuterEnumInteger o * @return outerEnumInteger */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -475,8 +461,6 @@ public EnumTest outerEnumDefaultValue(@jakarta.annotation.Nullable OuterEnumDefa * @return outerEnumDefaultValue */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -502,8 +486,6 @@ public EnumTest outerEnumIntegerDefaultValue(@jakarta.annotation.Nullable OuterE * @return outerEnumIntegerDefaultValue */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -524,7 +506,22 @@ public void setOuterEnumIntegerDefaultValue(@jakarta.annotation.Nullable OuterEn */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumTest enumTest = (EnumTest) o; + return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && + Objects.equals(this.enumInteger, enumTest.enumInteger) && + Objects.equals(this.enumIntegerOnly, enumTest.enumIntegerOnly) && + Objects.equals(this.enumNumber, enumTest.enumNumber) && + equalsNullable(this.outerEnum, enumTest.outerEnum) && + Objects.equals(this.outerEnumInteger, enumTest.outerEnumInteger) && + Objects.equals(this.outerEnumDefaultValue, enumTest.outerEnumDefaultValue) && + Objects.equals(this.outerEnumIntegerDefaultValue, enumTest.outerEnumIntegerDefaultValue); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -533,7 +530,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(enumString, enumStringRequired, enumInteger, enumIntegerOnly, enumNumber, hashCodeNullable(outerEnum), outerEnumInteger, outerEnumDefaultValue, outerEnumIntegerDefaultValue); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java index 597609111f84..662ade9ad613 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -29,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -64,8 +56,6 @@ public EquilateralTriangle shapeType(@jakarta.annotation.Nonnull String shapeTyp * @return shapeType */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -91,8 +81,6 @@ public EquilateralTriangle triangleType(@jakarta.annotation.Nonnull String trian * @return triangleType */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -107,55 +95,26 @@ public void setTriangleType(@jakarta.annotation.Nonnull String triangleType) { this.triangleType = triangleType; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public EquilateralTriangle putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } /** * Return true if this EquilateralTriangle object is equal to o. */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EquilateralTriangle equilateralTriangle = (EquilateralTriangle) o; + return Objects.equals(this.shapeType, equilateralTriangle.shapeType) && + Objects.equals(this.triangleType, equilateralTriangle.triangleType); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(shapeType, triangleType); } @Override @@ -164,7 +123,6 @@ public String toString() { sb.append("class EquilateralTriangle {\n"); sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); sb.append(" triangleType: ").append(toIndentedString(triangleType)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index a67cdded729a..579b4efa21ed 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -28,8 +26,6 @@ import java.util.List; import org.openapitools.client.model.ModelFile; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -48,7 +44,7 @@ public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILES = "files"; @jakarta.annotation.Nullable - private List<@Valid ModelFile> files = new ArrayList<>(); + private List files = new ArrayList<>(); public FileSchemaTestClass() { } @@ -63,8 +59,6 @@ public FileSchemaTestClass _file(@jakarta.annotation.Nullable ModelFile _file) { * @return _file */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_FILE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -80,7 +74,7 @@ public void setFile(@jakarta.annotation.Nullable ModelFile _file) { } - public FileSchemaTestClass files(@jakarta.annotation.Nullable List<@Valid ModelFile> files) { + public FileSchemaTestClass files(@jakarta.annotation.Nullable List files) { this.files = files; return this; } @@ -98,19 +92,17 @@ public FileSchemaTestClass addFilesItem(ModelFile filesItem) { * @return files */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_FILES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List<@Valid ModelFile> getFiles() { + public List getFiles() { return files; } @JsonProperty(value = JSON_PROPERTY_FILES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(@jakarta.annotation.Nullable List<@Valid ModelFile> files) { + public void setFiles(@jakarta.annotation.Nullable List files) { this.files = files; } @@ -120,12 +112,20 @@ public void setFiles(@jakarta.annotation.Nullable List<@Valid ModelFile> files) */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; + return Objects.equals(this._file, fileSchemaTestClass._file) && + Objects.equals(this.files, fileSchemaTestClass.files); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(_file, files); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Foo.java index aa2b92e4e805..f3fc062a1da9 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Foo.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -55,7 +51,6 @@ public Foo bar(@jakarta.annotation.Nullable String bar) { * @return bar */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_BAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -76,12 +71,19 @@ public void setBar(@jakarta.annotation.Nullable String bar) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Foo foo = (Foo) o; + return Objects.equals(this.bar, foo.bar); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(bar); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index c490fde0486e..e216f393a4e9 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -26,8 +24,6 @@ import java.util.Arrays; import org.openapitools.client.model.Foo; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -57,8 +53,6 @@ public FooGetDefaultResponse string(@jakarta.annotation.Nullable Foo string) { * @return string */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -79,12 +73,19 @@ public void setString(@jakarta.annotation.Nullable Foo string) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FooGetDefaultResponse fooGetDefaultResponse = (FooGetDefaultResponse) o; + return Objects.equals(this.string, fooGetDefaultResponse.string); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(string); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FormatTest.java index 90fea3fd5cdf..6dbf825a882e 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FormatTest.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -30,8 +28,6 @@ import java.util.Arrays; import java.util.UUID; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -138,7 +134,6 @@ public FormatTest integer(@jakarta.annotation.Nullable Integer integer) { * @return integer */ @jakarta.annotation.Nullable - @Min(10) @Max(100) @JsonProperty(value = JSON_PROPERTY_INTEGER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -166,7 +161,6 @@ public FormatTest int32(@jakarta.annotation.Nullable Integer int32) { * @return int32 */ @jakarta.annotation.Nullable - @Min(20) @Max(200) @JsonProperty(value = JSON_PROPERTY_INT32, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -192,7 +186,6 @@ public FormatTest int64(@jakarta.annotation.Nullable Long int64) { * @return int64 */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_INT64, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -220,9 +213,6 @@ public FormatTest number(@jakarta.annotation.Nonnull BigDecimal number) { * @return number */ @jakarta.annotation.Nonnull - @NotNull - @Valid - @DecimalMin("32.1") @DecimalMax("543.2") @JsonProperty(value = JSON_PROPERTY_NUMBER, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -250,7 +240,6 @@ public FormatTest _float(@jakarta.annotation.Nullable Float _float) { * @return _float */ @jakarta.annotation.Nullable - @DecimalMin("54.3") @DecimalMax("987.6") @JsonProperty(value = JSON_PROPERTY_FLOAT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -278,7 +267,6 @@ public FormatTest _double(@jakarta.annotation.Nullable Double _double) { * @return _double */ @jakarta.annotation.Nullable - @DecimalMin("67.8") @DecimalMax("123.4") @JsonProperty(value = JSON_PROPERTY_DOUBLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -304,8 +292,6 @@ public FormatTest decimal(@jakarta.annotation.Nullable BigDecimal decimal) { * @return decimal */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_DECIMAL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -331,7 +317,6 @@ public FormatTest string(@jakarta.annotation.Nullable String string) { * @return string */ @jakarta.annotation.Nullable - @Pattern(regexp="/[a-z]/i") @JsonProperty(value = JSON_PROPERTY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -357,8 +342,6 @@ public FormatTest _byte(@jakarta.annotation.Nonnull byte[] _byte) { * @return _byte */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_BYTE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -384,8 +367,6 @@ public FormatTest binary(@jakarta.annotation.Nullable File binary) { * @return binary */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_BINARY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -411,9 +392,6 @@ public FormatTest date(@jakarta.annotation.Nonnull LocalDate date) { * @return date */ @jakarta.annotation.Nonnull - @NotNull - @Valid - @JsonProperty(value = JSON_PROPERTY_DATE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -439,8 +417,6 @@ public FormatTest dateTime(@jakarta.annotation.Nullable OffsetDateTime dateTime) * @return dateTime */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_DATE_TIME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -466,8 +442,6 @@ public FormatTest uuid(@jakarta.annotation.Nullable UUID uuid) { * @return uuid */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -493,8 +467,6 @@ public FormatTest password(@jakarta.annotation.Nonnull String password) { * @return password */ @jakarta.annotation.Nonnull - @NotNull - @Size(min=10,max=64) @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -520,7 +492,6 @@ public FormatTest patternWithDigits(@jakarta.annotation.Nullable String patternW * @return patternWithDigits */ @jakarta.annotation.Nullable - @Pattern(regexp="^\\d{10}$") @JsonProperty(value = JSON_PROPERTY_PATTERN_WITH_DIGITS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -546,7 +517,6 @@ public FormatTest patternWithDigitsAndDelimiter(@jakarta.annotation.Nullable Str * @return patternWithDigitsAndDelimiter */ @jakarta.annotation.Nullable - @Pattern(regexp="/^image_\\d{1,3}$/i") @JsonProperty(value = JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -567,12 +537,34 @@ public void setPatternWithDigitsAndDelimiter(@jakarta.annotation.Nullable String */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FormatTest formatTest = (FormatTest) o; + return Objects.equals(this.integer, formatTest.integer) && + Objects.equals(this.int32, formatTest.int32) && + Objects.equals(this.int64, formatTest.int64) && + Objects.equals(this.number, formatTest.number) && + Objects.equals(this._float, formatTest._float) && + Objects.equals(this._double, formatTest._double) && + Objects.equals(this.decimal, formatTest.decimal) && + Objects.equals(this.string, formatTest.string) && + Arrays.equals(this._byte, formatTest._byte) && + Objects.equals(this.binary, formatTest.binary) && + Objects.equals(this.date, formatTest.date) && + Objects.equals(this.dateTime, formatTest.dateTime) && + Objects.equals(this.uuid, formatTest.uuid) && + Objects.equals(this.password, formatTest.password) && + Objects.equals(this.patternWithDigits, formatTest.patternWithDigits) && + Objects.equals(this.patternWithDigitsAndDelimiter, formatTest.patternWithDigitsAndDelimiter); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(integer, int32, int64, number, _float, _double, decimal, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, patternWithDigits, patternWithDigitsAndDelimiter); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Fruit.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Fruit.java index c8849fe3a11f..3bf4681b7c3b 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Fruit.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -28,8 +26,6 @@ import org.openapitools.client.model.Apple; import org.openapitools.client.model.Banana; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FruitReq.java index fdea804b7b23..c7b5a4f590da 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FruitReq.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -28,8 +26,6 @@ import org.openapitools.client.model.AppleReq; import org.openapitools.client.model.BananaReq; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java index 93954725a450..c6567bd814d7 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -28,8 +26,6 @@ import org.openapitools.client.model.Apple; import org.openapitools.client.model.Banana; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java index bb272cde7d6e..b221d2acb7ca 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -28,8 +26,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -68,8 +64,6 @@ public GrandparentAnimal petType(@jakarta.annotation.Nonnull String petType) { * @return petType */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_PET_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -90,12 +84,19 @@ public void setPetType(@jakarta.annotation.Nonnull String petType) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GrandparentAnimal grandparentAnimal = (GrandparentAnimal) o; + return Objects.equals(this.petType, grandparentAnimal.petType); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(petType); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 65d4a06592c9..391848b281b4 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -66,7 +62,6 @@ public HasOnlyReadOnly( * @return bar */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_BAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -82,7 +77,6 @@ public String getBar() { * @return foo */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_FOO, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -98,12 +92,20 @@ public String getFoo() { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; + return Objects.equals(this.bar, hasOnlyReadOnly.bar) && + Objects.equals(this.foo, hasOnlyReadOnly.foo); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(bar, foo); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HealthCheckResult.java index d03284e7a21e..db1ea005cbb2 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -29,8 +27,6 @@ import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -58,7 +54,6 @@ public HealthCheckResult nullableMessage(@jakarta.annotation.Nullable String nul * @return nullableMessage */ @jakarta.annotation.Nullable - @JsonIgnore public String getNullableMessage() { @@ -87,7 +82,14 @@ public void setNullableMessage(@jakarta.annotation.Nullable String nullableMessa */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HealthCheckResult healthCheckResult = (HealthCheckResult) o; + return equalsNullable(this.nullableMessage, healthCheckResult.nullableMessage); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -96,7 +98,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(hashCodeNullable(nullableMessage)); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java index 571e606d968b..fa712f06f261 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -60,8 +56,6 @@ public IsoscelesTriangle shapeType(@jakarta.annotation.Nonnull String shapeType) * @return shapeType */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -87,8 +81,6 @@ public IsoscelesTriangle triangleType(@jakarta.annotation.Nonnull String triangl * @return triangleType */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -109,12 +101,20 @@ public void setTriangleType(@jakarta.annotation.Nonnull String triangleType) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IsoscelesTriangle isoscelesTriangle = (IsoscelesTriangle) o; + return Objects.equals(this.shapeType, isoscelesTriangle.shapeType) && + Objects.equals(this.triangleType, isoscelesTriangle.triangleType); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(shapeType, triangleType); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Mammal.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Mammal.java index 25de7885e9b3..07f6206606d4 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Mammal.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -35,8 +29,6 @@ import org.openapitools.client.model.Whale; import org.openapitools.client.model.Zebra; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -100,26 +92,6 @@ public MammalDeserializer(Class vc) { public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { JsonNode tree = ctxt.readTree(jp); Object deserialized = null; - Mammal newMammal = new Mammal(); - Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); - String discriminatorValue = (String)result2.get("className"); - switch (discriminatorValue) { - case "Pig": - deserialized = tree.traverse(jp.getCodec()).readValueAs(Pig.class); - newMammal.setActualInstance(deserialized); - return newMammal; - case "whale": - deserialized = tree.traverse(jp.getCodec()).readValueAs(Whale.class); - newMammal.setActualInstance(deserialized); - return newMammal; - case "zebra": - deserialized = tree.traverse(jp.getCodec()).readValueAs(Zebra.class); - newMammal.setActualInstance(deserialized); - return newMammal; - default: - log.log(Level.WARNING, String.format(java.util.Locale.ROOT, "Failed to lookup discriminator value `%s` for Mammal. Possible values: Pig whale zebra", discriminatorValue)); - } - boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; JsonToken token = tree.traverse(jp.getCodec()).nextToken(); @@ -194,56 +166,7 @@ public Mammal getNullValue(DeserializationContext ctxt) throws JsonMappingExcept public Mammal() { super("oneOf", Boolean.FALSE); } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public Mammal putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - /** - * Return true if this mammal object is equal to o. - */ - @Override - public boolean equals(Object o) { - return super.equals(o) && Objects.equals(this.additionalProperties, ((Mammal)o).additionalProperties); - } - @Override - public int hashCode() { - return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); - } public Mammal(Whale o) { super("oneOf", Boolean.FALSE); setActualInstance(o); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MammalAnyof.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MammalAnyof.java index f65a02a0ed03..e97298aa75bb 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MammalAnyof.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MammalAnyof.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -35,8 +29,6 @@ import org.openapitools.client.model.Whale; import org.openapitools.client.model.Zebra; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -159,56 +151,7 @@ public MammalAnyof getNullValue(DeserializationContext ctxt) throws JsonMappingE public MammalAnyof() { super("anyOf", Boolean.FALSE); } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public MammalAnyof putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - /** - * Return true if this mammal_anyof object is equal to o. - */ - @Override - public boolean equals(Object o) { - return super.equals(o) && Objects.equals(this.additionalProperties, ((MammalAnyof)o).additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); - } public MammalAnyof(Whale o) { super("anyOf", Boolean.FALSE); setActualInstance(o); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MapTest.java index 2b24222db2e9..dfb9497f0353 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MapTest.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -27,8 +25,6 @@ import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -115,8 +111,6 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr * @return mapMapOfString */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_MAP_MAP_OF_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -150,7 +144,6 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) * @return mapOfEnumString */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_MAP_OF_ENUM_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -184,7 +177,6 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { * @return directMap */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DIRECT_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -218,7 +210,6 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { * @return indirectMap */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_INDIRECT_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -239,12 +230,22 @@ public void setIndirectMap(@jakarta.annotation.Nullable Map ind */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MapTest mapTest = (MapTest) o; + return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 8565aa43bdf5..719ca8e7ef3a 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -30,8 +28,6 @@ import java.util.UUID; import org.openapitools.client.model.Animal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -70,8 +66,6 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(@jakarta.annotation.Null * @return uuid */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -97,8 +91,6 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(@jakarta.annotation. * @return dateTime */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_DATE_TIME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -132,8 +124,6 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * @return map */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_MAP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -154,12 +144,21 @@ public void setMap(@jakarta.annotation.Nullable Map map) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; + return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && + Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && + Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(uuid, dateTime, map); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Model200Response.java index 21f893609303..4aa9b96ddb19 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Model200Response.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -61,7 +57,6 @@ public Model200Response name(@jakarta.annotation.Nullable Integer name) { * @return name */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -87,7 +82,6 @@ public Model200Response propertyClass(@jakarta.annotation.Nullable String proper * @return propertyClass */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PROPERTY_CLASS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -108,12 +102,20 @@ public void setPropertyClass(@jakarta.annotation.Nullable String propertyClass) */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(name, propertyClass); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java index dc90edbd32a3..13d502025a50 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -66,7 +62,6 @@ public ModelApiResponse code(@jakarta.annotation.Nullable Integer code) { * @return code */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_CODE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -92,7 +87,6 @@ public ModelApiResponse type(@jakarta.annotation.Nullable String type) { * @return type */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -118,7 +112,6 @@ public ModelApiResponse message(@jakarta.annotation.Nullable String message) { * @return message */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -139,12 +132,21 @@ public void setMessage(@jakarta.annotation.Nullable String message) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelApiResponse _apiResponse = (ModelApiResponse) o; + return Objects.equals(this.code, _apiResponse.code) && + Objects.equals(this.type, _apiResponse.type) && + Objects.equals(this.message, _apiResponse.message); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(code, type, message); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelFile.java index 8d72f2cea260..cfd98539ff7b 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelFile.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -56,7 +52,6 @@ public ModelFile sourceURI(@jakarta.annotation.Nullable String sourceURI) { * @return sourceURI */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SOURCE_U_R_I, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -77,12 +72,19 @@ public void setSourceURI(@jakarta.annotation.Nullable String sourceURI) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(sourceURI); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelList.java index 3548ff1c07eb..e3e79bdacdad 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelList.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -56,7 +52,6 @@ public ModelList _123list(@jakarta.annotation.Nullable String _123list) { * @return _123list */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_123LIST, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -77,12 +72,19 @@ public void set123list(@jakarta.annotation.Nullable String _123list) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(_123list); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelReturn.java index 4ad10dc0a037..2c074bd3a0b0 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -56,7 +52,6 @@ public ModelReturn _return(@jakarta.annotation.Nullable Integer _return) { * @return _return */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_RETURN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -77,12 +72,19 @@ public void setReturn(@jakarta.annotation.Nullable Integer _return) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelReturn _return = (ModelReturn) o; + return Objects.equals(this._return, _return._return); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(_return); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Name.java index e70b16384063..cc1f0253f8ea 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Name.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -80,8 +76,6 @@ public Name name(@jakarta.annotation.Nonnull Integer name) { * @return name */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -102,7 +96,6 @@ public void setName(@jakarta.annotation.Nonnull Integer name) { * @return snakeCase */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SNAKE_CASE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -123,7 +116,6 @@ public Name property(@jakarta.annotation.Nullable String property) { * @return property */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -144,7 +136,6 @@ public void setProperty(@jakarta.annotation.Nullable String property) { * @return _123number */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_123NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -160,12 +151,22 @@ public Integer get123number() { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Name name = (Name) o; + return Objects.equals(this.name, name.name) && + Objects.equals(this.snakeCase, name.snakeCase) && + Objects.equals(this.property, name.property) && + Objects.equals(this._123number, name._123number); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(name, snakeCase, property, _123number); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableClass.java index 60cb4a0740be..dc8b80a2a03c 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableClass.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -40,8 +38,6 @@ import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -115,7 +111,6 @@ public NullableClass integerProp(@jakarta.annotation.Nullable Integer integerPro * @return integerProp */ @jakarta.annotation.Nullable - @JsonIgnore public Integer getIntegerProp() { @@ -149,8 +144,6 @@ public NullableClass numberProp(@jakarta.annotation.Nullable BigDecimal numberPr * @return numberProp */ @jakarta.annotation.Nullable - @Valid - @JsonIgnore public BigDecimal getNumberProp() { @@ -184,7 +177,6 @@ public NullableClass booleanProp(@jakarta.annotation.Nullable Boolean booleanPro * @return booleanProp */ @jakarta.annotation.Nullable - @JsonIgnore public Boolean getBooleanProp() { @@ -218,7 +210,6 @@ public NullableClass stringProp(@jakarta.annotation.Nullable String stringProp) * @return stringProp */ @jakarta.annotation.Nullable - @JsonIgnore public String getStringProp() { @@ -252,8 +243,6 @@ public NullableClass dateProp(@jakarta.annotation.Nullable LocalDate dateProp) { * @return dateProp */ @jakarta.annotation.Nullable - @Valid - @JsonIgnore public LocalDate getDateProp() { @@ -287,8 +276,6 @@ public NullableClass datetimeProp(@jakarta.annotation.Nullable OffsetDateTime da * @return datetimeProp */ @jakarta.annotation.Nullable - @Valid - @JsonIgnore public OffsetDateTime getDatetimeProp() { @@ -334,7 +321,6 @@ public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) { * @return arrayNullableProp */ @jakarta.annotation.Nullable - @JsonIgnore public List getArrayNullableProp() { @@ -380,7 +366,6 @@ public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullab * @return arrayAndItemsNullableProp */ @jakarta.annotation.Nullable - @JsonIgnore public List getArrayAndItemsNullableProp() { @@ -422,7 +407,6 @@ public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) { * @return arrayItemsNullable */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ARRAY_ITEMS_NULLABLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -460,7 +444,6 @@ public NullableClass putObjectNullablePropItem(String key, Object objectNullable * @return objectNullableProp */ @jakarta.annotation.Nullable - @JsonIgnore public Map getObjectNullableProp() { @@ -506,7 +489,6 @@ public NullableClass putObjectAndItemsNullablePropItem(String key, Object object * @return objectAndItemsNullableProp */ @jakarta.annotation.Nullable - @JsonIgnore public Map getObjectAndItemsNullableProp() { @@ -548,7 +530,6 @@ public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNu * @return objectItemsNullable */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_OBJECT_ITEMS_NULLABLE, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) @@ -606,7 +587,26 @@ public Object getAdditionalProperty(String key) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NullableClass nullableClass = (NullableClass) o; + return equalsNullable(this.integerProp, nullableClass.integerProp) && + equalsNullable(this.numberProp, nullableClass.numberProp) && + equalsNullable(this.booleanProp, nullableClass.booleanProp) && + equalsNullable(this.stringProp, nullableClass.stringProp) && + equalsNullable(this.dateProp, nullableClass.dateProp) && + equalsNullable(this.datetimeProp, nullableClass.datetimeProp) && + equalsNullable(this.arrayNullableProp, nullableClass.arrayNullableProp) && + equalsNullable(this.arrayAndItemsNullableProp, nullableClass.arrayAndItemsNullableProp) && + Objects.equals(this.arrayItemsNullable, nullableClass.arrayItemsNullable) && + equalsNullable(this.objectNullableProp, nullableClass.objectNullableProp) && + equalsNullable(this.objectAndItemsNullableProp, nullableClass.objectAndItemsNullableProp) && + Objects.equals(this.objectItemsNullable, nullableClass.objectItemsNullable)&& + Objects.equals(this.additionalProperties, nullableClass.additionalProperties); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -615,7 +615,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(hashCodeNullable(integerProp), hashCodeNullable(numberProp), hashCodeNullable(booleanProp), hashCodeNullable(stringProp), hashCodeNullable(dateProp), hashCodeNullable(datetimeProp), hashCodeNullable(arrayNullableProp), hashCodeNullable(arrayAndItemsNullableProp), arrayItemsNullable, hashCodeNullable(objectNullableProp), hashCodeNullable(objectAndItemsNullableProp), objectItemsNullable, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableShape.java index f37075699d82..3a76d17e8872 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableShape.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -34,8 +28,6 @@ import org.openapitools.client.model.Quadrilateral; import org.openapitools.client.model.Triangle; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -99,22 +91,6 @@ public NullableShapeDeserializer(Class vc) { public NullableShape deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { JsonNode tree = ctxt.readTree(jp); Object deserialized = null; - NullableShape newNullableShape = new NullableShape(); - Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); - String discriminatorValue = (String)result2.get("shapeType"); - switch (discriminatorValue) { - case "Quadrilateral": - deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class); - newNullableShape.setActualInstance(deserialized); - return newNullableShape; - case "Triangle": - deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class); - newNullableShape.setActualInstance(deserialized); - return newNullableShape; - default: - log.log(Level.WARNING, String.format(java.util.Locale.ROOT, "Failed to lookup discriminator value `%s` for NullableShape. Possible values: Quadrilateral Triangle", discriminatorValue)); - } - boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; JsonToken token = tree.traverse(jp.getCodec()).nextToken(); @@ -173,56 +149,7 @@ public NullableShape getNullValue(DeserializationContext ctxt) throws JsonMappin public NullableShape() { super("oneOf", Boolean.TRUE); } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public NullableShape putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - /** - * Return true if this NullableShape object is equal to o. - */ - @Override - public boolean equals(Object o) { - return super.equals(o) && Objects.equals(this.additionalProperties, ((NullableShape)o).additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); - } public NullableShape(Triangle o) { super("oneOf", Boolean.FALSE); setActualInstance(o); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NumberOnly.java index 366223248587..2f00a1bdf036 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -26,8 +24,6 @@ import java.math.BigDecimal; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -56,8 +52,6 @@ public NumberOnly justNumber(@jakarta.annotation.Nullable BigDecimal justNumber) * @return justNumber */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_JUST_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -78,12 +72,19 @@ public void setJustNumber(@jakarta.annotation.Nullable BigDecimal justNumber) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NumberOnly numberOnly = (NumberOnly) o; + return Objects.equals(this.justNumber, numberOnly.justNumber); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(justNumber); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index a999ac4fd377..0494242b4b5d 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -29,8 +27,6 @@ import java.util.List; import org.openapitools.client.model.DeprecatedObject; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -77,7 +73,6 @@ public ObjectWithDeprecatedFields uuid(@jakarta.annotation.Nullable String uuid) * @return uuid */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_UUID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -106,8 +101,6 @@ public ObjectWithDeprecatedFields id(@jakarta.annotation.Nullable BigDecimal id) */ @Deprecated @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -137,8 +130,6 @@ public ObjectWithDeprecatedFields deprecatedRef(@jakarta.annotation.Nullable Dep */ @Deprecated @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_DEPRECATED_REF, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -176,7 +167,6 @@ public ObjectWithDeprecatedFields addBarsItem(String barsItem) { */ @Deprecated @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_BARS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -198,12 +188,22 @@ public void setBars(@jakarta.annotation.Nullable List bars) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObjectWithDeprecatedFields objectWithDeprecatedFields = (ObjectWithDeprecatedFields) o; + return Objects.equals(this.uuid, objectWithDeprecatedFields.uuid) && + Objects.equals(this.id, objectWithDeprecatedFields.id) && + Objects.equals(this.deprecatedRef, objectWithDeprecatedFields.deprecatedRef) && + Objects.equals(this.bars, objectWithDeprecatedFields.bars); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(uuid, id, deprecatedRef, bars); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java index 1a8521382d8b..628154f7ef8f 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -26,8 +24,6 @@ import java.time.OffsetDateTime; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -118,7 +114,6 @@ public Order id(@jakarta.annotation.Nullable Long id) { * @return id */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -144,7 +139,6 @@ public Order petId(@jakarta.annotation.Nullable Long petId) { * @return petId */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PET_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -170,7 +164,6 @@ public Order quantity(@jakarta.annotation.Nullable Integer quantity) { * @return quantity */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_QUANTITY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -196,8 +189,6 @@ public Order shipDate(@jakarta.annotation.Nullable OffsetDateTime shipDate) { * @return shipDate */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_SHIP_DATE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -223,7 +214,6 @@ public Order status(@jakarta.annotation.Nullable StatusEnum status) { * @return status */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -249,7 +239,6 @@ public Order complete(@jakarta.annotation.Nullable Boolean complete) { * @return complete */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_COMPLETE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -270,12 +259,24 @@ public void setComplete(@jakarta.annotation.Nullable Boolean complete) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Order order = (Order) o; + return Objects.equals(this.id, order.id) && + Objects.equals(this.petId, order.petId) && + Objects.equals(this.quantity, order.quantity) && + Objects.equals(this.shipDate, order.shipDate) && + Objects.equals(this.status, order.status) && + Objects.equals(this.complete, order.complete); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(id, petId, quantity, shipDate, status, complete); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterComposite.java index abbab8cdc38d..fda5badcecb7 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -26,8 +24,6 @@ import java.math.BigDecimal; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -66,8 +62,6 @@ public OuterComposite myNumber(@jakarta.annotation.Nullable BigDecimal myNumber) * @return myNumber */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_MY_NUMBER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -93,7 +87,6 @@ public OuterComposite myString(@jakarta.annotation.Nullable String myString) { * @return myString */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_MY_STRING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -119,7 +112,6 @@ public OuterComposite myBoolean(@jakarta.annotation.Nullable Boolean myBoolean) * @return myBoolean */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_MY_BOOLEAN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -140,12 +132,21 @@ public void setMyBoolean(@jakarta.annotation.Nullable Boolean myBoolean) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterComposite outerComposite = (OuterComposite) o; + return Objects.equals(this.myNumber, outerComposite.myNumber) && + Objects.equals(this.myString, outerComposite.myString) && + Objects.equals(this.myBoolean, outerComposite.myBoolean); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(myNumber, myString, myBoolean); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnum.java index ff6b4dff8e97..d50018b999d5 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -13,14 +13,10 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java index 55e81d230056..73020e1e3b87 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java @@ -13,14 +13,10 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumInteger.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumInteger.java index 55c38bd319f2..a83925c58695 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumInteger.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumInteger.java @@ -13,14 +13,10 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java index b6156de0ce6a..383ca4227422 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java @@ -13,14 +13,10 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ParentPet.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ParentPet.java index d7f2b66ce113..d69986aadc73 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ParentPet.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ParentPet.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -33,8 +27,6 @@ import java.util.Arrays; import org.openapitools.client.model.GrandparentAnimal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -56,55 +48,24 @@ public class ParentPet extends GrandparentAnimal { public ParentPet() { } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public ParentPet putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } /** * Return true if this ParentPet object is equal to o. */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(super.hashCode()); } @Override @@ -112,7 +73,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ParentPet {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java index 57bc29549b05..9dcc1af2c993 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -29,8 +27,6 @@ import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -65,7 +61,7 @@ public class Pet { public static final String JSON_PROPERTY_TAGS = "tags"; @jakarta.annotation.Nullable - private List<@Valid Tag> tags = new ArrayList<>(); + private List tags = new ArrayList<>(); /** * pet status in the store @@ -121,7 +117,6 @@ public Pet id(@jakarta.annotation.Nullable Long id) { * @return id */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -147,8 +142,6 @@ public Pet category(@jakarta.annotation.Nullable Category category) { * @return category */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_CATEGORY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -174,8 +167,6 @@ public Pet name(@jakarta.annotation.Nonnull String name) { * @return name */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -209,8 +200,6 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_PHOTO_URLS, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -226,7 +215,7 @@ public void setPhotoUrls(@jakarta.annotation.Nonnull List photoUrls) { } - public Pet tags(@jakarta.annotation.Nullable List<@Valid Tag> tags) { + public Pet tags(@jakarta.annotation.Nullable List tags) { this.tags = tags; return this; } @@ -244,19 +233,17 @@ public Pet addTagsItem(Tag tagsItem) { * @return tags */ @jakarta.annotation.Nullable - @Valid - @JsonProperty(value = JSON_PROPERTY_TAGS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List<@Valid Tag> getTags() { + public List getTags() { return tags; } @JsonProperty(value = JSON_PROPERTY_TAGS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTags(@jakarta.annotation.Nullable List<@Valid Tag> tags) { + public void setTags(@jakarta.annotation.Nullable List tags) { this.tags = tags; } @@ -271,7 +258,6 @@ public Pet status(@jakarta.annotation.Nullable StatusEnum status) { * @return status */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -292,12 +278,24 @@ public void setStatus(@jakarta.annotation.Nullable StatusEnum status) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(this.id, pet.id) && + Objects.equals(this.category, pet.category) && + Objects.equals(this.name, pet.name) && + Objects.equals(this.photoUrls, pet.photoUrls) && + Objects.equals(this.tags, pet.tags) && + Objects.equals(this.status, pet.status); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(id, category, name, photoUrls, tags, status); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pig.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pig.java index acc3ab45717a..ef25a4326b5c 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pig.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -34,8 +28,6 @@ import org.openapitools.client.model.BasquePig; import org.openapitools.client.model.DanishPig; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -99,22 +91,6 @@ public PigDeserializer(Class vc) { public Pig deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { JsonNode tree = ctxt.readTree(jp); Object deserialized = null; - Pig newPig = new Pig(); - Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); - String discriminatorValue = (String)result2.get("className"); - switch (discriminatorValue) { - case "BasquePig": - deserialized = tree.traverse(jp.getCodec()).readValueAs(BasquePig.class); - newPig.setActualInstance(deserialized); - return newPig; - case "DanishPig": - deserialized = tree.traverse(jp.getCodec()).readValueAs(DanishPig.class); - newPig.setActualInstance(deserialized); - return newPig; - default: - log.log(Level.WARNING, String.format(java.util.Locale.ROOT, "Failed to lookup discriminator value `%s` for Pig. Possible values: BasquePig DanishPig", discriminatorValue)); - } - boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; JsonToken token = tree.traverse(jp.getCodec()).nextToken(); @@ -173,56 +149,7 @@ public Pig getNullValue(DeserializationContext ctxt) throws JsonMappingException public Pig() { super("oneOf", Boolean.FALSE); } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public Pig putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - /** - * Return true if this Pig object is equal to o. - */ - @Override - public boolean equals(Object o) { - return super.equals(o) && Objects.equals(this.additionalProperties, ((Pig)o).additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); - } public Pig(BasquePig o) { super("oneOf", Boolean.FALSE); setActualInstance(o); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Quadrilateral.java index ad90ab7a8a47..4e23ab92c036 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -34,8 +28,6 @@ import org.openapitools.client.model.ComplexQuadrilateral; import org.openapitools.client.model.SimpleQuadrilateral; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -99,22 +91,6 @@ public QuadrilateralDeserializer(Class vc) { public Quadrilateral deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { JsonNode tree = ctxt.readTree(jp); Object deserialized = null; - Quadrilateral newQuadrilateral = new Quadrilateral(); - Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); - String discriminatorValue = (String)result2.get("quadrilateralType"); - switch (discriminatorValue) { - case "ComplexQuadrilateral": - deserialized = tree.traverse(jp.getCodec()).readValueAs(ComplexQuadrilateral.class); - newQuadrilateral.setActualInstance(deserialized); - return newQuadrilateral; - case "SimpleQuadrilateral": - deserialized = tree.traverse(jp.getCodec()).readValueAs(SimpleQuadrilateral.class); - newQuadrilateral.setActualInstance(deserialized); - return newQuadrilateral; - default: - log.log(Level.WARNING, String.format(java.util.Locale.ROOT, "Failed to lookup discriminator value `%s` for Quadrilateral. Possible values: ComplexQuadrilateral SimpleQuadrilateral", discriminatorValue)); - } - boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; JsonToken token = tree.traverse(jp.getCodec()).nextToken(); @@ -173,56 +149,7 @@ public Quadrilateral getNullValue(DeserializationContext ctxt) throws JsonMappin public Quadrilateral() { super("oneOf", Boolean.FALSE); } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public Quadrilateral putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - /** - * Return true if this Quadrilateral object is equal to o. - */ - @Override - public boolean equals(Object o) { - return super.equals(o) && Objects.equals(this.additionalProperties, ((Quadrilateral)o).additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); - } public Quadrilateral(SimpleQuadrilateral o) { super("oneOf", Boolean.FALSE); setActualInstance(o); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java index a2a89a484fa5..688d3ee7e161 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -55,8 +51,6 @@ public QuadrilateralInterface quadrilateralType(@jakarta.annotation.Nonnull Stri * @return quadrilateralType */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -77,12 +71,19 @@ public void setQuadrilateralType(@jakarta.annotation.Nonnull String quadrilatera */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QuadrilateralInterface quadrilateralInterface = (QuadrilateralInterface) o; + return Objects.equals(this.quadrilateralType, quadrilateralInterface.quadrilateralType); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(quadrilateralType); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 806041d468e4..f277c0153703 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -63,7 +59,6 @@ public ReadOnlyFirst( * @return bar */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_BAR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -84,7 +79,6 @@ public ReadOnlyFirst baz(@jakarta.annotation.Nullable String baz) { * @return baz */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_BAZ, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -105,12 +99,20 @@ public void setBaz(@jakarta.annotation.Nullable String baz) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; + return Objects.equals(this.bar, readOnlyFirst.bar) && + Objects.equals(this.baz, readOnlyFirst.baz); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(bar, baz); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java index 6d54c432e85d..530ccd181d6a 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -29,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -64,8 +56,6 @@ public ScaleneTriangle shapeType(@jakarta.annotation.Nonnull String shapeType) { * @return shapeType */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -91,8 +81,6 @@ public ScaleneTriangle triangleType(@jakarta.annotation.Nonnull String triangleT * @return triangleType */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -107,55 +95,26 @@ public void setTriangleType(@jakarta.annotation.Nonnull String triangleType) { this.triangleType = triangleType; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public ScaleneTriangle putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } /** * Return true if this ScaleneTriangle object is equal to o. */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScaleneTriangle scaleneTriangle = (ScaleneTriangle) o; + return Objects.equals(this.shapeType, scaleneTriangle.shapeType) && + Objects.equals(this.triangleType, scaleneTriangle.triangleType); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(shapeType, triangleType); } @Override @@ -164,7 +123,6 @@ public String toString() { sb.append("class ScaleneTriangle {\n"); sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); sb.append(" triangleType: ").append(toIndentedString(triangleType)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Shape.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Shape.java index dedc0fc269df..2b1671eb9115 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Shape.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -34,8 +28,6 @@ import org.openapitools.client.model.Quadrilateral; import org.openapitools.client.model.Triangle; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -99,22 +91,6 @@ public ShapeDeserializer(Class vc) { public Shape deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { JsonNode tree = ctxt.readTree(jp); Object deserialized = null; - Shape newShape = new Shape(); - Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); - String discriminatorValue = (String)result2.get("shapeType"); - switch (discriminatorValue) { - case "Quadrilateral": - deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class); - newShape.setActualInstance(deserialized); - return newShape; - case "Triangle": - deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class); - newShape.setActualInstance(deserialized); - return newShape; - default: - log.log(Level.WARNING, String.format(java.util.Locale.ROOT, "Failed to lookup discriminator value `%s` for Shape. Possible values: Quadrilateral Triangle", discriminatorValue)); - } - boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; JsonToken token = tree.traverse(jp.getCodec()).nextToken(); @@ -173,56 +149,7 @@ public Shape getNullValue(DeserializationContext ctxt) throws JsonMappingExcepti public Shape() { super("oneOf", Boolean.FALSE); } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public Shape putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - /** - * Return true if this Shape object is equal to o. - */ - @Override - public boolean equals(Object o) { - return super.equals(o) && Objects.equals(this.additionalProperties, ((Shape)o).additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); - } public Shape(Triangle o) { super("oneOf", Boolean.FALSE); setActualInstance(o); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeInterface.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeInterface.java index 40b2f50b212c..275fbc6644bf 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeInterface.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeInterface.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -55,8 +51,6 @@ public ShapeInterface shapeType(@jakarta.annotation.Nonnull String shapeType) { * @return shapeType */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -77,12 +71,19 @@ public void setShapeType(@jakarta.annotation.Nonnull String shapeType) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ShapeInterface shapeInterface = (ShapeInterface) o; + return Objects.equals(this.shapeType, shapeInterface.shapeType); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(shapeType); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeOrNull.java index 0f92751d55bd..c7f385c28183 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -34,8 +28,6 @@ import org.openapitools.client.model.Quadrilateral; import org.openapitools.client.model.Triangle; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -99,22 +91,6 @@ public ShapeOrNullDeserializer(Class vc) { public ShapeOrNull deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { JsonNode tree = ctxt.readTree(jp); Object deserialized = null; - ShapeOrNull newShapeOrNull = new ShapeOrNull(); - Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); - String discriminatorValue = (String)result2.get("shapeType"); - switch (discriminatorValue) { - case "Quadrilateral": - deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class); - newShapeOrNull.setActualInstance(deserialized); - return newShapeOrNull; - case "Triangle": - deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class); - newShapeOrNull.setActualInstance(deserialized); - return newShapeOrNull; - default: - log.log(Level.WARNING, String.format(java.util.Locale.ROOT, "Failed to lookup discriminator value `%s` for ShapeOrNull. Possible values: Quadrilateral Triangle", discriminatorValue)); - } - boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; JsonToken token = tree.traverse(jp.getCodec()).nextToken(); @@ -173,56 +149,7 @@ public ShapeOrNull getNullValue(DeserializationContext ctxt) throws JsonMappingE public ShapeOrNull() { super("oneOf", Boolean.TRUE); } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public ShapeOrNull putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - /** - * Return true if this ShapeOrNull object is equal to o. - */ - @Override - public boolean equals(Object o) { - return super.equals(o) && Objects.equals(this.additionalProperties, ((ShapeOrNull)o).additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); - } public ShapeOrNull(Triangle o) { super("oneOf", Boolean.FALSE); setActualInstance(o); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java index d56925add207..ab81d8d4201a 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -29,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -64,8 +56,6 @@ public SimpleQuadrilateral shapeType(@jakarta.annotation.Nonnull String shapeTyp * @return shapeType */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -91,8 +81,6 @@ public SimpleQuadrilateral quadrilateralType(@jakarta.annotation.Nonnull String * @return quadrilateralType */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -107,55 +95,26 @@ public void setQuadrilateralType(@jakarta.annotation.Nonnull String quadrilatera this.quadrilateralType = quadrilateralType; } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public SimpleQuadrilateral putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } /** * Return true if this SimpleQuadrilateral object is equal to o. */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SimpleQuadrilateral simpleQuadrilateral = (SimpleQuadrilateral) o; + return Objects.equals(this.shapeType, simpleQuadrilateral.shapeType) && + Objects.equals(this.quadrilateralType, simpleQuadrilateral.quadrilateralType); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(shapeType, quadrilateralType); } @Override @@ -164,7 +123,6 @@ public String toString() { sb.append("class SimpleQuadrilateral {\n"); sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); sb.append(" quadrilateralType: ").append(toIndentedString(quadrilateralType)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SpecialModelName.java index e34277354af2..e1537ebd15b5 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -61,7 +57,6 @@ public SpecialModelName() { * @return $specialPropertyName */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -87,7 +82,6 @@ public SpecialModelName specialModelName(@jakarta.annotation.Nullable String spe * @return specialModelName */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SPECIAL_MODEL_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -108,12 +102,20 @@ public void setSpecialModelName(@jakarta.annotation.Nullable String specialModel */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName) && + Objects.equals(this.specialModelName, specialModelName.specialModelName); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash($specialPropertyName, specialModelName); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java index a81f7ff44082..07817e57d16b 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -60,7 +56,6 @@ public Tag id(@jakarta.annotation.Nullable Long id) { * @return id */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -86,7 +81,6 @@ public Tag name(@jakarta.annotation.Nullable String name) { * @return name */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -107,12 +101,20 @@ public void setName(@jakarta.annotation.Nullable String name) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tag tag = (Tag) o; + return Objects.equals(this.id, tag.id) && + Objects.equals(this.name, tag.name); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(id, name); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index 218650c2a1e8..05cdd86840ab 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -29,8 +27,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -60,7 +56,6 @@ public TestInlineFreeformAdditionalPropertiesRequest someProperty(@jakarta.annot * @return someProperty */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SOME_PROPERTY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -118,12 +113,20 @@ public Object getAdditionalProperty(String key) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; + return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty)&& + Objects.equals(this.additionalProperties, testInlineFreeformAdditionalPropertiesRequest.additionalProperties); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(someProperty, additionalProperties); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Triangle.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Triangle.java index 7d2130da4415..db2db396b9f9 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Triangle.java @@ -13,12 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -35,8 +29,6 @@ import org.openapitools.client.model.IsoscelesTriangle; import org.openapitools.client.model.ScaleneTriangle; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; import com.fasterxml.jackson.core.type.TypeReference; @@ -100,26 +92,6 @@ public TriangleDeserializer(Class vc) { public Triangle deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { JsonNode tree = ctxt.readTree(jp); Object deserialized = null; - Triangle newTriangle = new Triangle(); - Map result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); - String discriminatorValue = (String)result2.get("triangleType"); - switch (discriminatorValue) { - case "EquilateralTriangle": - deserialized = tree.traverse(jp.getCodec()).readValueAs(EquilateralTriangle.class); - newTriangle.setActualInstance(deserialized); - return newTriangle; - case "IsoscelesTriangle": - deserialized = tree.traverse(jp.getCodec()).readValueAs(IsoscelesTriangle.class); - newTriangle.setActualInstance(deserialized); - return newTriangle; - case "ScaleneTriangle": - deserialized = tree.traverse(jp.getCodec()).readValueAs(ScaleneTriangle.class); - newTriangle.setActualInstance(deserialized); - return newTriangle; - default: - log.log(Level.WARNING, String.format(java.util.Locale.ROOT, "Failed to lookup discriminator value `%s` for Triangle. Possible values: EquilateralTriangle IsoscelesTriangle ScaleneTriangle", discriminatorValue)); - } - boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; JsonToken token = tree.traverse(jp.getCodec()).nextToken(); @@ -194,56 +166,7 @@ public Triangle getNullValue(DeserializationContext ctxt) throws JsonMappingExce public Triangle() { super("oneOf", Boolean.FALSE); } - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - */ - @JsonAnySetter - public Triangle putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap<>(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) property. - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - /** - * Return true if this Triangle object is equal to o. - */ - @Override - public boolean equals(Object o) { - return super.equals(o) && Objects.equals(this.additionalProperties, ((Triangle)o).additionalProperties); - } - @Override - public int hashCode() { - return Objects.hash(getActualInstance(), isNullable(), getSchemaType(), additionalProperties); - } public Triangle(EquilateralTriangle o) { super("oneOf", Boolean.FALSE); setActualInstance(o); diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TriangleInterface.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TriangleInterface.java index 3920d3fb5447..c6fc7baab0ee 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TriangleInterface.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TriangleInterface.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -55,8 +51,6 @@ public TriangleInterface triangleType(@jakarta.annotation.Nonnull String triangl * @return triangleType */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -77,12 +71,19 @@ public void setTriangleType(@jakarta.annotation.Nonnull String triangleType) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TriangleInterface triangleInterface = (TriangleInterface) o; + return Objects.equals(this.triangleType, triangleInterface.triangleType); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(triangleType); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java index 4702efc203d1..e003616ccee0 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -29,8 +27,6 @@ import org.openapitools.jackson.nullable.JsonNullable; import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -111,7 +107,6 @@ public User id(@jakarta.annotation.Nullable Long id) { * @return id */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -137,7 +132,6 @@ public User username(@jakarta.annotation.Nullable String username) { * @return username */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_USERNAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -163,7 +157,6 @@ public User firstName(@jakarta.annotation.Nullable String firstName) { * @return firstName */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_FIRST_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -189,7 +182,6 @@ public User lastName(@jakarta.annotation.Nullable String lastName) { * @return lastName */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_LAST_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -215,7 +207,6 @@ public User email(@jakarta.annotation.Nullable String email) { * @return email */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_EMAIL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -241,7 +232,6 @@ public User password(@jakarta.annotation.Nullable String password) { * @return password */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -267,7 +257,6 @@ public User phone(@jakarta.annotation.Nullable String phone) { * @return phone */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PHONE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -293,7 +282,6 @@ public User userStatus(@jakarta.annotation.Nullable Integer userStatus) { * @return userStatus */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_USER_STATUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -319,7 +307,6 @@ public User objectWithNoDeclaredProps(@jakarta.annotation.Nullable Object object * @return objectWithNoDeclaredProps */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -345,7 +332,6 @@ public User objectWithNoDeclaredPropsNullable(@jakarta.annotation.Nullable Objec * @return objectWithNoDeclaredPropsNullable */ @jakarta.annotation.Nullable - @JsonIgnore public Object getObjectWithNoDeclaredPropsNullable() { @@ -379,7 +365,6 @@ public User anyTypeProp(@jakarta.annotation.Nullable Object anyTypeProp) { * @return anyTypeProp */ @jakarta.annotation.Nullable - @JsonIgnore public Object getAnyTypeProp() { @@ -413,7 +398,6 @@ public User anyTypePropNullable(@jakarta.annotation.Nullable Object anyTypePropN * @return anyTypePropNullable */ @jakarta.annotation.Nullable - @JsonIgnore public Object getAnyTypePropNullable() { @@ -442,7 +426,25 @@ public void setAnyTypePropNullable(@jakarta.annotation.Nullable Object anyTypePr */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(this.id, user.id) && + Objects.equals(this.username, user.username) && + Objects.equals(this.firstName, user.firstName) && + Objects.equals(this.lastName, user.lastName) && + Objects.equals(this.email, user.email) && + Objects.equals(this.password, user.password) && + Objects.equals(this.phone, user.phone) && + Objects.equals(this.userStatus, user.userStatus) && + Objects.equals(this.objectWithNoDeclaredProps, user.objectWithNoDeclaredProps) && + equalsNullable(this.objectWithNoDeclaredPropsNullable, user.objectWithNoDeclaredPropsNullable) && + equalsNullable(this.anyTypeProp, user.anyTypeProp) && + equalsNullable(this.anyTypePropNullable, user.anyTypePropNullable); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -451,7 +453,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus, objectWithNoDeclaredProps, hashCodeNullable(objectWithNoDeclaredPropsNullable), hashCodeNullable(anyTypeProp), hashCodeNullable(anyTypePropNullable)); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Whale.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Whale.java index 965b4cd7c5ab..a74efed93661 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Whale.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Whale.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -25,8 +23,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -66,7 +62,6 @@ public Whale hasBaleen(@jakarta.annotation.Nullable Boolean hasBaleen) { * @return hasBaleen */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_HAS_BALEEN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -92,7 +87,6 @@ public Whale hasTeeth(@jakarta.annotation.Nullable Boolean hasTeeth) { * @return hasTeeth */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_HAS_TEETH, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -118,8 +112,6 @@ public Whale className(@jakarta.annotation.Nonnull String className) { * @return className */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -140,12 +132,21 @@ public void setClassName(@jakarta.annotation.Nonnull String className) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Whale whale = (Whale) o; + return Objects.equals(this.hasBaleen, whale.hasBaleen) && + Objects.equals(this.hasTeeth, whale.hasTeeth) && + Objects.equals(this.className, whale.className); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(hasBaleen, hasTeeth, className); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Zebra.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Zebra.java index 209104fdfc82..50e06af9e38f 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Zebra.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Zebra.java @@ -13,8 +13,6 @@ package org.openapitools.client.model; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -29,8 +27,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import jakarta.validation.constraints.*; -import jakarta.validation.Valid; import org.openapitools.client.JSON; @@ -102,7 +98,6 @@ public Zebra type(@jakarta.annotation.Nullable TypeEnum type) { * @return type */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -128,8 +123,6 @@ public Zebra className(@jakarta.annotation.Nonnull String className) { * @return className */ @jakarta.annotation.Nonnull - @NotNull - @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -187,12 +180,21 @@ public Object getAdditionalProperty(String key) { */ @Override public boolean equals(Object o) { - return EqualsBuilder.reflectionEquals(this, o, false, null, true); + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Zebra zebra = (Zebra) o; + return Objects.equals(this.type, zebra.type) && + Objects.equals(this.className, zebra.className)&& + Objects.equals(this.additionalProperties, zebra.additionalProperties); } @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + return Objects.hash(type, className, additionalProperties); } @Override From 7275384c256ea299178440888be550e703b692d7 Mon Sep 17 00:00:00 2001 From: Chhida <44230565+Chhida@users.noreply.github.com> Date: Mon, 20 Apr 2026 10:47:00 +0100 Subject: [PATCH 16/17] fix: address cubic-dev-ai review comments - Remove {{^-first}} to include ALL responses in errorType map (not just from 2nd response) - Add transient keyword to errorEntity field for serialization safety - Update test to expect transient keyword - Regenerate samples with fixes --- .../src/main/resources/Java/libraries/jersey3/api.mustache | 2 -- .../resources/Java/libraries/jersey3/apiException.mustache | 2 +- .../java/jersey3/JavaJersey3ErrorEntityFunctionalTest.java | 4 ++-- samples/client/petstore/java/jersey3-oneOf/pom.xml | 1 + 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api.mustache index 03210490afb7..feb5324dd7e2 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api.mustache @@ -197,11 +197,9 @@ public class {{classname}} { {{/hasAuthMethods}} final Map localVarErrorTypes = new HashMap(); {{#responses}} - {{^-first}} {{#dataType}} localVarErrorTypes.put("{{code}}", new GenericType<{{{dataType}}}>() {}); {{/dataType}} - {{/-first}} {{/responses}} {{#returnType}} GenericType<{{{returnType}}}> localVarReturnType = new GenericType<{{{returnType}}}>() {}; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/apiException.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/apiException.mustache index e3b40f7d6cca..73548e25abc1 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/apiException.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/apiException.mustache @@ -20,7 +20,7 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us private int code = 0; private Map> responseHeaders = null; private String responseBody = null; - private Object errorEntity = null; + private transient Object errorEntity = null; public ApiException() {} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jersey3/JavaJersey3ErrorEntityFunctionalTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jersey3/JavaJersey3ErrorEntityFunctionalTest.java index 4ac873f3428e..6b3610fc8c56 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jersey3/JavaJersey3ErrorEntityFunctionalTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jersey3/JavaJersey3ErrorEntityFunctionalTest.java @@ -50,8 +50,8 @@ public void testGeneratedApiExceptionHasErrorEntity() throws Exception { String template = readTemplate("apiException.mustache"); assertNotNull(template); - // Verify errorEntity field exists - assertTrue(template.contains("private Object errorEntity = null"), + // Verify errorEntity field exists (transient for serialization safety) + assertTrue(template.contains("private transient Object errorEntity = null"), "Generated ApiException should have errorEntity field"); // Verify getErrorEntity() method exists diff --git a/samples/client/petstore/java/jersey3-oneOf/pom.xml b/samples/client/petstore/java/jersey3-oneOf/pom.xml index c0d7a05a48f2..b4e3b9c5a084 100644 --- a/samples/client/petstore/java/jersey3-oneOf/pom.xml +++ b/samples/client/petstore/java/jersey3-oneOf/pom.xml @@ -358,6 +358,7 @@ 3.12.0 1.8 5.10.0 + 5.10.0 2.21.0 From b20c211b6946213f379a7be44d182509349c17f5 Mon Sep 17 00:00:00 2001 From: Chhida <44230565+Chhida@users.noreply.github.com> Date: Mon, 20 Apr 2026 11:58:50 +0100 Subject: [PATCH 17/17] fix: remove duplicate junit-version property from pom.xml Duplicate property removed to fix P2 issue from cubic-dev-ai review. --- samples/client/petstore/java/jersey3-oneOf/pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/samples/client/petstore/java/jersey3-oneOf/pom.xml b/samples/client/petstore/java/jersey3-oneOf/pom.xml index b4e3b9c5a084..c0d7a05a48f2 100644 --- a/samples/client/petstore/java/jersey3-oneOf/pom.xml +++ b/samples/client/petstore/java/jersey3-oneOf/pom.xml @@ -358,7 +358,6 @@ 3.12.0 1.8 5.10.0 - 5.10.0 2.21.0