diff --git a/.github/workflows/samples-java-client-jdk11.yaml b/.github/workflows/samples-java-client-jdk11.yaml index 268d078095c3..22d6e72a987b 100644 --- a/.github/workflows/samples-java-client-jdk11.yaml +++ b/.github/workflows/samples-java-client-jdk11.yaml @@ -61,12 +61,15 @@ jobs: - samples/client/petstore/java/rest-assured - samples/client/petstore/java/rest-assured-jackson - samples/client/petstore/java/microprofile-rest-client + - samples/client/petstore/java/microprofile-rest-client-mutiny - samples/client/petstore/java/microprofile-rest-client-3.0 - samples/client/petstore/java/microprofile-rest-client-3.0-jackson - samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml + - samples/client/petstore/java/microprofile-rest-client-3.0-mutiny - samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter - samples/client/petstore/java/apache-httpclient - samples/client/petstore/java/feign + - samples/client/petstore/java/feign-no-nullable - samples/client/petstore/java/okhttp-gson-awsv4signature - samples/openapi3/client/petstore/java/jersey2-java8-special-characters - samples/openapi3/client/petstore/java/native diff --git a/bin/configs/java-feign-no-nullable.yaml b/bin/configs/java-feign-no-nullable.yaml index 05453b419dcf..50aacc2ff08f 100644 --- a/bin/configs/java-feign-no-nullable.yaml +++ b/bin/configs/java-feign-no-nullable.yaml @@ -6,6 +6,8 @@ templateDir: modules/openapi-generator/src/main/resources/Java additionalProperties: booleanGetterPrefix: is artifactId: petstore-feign-no-nullable - hideGenerationTimestamp: "true" + hideGenerationTimestamp: true additionalModelTypeAnnotations: '@javax.annotation.concurrent.Immutable' - openApiNullable: "false" + openApiNullable: false + useReflectionEqualsHashCode: true + annotationLibrary: "swagger1" diff --git a/bin/configs/java-jersey2-8.yaml b/bin/configs/java-jersey2-8.yaml index e4407a08260b..259b88e07ceb 100644 --- a/bin/configs/java-jersey2-8.yaml +++ b/bin/configs/java-jersey2-8.yaml @@ -11,4 +11,5 @@ additionalProperties: useOneOfDiscriminatorLookup: true disallowAdditionalPropertiesIfNotPresent: false gradleProperties: "\n# JVM arguments\norg.gradle.jvmargs=-Xmx2024m -XX:MaxPermSize=512m\n# set timeout\norg.gradle.daemon.idletimeout=3600000\n# show all warnings\norg.gradle.warning.mode=all" - failOnUnknownProperties: true \ No newline at end of file + failOnUnknownProperties: true + useReflectionEqualsHashCode: true diff --git a/bin/configs/java-jersey3.yaml b/bin/configs/java-jersey3.yaml index 3d958f012564..513f3889d3c7 100644 --- a/bin/configs/java-jersey3.yaml +++ b/bin/configs/java-jersey3.yaml @@ -12,4 +12,5 @@ additionalProperties: useOneOfDiscriminatorLookup: true disallowAdditionalPropertiesIfNotPresent: false gradleProperties: "\n# JVM arguments\norg.gradle.jvmargs=-Xmx2024m -XX:MaxPermSize=512m\n# set timeout\norg.gradle.daemon.idletimeout=3600000\n# show all warnings\norg.gradle.warning.mode=all" - failOnUnknownProperties: true \ No newline at end of file + failOnUnknownProperties: true + useReflectionEqualsHashCode: true diff --git a/bin/configs/java-microprofile-rest-client-3.0-mutiny.yaml b/bin/configs/java-microprofile-rest-client-3.0-mutiny.yaml new file mode 100644 index 000000000000..aa2edc314502 --- /dev/null +++ b/bin/configs/java-microprofile-rest-client-3.0-mutiny.yaml @@ -0,0 +1,10 @@ +generatorName: java +outputDir: samples/client/petstore/java/microprofile-rest-client-3.0-mutiny +library: microprofile +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/Java +additionalProperties: + artifactId: microprofile-rest-client-3-mutiny + configKey: petstore + microprofileRestClientVersion: "3.0" + microprofileMutiny: true diff --git a/bin/configs/java-microprofile-rest-client-mutiny.yaml b/bin/configs/java-microprofile-rest-client-mutiny.yaml new file mode 100644 index 000000000000..d27aaf8cdfde --- /dev/null +++ b/bin/configs/java-microprofile-rest-client-mutiny.yaml @@ -0,0 +1,9 @@ +generatorName: java +outputDir: samples/client/petstore/java/microprofile-rest-client-mutiny +library: microprofile +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/Java +additionalProperties: + artifactId: microprofile-rest-client-mutiny + configKeyFromClassName: true + microprofileMutiny: true diff --git a/bin/configs/java-native.yaml b/bin/configs/java-native.yaml index ba1795d9de39..467d6da65459 100644 --- a/bin/configs/java-native.yaml +++ b/bin/configs/java-native.yaml @@ -7,3 +7,4 @@ additionalProperties: artifactId: petstore-native hideGenerationTimestamp: "true" generateBuilders: true + useReflectionEqualsHashCode: "true" diff --git a/bin/configs/java-okhttp-gson.yaml b/bin/configs/java-okhttp-gson.yaml index 8b402a580a80..8f5c07cae49c 100644 --- a/bin/configs/java-okhttp-gson.yaml +++ b/bin/configs/java-okhttp-gson.yaml @@ -11,9 +11,10 @@ parameterNameMappings: type_: typeWithUnderscore additionalProperties: artifactId: petstore-okhttp-gson - hideGenerationTimestamp: "true" - useOneOfDiscriminatorLookup: "true" + hideGenerationTimestamp: true + useOneOfDiscriminatorLookup: true disallowAdditionalPropertiesIfNotPresent: false + useReflectionEqualsHashCode:: true enumNameMappings: s: LOWER_CASE_S S: UPPER_CASE_S diff --git a/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache index 7409e650ff85..6557a7c70b38 100644 --- a/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache @@ -126,6 +126,9 @@ ext { jersey_version = "1.19.4" jodatime_version = "2.9.9" junit_version = "5.10.2" + {{#useReflectionEqualsHashCode}} + commons_lang3_version = "3.17.0" + {{/useReflectionEqualsHashCode}} } dependencies { @@ -148,6 +151,9 @@ dependencies { {{#useBeanValidation}} implementation "jakarta.validation:jakarta.validation-api:$bean_validation_version" {{/useBeanValidation}} + {{#useReflectionEqualsHashCode}} + implementation "org.apache.commons:commons-lang3:$commons_lang3_version" + {{/useReflectionEqualsHashCode}} testImplementation "junit:junit:$junit_version" testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache index 4c485fede0cc..2b4e0340e7fc 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache @@ -114,6 +114,9 @@ ext { feign_form_version = "3.8.0" junit_version = "5.7.0" scribejava_version = "8.0.0" + {{#useReflectionEqualsHashCode}} + commons_lang3_version = "3.17.0" + {{/useReflectionEqualsHashCode}} } dependencies { @@ -127,9 +130,9 @@ dependencies { implementation "io.github.openfeign:feign-okhttp:$feign_version" implementation "io.github.openfeign.form:feign-form:$feign_form_version" {{#jackson}} - {{#joda}} + {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" - {{/joda}} + {{/joda}} implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" @@ -142,6 +145,9 @@ dependencies { implementation "com.github.scribejava:scribejava-core:$scribejava_version" implementation "com.brsanthu:migbase64:2.2" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + {{#useReflectionEqualsHashCode}} + implementation "org.apache.commons:commons-lang3:$commons_lang3_version" + {{/useReflectionEqualsHashCode}} testImplementation "org.junit.jupiter:junit-jupiter:$junit_version" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" testImplementation "org.junit.jupiter:junit-jupiter-params:$junit_version" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache index f42f909cc70f..1a24b99f55d7 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache @@ -28,6 +28,9 @@ lazy val root = (project in file(".")). "com.github.scribejava" % "scribejava-core" % "8.0.0" % "compile", "com.brsanthu" % "migbase64" % "2.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", +{{#useReflectionEqualsHashCode}} + "org.apache.commons" % "commons-lang3" % "3.17.0" % "compile", +{{/useReflectionEqualsHashCode}} "org.junit.jupiter" % "junit-jupiter" % "5.7.0" % "test", "org.junit.jupiter" % "junit-jupiter-params" % "5.7.0" % "test", "com.github.tomakehurst" % "wiremock-jre8" % "2.35.1" % "test", diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache index 79712da6a4e7..c915ea0ec9f4 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache @@ -345,6 +345,14 @@ provided {{/useBeanValidation}} + {{#useReflectionEqualsHashCode}} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + {{/useReflectionEqualsHashCode}} @@ -409,6 +417,9 @@ 1.3.5 2.0.2 {{/useJakartaEe}} + {{#useReflectionEqualsHashCode}} + 3.17.0 + {{/useReflectionEqualsHashCode}} 5.10.0 1.0.0 8.3.3 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache index a9ab96231611..ca6ae2abe01e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache @@ -116,6 +116,9 @@ ext { {{#hasHttpSignatureMethods}} tomitribe_http_signatures_version = "1.7" {{/hasHttpSignatureMethods}} + {{#useReflectionEqualsHashCode}} + commons_lang3_version = "3.17.0" + {{/useReflectionEqualsHashCode}} } dependencies { @@ -146,6 +149,9 @@ dependencies { {{#useBeanValidation}} implementation "jakarta.validation:jakarta.validation-api:$bean_validation_version" {{/useBeanValidation}} + {{#useReflectionEqualsHashCode}} + implementation "org.apache.commons:commons-lang3:$commons_lang3_version" + {{/useReflectionEqualsHashCode}} testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache index d055cf378de5..fa3ead60a2d6 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache @@ -33,6 +33,9 @@ lazy val root = (project in file(".")). "org.tomitribe" % "tomitribe-http-signatures" % "1.7" % "compile", {{/hasHttpSignatureMethods}} "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + {{#useReflectionEqualsHashCode}} + "org.apache.commons" % "commons-lang3" % "3.17.0" % "compile", + {{/useReflectionEqualsHashCode}} "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" ) ) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache index ec3ad12d3285..1373579cadcf 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache @@ -379,6 +379,15 @@ jersey-apache-connector ${jersey-version} + {{#useReflectionEqualsHashCode}} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + {{/useReflectionEqualsHashCode}} + org.junit.jupiter @@ -414,6 +423,9 @@ {{#hasOAuthMethods}} 8.3.3 {{/hasOAuthMethods}} + {{#useReflectionEqualsHashCode}} + 3.17.0 + {{/useReflectionEqualsHashCode}} 2.21.0 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache index 42908c8bb47e..f95eafca0c69 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache @@ -116,6 +116,9 @@ ext { {{#hasHttpSignatureMethods}} tomitribe_http_signatures_version = "1.7" {{/hasHttpSignatureMethods}} + {{#useReflectionEqualsHashCode}} + commons_lang3_version = "3.17.0" + {{/useReflectionEqualsHashCode}} } dependencies { @@ -146,6 +149,9 @@ dependencies { {{#useBeanValidation}} implementation "jakarta.validation:jakarta.validation-api:$bean_validation_version" {{/useBeanValidation}} + {{#useReflectionEqualsHashCode}} + implementation "org.apache.commons:commons-lang3:$commons_lang3_version" + {{/useReflectionEqualsHashCode}} testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.sbt.mustache index 6e89375a6a1c..5f07e56716e8 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.sbt.mustache @@ -33,6 +33,9 @@ lazy val root = (project in file(".")). "org.tomitribe" % "tomitribe-http-signatures" % "1.7" % "compile", {{/hasHttpSignatureMethods}} "jakarta.annotation" % "jakarta.annotation-api" % "2.1.0" % "compile", + {{#useReflectionEqualsHashCode}} + "org.apache.commons" % "commons-lang3" % "3.17.0" % "compile", + {{/useReflectionEqualsHashCode}} "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" ) ) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pom.mustache index 49583229d488..a3c115041714 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pom.mustache @@ -379,6 +379,15 @@ jersey-apache-connector ${jersey-version} + {{#useReflectionEqualsHashCode}} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + {{/useReflectionEqualsHashCode}} + org.junit.jupiter @@ -408,6 +417,9 @@ {{#hasOAuthMethods}} 8.3.3 {{/hasOAuthMethods}} + {{#useReflectionEqualsHashCode}} + 3.17.0 + {{/useReflectionEqualsHashCode}} 2.21.0 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache index 32f508679823..59896d820f43 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache @@ -249,7 +249,7 @@ 2.6 1.9.1 {{#microprofileMutiny}} - 1.2.0 + 1.10.0 {{/microprofileMutiny}} {{#useReflectionEqualsHashCode}} 3.17.0 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom_3.0.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom_3.0.mustache index 084bc6aee215..c09c296b42c6 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom_3.0.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom_3.0.mustache @@ -189,6 +189,13 @@ ${jakarta.annotation.version} provided +{{#microprofileMutiny}} + + io.smallrye.reactive + mutiny + ${mutiny.version} + +{{/microprofileMutiny}} {{#useReflectionEqualsHashCode}} @@ -241,6 +248,9 @@ 1.1.0 2.6 1.9.1 +{{#microprofileMutiny}} + 1.10.0 +{{/microprofileMutiny}} {{#useReflectionEqualsHashCode}} 3.17.0 {{/useReflectionEqualsHashCode}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache index 34f24d891617..a04a9645e175 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache @@ -85,6 +85,9 @@ ext { {{#hasFormParamsInSpec}} httpmime_version = "4.5.13" {{/hasFormParamsInSpec}} + {{#useReflectionEqualsHashCode}} + commons_lang3_version = "3.17.0" + {{/useReflectionEqualsHashCode}} } dependencies { @@ -107,6 +110,9 @@ dependencies { {{#hasFormParamsInSpec}} implementation "org.apache.httpcomponents:httpmime:$httpmime_version" {{/hasFormParamsInSpec}} + {{#useReflectionEqualsHashCode}} + implementation "org.apache.commons:commons-lang3:$commons_lang3_version" + {{/useReflectionEqualsHashCode}} testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache index 62bb7917deb1..0ccfa84182c2 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache @@ -271,6 +271,14 @@ ${httpmime-version} {{/hasFormParamsInSpec}} + {{#useReflectionEqualsHashCode}} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + {{/useReflectionEqualsHashCode}} @@ -304,6 +312,9 @@ {{#hasFormParamsInSpec}} 4.5.14 {{/hasFormParamsInSpec}} + {{#useReflectionEqualsHashCode}} + 3.17.0 + {{/useReflectionEqualsHashCode}} 5.10.2 2.27.2 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache index eb67fc112409..1b527257ae0f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache @@ -126,7 +126,7 @@ dependencies { {{#hasOAuthMethods}} implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' {{/hasOAuthMethods}} - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' {{#joda}} implementation 'joda-time:joda-time:2.9.9' {{/joda}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache index 2045b84742e3..54bd804c4411 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", {{#openApiNullable}} "org.openapitools" % "jackson-databind-nullable" % "0.2.6", diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache index 465076a4d6ea..5e7bd9b86ed0 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache @@ -414,7 +414,7 @@ {{/swagger2AnnotationLibrary}} 4.12.0 2.10.1 - 3.14.0 + 3.17.0 {{#openApiNullable}} 0.2.6 {{/openApiNullable}} diff --git a/modules/openapi-generator/src/main/resources/Java/pom.mustache b/modules/openapi-generator/src/main/resources/Java/pom.mustache index b2bc5a25d8a6..c46bc598e739 100644 --- a/modules/openapi-generator/src/main/resources/Java/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/pom.mustache @@ -289,12 +289,12 @@ {{/useJakartaEe}} {{#withXml}} - - - com.fasterxml.jackson.dataformat - jackson-dataformat-xml - ${jackson-version} - + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + ${jackson-version} + {{/withXml}} {{#joda}} @@ -341,6 +341,15 @@ ${jakarta-annotation-version} provided + {{#useReflectionEqualsHashCode}} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + {{/useReflectionEqualsHashCode}} + org.junit.jupiter @@ -374,6 +383,9 @@ 1.3.5 2.0.2 {{/useJakartaEe}} + {{#useReflectionEqualsHashCode}} + 3.17.0 + {{/useReflectionEqualsHashCode}} 1.0.0 5.10.2 1.10.0 diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/build.gradle b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/build.gradle index 676e8c999a0e..2d1609df2afc 100644 --- a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/build.gradle +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/build.gradle @@ -115,7 +115,7 @@ dependencies { implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/build.sbt b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/build.sbt index 41a2d93764c2..e79c5140fca8 100644 --- a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/build.sbt +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2", diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/pom.xml b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/pom.xml index 7a5b714d3160..0e717a3ab121 100644 --- a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/pom.xml +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/pom.xml @@ -331,7 +331,7 @@ 1.9.0 4.12.0 2.10.1 - 3.14.0 + 3.17.0 0.2.6 1.3.5 2.0.2 diff --git a/samples/client/echo_api/java/okhttp-gson/build.gradle b/samples/client/echo_api/java/okhttp-gson/build.gradle index 1f433364a3a5..ac77e86d715c 100644 --- a/samples/client/echo_api/java/okhttp-gson/build.gradle +++ b/samples/client/echo_api/java/okhttp-gson/build.gradle @@ -114,7 +114,7 @@ dependencies { implementation 'io.gsonfire:gson-fire:1.9.0' implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' diff --git a/samples/client/echo_api/java/okhttp-gson/build.sbt b/samples/client/echo_api/java/okhttp-gson/build.sbt index 12ac2795172e..ecb09dd27f59 100644 --- a/samples/client/echo_api/java/okhttp-gson/build.sbt +++ b/samples/client/echo_api/java/okhttp-gson/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", diff --git a/samples/client/echo_api/java/okhttp-gson/pom.xml b/samples/client/echo_api/java/okhttp-gson/pom.xml index 862d43891b8e..806622488c7b 100644 --- a/samples/client/echo_api/java/okhttp-gson/pom.xml +++ b/samples/client/echo_api/java/okhttp-gson/pom.xml @@ -326,7 +326,7 @@ 1.9.0 4.12.0 2.10.1 - 3.14.0 + 3.17.0 0.2.6 1.3.5 2.0.2 diff --git a/samples/client/others/java/jersey2-oneOf-Mixed/pom.xml b/samples/client/others/java/jersey2-oneOf-Mixed/pom.xml index e2b1323c705b..75c992cab761 100644 --- a/samples/client/others/java/jersey2-oneOf-Mixed/pom.xml +++ b/samples/client/others/java/jersey2-oneOf-Mixed/pom.xml @@ -318,6 +318,7 @@ jersey-apache-connector ${jersey-version} + org.junit.jupiter diff --git a/samples/client/others/java/jersey2-oneOf-duplicates/pom.xml b/samples/client/others/java/jersey2-oneOf-duplicates/pom.xml index e2b1323c705b..75c992cab761 100644 --- a/samples/client/others/java/jersey2-oneOf-duplicates/pom.xml +++ b/samples/client/others/java/jersey2-oneOf-duplicates/pom.xml @@ -318,6 +318,7 @@ jersey-apache-connector ${jersey-version} + org.junit.jupiter diff --git a/samples/client/others/java/okhttp-gson-oneOf-array/build.gradle b/samples/client/others/java/okhttp-gson-oneOf-array/build.gradle index d1dc4ac2a571..d96f6d99d885 100644 --- a/samples/client/others/java/okhttp-gson-oneOf-array/build.gradle +++ b/samples/client/others/java/okhttp-gson-oneOf-array/build.gradle @@ -114,7 +114,7 @@ dependencies { implementation 'io.gsonfire:gson-fire:1.9.0' implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' diff --git a/samples/client/others/java/okhttp-gson-oneOf-array/build.sbt b/samples/client/others/java/okhttp-gson-oneOf-array/build.sbt index ecdac6b908f2..8c3d65a33a6e 100644 --- a/samples/client/others/java/okhttp-gson-oneOf-array/build.sbt +++ b/samples/client/others/java/okhttp-gson-oneOf-array/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", diff --git a/samples/client/others/java/okhttp-gson-oneOf-array/pom.xml b/samples/client/others/java/okhttp-gson-oneOf-array/pom.xml index 4796ef596cba..bd334327c87a 100644 --- a/samples/client/others/java/okhttp-gson-oneOf-array/pom.xml +++ b/samples/client/others/java/okhttp-gson-oneOf-array/pom.xml @@ -333,7 +333,7 @@ 1.9.0 4.12.0 2.10.1 - 3.14.0 + 3.17.0 0.2.6 1.3.5 2.0.2 diff --git a/samples/client/others/java/okhttp-gson-oneOf/build.gradle b/samples/client/others/java/okhttp-gson-oneOf/build.gradle index d1dc4ac2a571..d96f6d99d885 100644 --- a/samples/client/others/java/okhttp-gson-oneOf/build.gradle +++ b/samples/client/others/java/okhttp-gson-oneOf/build.gradle @@ -114,7 +114,7 @@ dependencies { implementation 'io.gsonfire:gson-fire:1.9.0' implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' diff --git a/samples/client/others/java/okhttp-gson-oneOf/build.sbt b/samples/client/others/java/okhttp-gson-oneOf/build.sbt index ecdac6b908f2..8c3d65a33a6e 100644 --- a/samples/client/others/java/okhttp-gson-oneOf/build.sbt +++ b/samples/client/others/java/okhttp-gson-oneOf/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", diff --git a/samples/client/others/java/okhttp-gson-oneOf/pom.xml b/samples/client/others/java/okhttp-gson-oneOf/pom.xml index 8d703337d94e..667b3b718af6 100644 --- a/samples/client/others/java/okhttp-gson-oneOf/pom.xml +++ b/samples/client/others/java/okhttp-gson-oneOf/pom.xml @@ -326,7 +326,7 @@ 1.9.0 4.12.0 2.10.1 - 3.14.0 + 3.17.0 0.2.6 1.3.5 2.0.2 diff --git a/samples/client/others/java/okhttp-gson-streaming/build.gradle b/samples/client/others/java/okhttp-gson-streaming/build.gradle index b454a3a81321..41bc90123d83 100644 --- a/samples/client/others/java/okhttp-gson-streaming/build.gradle +++ b/samples/client/others/java/okhttp-gson-streaming/build.gradle @@ -114,7 +114,7 @@ dependencies { implementation 'io.gsonfire:gson-fire:1.9.0' implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' diff --git a/samples/client/others/java/okhttp-gson-streaming/build.sbt b/samples/client/others/java/okhttp-gson-streaming/build.sbt index b776f34e427a..c074040f59f4 100644 --- a/samples/client/others/java/okhttp-gson-streaming/build.sbt +++ b/samples/client/others/java/okhttp-gson-streaming/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", diff --git a/samples/client/others/java/okhttp-gson-streaming/pom.xml b/samples/client/others/java/okhttp-gson-streaming/pom.xml index 4b0f7510602c..1db320466c16 100644 --- a/samples/client/others/java/okhttp-gson-streaming/pom.xml +++ b/samples/client/others/java/okhttp-gson-streaming/pom.xml @@ -326,7 +326,7 @@ 1.9.0 4.12.0 2.10.1 - 3.14.0 + 3.17.0 0.2.6 1.3.5 2.0.2 diff --git a/samples/client/petstore/java/feign-no-nullable/build.gradle b/samples/client/petstore/java/feign-no-nullable/build.gradle index b71958edb547..7df6a10718df 100644 --- a/samples/client/petstore/java/feign-no-nullable/build.gradle +++ b/samples/client/petstore/java/feign-no-nullable/build.gradle @@ -109,6 +109,7 @@ ext { feign_form_version = "3.8.0" junit_version = "5.7.0" scribejava_version = "8.0.0" + commons_lang3_version = "3.17.0" } dependencies { @@ -127,6 +128,7 @@ dependencies { implementation "com.github.scribejava:scribejava-core:$scribejava_version" implementation "com.brsanthu:migbase64:2.2" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + implementation "org.apache.commons:commons-lang3:$commons_lang3_version" testImplementation "org.junit.jupiter:junit-jupiter:$junit_version" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" testImplementation "org.junit.jupiter:junit-jupiter-params:$junit_version" diff --git a/samples/client/petstore/java/feign-no-nullable/build.sbt b/samples/client/petstore/java/feign-no-nullable/build.sbt index 6a1f2cb2fb3e..1f85088e35a9 100644 --- a/samples/client/petstore/java/feign-no-nullable/build.sbt +++ b/samples/client/petstore/java/feign-no-nullable/build.sbt @@ -24,6 +24,7 @@ lazy val root = (project in file(".")). "com.github.scribejava" % "scribejava-core" % "8.0.0" % "compile", "com.brsanthu" % "migbase64" % "2.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.apache.commons" % "commons-lang3" % "3.17.0" % "compile", "org.junit.jupiter" % "junit-jupiter" % "5.7.0" % "test", "org.junit.jupiter" % "junit-jupiter-params" % "5.7.0" % "test", "com.github.tomakehurst" % "wiremock-jre8" % "2.35.1" % "test", diff --git a/samples/client/petstore/java/feign-no-nullable/pom.xml b/samples/client/petstore/java/feign-no-nullable/pom.xml index 1e12c67db067..dec835d94fcc 100644 --- a/samples/client/petstore/java/feign-no-nullable/pom.xml +++ b/samples/client/petstore/java/feign-no-nullable/pom.xml @@ -206,6 +206,11 @@ + + io.swagger + swagger-annotations + ${swagger-annotations-version} + @@ -273,6 +278,12 @@ ${jakarta-annotation-version} provided + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + @@ -311,12 +322,14 @@ 1.8 ${java.version} ${java.version} + 1.6.11 13.2.1 3.8.0 2.17.1 2.17.1 1.3.5 2.0.2 + 3.17.0 5.10.0 1.0.0 8.3.3 diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index d956eec0ce1a..09baf1f4824a 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.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; @@ -24,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -57,6 +61,7 @@ public AdditionalPropertiesAnyType name(@javax.annotation.Nullable String name) * @return name */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -117,20 +122,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; - } - AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o; - return Objects.equals(this.name, additionalPropertiesAnyType.name) && - super.equals(o); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, super.hashCode()); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index ea7b682f2740..564290adaad3 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.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; @@ -24,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -58,6 +62,7 @@ public AdditionalPropertiesArray name(@javax.annotation.Nullable String name) { * @return name */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -118,20 +123,12 @@ public List getAdditionalProperty(String key) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o; - return Objects.equals(this.name, additionalPropertiesArray.name) && - super.equals(o); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, super.hashCode()); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 957e51a26c22..c734287b41f3 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.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; @@ -24,6 +26,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -57,6 +61,7 @@ public AdditionalPropertiesBoolean name(@javax.annotation.Nullable String name) * @return name */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -117,20 +122,12 @@ public Boolean getAdditionalProperty(String key) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o; - return Objects.equals(this.name, additionalPropertiesBoolean.name) && - super.equals(o); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, super.hashCode()); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index e5f2a700681c..ea608f9e00fd 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign-no-nullable/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.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -20,6 +22,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.HashMap; import java.util.List; @@ -112,6 +116,7 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt * @return mapString */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_MAP_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -146,6 +151,7 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb * @return mapNumber */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_MAP_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -180,6 +186,7 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege * @return mapInteger */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_MAP_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -214,6 +221,7 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea * @return mapBoolean */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -248,6 +256,7 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List * @return mapArrayAnytype */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -316,6 +326,7 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map arrayAr * @return arrayArrayNumber */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -79,19 +84,12 @@ public void setArrayArrayNumber(@javax.annotation.Nullable List @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; - return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(arrayArrayNumber); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 9a2cc4f2cd56..654d79edb30f 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.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.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -20,6 +22,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; @@ -62,6 +66,7 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { * @return arrayNumber */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -79,19 +84,12 @@ public void setArrayNumber(@javax.annotation.Nullable List arrayNumb @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/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java index b513a4b9ebb5..8095b9f458c9 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/feign-no-nullable/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.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -20,6 +22,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -72,6 +76,7 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { * @return arrayOfString */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -106,6 +111,7 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) * @return arrayArrayOfInteger */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -140,6 +146,7 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI * @return arrayArrayOfModel */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -157,21 +164,12 @@ public void setArrayArrayOfModel(@javax.annotation.Nullable List arrayEnu @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/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumClass.java index 1190cf5abe3c..111927ab55fe 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumClass.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.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java index d45573450000..fbfd40807181 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/feign-no-nullable/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.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -20,6 +22,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import org.openapitools.client.model.OuterEnum; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -216,6 +220,7 @@ public EnumTest enumString(@javax.annotation.Nullable EnumStringEnum enumString) * @return enumString */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -242,6 +247,7 @@ public EnumTest enumStringRequired(@javax.annotation.Nonnull EnumStringRequiredE * @return enumStringRequired */ @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -268,6 +274,7 @@ public EnumTest enumInteger(@javax.annotation.Nullable EnumIntegerEnum enumInteg * @return enumInteger */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -294,6 +301,7 @@ public EnumTest enumNumber(@javax.annotation.Nullable EnumNumberEnum enumNumber) * @return enumNumber */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -320,6 +328,7 @@ public EnumTest outerEnum(@javax.annotation.Nullable OuterEnum outerEnum) { * @return outerEnum */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_OUTER_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -337,23 +346,12 @@ public void setOuterEnum(@javax.annotation.Nullable OuterEnum outerEnum) { @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.enumNumber, enumTest.enumNumber) && - Objects.equals(this.outerEnum, enumTest.outerEnum); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/File.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/File.java index e96a02bcd023..55a44a1bee16 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/File.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/File.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.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -20,12 +22,15 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; /** * Must be named `File` for test. */ +@ApiModel(description = "Must be named `File` for test.") @JsonPropertyOrder({ File.JSON_PROPERTY_SOURCE_U_R_I }) @@ -50,6 +55,7 @@ public File sourceURI(@javax.annotation.Nullable String sourceURI) { * @return sourceURI */ @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -67,19 +73,12 @@ public void setSourceURI(@javax.annotation.Nullable String sourceURI) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - File file = (File) 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/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 250122ef1808..180070914cd3 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/feign-no-nullable/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.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -20,6 +22,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.util.ArrayList; import java.util.Arrays; @@ -59,6 +63,7 @@ public FileSchemaTestClass file(@javax.annotation.Nullable File file) { * @return file */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -93,6 +98,7 @@ public FileSchemaTestClass addFilesItem(File filesItem) { * @return files */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -110,20 +116,12 @@ public void setFiles(@javax.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/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java index 93940d641d01..7a1e88fcfbd4 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/feign-no-nullable/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.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -20,6 +22,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.math.BigDecimal; import java.time.LocalDate; @@ -123,6 +127,7 @@ public FormatTest integer(@javax.annotation.Nullable Integer integer) { * @return integer */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -151,6 +156,7 @@ public FormatTest int32(@javax.annotation.Nullable Integer int32) { * @return int32 */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_INT32) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -177,6 +183,7 @@ public FormatTest int64(@javax.annotation.Nullable Long int64) { * @return int64 */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_INT64) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -205,6 +212,7 @@ public FormatTest number(@javax.annotation.Nonnull BigDecimal number) { * @return number */ @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_NUMBER) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -233,6 +241,7 @@ public FormatTest _float(@javax.annotation.Nullable Float _float) { * @return _float */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FLOAT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -261,6 +270,7 @@ public FormatTest _double(@javax.annotation.Nullable Double _double) { * @return _double */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_DOUBLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -287,6 +297,7 @@ public FormatTest string(@javax.annotation.Nullable String string) { * @return string */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -313,6 +324,7 @@ public FormatTest _byte(@javax.annotation.Nonnull byte[] _byte) { * @return _byte */ @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_BYTE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -339,6 +351,7 @@ public FormatTest binary(@javax.annotation.Nullable File binary) { * @return binary */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_BINARY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -365,6 +378,7 @@ public FormatTest date(@javax.annotation.Nonnull LocalDate date) { * @return date */ @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_DATE) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -391,6 +405,7 @@ public FormatTest dateTime(@javax.annotation.Nullable OffsetDateTime dateTime) { * @return dateTime */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -417,6 +432,7 @@ public FormatTest uuid(@javax.annotation.Nullable UUID uuid) { * @return uuid */ @javax.annotation.Nullable + @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -443,6 +459,7 @@ public FormatTest password(@javax.annotation.Nonnull String password) { * @return password */ @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -469,6 +486,7 @@ public FormatTest bigDecimal(@javax.annotation.Nullable BigDecimal bigDecimal) { * @return bigDecimal */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_BIG_DECIMAL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -486,32 +504,12 @@ public void setBigDecimal(@javax.annotation.Nullable BigDecimal bigDecimal) { @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.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.bigDecimal, formatTest.bigDecimal); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 9dc90d1f3cea..3c8e0591f6dc 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/feign-no-nullable/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.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -20,6 +22,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -60,6 +64,7 @@ public HasOnlyReadOnly( * @return bar */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -75,6 +80,7 @@ public String getBar() { * @return foo */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FOO) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -87,20 +93,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/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java index 81c20684340b..d562576eb5ba 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/feign-no-nullable/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.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -20,6 +22,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -110,6 +114,7 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr * @return mapMapOfString */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -144,6 +149,7 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) * @return mapOfEnumString */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -178,6 +184,7 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { * @return directMap */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_DIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -212,6 +219,7 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { * @return indirectMap */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -229,22 +237,12 @@ public void setIndirectMap(@javax.annotation.Nullable Map indir @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/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 85e8725ad6f3..9c15ac145d65 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign-no-nullable/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.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -20,6 +22,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; @@ -65,6 +69,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(@javax.annotation.Nullab * @return uuid */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -91,6 +96,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(@javax.annotation.Nu * @return dateTime */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -125,6 +131,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * @return map */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -142,21 +149,12 @@ public void setMap(@javax.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/feign-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java index 05d89779ec12..6d244a206504 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/feign-no-nullable/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.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -20,12 +22,15 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; /** * Model for testing model name starting with number */ +@ApiModel(description = "Model for testing model name starting with number") @JsonPropertyOrder({ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS @@ -56,6 +61,7 @@ public Model200Response name(@javax.annotation.Nullable Integer name) { * @return name */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -82,6 +88,7 @@ public Model200Response propertyClass(@javax.annotation.Nullable String property * @return propertyClass */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -99,20 +106,12 @@ public void setPropertyClass(@javax.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/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 831e6c8580a5..0052dc96f970 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/feign-no-nullable/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.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -20,6 +22,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -61,6 +65,7 @@ public ModelApiResponse code(@javax.annotation.Nullable Integer code) { * @return code */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -87,6 +92,7 @@ public ModelApiResponse type(@javax.annotation.Nullable String type) { * @return type */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -113,6 +119,7 @@ public ModelApiResponse message(@javax.annotation.Nullable String message) { * @return message */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -130,21 +137,12 @@ public void setMessage(@javax.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/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java index 712b3cf6b47c..968cc05d4599 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/feign-no-nullable/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.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -20,6 +22,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -51,6 +55,7 @@ public ModelList _123list(@javax.annotation.Nullable String _123list) { * @return _123list */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_123LIST) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -68,19 +73,12 @@ public void set123list(@javax.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/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java index c2c62f72330c..e0f52102ba37 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/feign-no-nullable/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.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -20,12 +22,15 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; /** * Model for testing reserved words */ +@ApiModel(description = "Model for testing reserved words") @JsonPropertyOrder({ ModelReturn.JSON_PROPERTY_RETURN }) @@ -51,6 +56,7 @@ public ModelReturn _return(@javax.annotation.Nullable Integer _return) { * @return _return */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_RETURN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -68,19 +74,12 @@ public void setReturn(@javax.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/feign-no-nullable/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Name.java index bbe70280caef..1119481e9fec 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/feign-no-nullable/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.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -20,12 +22,15 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; /** * Model for testing model name same as property name */ +@ApiModel(description = "Model for testing model name same as property name") @JsonPropertyOrder({ Name.JSON_PROPERTY_NAME, Name.JSON_PROPERTY_SNAKE_CASE, @@ -75,6 +80,7 @@ public Name name(@javax.annotation.Nonnull Integer name) { * @return name */ @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -95,6 +101,7 @@ public void setName(@javax.annotation.Nonnull Integer name) { * @return snakeCase */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SNAKE_CASE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -116,6 +123,7 @@ public Name property(@javax.annotation.Nullable String property) { * @return property */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -136,6 +144,7 @@ public void setProperty(@javax.annotation.Nullable String property) { * @return _123number */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_123NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -148,22 +157,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/feign-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java index 1d49eb406fed..2bb6f0cac011 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/feign-no-nullable/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.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -20,6 +22,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -51,6 +55,7 @@ public NumberOnly justNumber(@javax.annotation.Nullable BigDecimal justNumber) { * @return justNumber */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_JUST_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -68,19 +73,12 @@ public void setJustNumber(@javax.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/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java index dc6d52dc2091..677cb671afa1 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/feign-no-nullable/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.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -20,6 +22,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -113,6 +117,7 @@ public Order id(@javax.annotation.Nullable Long id) { * @return id */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -139,6 +144,7 @@ public Order petId(@javax.annotation.Nullable Long petId) { * @return petId */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PET_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -165,6 +171,7 @@ public Order quantity(@javax.annotation.Nullable Integer quantity) { * @return quantity */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_QUANTITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -191,6 +198,7 @@ public Order shipDate(@javax.annotation.Nullable OffsetDateTime shipDate) { * @return shipDate */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SHIP_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -217,6 +225,7 @@ public Order status(@javax.annotation.Nullable StatusEnum status) { * @return status */ @javax.annotation.Nullable + @ApiModelProperty(value = "Order Status") @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -243,6 +252,7 @@ public Order complete(@javax.annotation.Nullable Boolean complete) { * @return complete */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -260,24 +270,12 @@ public void setComplete(@javax.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/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java index e919c4e6d9e1..583303bd274e 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/feign-no-nullable/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.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -20,6 +22,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -61,6 +65,7 @@ public OuterComposite myNumber(@javax.annotation.Nullable BigDecimal myNumber) { * @return myNumber */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_MY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -87,6 +92,7 @@ public OuterComposite myString(@javax.annotation.Nullable String myString) { * @return myString */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_MY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -113,6 +119,7 @@ public OuterComposite myBoolean(@javax.annotation.Nullable Boolean myBoolean) { * @return myBoolean */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -130,21 +137,12 @@ public void setMyBoolean(@javax.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/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterEnum.java index d2924eb9c29b..925066b50704 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterEnum.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.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java index 3fd31774a9dd..6bf46e65af08 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/feign-no-nullable/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.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -21,6 +23,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.Arrays; import java.util.LinkedHashSet; @@ -120,6 +124,7 @@ public Pet id(@javax.annotation.Nullable Long id) { * @return id */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -146,6 +151,7 @@ public Pet category(@javax.annotation.Nullable Category category) { * @return category */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -172,6 +178,7 @@ public Pet name(@javax.annotation.Nonnull String name) { * @return name */ @javax.annotation.Nonnull + @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -206,6 +213,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls */ @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -241,6 +249,7 @@ public Pet addTagsItem(Tag tagsItem) { * @return tags */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -267,6 +276,7 @@ public Pet status(@javax.annotation.Nullable StatusEnum status) { * @return status */ @javax.annotation.Nullable + @ApiModelProperty(value = "pet status in the store") @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -284,24 +294,12 @@ public void setStatus(@javax.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/feign-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index e59d26515366..ae6b49f942c9 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/feign-no-nullable/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.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -20,6 +22,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -57,6 +61,7 @@ public ReadOnlyFirst( * @return bar */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -78,6 +83,7 @@ public ReadOnlyFirst baz(@javax.annotation.Nullable String baz) { * @return baz */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_BAZ) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -95,20 +101,12 @@ public void setBaz(@javax.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/feign-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java index 30f18df8bd54..5c45b2b8690a 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/feign-no-nullable/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.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -20,6 +22,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -51,6 +55,7 @@ public SpecialModelName() { * @return $specialPropertyName */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -68,19 +73,12 @@ public SpecialModelName() { @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); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash($specialPropertyName); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Tag.java index bdb029f73197..5eaa904b3d69 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/feign-no-nullable/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.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -20,6 +22,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -55,6 +59,7 @@ public Tag id(@javax.annotation.Nullable Long id) { * @return id */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -81,6 +86,7 @@ public Tag name(@javax.annotation.Nullable String name) { * @return name */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -98,20 +104,12 @@ public void setName(@javax.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/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index f6c5a693e8a0..bc17a17906fa 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.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.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -20,6 +22,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; @@ -74,6 +78,7 @@ public TypeHolderDefault stringItem(@javax.annotation.Nonnull String stringItem) * @return stringItem */ @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_STRING_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -100,6 +105,7 @@ public TypeHolderDefault numberItem(@javax.annotation.Nonnull BigDecimal numberI * @return numberItem */ @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -126,6 +132,7 @@ public TypeHolderDefault integerItem(@javax.annotation.Nonnull Integer integerIt * @return integerItem */ @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -152,6 +159,7 @@ public TypeHolderDefault boolItem(@javax.annotation.Nonnull Boolean boolItem) { * @return boolItem */ @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_BOOL_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -186,6 +194,7 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -203,23 +212,12 @@ public void setArrayItem(@javax.annotation.Nonnull List arrayItem) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TypeHolderDefault typeHolderDefault = (TypeHolderDefault) o; - return Objects.equals(this.stringItem, typeHolderDefault.stringItem) && - Objects.equals(this.numberItem, typeHolderDefault.numberItem) && - Objects.equals(this.integerItem, typeHolderDefault.integerItem) && - Objects.equals(this.boolItem, typeHolderDefault.boolItem) && - Objects.equals(this.arrayItem, typeHolderDefault.arrayItem); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 90c368d7a770..ca05c662f07e 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.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.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -20,6 +22,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; @@ -79,6 +83,7 @@ public TypeHolderExample stringItem(@javax.annotation.Nonnull String stringItem) * @return stringItem */ @javax.annotation.Nonnull + @ApiModelProperty(example = "what", required = true, value = "") @JsonProperty(JSON_PROPERTY_STRING_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -105,6 +110,7 @@ public TypeHolderExample numberItem(@javax.annotation.Nonnull BigDecimal numberI * @return numberItem */ @javax.annotation.Nonnull + @ApiModelProperty(example = "1.234", required = true, value = "") @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -131,6 +137,7 @@ public TypeHolderExample floatItem(@javax.annotation.Nonnull Float floatItem) { * @return floatItem */ @javax.annotation.Nonnull + @ApiModelProperty(example = "1.234", required = true, value = "") @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -157,6 +164,7 @@ public TypeHolderExample integerItem(@javax.annotation.Nonnull Integer integerIt * @return integerItem */ @javax.annotation.Nonnull + @ApiModelProperty(example = "-2", required = true, value = "") @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -183,6 +191,7 @@ public TypeHolderExample boolItem(@javax.annotation.Nonnull Boolean boolItem) { * @return boolItem */ @javax.annotation.Nonnull + @ApiModelProperty(example = "true", required = true, value = "") @JsonProperty(JSON_PROPERTY_BOOL_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -217,6 +226,7 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @javax.annotation.Nonnull + @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) @JsonInclude(value = JsonInclude.Include.ALWAYS) @@ -234,24 +244,12 @@ public void setArrayItem(@javax.annotation.Nonnull List arrayItem) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TypeHolderExample typeHolderExample = (TypeHolderExample) o; - return Objects.equals(this.stringItem, typeHolderExample.stringItem) && - Objects.equals(this.numberItem, typeHolderExample.numberItem) && - Objects.equals(this.floatItem, typeHolderExample.floatItem) && - Objects.equals(this.integerItem, typeHolderExample.integerItem) && - Objects.equals(this.boolItem, typeHolderExample.boolItem) && - Objects.equals(this.arrayItem, typeHolderExample.arrayItem); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/User.java index 453196da0143..6bff7c18d9b7 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/feign-no-nullable/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.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -20,6 +22,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -85,6 +89,7 @@ public User id(@javax.annotation.Nullable Long id) { * @return id */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -111,6 +116,7 @@ public User username(@javax.annotation.Nullable String username) { * @return username */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_USERNAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -137,6 +143,7 @@ public User firstName(@javax.annotation.Nullable String firstName) { * @return firstName */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FIRST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -163,6 +170,7 @@ public User lastName(@javax.annotation.Nullable String lastName) { * @return lastName */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_LAST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -189,6 +197,7 @@ public User email(@javax.annotation.Nullable String email) { * @return email */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_EMAIL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -215,6 +224,7 @@ public User password(@javax.annotation.Nullable String password) { * @return password */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -241,6 +251,7 @@ public User phone(@javax.annotation.Nullable String phone) { * @return phone */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PHONE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -267,6 +278,7 @@ public User userStatus(@javax.annotation.Nullable Integer userStatus) { * @return userStatus */ @javax.annotation.Nullable + @ApiModelProperty(value = "User Status") @JsonProperty(JSON_PROPERTY_USER_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -284,26 +296,12 @@ public void setUserStatus(@javax.annotation.Nullable Integer userStatus) { @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); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java index bc3a8faa2f06..a6e2c952994f 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.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.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -20,6 +22,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; @@ -194,6 +198,7 @@ public XmlItem attributeString(@javax.annotation.Nullable String attributeString * @return attributeString */ @javax.annotation.Nullable + @ApiModelProperty(example = "string", value = "") @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -220,6 +225,7 @@ public XmlItem attributeNumber(@javax.annotation.Nullable BigDecimal attributeNu * @return attributeNumber */ @javax.annotation.Nullable + @ApiModelProperty(example = "1.234", value = "") @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -246,6 +252,7 @@ public XmlItem attributeInteger(@javax.annotation.Nullable Integer attributeInte * @return attributeInteger */ @javax.annotation.Nullable + @ApiModelProperty(example = "-2", value = "") @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -272,6 +279,7 @@ public XmlItem attributeBoolean(@javax.annotation.Nullable Boolean attributeBool * @return attributeBoolean */ @javax.annotation.Nullable + @ApiModelProperty(example = "true", value = "") @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -306,6 +314,7 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { * @return wrappedArray */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -332,6 +341,7 @@ public XmlItem nameString(@javax.annotation.Nullable String nameString) { * @return nameString */ @javax.annotation.Nullable + @ApiModelProperty(example = "string", value = "") @JsonProperty(JSON_PROPERTY_NAME_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -358,6 +368,7 @@ public XmlItem nameNumber(@javax.annotation.Nullable BigDecimal nameNumber) { * @return nameNumber */ @javax.annotation.Nullable + @ApiModelProperty(example = "1.234", value = "") @JsonProperty(JSON_PROPERTY_NAME_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -384,6 +395,7 @@ public XmlItem nameInteger(@javax.annotation.Nullable Integer nameInteger) { * @return nameInteger */ @javax.annotation.Nullable + @ApiModelProperty(example = "-2", value = "") @JsonProperty(JSON_PROPERTY_NAME_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -410,6 +422,7 @@ public XmlItem nameBoolean(@javax.annotation.Nullable Boolean nameBoolean) { * @return nameBoolean */ @javax.annotation.Nullable + @ApiModelProperty(example = "true", value = "") @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -444,6 +457,7 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { * @return nameArray */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_NAME_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -478,6 +492,7 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { * @return nameWrappedArray */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -504,6 +519,7 @@ public XmlItem prefixString(@javax.annotation.Nullable String prefixString) { * @return prefixString */ @javax.annotation.Nullable + @ApiModelProperty(example = "string", value = "") @JsonProperty(JSON_PROPERTY_PREFIX_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -530,6 +546,7 @@ public XmlItem prefixNumber(@javax.annotation.Nullable BigDecimal prefixNumber) * @return prefixNumber */ @javax.annotation.Nullable + @ApiModelProperty(example = "1.234", value = "") @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -556,6 +573,7 @@ public XmlItem prefixInteger(@javax.annotation.Nullable Integer prefixInteger) { * @return prefixInteger */ @javax.annotation.Nullable + @ApiModelProperty(example = "-2", value = "") @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -582,6 +600,7 @@ public XmlItem prefixBoolean(@javax.annotation.Nullable Boolean prefixBoolean) { * @return prefixBoolean */ @javax.annotation.Nullable + @ApiModelProperty(example = "true", value = "") @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -616,6 +635,7 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { * @return prefixArray */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -650,6 +670,7 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { * @return prefixWrappedArray */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -676,6 +697,7 @@ public XmlItem namespaceString(@javax.annotation.Nullable String namespaceString * @return namespaceString */ @javax.annotation.Nullable + @ApiModelProperty(example = "string", value = "") @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -702,6 +724,7 @@ public XmlItem namespaceNumber(@javax.annotation.Nullable BigDecimal namespaceNu * @return namespaceNumber */ @javax.annotation.Nullable + @ApiModelProperty(example = "1.234", value = "") @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -728,6 +751,7 @@ public XmlItem namespaceInteger(@javax.annotation.Nullable Integer namespaceInte * @return namespaceInteger */ @javax.annotation.Nullable + @ApiModelProperty(example = "-2", value = "") @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -754,6 +778,7 @@ public XmlItem namespaceBoolean(@javax.annotation.Nullable Boolean namespaceBool * @return namespaceBoolean */ @javax.annotation.Nullable + @ApiModelProperty(example = "true", value = "") @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -788,6 +813,7 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { * @return namespaceArray */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -822,6 +848,7 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { * @return namespaceWrappedArray */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -848,6 +875,7 @@ public XmlItem prefixNsString(@javax.annotation.Nullable String prefixNsString) * @return prefixNsString */ @javax.annotation.Nullable + @ApiModelProperty(example = "string", value = "") @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -874,6 +902,7 @@ public XmlItem prefixNsNumber(@javax.annotation.Nullable BigDecimal prefixNsNumb * @return prefixNsNumber */ @javax.annotation.Nullable + @ApiModelProperty(example = "1.234", value = "") @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -900,6 +929,7 @@ public XmlItem prefixNsInteger(@javax.annotation.Nullable Integer prefixNsIntege * @return prefixNsInteger */ @javax.annotation.Nullable + @ApiModelProperty(example = "-2", value = "") @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -926,6 +956,7 @@ public XmlItem prefixNsBoolean(@javax.annotation.Nullable Boolean prefixNsBoolea * @return prefixNsBoolean */ @javax.annotation.Nullable + @ApiModelProperty(example = "true", value = "") @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -960,6 +991,7 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { * @return prefixNsArray */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -994,6 +1026,7 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { * @return prefixNsWrappedArray */ @javax.annotation.Nullable + @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1011,47 +1044,12 @@ public void setPrefixNsWrappedArray(@javax.annotation.Nullable List pre @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - XmlItem xmlItem = (XmlItem) o; - return Objects.equals(this.attributeString, xmlItem.attributeString) && - Objects.equals(this.attributeNumber, xmlItem.attributeNumber) && - Objects.equals(this.attributeInteger, xmlItem.attributeInteger) && - Objects.equals(this.attributeBoolean, xmlItem.attributeBoolean) && - Objects.equals(this.wrappedArray, xmlItem.wrappedArray) && - Objects.equals(this.nameString, xmlItem.nameString) && - Objects.equals(this.nameNumber, xmlItem.nameNumber) && - Objects.equals(this.nameInteger, xmlItem.nameInteger) && - Objects.equals(this.nameBoolean, xmlItem.nameBoolean) && - Objects.equals(this.nameArray, xmlItem.nameArray) && - Objects.equals(this.nameWrappedArray, xmlItem.nameWrappedArray) && - Objects.equals(this.prefixString, xmlItem.prefixString) && - Objects.equals(this.prefixNumber, xmlItem.prefixNumber) && - Objects.equals(this.prefixInteger, xmlItem.prefixInteger) && - Objects.equals(this.prefixBoolean, xmlItem.prefixBoolean) && - Objects.equals(this.prefixArray, xmlItem.prefixArray) && - Objects.equals(this.prefixWrappedArray, xmlItem.prefixWrappedArray) && - Objects.equals(this.namespaceString, xmlItem.namespaceString) && - Objects.equals(this.namespaceNumber, xmlItem.namespaceNumber) && - Objects.equals(this.namespaceInteger, xmlItem.namespaceInteger) && - Objects.equals(this.namespaceBoolean, xmlItem.namespaceBoolean) && - Objects.equals(this.namespaceArray, xmlItem.namespaceArray) && - Objects.equals(this.namespaceWrappedArray, xmlItem.namespaceWrappedArray) && - Objects.equals(this.prefixNsString, xmlItem.prefixNsString) && - Objects.equals(this.prefixNsNumber, xmlItem.prefixNsNumber) && - Objects.equals(this.prefixNsInteger, xmlItem.prefixNsInteger) && - Objects.equals(this.prefixNsBoolean, xmlItem.prefixNsBoolean) && - Objects.equals(this.prefixNsArray, xmlItem.prefixNsArray) && - Objects.equals(this.prefixNsWrappedArray, xmlItem.prefixNsWrappedArray); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml b/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml index e8b2b4285933..4b517189c012 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml @@ -323,6 +323,7 @@ jersey-apache-connector ${jersey-version} + org.junit.jupiter diff --git a/samples/client/petstore/java/jersey2-java8/pom.xml b/samples/client/petstore/java/jersey2-java8/pom.xml index ada0fee29cda..1d56717fbc2c 100644 --- a/samples/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/client/petstore/java/jersey2-java8/pom.xml @@ -323,6 +323,7 @@ jersey-apache-connector ${jersey-version} + org.junit.jupiter diff --git a/samples/client/petstore/java/jersey3-oneOf/pom.xml b/samples/client/petstore/java/jersey3-oneOf/pom.xml index 616be794b601..590d772f329e 100644 --- a/samples/client/petstore/java/jersey3-oneOf/pom.xml +++ b/samples/client/petstore/java/jersey3-oneOf/pom.xml @@ -318,6 +318,7 @@ jersey-apache-connector ${jersey-version} + org.junit.jupiter diff --git a/samples/client/petstore/java/jersey3/build.gradle b/samples/client/petstore/java/jersey3/build.gradle index 66e463de413e..10c96f84970e 100644 --- a/samples/client/petstore/java/jersey3/build.gradle +++ b/samples/client/petstore/java/jersey3/build.gradle @@ -108,6 +108,7 @@ ext { junit_version = "5.8.2" scribejava_apis_version = "8.3.1" tomitribe_http_signatures_version = "1.7" + commons_lang3_version = "3.17.0" } dependencies { @@ -127,6 +128,7 @@ dependencies { 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 f57389cc41f5..693ad5c72089 100644 --- a/samples/client/petstore/java/jersey3/build.sbt +++ b/samples/client/petstore/java/jersey3/build.sbt @@ -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/pom.xml b/samples/client/petstore/java/jersey3/pom.xml index 11aaeb47b7fb..69c559dbede8 100644 --- a/samples/client/petstore/java/jersey3/pom.xml +++ b/samples/client/petstore/java/jersey3/pom.xml @@ -335,6 +335,13 @@ jersey-apache-connector ${jersey-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + org.junit.jupiter @@ -354,6 +361,7 @@ 5.10.0 1.8 8.3.3 + 3.17.0 2.21.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 795337f2d52b..38600bbe6fc2 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; @@ -337,21 +339,7 @@ public void setMapWithUndeclaredPropertiesString(@jakarta.annotation.Nullable Ma */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) && - Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty) && - equalsNullable(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.mapWithUndeclaredPropertiesAnytype1, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype1) && - Objects.equals(this.mapWithUndeclaredPropertiesAnytype2, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype2) && - Objects.equals(this.mapWithUndeclaredPropertiesAnytype3, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype3) && - Objects.equals(this.emptyMap, additionalPropertiesClass.emptyMap) && - Objects.equals(this.mapWithUndeclaredPropertiesString, additionalPropertiesClass.mapWithUndeclaredPropertiesString); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -360,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/Animal.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Animal.java index 118df7958065..e5f42f8b418f 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; @@ -119,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 24e7849e22b6..0d82658dac6d 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; @@ -106,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 73918b98ff7f..7ae4e6cbe17a 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; @@ -107,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 7f4d13dbf205..579df04b5179 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; @@ -86,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 81b5130763e0..27cfadfc1e1e 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; @@ -165,21 +167,12 @@ public void setArrayArrayOfModel(@jakarta.annotation.Nullable List boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -264,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 c171e5308d65..52eb75c7a2c3 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; @@ -185,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 8896a4043cba..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,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; 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 156ca8f8972b..4a78c7cdf54b 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; @@ -522,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) { @@ -546,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 44732e013917..89b557c00d4f 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,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; @@ -148,21 +150,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; - } - EquilateralTriangle equilateralTriangle = (EquilateralTriangle) o; - return Objects.equals(this.shapeType, equilateralTriangle.shapeType) && - Objects.equals(this.triangleType, equilateralTriangle.triangleType)&& - Objects.equals(this.additionalProperties, equilateralTriangle.additionalProperties); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(shapeType, triangleType, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override 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 ba770c57dd9b..b35606dfb0c2 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; @@ -118,20 +120,12 @@ public void setFiles(@jakarta.annotation.Nullable List<@Valid ModelFile> 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 62210e1b6ce4..d0f4a278200d 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; @@ -74,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 c18b124e09af..ff6ef3437c26 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; @@ -77,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 a82a6a123b79..23bae6a2b07d 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; @@ -565,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 c819d5a93657..fed2a9288fad 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; 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 17c9e85e05c1..c84f7a734393 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; 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 36ffb634603e..5f1d0c0244ae 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; 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 fbbe6f2788a1..56c27efa3ee2 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; @@ -88,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 2b6cd744bd21..7a4669ecd5af 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; @@ -96,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 cb1d09c13c50..e4b40a5da077 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; @@ -85,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) { @@ -101,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 d116617abdd7..3274a6c2de5d 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; @@ -107,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 6b46ceee645b..dff17656315c 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,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; 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 90e11adaa73b..21af2f6a0ffb 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,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; 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 03f3eda9cc3c..6e4215d1e93d 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; @@ -237,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 eb9a5aef5007..a0849457b7d5 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; @@ -152,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 aabc6c471b2c..9d7b704fcd58 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; @@ -106,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 33bdc417985e..2ed3b0d59f72 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; @@ -137,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 98a0e80e521d..ea54901098c8 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; @@ -75,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 0434c06ae29c..fb84e33166e0 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; @@ -75,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 840f3dae748c..bc0267264958 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; @@ -75,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 2bd14b77f3a1..bf7c1a23f05f 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; @@ -158,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 883f1cbba65c..ec8d3c13a93e 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; @@ -604,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) { @@ -632,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 429b0dde63eb..b1def258839e 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,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; 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 2ce68e240848..be29d3d8a137 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; @@ -76,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 a79d8c67c625..af61194f8168 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; @@ -196,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 1205e73cfcf7..7990be6a7ce4 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; @@ -268,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 286cf92b75b8..a356b02afb94 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; @@ -138,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 d1406d0afca8..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,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; 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 e20841e97c8c..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,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; 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 f7c3095b681b..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,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; 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 71b91d2f62b2..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,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; 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 68ee6a8725e3..363d6876db9f 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,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; @@ -97,18 +99,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; - } - return super.equals(o); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(super.hashCode(), additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @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 0db1e4785521..229b5c7cd9ed 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; @@ -290,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 16cb5a576e22..ec067e21df82 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,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; 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 3d0dea5e0ce3..0bd869d79a06 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,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; 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 b143ca302ec5..949b2c848752 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; @@ -75,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 8cfa6a5ae6fc..25adc586f1da 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; @@ -103,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 3714690b9482..9c57722230a1 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,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; @@ -148,21 +150,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; - } - ScaleneTriangle scaleneTriangle = (ScaleneTriangle) o; - return Objects.equals(this.shapeType, scaleneTriangle.shapeType) && - Objects.equals(this.triangleType, scaleneTriangle.triangleType)&& - Objects.equals(this.additionalProperties, scaleneTriangle.additionalProperties); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(shapeType, triangleType, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override 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 efa80a0e1e0f..aeab1549cc60 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,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; 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 c24a869e117d..63d2b7745adb 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; @@ -75,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 5bf7e3480669..a8dc52548452 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,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; 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 7fd5a7fc8f6f..98fe5d7e3c45 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,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; @@ -148,21 +150,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; - } - SimpleQuadrilateral simpleQuadrilateral = (SimpleQuadrilateral) o; - return Objects.equals(this.shapeType, simpleQuadrilateral.shapeType) && - Objects.equals(this.quadrilateralType, simpleQuadrilateral.quadrilateralType)&& - Objects.equals(this.additionalProperties, simpleQuadrilateral.additionalProperties); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(shapeType, quadrilateralType, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override 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 ae88910475e1..409808085413 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; @@ -106,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 14fd4f1c7665..ba300d4c073d 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; @@ -105,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 deeba97cf158..d9efa6f38b48 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; @@ -116,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 65bc16911cfa..1d54ef1adea1 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,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; 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 374c74068280..eb2b25d202a1 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; @@ -75,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 f515fdb5a1f7..8df0a4c4ca80 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; @@ -440,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) { @@ -467,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 f82b8c58919a..2912a02ef2fd 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; @@ -138,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 7d2e7458855b..560538a81608 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; @@ -185,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 diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/.openapi-generator-ignore b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/.openapi-generator/FILES b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/.openapi-generator/FILES new file mode 100644 index 000000000000..ae145903e52b --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/.openapi-generator/FILES @@ -0,0 +1,22 @@ +README.md +docs/Category.md +docs/ModelApiResponse.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md +pom.xml +src/main/java/org/openapitools/client/api/ApiException.java +src/main/java/org/openapitools/client/api/ApiExceptionMapper.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 +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/.openapi-generator/VERSION b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/.openapi-generator/VERSION new file mode 100644 index 000000000000..6935482704c1 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.10.0-SNAPSHOT diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/README.md b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/README.md new file mode 100644 index 000000000000..4c3e40a34b5c --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/README.md @@ -0,0 +1,9 @@ +# OpenAPI Petstore - MicroProfile Rest Client & MicroProfile Server + +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. +[MicroProfile Rest Client](https://github.com/eclipse/microprofile-rest-client) is a type-safe way of calling +REST services. The generated client contains an interface which acts as the client, you can inject it into dependent classes. + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/docs/Category.md b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/docs/Category.md new file mode 100644 index 000000000000..a7fc939d252e --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/docs/Category.md @@ -0,0 +1,15 @@ + + +# Category + +A category for a pet + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**name** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/docs/ModelApiResponse.md b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/docs/ModelApiResponse.md new file mode 100644 index 000000000000..cd7e3c400be6 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/docs/ModelApiResponse.md @@ -0,0 +1,16 @@ + + +# ModelApiResponse + +Describes the result of uploading an image resource + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Integer** | | [optional] | +|**type** | **String** | | [optional] | +|**message** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/docs/Order.md b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/docs/Order.md new file mode 100644 index 000000000000..7bfa42e6a902 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/docs/Order.md @@ -0,0 +1,29 @@ + + +# Order + +An order for a pets from the pet store + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**petId** | **Long** | | [optional] | +|**quantity** | **Integer** | | [optional] | +|**shipDate** | **Date** | | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional] | +|**complete** | **Boolean** | | [optional] | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| PLACED | "placed" | +| APPROVED | "approved" | +| DELIVERED | "delivered" | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/docs/Pet.md b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/docs/Pet.md new file mode 100644 index 000000000000..8bb363301232 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/docs/Pet.md @@ -0,0 +1,29 @@ + + +# Pet + +A pet for sale in the pet store + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**category** | [**Category**](Category.md) | | [optional] | +|**name** | **String** | | | +|**photoUrls** | **List<String>** | | | +|**tags** | [**List<Tag>**](Tag.md) | | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| AVAILABLE | "available" | +| PENDING | "pending" | +| SOLD | "sold" | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/docs/PetApi.md b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/docs/PetApi.md new file mode 100644 index 000000000000..fb5361b0808f --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/docs/PetApi.md @@ -0,0 +1,604 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store | +| [**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet | +| [**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status | +| [**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags | +| [**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID | +| [**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 | + + + +## addPet + +> Pet addPet(pet) + +Add a new pet to the store + + + +### Example + +```java +// 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.models.*; +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"); + + // 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); + } catch (ApiException e) { + 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()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **405** | Invalid input | - | + + +## deletePet + +> void deletePet(petId, apiKey) + +Deletes a pet + + + +### Example + +```java +// 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.models.*; +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"); + + // 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 | Pet id to delete + String apiKey = "apiKey_example"; // String | + try { + void result = apiInstance.deletePet(petId, apiKey); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#deletePet"); + 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**| Pet id to delete | | +| **apiKey** | **String**| | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid pet value | - | + + +## findPetsByStatus + +> List<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example + +```java +// 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.models.*; +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"); + + // 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 { + List result = apiInstance.findPetsByStatus(status); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByStatus"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + + +## findPetsByTags + +> List<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + +```java +// 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.models.*; +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"); + + // 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 { + List result = apiInstance.findPetsByTags(tags); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByTags"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **tags** | [**List<String>**](String.md)| Tags to filter by | | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + + +## getPetById + +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example + +```java +// 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.models.*; +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"); + + // 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"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to return + try { + Pet result = apiInstance.getPetById(petId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#getPetById"); + 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 return | | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: 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 | - | + + +## updatePet + +> Pet updatePet(pet) + +Update an existing pet + + + +### Example + +```java +// 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.models.*; +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"); + + // 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); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#updatePet"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **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 | - | + + +## updatePetWithForm + +> void updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + + + +### Example + +```java +// 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.models.*; +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"); + + // 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 that needs to be updated + String name = "name_example"; // String | Updated name of the pet + String status = "status_example"; // String | Updated status of the pet + try { + void result = apiInstance.updatePetWithForm(petId, name, status); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#updatePetWithForm"); + 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 that needs to be updated | | +| **name** | **String**| Updated name of the pet | [optional] | +| **status** | **String**| Updated status of the pet | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + + +## uploadFile + +> ModelApiResponse uploadFile(petId, additionalMetadata, _file) + +uploads an image + + + +### Example + +```java +// 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.models.*; +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"); + + // 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 + String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server + File _file = new File("/path/to/file"); // File | file to upload + try { + ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, _file); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#uploadFile"); + 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 | | +| **additionalMetadata** | **String**| Additional data to pass to server | [optional] | +| **_file** | **File**| file to upload | [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/microprofile-rest-client-3.0-mutiny/docs/StoreApi.md b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/docs/StoreApi.md new file mode 100644 index 000000000000..ae64b8574e22 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/docs/StoreApi.md @@ -0,0 +1,283 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**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/{orderId} | Find purchase order by ID | +| [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet | + + + +## deleteOrder + +> void deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +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"); + + StoreApi apiInstance = new StoreApi(defaultClient); + String orderId = "orderId_example"; // String | ID of the order that needs to be deleted + try { + void result = apiInstance.deleteOrder(orderId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#deleteOrder"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **orderId** | **String**| ID of the order that needs to be deleted | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + + +## getInventory + +> Map<String, Integer> getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example + +```java +// 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.models.*; +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"); + + // 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"); + + StoreApi apiInstance = new StoreApi(defaultClient); + try { + Map result = apiInstance.getInventory(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getInventory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**Map<String, Integer>** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## getOrderById + +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +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"); + + StoreApi apiInstance = new StoreApi(defaultClient); + Long orderId = 56L; // Long | ID of pet that needs to be fetched + try { + Order result = apiInstance.getOrderById(orderId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getOrderById"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **orderId** | **Long**| ID of pet that needs to be fetched | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + + +## placeOrder + +> Order placeOrder(order) + +Place an order for a pet + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +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"); + + StoreApi apiInstance = new StoreApi(defaultClient); + Order order = new Order(); // Order | order placed for purchasing the pet + try { + Order result = apiInstance.placeOrder(order); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#placeOrder"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **order** | [**Order**](Order.md)| order placed for purchasing the pet | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/docs/Tag.md b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/docs/Tag.md new file mode 100644 index 000000000000..abfde4afb501 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/docs/Tag.md @@ -0,0 +1,15 @@ + + +# Tag + +A tag for a pet + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**name** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/docs/User.md b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/docs/User.md new file mode 100644 index 000000000000..426845227bd3 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/docs/User.md @@ -0,0 +1,21 @@ + + +# User + +A User who is purchasing from the pet store + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**username** | **String** | | [optional] | +|**firstName** | **String** | | [optional] | +|**lastName** | **String** | | [optional] | +|**email** | **String** | | [optional] | +|**password** | **String** | | [optional] | +|**phone** | **String** | | [optional] | +|**userStatus** | **Integer** | User Status | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/docs/UserApi.md b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/docs/UserApi.md new file mode 100644 index 000000000000..89c1bfc6026d --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/docs/UserApi.md @@ -0,0 +1,591 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createUser**](UserApi.md#createUser) | **POST** /user | Create user | +| [**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array | +| [**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array | +| [**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user | +| [**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name | +| [**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system | +| [**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session | +| [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user | + + + +## createUser + +> void createUser(user) + +Create user + +This can only be done by the logged in user. + +### Example + +```java +// 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.models.*; +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"); + + UserApi apiInstance = new UserApi(defaultClient); + User user = new User(); // User | Created user object + try { + void result = apiInstance.createUser(user); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUser"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **user** | [**User**](User.md)| Created user object | | + +### Return type + +[**void**](Void.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## createUsersWithArrayInput + +> void createUsersWithArrayInput(user) + +Creates list of users with given input array + + + +### Example + +```java +// 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.models.*; +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"); + + UserApi apiInstance = new UserApi(defaultClient); + List user = Arrays.asList(); // List | List of user object + try { + void result = apiInstance.createUsersWithArrayInput(user); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **user** | [**List<User>**](User.md)| List of user object | | + +### Return type + +[**void**](Void.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## createUsersWithListInput + +> void createUsersWithListInput(user) + +Creates list of users with given input array + + + +### Example + +```java +// 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.models.*; +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"); + + UserApi apiInstance = new UserApi(defaultClient); + List user = Arrays.asList(); // List | List of user object + try { + void result = apiInstance.createUsersWithListInput(user); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithListInput"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **user** | [**List<User>**](User.md)| List of user object | | + +### Return type + +[**void**](Void.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## deleteUser + +> void deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example + +```java +// 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.models.*; +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"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The name that needs to be deleted + try { + void result = apiInstance.deleteUser(username); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#deleteUser"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| The name that needs to be deleted | | + +### Return type + +[**void**](Void.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## getUserByName + +> User getUserByName(username) + +Get user by user name + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +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"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. + try { + User result = apiInstance.getUserByName(username); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#getUserByName"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| The name that needs to be fetched. Use user1 for testing. | | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## loginUser + +> String loginUser(username, password) + +Logs user into the system + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +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"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The user name for login + String password = "password_example"; // String | The password for login in clear text + try { + String result = apiInstance.loginUser(username, password); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#loginUser"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| The user name for login | | +| **password** | **String**| The password for login in clear text | | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### 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
| +| **400** | Invalid username/password supplied | - | + + +## logoutUser + +> void logoutUser() + +Logs out current logged in user session + + + +### Example + +```java +// 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.models.*; +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"); + + UserApi apiInstance = new UserApi(defaultClient); + try { + void result = apiInstance.logoutUser(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#logoutUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**void**](Void.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## updateUser + +> void updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example + +```java +// 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.models.*; +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"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | name that need to be deleted + User user = new User(); // User | Updated user object + try { + void result = apiInstance.updateUser(username, user); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#updateUser"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| name that need to be deleted | | +| **user** | [**User**](User.md)| Updated user object | | + +### Return type + +[**void**](Void.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/pom.xml b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/pom.xml new file mode 100644 index 000000000000..5dfda58407b2 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/pom.xml @@ -0,0 +1,184 @@ + + 4.0.0 + org.openapitools + microprofile-rest-client-3-mutiny + jar + microprofile-rest-client-3-mutiny + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + 1.0.0 + + src/main/java + + + org.jboss.jandex + jandex-maven-plugin + ${jandex.maven.plugin.version} + + + make-index + + jandex + + + + + + maven-failsafe-plugin + ${maven.failsafe.plugin.version} + + + + integration-test + verify + + + + + + org.codehaus.mojo + build-helper-maven-plugin + ${build.helper.maven.plugin.version} + + + add-source + generate-sources + + add-source + + + + src/gen/java + + + + + + + + + + org.junit.jupiter + junit-jupiter-api + ${junit.version} + test + + + + org.eclipse.microprofile.rest.client + microprofile-rest-client-api + ${microprofile.rest.client.api.version} + + + + + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.rs.version} + provided + + + + org.glassfish.jersey.ext.microprofile + jersey-mp-rest-client + ${jersey.mp.rest.client.version} + test + + + org.apache.geronimo.config + geronimo-config-impl + ${geronimo.config.impl.version} + test + + + + org.apache.cxf + cxf-rt-rs-extension-providers + ${cxf.rt.rs.extension.providers.version} + + + jakarta.json.bind + jakarta.json.bind-api + ${jakarta.json.bind.version} + + + jakarta.json + jakarta.json-api + ${jakarta.json.version} + + + jakarta.xml.bind + jakarta.xml.bind-api + ${jakarta.xml.bind.version} + + + com.sun.xml.bind + jaxb-core + ${jaxb.core.version} + + + com.sun.xml.bind + jaxb-impl + ${jaxb.impl.version} + + + jakarta.activation + jakarta.activation-api + ${jakarta.activation.version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson.jaxrs.version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta.annotation.version} + provided + + + io.smallrye.reactive + mutiny + ${mutiny.version} + + + + + sonatype-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + true + + + + + 11 + ${java.version} + ${java.version} + UTF-8 + + 1.5.18 + 9.2.9.v20150224 + 5.10.2 + 1.4.14 + 3.2.7 + 2.17.1 + 2.1.0 + 2.0.0 + 2.0.0 + 2.0.1 + 3.0.0 + 3.0.1 + 3.0 + 3.0.4 + 1.2.3 + 3.5.1 + 3.0.2 + 3.0.2 + 7.0.4.Final + 1.1.0 + 2.6 + 1.9.1 + 1.10.0 + + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/api/ApiException.java b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/api/ApiException.java new file mode 100644 index 000000000000..2fc6d04ee687 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/api/ApiException.java @@ -0,0 +1,34 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import jakarta.ws.rs.core.Response; + +public class ApiException extends Exception { + + private static final long serialVersionUID = 1L; + private Response response; + + public ApiException() { + super(); + } + + public ApiException(Response response) { + super("Api response has status code " + response.getStatus()); + this.response = response; + } + + public Response getResponse() { + return this.response; + } +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java new file mode 100644 index 000000000000..0dec2c6aec06 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java @@ -0,0 +1,33 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.Provider; +import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper; + +@Provider +public class ApiExceptionMapper + implements ResponseExceptionMapper { + + @Override + public boolean handles(int status, MultivaluedMap headers) { + return status >= 400; + } + + @Override + public ApiException toThrowable(Response response) { + return new ApiException(response); + } +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/api/PetApi.java new file mode 100644 index 000000000000..78f825370542 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/api/PetApi.java @@ -0,0 +1,137 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import java.io.File; +import org.openapitools.client.model.ModelApiResponse; +import org.openapitools.client.model.Pet; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; +import io.smallrye.mutiny.Uni; + + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +/** + * 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. + * + */ + +@RegisterRestClient(configKey="petstore") +@RegisterProvider(ApiExceptionMapper.class) +@Path("/pet") +public interface PetApi { + + /** + * Add a new pet to the store + * + * + * + */ + @POST + + @Consumes({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) + Uni addPet(Pet pet) throws ApiException, ProcessingException; + + /** + * Deletes a pet + * + * + * + */ + @DELETE + @Path("/{petId}") + Uni deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey) throws ApiException, ProcessingException; + + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + */ + @GET + @Path("/findByStatus") + @Produces({ "application/xml", "application/json" }) + Uni> findPetsByStatus(@QueryParam("status") List status) throws ApiException, ProcessingException; + + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @deprecated + */ + @Deprecated + @GET + @Path("/findByTags") + @Produces({ "application/xml", "application/json" }) + Uni> findPetsByTags(@QueryParam("tags") List tags) throws ApiException, ProcessingException; + + /** + * Find pet by ID + * + * Returns a single pet + * + */ + @GET + @Path("/{petId}") + @Produces({ "application/xml", "application/json" }) + Uni getPetById(@PathParam("petId") Long petId) throws ApiException, ProcessingException; + + /** + * Update an existing pet + * + * + * + */ + @PUT + + @Consumes({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) + Uni updatePet(Pet pet) throws ApiException, ProcessingException; + + /** + * Updates a pet in the store with form data + * + * + * + */ + @POST + @Path("/{petId}") + @Consumes({ "application/x-www-form-urlencoded" }) + Uni updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status) throws ApiException, ProcessingException; + + /** + * uploads an image + * + * + * + */ + @POST + @Path("/{petId}/uploadImage") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + Uni uploadFile(@PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file" , required = false) Attachment _fileDetail) throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/api/StoreApi.java new file mode 100644 index 000000000000..3e3568235bc9 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/api/StoreApi.java @@ -0,0 +1,87 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import org.openapitools.client.model.Order; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; +import io.smallrye.mutiny.Uni; + + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +/** + * 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. + * + */ + +@RegisterRestClient(configKey="petstore") +@RegisterProvider(ApiExceptionMapper.class) +@Path("/store") +public interface StoreApi { + + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + */ + @DELETE + @Path("/order/{orderId}") + Uni deleteOrder(@PathParam("orderId") String orderId) throws ApiException, ProcessingException; + + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + */ + @GET + @Path("/inventory") + @Produces({ "application/json" }) + Uni> getInventory() throws ApiException, ProcessingException; + + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + * + */ + @GET + @Path("/order/{orderId}") + @Produces({ "application/xml", "application/json" }) + Uni getOrderById(@PathParam("orderId") Long orderId) throws ApiException, ProcessingException; + + /** + * Place an order for a pet + * + * + * + */ + @POST + @Path("/order") + @Consumes({ "application/json" }) + @Produces({ "application/xml", "application/json" }) + Uni placeOrder(Order order) throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/api/UserApi.java new file mode 100644 index 000000000000..398314fe46cd --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/api/UserApi.java @@ -0,0 +1,130 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import java.util.Date; +import org.openapitools.client.model.User; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; +import io.smallrye.mutiny.Uni; + + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +/** + * 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. + * + */ + +@RegisterRestClient(configKey="petstore") +@RegisterProvider(ApiExceptionMapper.class) +@Path("/user") +public interface UserApi { + + /** + * Create user + * + * This can only be done by the logged in user. + * + */ + @POST + + @Consumes({ "application/json" }) + Uni createUser(User user) throws ApiException, ProcessingException; + + /** + * Creates list of users with given input array + * + * + * + */ + @POST + @Path("/createWithArray") + @Consumes({ "application/json" }) + Uni createUsersWithArrayInput(List user) throws ApiException, ProcessingException; + + /** + * Creates list of users with given input array + * + * + * + */ + @POST + @Path("/createWithList") + @Consumes({ "application/json" }) + Uni createUsersWithListInput(List user) throws ApiException, ProcessingException; + + /** + * Delete user + * + * This can only be done by the logged in user. + * + */ + @DELETE + @Path("/{username}") + Uni deleteUser(@PathParam("username") String username) throws ApiException, ProcessingException; + + /** + * Get user by user name + * + * + * + */ + @GET + @Path("/{username}") + @Produces({ "application/xml", "application/json" }) + Uni getUserByName(@PathParam("username") String username) throws ApiException, ProcessingException; + + /** + * Logs user into the system + * + * + * + */ + @GET + @Path("/login") + @Produces({ "application/xml", "application/json" }) + Uni loginUser(@QueryParam("username") String username, @QueryParam("password") String password) throws ApiException, ProcessingException; + + /** + * Logs out current logged in user session + * + * + * + */ + @GET + @Path("/logout") + Uni logoutUser() throws ApiException, ProcessingException; + + /** + * Updated user + * + * This can only be done by the logged in user. + * + */ + @PUT + @Path("/{username}") + @Consumes({ "application/json" }) + Uni updateUser(@PathParam("username") String username, User user) throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/Category.java new file mode 100644 index 000000000000..d7d5dca2bc60 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/Category.java @@ -0,0 +1,123 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; + +/** + * A category for a pet + */ + +public class Category { + + @JsonbProperty("id") + private Long id; + + @JsonbProperty("name") + private String name; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + */ + public void setId(Long id) { + this.id = id; + } + + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + /** + * Set name + */ + public void setName(String name) { + this.name = name; + } + + public Category name(String name) { + this.name = name; + return this; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/ModelApiResponse.java new file mode 100644 index 000000000000..2791024ba294 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -0,0 +1,148 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; + +/** + * Describes the result of uploading an image resource + */ + +public class ModelApiResponse { + + @JsonbProperty("code") + private Integer code; + + @JsonbProperty("type") + private String type; + + @JsonbProperty("message") + private String message; + + /** + * Get code + * @return code + **/ + public Integer getCode() { + return code; + } + + /** + * Set code + */ + public void setCode(Integer code) { + this.code = code; + } + + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get type + * @return type + **/ + public String getType() { + return type; + } + + /** + * Set type + */ + public void setType(String type) { + this.type = type; + } + + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + /** + * Get message + * @return message + **/ + public String getMessage() { + return message; + } + + /** + * Set message + */ + public void setMessage(String message) { + this.message = message; + } + + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/Order.java new file mode 100644 index 000000000000..d7e654ce3a9e --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/Order.java @@ -0,0 +1,269 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Date; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; + +/** + * An order for a pets from the pet store + */ + +public class Order { + + @JsonbProperty("id") + private Long id; + + @JsonbProperty("petId") + private Long petId; + + @JsonbProperty("quantity") + private Integer quantity; + + @JsonbProperty("shipDate") + private Date shipDate; + + @JsonbTypeSerializer(StatusEnum.Serializer.class) + @JsonbTypeDeserializer(StatusEnum.Deserializer.class) + public enum StatusEnum { + + PLACED(String.valueOf("placed")), APPROVED(String.valueOf("approved")), DELIVERED(String.valueOf("delivered")); + + + String value; + + StatusEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public StatusEnum deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'"); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(StatusEnum obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + } + + /** + * Order Status + */ + @JsonbProperty("status") + private StatusEnum status; + + @JsonbProperty("complete") + private Boolean complete = false; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + */ + public void setId(Long id) { + this.id = id; + } + + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get petId + * @return petId + **/ + public Long getPetId() { + return petId; + } + + /** + * Set petId + */ + public void setPetId(Long petId) { + this.petId = petId; + } + + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get quantity + * @return quantity + **/ + public Integer getQuantity() { + return quantity; + } + + /** + * Set quantity + */ + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get shipDate + * @return shipDate + **/ + public Date getShipDate() { + return shipDate; + } + + /** + * Set shipDate + */ + public void setShipDate(Date shipDate) { + this.shipDate = shipDate; + } + + public Order shipDate(Date shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Order Status + * @return status + **/ + public StatusEnum getStatus() { + return status; + } + + /** + * Set status + */ + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Get complete + * @return complete + **/ + public Boolean getComplete() { + return complete; + } + + /** + * Set complete + */ + public void setComplete(Boolean complete) { + this.complete = complete; + } + + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/Pet.java new file mode 100644 index 000000000000..d2b51d9db1cb --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/Pet.java @@ -0,0 +1,291 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; + +/** + * A pet for sale in the pet store + */ + +public class Pet { + + @JsonbProperty("id") + private Long id; + + @JsonbProperty("category") + private Category category; + + @JsonbProperty("name") + private String name; + + @JsonbProperty("photoUrls") + private List photoUrls = new ArrayList<>(); + + @JsonbProperty("tags") + private List tags = null; + + @JsonbTypeSerializer(StatusEnum.Serializer.class) + @JsonbTypeDeserializer(StatusEnum.Deserializer.class) + public enum StatusEnum { + + AVAILABLE(String.valueOf("available")), PENDING(String.valueOf("pending")), SOLD(String.valueOf("sold")); + + + String value; + + StatusEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public StatusEnum deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'"); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(StatusEnum obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + } + + /** + * pet status in the store + */ + @JsonbProperty("status") + private StatusEnum status; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + */ + public void setId(Long id) { + this.id = id; + } + + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get category + * @return category + **/ + public Category getCategory() { + return category; + } + + /** + * Set category + */ + public void setCategory(Category category) { + this.category = category; + } + + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + /** + * Set name + */ + public void setName(String name) { + this.name = name; + } + + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get photoUrls + * @return photoUrls + **/ + public List getPhotoUrls() { + return photoUrls; + } + + /** + * Set photoUrls + */ + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get tags + * @return tags + **/ + public List getTags() { + return tags; + } + + /** + * Set tags + */ + public void setTags(List tags) { + this.tags = tags; + } + + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * pet status in the store + * @return status + * @deprecated + **/ + @Deprecated + public StatusEnum getStatus() { + return status; + } + + /** + * Set status + */ + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/Tag.java new file mode 100644 index 000000000000..1317a25b1776 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/Tag.java @@ -0,0 +1,123 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; + +/** + * A tag for a pet + */ + +public class Tag { + + @JsonbProperty("id") + private Long id; + + @JsonbProperty("name") + private String name; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + */ + public void setId(Long id) { + this.id = id; + } + + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + /** + * Set name + */ + public void setName(String name) { + this.name = name; + } + + public Tag name(String name) { + this.name = name; + return this; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/User.java new file mode 100644 index 000000000000..d717a4bd3219 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/main/java/org/openapitools/client/model/User.java @@ -0,0 +1,276 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import jakarta.json.bind.annotation.JsonbTypeDeserializer; +import jakarta.json.bind.annotation.JsonbTypeSerializer; +import jakarta.json.bind.serializer.DeserializationContext; +import jakarta.json.bind.serializer.JsonbDeserializer; +import jakarta.json.bind.serializer.JsonbSerializer; +import jakarta.json.bind.serializer.SerializationContext; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.bind.annotation.JsonbProperty; + +/** + * A User who is purchasing from the pet store + */ + +public class User { + + @JsonbProperty("id") + private Long id; + + @JsonbProperty("username") + private String username; + + @JsonbProperty("firstName") + private String firstName; + + @JsonbProperty("lastName") + private String lastName; + + @JsonbProperty("email") + private String email; + + @JsonbProperty("password") + private String password; + + @JsonbProperty("phone") + private String phone; + + /** + * User Status + */ + @JsonbProperty("userStatus") + private Integer userStatus; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + */ + public void setId(Long id) { + this.id = id; + } + + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get username + * @return username + **/ + public String getUsername() { + return username; + } + + /** + * Set username + */ + public void setUsername(String username) { + this.username = username; + } + + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get firstName + * @return firstName + **/ + public String getFirstName() { + return firstName; + } + + /** + * Set firstName + */ + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get lastName + * @return lastName + **/ + public String getLastName() { + return lastName; + } + + /** + * Set lastName + */ + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get email + * @return email + **/ + public String getEmail() { + return email; + } + + /** + * Set email + */ + public void setEmail(String email) { + this.email = email; + } + + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get password + * @return password + **/ + public String getPassword() { + return password; + } + + /** + * Set password + */ + public void setPassword(String password) { + this.password = password; + } + + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get phone + * @return phone + **/ + public String getPhone() { + return phone; + } + + /** + * Set phone + */ + public void setPhone(String phone) { + this.phone = phone; + } + + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * User Status + * @return userStatus + **/ + public Integer getUserStatus() { + return userStatus; + } + + /** + * Set userStatus + */ + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + 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("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/test/java/org/openapitools/client/api/PetApiTest.java new file mode 100644 index 000000000000..a08c4178f405 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -0,0 +1,198 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import java.io.File; +import org.openapitools.client.model.ModelApiResponse; +import org.openapitools.client.model.Pet; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for PetApi + */ +public class PetApiTest { + + private PetApi client; + private String baseUrl = "http://localhost:9080"; + + @BeforeEach + public void setup() throws MalformedURLException { + // TODO initialize the client + } + + + /** + * Add a new pet to the store + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void addPetTest() { + // TODO: test validations + Pet pet = null; + //Uni response = api.addPet(pet); + //Assertions.assertNotNull(response); + + + } + + /** + * Deletes a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deletePetTest() { + // TODO: test validations + Long petId = null; + String apiKey = null; + //api.deletePet(petId, apiKey); + //Assertions.assertNotNull(response); + + + } + + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void findPetsByStatusTest() { + // TODO: test validations + List status = null; + //Uni> response = api.findPetsByStatus(status); + //Assertions.assertNotNull(response); + + + } + + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void findPetsByTagsTest() { + // TODO: test validations + List tags = null; + //Uni> response = api.findPetsByTags(tags); + //Assertions.assertNotNull(response); + + + } + + /** + * Find pet by ID + * + * Returns a single pet + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getPetByIdTest() { + // TODO: test validations + Long petId = null; + //Uni response = api.getPetById(petId); + //Assertions.assertNotNull(response); + + + } + + /** + * Update an existing pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updatePetTest() { + // TODO: test validations + Pet pet = null; + //Uni response = api.updatePet(pet); + //Assertions.assertNotNull(response); + + + } + + /** + * Updates a pet in the store with form data + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updatePetWithFormTest() { + // TODO: test validations + Long petId = null; + String name = null; + String status = null; + //api.updatePetWithForm(petId, name, status); + //Assertions.assertNotNull(response); + + + } + + /** + * uploads an image + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void uploadFileTest() { + // TODO: test validations + Long petId = null; + String additionalMetadata = null; + org.apache.cxf.jaxrs.ext.multipart.Attachment _file = null; + //Uni response = api.uploadFile(petId, additionalMetadata, _file); + //Assertions.assertNotNull(response); + + + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/test/java/org/openapitools/client/api/StoreApiTest.java new file mode 100644 index 000000000000..14e07617aa12 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -0,0 +1,118 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.Order; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for StoreApi + */ +public class StoreApiTest { + + private StoreApi client; + private String baseUrl = "http://localhost:9080"; + + @BeforeEach + public void setup() throws MalformedURLException { + // TODO initialize the client + } + + + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteOrderTest() { + // TODO: test validations + String orderId = null; + //api.deleteOrder(orderId); + //Assertions.assertNotNull(response); + + + } + + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getInventoryTest() { + // TODO: test validations + //Uni> response = api.getInventory(); + //Assertions.assertNotNull(response); + + + } + + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getOrderByIdTest() { + // TODO: test validations + Long orderId = null; + //Uni response = api.getOrderById(orderId); + //Assertions.assertNotNull(response); + + + } + + /** + * Place an order for a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void placeOrderTest() { + // TODO: test validations + Order order = null; + //Uni response = api.placeOrder(order); + //Assertions.assertNotNull(response); + + + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/test/java/org/openapitools/client/api/UserApiTest.java new file mode 100644 index 000000000000..61e04bc03b7e --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -0,0 +1,193 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import java.util.Date; +import org.openapitools.client.model.User; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for UserApi + */ +public class UserApiTest { + + private UserApi client; + private String baseUrl = "http://localhost:9080"; + + @BeforeEach + public void setup() throws MalformedURLException { + // TODO initialize the client + } + + + /** + * Create user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUserTest() { + // TODO: test validations + User user = null; + //api.createUser(user); + //Assertions.assertNotNull(response); + + + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUsersWithArrayInputTest() { + // TODO: test validations + List user = null; + //api.createUsersWithArrayInput(user); + //Assertions.assertNotNull(response); + + + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUsersWithListInputTest() { + // TODO: test validations + List user = null; + //api.createUsersWithListInput(user); + //Assertions.assertNotNull(response); + + + } + + /** + * Delete user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteUserTest() { + // TODO: test validations + String username = null; + //api.deleteUser(username); + //Assertions.assertNotNull(response); + + + } + + /** + * Get user by user name + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getUserByNameTest() { + // TODO: test validations + String username = null; + //Uni response = api.getUserByName(username); + //Assertions.assertNotNull(response); + + + } + + /** + * Logs user into the system + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void loginUserTest() { + // TODO: test validations + String username = null; + String password = null; + //Uni response = api.loginUser(username, password); + //Assertions.assertNotNull(response); + + + } + + /** + * Logs out current logged in user session + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void logoutUserTest() { + // TODO: test validations + //api.logoutUser(); + //Assertions.assertNotNull(response); + + + } + + /** + * Updated user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updateUserTest() { + // TODO: test validations + String username = null; + User user = null; + //api.updateUser(username, user); + //Assertions.assertNotNull(response); + + + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/test/java/org/openapitools/client/model/CategoryTest.java new file mode 100644 index 000000000000..d0568f977669 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -0,0 +1,50 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Category + */ +class CategoryTest { + private final Category model = new Category(); + + /** + * Model tests for Category + */ + @Test + void testCategory() { + // TODO: test Category + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java new file mode 100644 index 000000000000..ddfa78c4ac31 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -0,0 +1,58 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelApiResponse + */ +class ModelApiResponseTest { + private final ModelApiResponse model = new ModelApiResponse(); + + /** + * Model tests for ModelApiResponse + */ + @Test + void testModelApiResponse() { + // TODO: test ModelApiResponse + } + + /** + * Test the property 'code' + */ + @Test + void codeTest() { + // TODO: test code + } + + /** + * Test the property 'type' + */ + @Test + void typeTest() { + // TODO: test type + } + + /** + * Test the property 'message' + */ + @Test + void messageTest() { + // TODO: test message + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/test/java/org/openapitools/client/model/OrderTest.java new file mode 100644 index 000000000000..0d23109bd825 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/test/java/org/openapitools/client/model/OrderTest.java @@ -0,0 +1,83 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Date; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Order + */ +class OrderTest { + private final Order model = new Order(); + + /** + * Model tests for Order + */ + @Test + void testOrder() { + // TODO: test Order + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'petId' + */ + @Test + void petIdTest() { + // TODO: test petId + } + + /** + * Test the property 'quantity' + */ + @Test + void quantityTest() { + // TODO: test quantity + } + + /** + * Test the property 'shipDate' + */ + @Test + void shipDateTest() { + // TODO: test shipDate + } + + /** + * Test the property 'status' + */ + @Test + void statusTest() { + // TODO: test status + } + + /** + * Test the property 'complete' + */ + @Test + void completeTest() { + // TODO: test complete + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/test/java/org/openapitools/client/model/PetTest.java new file mode 100644 index 000000000000..e939e3b1d45a --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/test/java/org/openapitools/client/model/PetTest.java @@ -0,0 +1,87 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Pet + */ +class PetTest { + private final Pet model = new Pet(); + + /** + * Model tests for Pet + */ + @Test + void testPet() { + // TODO: test Pet + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'category' + */ + @Test + void categoryTest() { + // TODO: test category + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + + /** + * Test the property 'photoUrls' + */ + @Test + void photoUrlsTest() { + // TODO: test photoUrls + } + + /** + * Test the property 'tags' + */ + @Test + void tagsTest() { + // TODO: test tags + } + + /** + * Test the property 'status' + */ + @Test + void statusTest() { + // TODO: test status + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/test/java/org/openapitools/client/model/TagTest.java new file mode 100644 index 000000000000..5131a8a3e889 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/test/java/org/openapitools/client/model/TagTest.java @@ -0,0 +1,50 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Tag + */ +class TagTest { + private final Tag model = new Tag(); + + /** + * Model tests for Tag + */ + @Test + void testTag() { + // TODO: test Tag + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/test/java/org/openapitools/client/model/UserTest.java new file mode 100644 index 000000000000..d0d84b127052 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-mutiny/src/test/java/org/openapitools/client/model/UserTest.java @@ -0,0 +1,98 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for User + */ +class UserTest { + private final User model = new User(); + + /** + * Model tests for User + */ + @Test + void testUser() { + // TODO: test User + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'username' + */ + @Test + void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'firstName' + */ + @Test + void firstNameTest() { + // TODO: test firstName + } + + /** + * Test the property 'lastName' + */ + @Test + void lastNameTest() { + // TODO: test lastName + } + + /** + * Test the property 'email' + */ + @Test + void emailTest() { + // TODO: test email + } + + /** + * Test the property 'password' + */ + @Test + void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'phone' + */ + @Test + void phoneTest() { + // TODO: test phone + } + + /** + * Test the property 'userStatus' + */ + @Test + void userStatusTest() { + // TODO: test userStatus + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/.openapi-generator-ignore b/samples/client/petstore/java/microprofile-rest-client-mutiny/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/.openapi-generator/FILES b/samples/client/petstore/java/microprofile-rest-client-mutiny/.openapi-generator/FILES new file mode 100644 index 000000000000..ae145903e52b --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/.openapi-generator/FILES @@ -0,0 +1,22 @@ +README.md +docs/Category.md +docs/ModelApiResponse.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md +pom.xml +src/main/java/org/openapitools/client/api/ApiException.java +src/main/java/org/openapitools/client/api/ApiExceptionMapper.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 +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/.openapi-generator/VERSION b/samples/client/petstore/java/microprofile-rest-client-mutiny/.openapi-generator/VERSION new file mode 100644 index 000000000000..6935482704c1 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.10.0-SNAPSHOT diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/README.md b/samples/client/petstore/java/microprofile-rest-client-mutiny/README.md new file mode 100644 index 000000000000..4c3e40a34b5c --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/README.md @@ -0,0 +1,9 @@ +# OpenAPI Petstore - MicroProfile Rest Client & MicroProfile Server + +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. +[MicroProfile Rest Client](https://github.com/eclipse/microprofile-rest-client) is a type-safe way of calling +REST services. The generated client contains an interface which acts as the client, you can inject it into dependent classes. + diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/docs/Category.md b/samples/client/petstore/java/microprofile-rest-client-mutiny/docs/Category.md new file mode 100644 index 000000000000..a7fc939d252e --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/docs/Category.md @@ -0,0 +1,15 @@ + + +# Category + +A category for a pet + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**name** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/docs/ModelApiResponse.md b/samples/client/petstore/java/microprofile-rest-client-mutiny/docs/ModelApiResponse.md new file mode 100644 index 000000000000..cd7e3c400be6 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/docs/ModelApiResponse.md @@ -0,0 +1,16 @@ + + +# ModelApiResponse + +Describes the result of uploading an image resource + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Integer** | | [optional] | +|**type** | **String** | | [optional] | +|**message** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/docs/Order.md b/samples/client/petstore/java/microprofile-rest-client-mutiny/docs/Order.md new file mode 100644 index 000000000000..7bfa42e6a902 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/docs/Order.md @@ -0,0 +1,29 @@ + + +# Order + +An order for a pets from the pet store + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**petId** | **Long** | | [optional] | +|**quantity** | **Integer** | | [optional] | +|**shipDate** | **Date** | | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional] | +|**complete** | **Boolean** | | [optional] | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| PLACED | "placed" | +| APPROVED | "approved" | +| DELIVERED | "delivered" | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/docs/Pet.md b/samples/client/petstore/java/microprofile-rest-client-mutiny/docs/Pet.md new file mode 100644 index 000000000000..8bb363301232 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/docs/Pet.md @@ -0,0 +1,29 @@ + + +# Pet + +A pet for sale in the pet store + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**category** | [**Category**](Category.md) | | [optional] | +|**name** | **String** | | | +|**photoUrls** | **List<String>** | | | +|**tags** | [**List<Tag>**](Tag.md) | | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| AVAILABLE | "available" | +| PENDING | "pending" | +| SOLD | "sold" | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/docs/PetApi.md b/samples/client/petstore/java/microprofile-rest-client-mutiny/docs/PetApi.md new file mode 100644 index 000000000000..fb5361b0808f --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/docs/PetApi.md @@ -0,0 +1,604 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store | +| [**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet | +| [**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status | +| [**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags | +| [**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID | +| [**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 | + + + +## addPet + +> Pet addPet(pet) + +Add a new pet to the store + + + +### Example + +```java +// 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.models.*; +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"); + + // 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); + } catch (ApiException e) { + 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()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **405** | Invalid input | - | + + +## deletePet + +> void deletePet(petId, apiKey) + +Deletes a pet + + + +### Example + +```java +// 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.models.*; +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"); + + // 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 | Pet id to delete + String apiKey = "apiKey_example"; // String | + try { + void result = apiInstance.deletePet(petId, apiKey); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#deletePet"); + 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**| Pet id to delete | | +| **apiKey** | **String**| | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid pet value | - | + + +## findPetsByStatus + +> List<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example + +```java +// 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.models.*; +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"); + + // 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 { + List result = apiInstance.findPetsByStatus(status); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByStatus"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + + +## findPetsByTags + +> List<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + +```java +// 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.models.*; +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"); + + // 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 { + List result = apiInstance.findPetsByTags(tags); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByTags"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **tags** | [**List<String>**](String.md)| Tags to filter by | | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + + +## getPetById + +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example + +```java +// 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.models.*; +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"); + + // 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"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to return + try { + Pet result = apiInstance.getPetById(petId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#getPetById"); + 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 return | | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: 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 | - | + + +## updatePet + +> Pet updatePet(pet) + +Update an existing pet + + + +### Example + +```java +// 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.models.*; +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"); + + // 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); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#updatePet"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **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 | - | + + +## updatePetWithForm + +> void updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + + + +### Example + +```java +// 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.models.*; +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"); + + // 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 that needs to be updated + String name = "name_example"; // String | Updated name of the pet + String status = "status_example"; // String | Updated status of the pet + try { + void result = apiInstance.updatePetWithForm(petId, name, status); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#updatePetWithForm"); + 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 that needs to be updated | | +| **name** | **String**| Updated name of the pet | [optional] | +| **status** | **String**| Updated status of the pet | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + + +## uploadFile + +> ModelApiResponse uploadFile(petId, additionalMetadata, _file) + +uploads an image + + + +### Example + +```java +// 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.models.*; +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"); + + // 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 + String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server + File _file = new File("/path/to/file"); // File | file to upload + try { + ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, _file); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#uploadFile"); + 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 | | +| **additionalMetadata** | **String**| Additional data to pass to server | [optional] | +| **_file** | **File**| file to upload | [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/microprofile-rest-client-mutiny/docs/StoreApi.md b/samples/client/petstore/java/microprofile-rest-client-mutiny/docs/StoreApi.md new file mode 100644 index 000000000000..ae64b8574e22 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/docs/StoreApi.md @@ -0,0 +1,283 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**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/{orderId} | Find purchase order by ID | +| [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet | + + + +## deleteOrder + +> void deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +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"); + + StoreApi apiInstance = new StoreApi(defaultClient); + String orderId = "orderId_example"; // String | ID of the order that needs to be deleted + try { + void result = apiInstance.deleteOrder(orderId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#deleteOrder"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **orderId** | **String**| ID of the order that needs to be deleted | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + + +## getInventory + +> Map<String, Integer> getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example + +```java +// 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.models.*; +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"); + + // 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"); + + StoreApi apiInstance = new StoreApi(defaultClient); + try { + Map result = apiInstance.getInventory(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getInventory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**Map<String, Integer>** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## getOrderById + +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +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"); + + StoreApi apiInstance = new StoreApi(defaultClient); + Long orderId = 56L; // Long | ID of pet that needs to be fetched + try { + Order result = apiInstance.getOrderById(orderId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getOrderById"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **orderId** | **Long**| ID of pet that needs to be fetched | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + + +## placeOrder + +> Order placeOrder(order) + +Place an order for a pet + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +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"); + + StoreApi apiInstance = new StoreApi(defaultClient); + Order order = new Order(); // Order | order placed for purchasing the pet + try { + Order result = apiInstance.placeOrder(order); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#placeOrder"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **order** | [**Order**](Order.md)| order placed for purchasing the pet | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/docs/Tag.md b/samples/client/petstore/java/microprofile-rest-client-mutiny/docs/Tag.md new file mode 100644 index 000000000000..abfde4afb501 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/docs/Tag.md @@ -0,0 +1,15 @@ + + +# Tag + +A tag for a pet + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**name** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/docs/User.md b/samples/client/petstore/java/microprofile-rest-client-mutiny/docs/User.md new file mode 100644 index 000000000000..426845227bd3 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/docs/User.md @@ -0,0 +1,21 @@ + + +# User + +A User who is purchasing from the pet store + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**username** | **String** | | [optional] | +|**firstName** | **String** | | [optional] | +|**lastName** | **String** | | [optional] | +|**email** | **String** | | [optional] | +|**password** | **String** | | [optional] | +|**phone** | **String** | | [optional] | +|**userStatus** | **Integer** | User Status | [optional] | + + + diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/docs/UserApi.md b/samples/client/petstore/java/microprofile-rest-client-mutiny/docs/UserApi.md new file mode 100644 index 000000000000..89c1bfc6026d --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/docs/UserApi.md @@ -0,0 +1,591 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createUser**](UserApi.md#createUser) | **POST** /user | Create user | +| [**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array | +| [**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array | +| [**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user | +| [**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name | +| [**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system | +| [**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session | +| [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user | + + + +## createUser + +> void createUser(user) + +Create user + +This can only be done by the logged in user. + +### Example + +```java +// 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.models.*; +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"); + + UserApi apiInstance = new UserApi(defaultClient); + User user = new User(); // User | Created user object + try { + void result = apiInstance.createUser(user); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUser"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **user** | [**User**](User.md)| Created user object | | + +### Return type + +[**void**](Void.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## createUsersWithArrayInput + +> void createUsersWithArrayInput(user) + +Creates list of users with given input array + + + +### Example + +```java +// 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.models.*; +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"); + + UserApi apiInstance = new UserApi(defaultClient); + List user = Arrays.asList(); // List | List of user object + try { + void result = apiInstance.createUsersWithArrayInput(user); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **user** | [**List<User>**](User.md)| List of user object | | + +### Return type + +[**void**](Void.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## createUsersWithListInput + +> void createUsersWithListInput(user) + +Creates list of users with given input array + + + +### Example + +```java +// 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.models.*; +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"); + + UserApi apiInstance = new UserApi(defaultClient); + List user = Arrays.asList(); // List | List of user object + try { + void result = apiInstance.createUsersWithListInput(user); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithListInput"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **user** | [**List<User>**](User.md)| List of user object | | + +### Return type + +[**void**](Void.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## deleteUser + +> void deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example + +```java +// 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.models.*; +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"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The name that needs to be deleted + try { + void result = apiInstance.deleteUser(username); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#deleteUser"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| The name that needs to be deleted | | + +### Return type + +[**void**](Void.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## getUserByName + +> User getUserByName(username) + +Get user by user name + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +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"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. + try { + User result = apiInstance.getUserByName(username); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#getUserByName"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| The name that needs to be fetched. Use user1 for testing. | | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## loginUser + +> String loginUser(username, password) + +Logs user into the system + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +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"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The user name for login + String password = "password_example"; // String | The password for login in clear text + try { + String result = apiInstance.loginUser(username, password); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#loginUser"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| The user name for login | | +| **password** | **String**| The password for login in clear text | | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### 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
| +| **400** | Invalid username/password supplied | - | + + +## logoutUser + +> void logoutUser() + +Logs out current logged in user session + + + +### Example + +```java +// 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.models.*; +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"); + + UserApi apiInstance = new UserApi(defaultClient); + try { + void result = apiInstance.logoutUser(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#logoutUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**void**](Void.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## updateUser + +> void updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example + +```java +// 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.models.*; +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"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | name that need to be deleted + User user = new User(); // User | Updated user object + try { + void result = apiInstance.updateUser(username, user); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#updateUser"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| name that need to be deleted | | +| **user** | [**User**](User.md)| Updated user object | | + +### Return type + +[**void**](Void.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/pom.xml b/samples/client/petstore/java/microprofile-rest-client-mutiny/pom.xml new file mode 100644 index 000000000000..d9ca684ed950 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/pom.xml @@ -0,0 +1,184 @@ + + 4.0.0 + org.openapitools + microprofile-rest-client-mutiny + jar + microprofile-rest-client-mutiny + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + 1.0.0 + + src/main/java + + + org.jboss.jandex + jandex-maven-plugin + ${jandex.maven.plugin.version} + + + make-index + + jandex + + + + + + maven-failsafe-plugin + ${maven.failsafe.plugin.version} + + + + integration-test + verify + + + + + + org.codehaus.mojo + build-helper-maven-plugin + ${build.helper.maven.plugin.version} + + + add-source + generate-sources + + add-source + + + + src/gen/java + + + + + + + + + + org.junit.jupiter + junit-jupiter-api + ${junit.version} + test + + + + org.eclipse.microprofile.rest.client + microprofile-rest-client-api + ${microprofile.rest.client.api.version} + + + + + jakarta.ws.rs + jakarta.ws.rs-api + ${jakarta.ws.rs.version} + provided + + + + io.smallrye + smallrye-rest-client + ${smallrye.rest.client.version} + test + + + + io.smallrye + smallrye-config + ${smallrye.config.version} + test + + + org.apache.cxf + cxf-rt-rs-extension-providers + ${cxf.rt.rs.extension.providers.version} + + + jakarta.json.bind + jakarta.json.bind-api + ${jakarta.json.bind.version} + + + jakarta.json + jakarta.json-api + ${jakarta.json.version} + + + jakarta.xml.bind + jakarta.xml.bind-api + ${jakarta.xml.bind.version} + + + com.sun.xml.bind + jaxb-core + ${jaxb.core.version} + + + com.sun.xml.bind + jaxb-impl + ${jaxb.impl.version} + + + jakarta.activation + jakarta.activation-api + ${jakarta.activation.version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson.jaxrs.version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta.annotation.version} + provided + + + io.smallrye.reactive + mutiny + ${mutiny.version} + + + + + sonatype-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + true + + + + + 1.8 + ${java.version} + ${java.version} + UTF-8 + + 1.5.18 + 9.2.9.v20150224 + 5.10.2 + 1.4.14 + 3.2.7 + 2.17.1 + 1.2.2 + 1.3.5 + 1.0.2 + 1.1.6 + 2.1.6 + 2.3.3 + 2.0 + 1.2.1 + 1.3.5 + 3.2.6 + 2.2.11 + 2.2.11 + 5.2.2.Final + 1.1.0 + 2.6 + 1.9.1 + 1.10.0 + + diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/api/ApiException.java b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/api/ApiException.java new file mode 100644 index 000000000000..13fb50ad633e --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/api/ApiException.java @@ -0,0 +1,34 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import javax.ws.rs.core.Response; + +public class ApiException extends Exception { + + private static final long serialVersionUID = 1L; + private Response response; + + public ApiException() { + super(); + } + + public ApiException(Response response) { + super("Api response has status code " + response.getStatus()); + this.response = response; + } + + public Response getResponse() { + return this.response; + } +} diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java new file mode 100644 index 000000000000..51c2aa50a62a --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java @@ -0,0 +1,33 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; +import javax.ws.rs.ext.Provider; +import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper; + +@Provider +public class ApiExceptionMapper + implements ResponseExceptionMapper { + + @Override + public boolean handles(int status, MultivaluedMap headers) { + return status >= 400; + } + + @Override + public ApiException toThrowable(Response response) { + return new ApiException(response); + } +} diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/api/PetApi.java new file mode 100644 index 000000000000..0964ae15d4c7 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/api/PetApi.java @@ -0,0 +1,137 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import java.io.File; +import org.openapitools.client.model.ModelApiResponse; +import org.openapitools.client.model.Pet; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.ws.rs.*; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; +import io.smallrye.mutiny.Uni; + + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +/** + * 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. + * + */ + +@RegisterRestClient(configKey="pet-api") +@RegisterProvider(ApiExceptionMapper.class) +@Path("/pet") +public interface PetApi { + + /** + * Add a new pet to the store + * + * + * + */ + @POST + + @Consumes({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) + Uni addPet(Pet pet) throws ApiException, ProcessingException; + + /** + * Deletes a pet + * + * + * + */ + @DELETE + @Path("/{petId}") + Uni deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey) throws ApiException, ProcessingException; + + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + */ + @GET + @Path("/findByStatus") + @Produces({ "application/xml", "application/json" }) + Uni> findPetsByStatus(@QueryParam("status") List status) throws ApiException, ProcessingException; + + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @deprecated + */ + @Deprecated + @GET + @Path("/findByTags") + @Produces({ "application/xml", "application/json" }) + Uni> findPetsByTags(@QueryParam("tags") List tags) throws ApiException, ProcessingException; + + /** + * Find pet by ID + * + * Returns a single pet + * + */ + @GET + @Path("/{petId}") + @Produces({ "application/xml", "application/json" }) + Uni getPetById(@PathParam("petId") Long petId) throws ApiException, ProcessingException; + + /** + * Update an existing pet + * + * + * + */ + @PUT + + @Consumes({ "application/json", "application/xml" }) + @Produces({ "application/xml", "application/json" }) + Uni updatePet(Pet pet) throws ApiException, ProcessingException; + + /** + * Updates a pet in the store with form data + * + * + * + */ + @POST + @Path("/{petId}") + @Consumes({ "application/x-www-form-urlencoded" }) + Uni updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status) throws ApiException, ProcessingException; + + /** + * uploads an image + * + * + * + */ + @POST + @Path("/{petId}/uploadImage") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + Uni uploadFile(@PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file" , required = false) Attachment _fileDetail) throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/api/StoreApi.java new file mode 100644 index 000000000000..de22bb71fd2e --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/api/StoreApi.java @@ -0,0 +1,87 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import org.openapitools.client.model.Order; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.ws.rs.*; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; +import io.smallrye.mutiny.Uni; + + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +/** + * 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. + * + */ + +@RegisterRestClient(configKey="store-api") +@RegisterProvider(ApiExceptionMapper.class) +@Path("/store") +public interface StoreApi { + + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + */ + @DELETE + @Path("/order/{orderId}") + Uni deleteOrder(@PathParam("orderId") String orderId) throws ApiException, ProcessingException; + + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + */ + @GET + @Path("/inventory") + @Produces({ "application/json" }) + Uni> getInventory() throws ApiException, ProcessingException; + + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + * + */ + @GET + @Path("/order/{orderId}") + @Produces({ "application/xml", "application/json" }) + Uni getOrderById(@PathParam("orderId") Long orderId) throws ApiException, ProcessingException; + + /** + * Place an order for a pet + * + * + * + */ + @POST + @Path("/order") + @Consumes({ "application/json" }) + @Produces({ "application/xml", "application/json" }) + Uni placeOrder(Order order) throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/api/UserApi.java new file mode 100644 index 000000000000..1fc96630b011 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/api/UserApi.java @@ -0,0 +1,130 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import java.util.Date; +import org.openapitools.client.model.User; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.ws.rs.*; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; +import io.smallrye.mutiny.Uni; + + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +/** + * 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. + * + */ + +@RegisterRestClient(configKey="user-api") +@RegisterProvider(ApiExceptionMapper.class) +@Path("/user") +public interface UserApi { + + /** + * Create user + * + * This can only be done by the logged in user. + * + */ + @POST + + @Consumes({ "application/json" }) + Uni createUser(User user) throws ApiException, ProcessingException; + + /** + * Creates list of users with given input array + * + * + * + */ + @POST + @Path("/createWithArray") + @Consumes({ "application/json" }) + Uni createUsersWithArrayInput(List user) throws ApiException, ProcessingException; + + /** + * Creates list of users with given input array + * + * + * + */ + @POST + @Path("/createWithList") + @Consumes({ "application/json" }) + Uni createUsersWithListInput(List user) throws ApiException, ProcessingException; + + /** + * Delete user + * + * This can only be done by the logged in user. + * + */ + @DELETE + @Path("/{username}") + Uni deleteUser(@PathParam("username") String username) throws ApiException, ProcessingException; + + /** + * Get user by user name + * + * + * + */ + @GET + @Path("/{username}") + @Produces({ "application/xml", "application/json" }) + Uni getUserByName(@PathParam("username") String username) throws ApiException, ProcessingException; + + /** + * Logs user into the system + * + * + * + */ + @GET + @Path("/login") + @Produces({ "application/xml", "application/json" }) + Uni loginUser(@QueryParam("username") String username, @QueryParam("password") String password) throws ApiException, ProcessingException; + + /** + * Logs out current logged in user session + * + * + * + */ + @GET + @Path("/logout") + Uni logoutUser() throws ApiException, ProcessingException; + + /** + * Updated user + * + * This can only be done by the logged in user. + * + */ + @PUT + @Path("/{username}") + @Consumes({ "application/json" }) + Uni updateUser(@PathParam("username") String username, User user) throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/Category.java new file mode 100644 index 000000000000..5a53099479ee --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/Category.java @@ -0,0 +1,123 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; + +/** + * A category for a pet + */ + +public class Category { + + @JsonbProperty("id") + private Long id; + + @JsonbProperty("name") + private String name; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + */ + public void setId(Long id) { + this.id = id; + } + + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + /** + * Set name + */ + public void setName(String name) { + this.name = name; + } + + public Category name(String name) { + this.name = name; + return this; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/ModelApiResponse.java new file mode 100644 index 000000000000..6926a2e2270f --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -0,0 +1,148 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; + +/** + * Describes the result of uploading an image resource + */ + +public class ModelApiResponse { + + @JsonbProperty("code") + private Integer code; + + @JsonbProperty("type") + private String type; + + @JsonbProperty("message") + private String message; + + /** + * Get code + * @return code + **/ + public Integer getCode() { + return code; + } + + /** + * Set code + */ + public void setCode(Integer code) { + this.code = code; + } + + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get type + * @return type + **/ + public String getType() { + return type; + } + + /** + * Set type + */ + public void setType(String type) { + this.type = type; + } + + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + /** + * Get message + * @return message + **/ + public String getMessage() { + return message; + } + + /** + * Set message + */ + public void setMessage(String message) { + this.message = message; + } + + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/Order.java new file mode 100644 index 000000000000..4f743c78a6c8 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/Order.java @@ -0,0 +1,269 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Date; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; + +/** + * An order for a pets from the pet store + */ + +public class Order { + + @JsonbProperty("id") + private Long id; + + @JsonbProperty("petId") + private Long petId; + + @JsonbProperty("quantity") + private Integer quantity; + + @JsonbProperty("shipDate") + private Date shipDate; + + @JsonbTypeSerializer(StatusEnum.Serializer.class) + @JsonbTypeDeserializer(StatusEnum.Deserializer.class) + public enum StatusEnum { + + PLACED(String.valueOf("placed")), APPROVED(String.valueOf("approved")), DELIVERED(String.valueOf("delivered")); + + + String value; + + StatusEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public StatusEnum deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'"); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(StatusEnum obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + } + + /** + * Order Status + */ + @JsonbProperty("status") + private StatusEnum status; + + @JsonbProperty("complete") + private Boolean complete = false; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + */ + public void setId(Long id) { + this.id = id; + } + + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get petId + * @return petId + **/ + public Long getPetId() { + return petId; + } + + /** + * Set petId + */ + public void setPetId(Long petId) { + this.petId = petId; + } + + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get quantity + * @return quantity + **/ + public Integer getQuantity() { + return quantity; + } + + /** + * Set quantity + */ + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get shipDate + * @return shipDate + **/ + public Date getShipDate() { + return shipDate; + } + + /** + * Set shipDate + */ + public void setShipDate(Date shipDate) { + this.shipDate = shipDate; + } + + public Order shipDate(Date shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Order Status + * @return status + **/ + public StatusEnum getStatus() { + return status; + } + + /** + * Set status + */ + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Get complete + * @return complete + **/ + public Boolean getComplete() { + return complete; + } + + /** + * Set complete + */ + public void setComplete(Boolean complete) { + this.complete = complete; + } + + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/Pet.java new file mode 100644 index 000000000000..03b5f5cd88f6 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/Pet.java @@ -0,0 +1,291 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; + +/** + * A pet for sale in the pet store + */ + +public class Pet { + + @JsonbProperty("id") + private Long id; + + @JsonbProperty("category") + private Category category; + + @JsonbProperty("name") + private String name; + + @JsonbProperty("photoUrls") + private List photoUrls = new ArrayList<>(); + + @JsonbProperty("tags") + private List tags = null; + + @JsonbTypeSerializer(StatusEnum.Serializer.class) + @JsonbTypeDeserializer(StatusEnum.Deserializer.class) + public enum StatusEnum { + + AVAILABLE(String.valueOf("available")), PENDING(String.valueOf("pending")), SOLD(String.valueOf("sold")); + + + String value; + + StatusEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static final class Deserializer implements JsonbDeserializer { + @Override + public StatusEnum deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'"); + } + } + + public static final class Serializer implements JsonbSerializer { + @Override + public void serialize(StatusEnum obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + } + + /** + * pet status in the store + */ + @JsonbProperty("status") + private StatusEnum status; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + */ + public void setId(Long id) { + this.id = id; + } + + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get category + * @return category + **/ + public Category getCategory() { + return category; + } + + /** + * Set category + */ + public void setCategory(Category category) { + this.category = category; + } + + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + /** + * Set name + */ + public void setName(String name) { + this.name = name; + } + + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get photoUrls + * @return photoUrls + **/ + public List getPhotoUrls() { + return photoUrls; + } + + /** + * Set photoUrls + */ + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get tags + * @return tags + **/ + public List getTags() { + return tags; + } + + /** + * Set tags + */ + public void setTags(List tags) { + this.tags = tags; + } + + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * pet status in the store + * @return status + * @deprecated + **/ + @Deprecated + public StatusEnum getStatus() { + return status; + } + + /** + * Set status + */ + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/Tag.java new file mode 100644 index 000000000000..5bb307506c92 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/Tag.java @@ -0,0 +1,123 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; + +/** + * A tag for a pet + */ + +public class Tag { + + @JsonbProperty("id") + private Long id; + + @JsonbProperty("name") + private String name; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + */ + public void setId(Long id) { + this.id = id; + } + + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + /** + * Set name + */ + public void setName(String name) { + this.name = name; + } + + public Tag name(String name) { + this.name = name; + return this; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/User.java new file mode 100644 index 000000000000..1542e3dfc587 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/main/java/org/openapitools/client/model/User.java @@ -0,0 +1,276 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.lang.reflect.Type; +import javax.json.bind.annotation.JsonbTypeDeserializer; +import javax.json.bind.annotation.JsonbTypeSerializer; +import javax.json.bind.serializer.DeserializationContext; +import javax.json.bind.serializer.JsonbDeserializer; +import javax.json.bind.serializer.JsonbSerializer; +import javax.json.bind.serializer.SerializationContext; +import javax.json.stream.JsonGenerator; +import javax.json.stream.JsonParser; +import javax.json.bind.annotation.JsonbProperty; + +/** + * A User who is purchasing from the pet store + */ + +public class User { + + @JsonbProperty("id") + private Long id; + + @JsonbProperty("username") + private String username; + + @JsonbProperty("firstName") + private String firstName; + + @JsonbProperty("lastName") + private String lastName; + + @JsonbProperty("email") + private String email; + + @JsonbProperty("password") + private String password; + + @JsonbProperty("phone") + private String phone; + + /** + * User Status + */ + @JsonbProperty("userStatus") + private Integer userStatus; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + */ + public void setId(Long id) { + this.id = id; + } + + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get username + * @return username + **/ + public String getUsername() { + return username; + } + + /** + * Set username + */ + public void setUsername(String username) { + this.username = username; + } + + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get firstName + * @return firstName + **/ + public String getFirstName() { + return firstName; + } + + /** + * Set firstName + */ + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get lastName + * @return lastName + **/ + public String getLastName() { + return lastName; + } + + /** + * Set lastName + */ + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get email + * @return email + **/ + public String getEmail() { + return email; + } + + /** + * Set email + */ + public void setEmail(String email) { + this.email = email; + } + + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get password + * @return password + **/ + public String getPassword() { + return password; + } + + /** + * Set password + */ + public void setPassword(String password) { + this.password = password; + } + + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get phone + * @return phone + **/ + public String getPhone() { + return phone; + } + + /** + * Set phone + */ + public void setPhone(String phone) { + this.phone = phone; + } + + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * User Status + * @return userStatus + **/ + public Integer getUserStatus() { + return userStatus; + } + + /** + * Set userStatus + */ + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + @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); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + /** + * Create a string representation of this pojo. + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + 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("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/test/java/org/openapitools/client/api/PetApiTest.java new file mode 100644 index 000000000000..764ced64f49a --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -0,0 +1,201 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import java.io.File; +import org.openapitools.client.model.ModelApiResponse; +import org.openapitools.client.model.Pet; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for PetApi + */ +public class PetApiTest { + + private PetApi client; + private String baseUrl = "http://localhost:9080"; + + @BeforeEach + public void setup() throws MalformedURLException { + client = RestClientBuilder.newBuilder() + .baseUrl(new URL(baseUrl)) + .register(ApiException.class) + .build(PetApi.class); + } + + + /** + * Add a new pet to the store + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void addPetTest() { + // TODO: test validations + Pet pet = null; + //Uni response = api.addPet(pet); + //Assertions.assertNotNull(response); + + + } + + /** + * Deletes a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deletePetTest() { + // TODO: test validations + Long petId = null; + String apiKey = null; + //api.deletePet(petId, apiKey); + //Assertions.assertNotNull(response); + + + } + + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void findPetsByStatusTest() { + // TODO: test validations + List status = null; + //Uni> response = api.findPetsByStatus(status); + //Assertions.assertNotNull(response); + + + } + + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void findPetsByTagsTest() { + // TODO: test validations + List tags = null; + //Uni> response = api.findPetsByTags(tags); + //Assertions.assertNotNull(response); + + + } + + /** + * Find pet by ID + * + * Returns a single pet + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getPetByIdTest() { + // TODO: test validations + Long petId = null; + //Uni response = api.getPetById(petId); + //Assertions.assertNotNull(response); + + + } + + /** + * Update an existing pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updatePetTest() { + // TODO: test validations + Pet pet = null; + //Uni response = api.updatePet(pet); + //Assertions.assertNotNull(response); + + + } + + /** + * Updates a pet in the store with form data + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updatePetWithFormTest() { + // TODO: test validations + Long petId = null; + String name = null; + String status = null; + //api.updatePetWithForm(petId, name, status); + //Assertions.assertNotNull(response); + + + } + + /** + * uploads an image + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void uploadFileTest() { + // TODO: test validations + Long petId = null; + String additionalMetadata = null; + org.apache.cxf.jaxrs.ext.multipart.Attachment _file = null; + //Uni response = api.uploadFile(petId, additionalMetadata, _file); + //Assertions.assertNotNull(response); + + + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/test/java/org/openapitools/client/api/StoreApiTest.java new file mode 100644 index 000000000000..eee457ee1025 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -0,0 +1,121 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.Order; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for StoreApi + */ +public class StoreApiTest { + + private StoreApi client; + private String baseUrl = "http://localhost:9080"; + + @BeforeEach + public void setup() throws MalformedURLException { + client = RestClientBuilder.newBuilder() + .baseUrl(new URL(baseUrl)) + .register(ApiException.class) + .build(StoreApi.class); + } + + + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteOrderTest() { + // TODO: test validations + String orderId = null; + //api.deleteOrder(orderId); + //Assertions.assertNotNull(response); + + + } + + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getInventoryTest() { + // TODO: test validations + //Uni> response = api.getInventory(); + //Assertions.assertNotNull(response); + + + } + + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getOrderByIdTest() { + // TODO: test validations + Long orderId = null; + //Uni response = api.getOrderById(orderId); + //Assertions.assertNotNull(response); + + + } + + /** + * Place an order for a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void placeOrderTest() { + // TODO: test validations + Order order = null; + //Uni response = api.placeOrder(order); + //Assertions.assertNotNull(response); + + + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/test/java/org/openapitools/client/api/UserApiTest.java new file mode 100644 index 000000000000..3721b04a5e4a --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -0,0 +1,196 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import java.util.Date; +import org.openapitools.client.model.User; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for UserApi + */ +public class UserApiTest { + + private UserApi client; + private String baseUrl = "http://localhost:9080"; + + @BeforeEach + public void setup() throws MalformedURLException { + client = RestClientBuilder.newBuilder() + .baseUrl(new URL(baseUrl)) + .register(ApiException.class) + .build(UserApi.class); + } + + + /** + * Create user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUserTest() { + // TODO: test validations + User user = null; + //api.createUser(user); + //Assertions.assertNotNull(response); + + + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUsersWithArrayInputTest() { + // TODO: test validations + List user = null; + //api.createUsersWithArrayInput(user); + //Assertions.assertNotNull(response); + + + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUsersWithListInputTest() { + // TODO: test validations + List user = null; + //api.createUsersWithListInput(user); + //Assertions.assertNotNull(response); + + + } + + /** + * Delete user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteUserTest() { + // TODO: test validations + String username = null; + //api.deleteUser(username); + //Assertions.assertNotNull(response); + + + } + + /** + * Get user by user name + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getUserByNameTest() { + // TODO: test validations + String username = null; + //Uni response = api.getUserByName(username); + //Assertions.assertNotNull(response); + + + } + + /** + * Logs user into the system + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void loginUserTest() { + // TODO: test validations + String username = null; + String password = null; + //Uni response = api.loginUser(username, password); + //Assertions.assertNotNull(response); + + + } + + /** + * Logs out current logged in user session + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void logoutUserTest() { + // TODO: test validations + //api.logoutUser(); + //Assertions.assertNotNull(response); + + + } + + /** + * Updated user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updateUserTest() { + // TODO: test validations + String username = null; + User user = null; + //api.updateUser(username, user); + //Assertions.assertNotNull(response); + + + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/test/java/org/openapitools/client/model/CategoryTest.java new file mode 100644 index 000000000000..d0568f977669 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -0,0 +1,50 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Category + */ +class CategoryTest { + private final Category model = new Category(); + + /** + * Model tests for Category + */ + @Test + void testCategory() { + // TODO: test Category + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java new file mode 100644 index 000000000000..ddfa78c4ac31 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -0,0 +1,58 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelApiResponse + */ +class ModelApiResponseTest { + private final ModelApiResponse model = new ModelApiResponse(); + + /** + * Model tests for ModelApiResponse + */ + @Test + void testModelApiResponse() { + // TODO: test ModelApiResponse + } + + /** + * Test the property 'code' + */ + @Test + void codeTest() { + // TODO: test code + } + + /** + * Test the property 'type' + */ + @Test + void typeTest() { + // TODO: test type + } + + /** + * Test the property 'message' + */ + @Test + void messageTest() { + // TODO: test message + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/test/java/org/openapitools/client/model/OrderTest.java new file mode 100644 index 000000000000..0d23109bd825 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/test/java/org/openapitools/client/model/OrderTest.java @@ -0,0 +1,83 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Date; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Order + */ +class OrderTest { + private final Order model = new Order(); + + /** + * Model tests for Order + */ + @Test + void testOrder() { + // TODO: test Order + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'petId' + */ + @Test + void petIdTest() { + // TODO: test petId + } + + /** + * Test the property 'quantity' + */ + @Test + void quantityTest() { + // TODO: test quantity + } + + /** + * Test the property 'shipDate' + */ + @Test + void shipDateTest() { + // TODO: test shipDate + } + + /** + * Test the property 'status' + */ + @Test + void statusTest() { + // TODO: test status + } + + /** + * Test the property 'complete' + */ + @Test + void completeTest() { + // TODO: test complete + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/test/java/org/openapitools/client/model/PetTest.java new file mode 100644 index 000000000000..e939e3b1d45a --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/test/java/org/openapitools/client/model/PetTest.java @@ -0,0 +1,87 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Pet + */ +class PetTest { + private final Pet model = new Pet(); + + /** + * Model tests for Pet + */ + @Test + void testPet() { + // TODO: test Pet + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'category' + */ + @Test + void categoryTest() { + // TODO: test category + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + + /** + * Test the property 'photoUrls' + */ + @Test + void photoUrlsTest() { + // TODO: test photoUrls + } + + /** + * Test the property 'tags' + */ + @Test + void tagsTest() { + // TODO: test tags + } + + /** + * Test the property 'status' + */ + @Test + void statusTest() { + // TODO: test status + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/test/java/org/openapitools/client/model/TagTest.java new file mode 100644 index 000000000000..5131a8a3e889 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/test/java/org/openapitools/client/model/TagTest.java @@ -0,0 +1,50 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Tag + */ +class TagTest { + private final Tag model = new Tag(); + + /** + * Model tests for Tag + */ + @Test + void testTag() { + // TODO: test Tag + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client-mutiny/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/test/java/org/openapitools/client/model/UserTest.java new file mode 100644 index 000000000000..d0d84b127052 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client-mutiny/src/test/java/org/openapitools/client/model/UserTest.java @@ -0,0 +1,98 @@ +/** + * 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. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for User + */ +class UserTest { + private final User model = new User(); + + /** + * Model tests for User + */ + @Test + void testUser() { + // TODO: test User + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'username' + */ + @Test + void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'firstName' + */ + @Test + void firstNameTest() { + // TODO: test firstName + } + + /** + * Test the property 'lastName' + */ + @Test + void lastNameTest() { + // TODO: test lastName + } + + /** + * Test the property 'email' + */ + @Test + void emailTest() { + // TODO: test email + } + + /** + * Test the property 'password' + */ + @Test + void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'phone' + */ + @Test + void phoneTest() { + // TODO: test phone + } + + /** + * Test the property 'userStatus' + */ + @Test + void userStatusTest() { + // TODO: test userStatus + } + +} diff --git a/samples/client/petstore/java/native/build.gradle b/samples/client/petstore/java/native/build.gradle index ad4e835b7708..bdc8a7c7d512 100644 --- a/samples/client/petstore/java/native/build.gradle +++ b/samples/client/petstore/java/native/build.gradle @@ -71,6 +71,7 @@ ext { beanvalidation_version = "2.0.2" junit_version = "5.10.2" httpmime_version = "4.5.13" + commons_lang3_version = "3.17.0" } dependencies { @@ -82,6 +83,7 @@ dependencies { implementation "org.openapitools:jackson-databind-nullable:0.2.1" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" implementation "org.apache.httpcomponents:httpmime:$httpmime_version" + implementation "org.apache.commons:commons-lang3:$commons_lang3_version" testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/samples/client/petstore/java/native/pom.xml b/samples/client/petstore/java/native/pom.xml index f5aa8987b095..68923150e4b7 100644 --- a/samples/client/petstore/java/native/pom.xml +++ b/samples/client/petstore/java/native/pom.xml @@ -239,6 +239,12 @@ httpmime ${httpmime-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + @@ -258,6 +264,7 @@ 1.3.5 2.0.2 4.5.14 + 3.17.0 5.10.2 2.27.2 diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 76dc10c07a8b..599568bde9f2 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -321,21 +323,7 @@ public void setMapWithUndeclaredPropertiesString(@javax.annotation.Nullable Map< */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) && - Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty) && - equalsNullable(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.mapWithUndeclaredPropertiesAnytype1, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype1) && - Objects.equals(this.mapWithUndeclaredPropertiesAnytype2, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype2) && - Objects.equals(this.mapWithUndeclaredPropertiesAnytype3, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype3) && - Objects.equals(this.emptyMap, additionalPropertiesClass.emptyMap) && - Objects.equals(this.mapWithUndeclaredPropertiesString, additionalPropertiesClass.mapWithUndeclaredPropertiesString); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -344,7 +332,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/native/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java index d1f3c98076fb..b94a0b477c59 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -116,20 +118,12 @@ public void setColor(@javax.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/native/src/main/java/org/openapitools/client/model/Apple.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Apple.java index 1c61171ebe6c..7254eb1a7250 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Apple.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -102,20 +104,12 @@ public void setOrigin(@javax.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/native/src/main/java/org/openapitools/client/model/AppleReq.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AppleReq.java index a34652b3c109..c29b483efe47 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AppleReq.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -102,20 +104,12 @@ public void setMealy(@javax.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/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 9028a95c7d42..b0651d33cd8c 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -84,19 +86,12 @@ public void setArrayArrayNumber(@javax.annotation.Nullable List */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; - return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(arrayArrayNumber); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 03e2f228771c..7d0e66aafd2f 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -84,19 +86,12 @@ public void setArrayNumber(@javax.annotation.Nullable List arrayNumb */ @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/native/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java index 234361daf01a..3fc422984c5a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -158,21 +160,12 @@ public void setArrayArrayOfModel(@javax.annotation.Nullable List boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -255,7 +245,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(mainShape, shapeOrNull, hashCodeNullable(nullableShape), shapes, super.hashCode(), additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java index 91d031f2d384..c8be0bc01545 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -182,20 +184,12 @@ public void setArrayEnum(@javax.annotation.Nullable List arrayEnu */ @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/native/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumClass.java index 456228e0398f..799cc43f029b 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumClass.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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java index a5b629557a10..84c1f7dbef64 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -499,22 +501,7 @@ public void setOuterEnumIntegerDefaultValue(@javax.annotation.Nullable OuterEnum */ @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) { @@ -523,7 +510,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/native/src/main/java/org/openapitools/client/model/EquilateralTriangle.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EquilateralTriangle.java index 2033162fd120..e995ec26a551 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EquilateralTriangle.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EquilateralTriangle.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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -102,20 +104,12 @@ public void setTriangleType(@javax.annotation.Nonnull String triangleType) { */ @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 diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java index 24888be137f3..56df082222e8 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -113,20 +115,12 @@ public void setSomeMap(@javax.annotation.Nullable Map someMa */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FakeBigDecimalMap200Response fakeBigDecimalMap200Response = (FakeBigDecimalMap200Response) o; - return Objects.equals(this.someId, fakeBigDecimalMap200Response.someId) && - Objects.equals(this.someMap, fakeBigDecimalMap200Response.someMap); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(someId, someMap); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 5a0e40370724..5bd7e5480dd3 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -113,20 +115,12 @@ public void setFiles(@javax.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/native/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Foo.java index baf2ad201972..f626dd429df8 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -73,19 +75,12 @@ public void setBar(@javax.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/native/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index 63ff6395a1e5..77541ddac031 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -74,19 +76,12 @@ public void setString(@javax.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/native/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java index 3bb358c894a1..06081ade5c97 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -523,34 +525,12 @@ public void setPatternWithDigitsAndDelimiter(@javax.annotation.Nullable String p */ @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/native/src/main/java/org/openapitools/client/model/Fruit.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Fruit.java index 657dfc19c850..7076e9cfc827 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FruitReq.java index 66a63ec9eb0f..253518900575 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GmFruit.java index 6b3ba6739e35..5d32e6502769 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GrandparentAnimal.java index 4d5c1dcadf07..d7861e6bc4e5 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GrandparentAnimal.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -87,19 +89,12 @@ public void setPetType(@javax.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/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 26ce80f3fc92..36059dcb94f3 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -92,20 +94,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/native/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HealthCheckResult.java index 128a16915fbb..dc73ce1cd163 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -84,14 +86,7 @@ public void setNullableMessage(@javax.annotation.Nullable String nullableMessage */ @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) { @@ -100,7 +95,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/native/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java index 640a0091b9aa..2ce076ed6eb1 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -102,20 +104,12 @@ public void setTriangleType(@javax.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/native/src/main/java/org/openapitools/client/model/Mammal.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Mammal.java index 727d75d58098..903b59b8f06a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Mammal.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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java index e8ab4903c9f7..199a4599163e 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -229,22 +231,12 @@ public void setIndirectMap(@javax.annotation.Nullable Map indir */ @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/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 9b8ea43fb256..58b3b554af24 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -144,21 +146,12 @@ public void setMap(@javax.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/native/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java index a587abd842bb..71fac698fae0 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -102,20 +104,12 @@ public void setPropertyClass(@javax.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/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java index f1a305ac8130..b5972d9c1c33 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -131,21 +133,12 @@ public void setMessage(@javax.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/native/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelFile.java index 2cbb873e1bbc..833706d38750 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -73,19 +75,12 @@ public void setSourceURI(@javax.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/native/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelList.java index 688bd3a492bd..3267f84f60a8 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -73,19 +75,12 @@ public void set123list(@javax.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/native/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java index 8afe2aa291cb..3e40db3fbfae 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -73,19 +75,12 @@ public void setReturn(@javax.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/native/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java index 254eb93783dc..038ad7859f90 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -150,22 +152,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/native/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NullableClass.java index 9cc1aec009d9..00551c478190 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/native/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; @@ -584,27 +586,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) && - super.equals(o); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -613,7 +595,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, super.hashCode(), additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NullableShape.java index 69337631f598..1010877832f5 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NullableShape.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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java index 311bddd0737b..ee0cbaa9b284 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -74,19 +76,12 @@ public void setJustNumber(@javax.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/native/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index 9f22ac33b402..9a22c13d20b0 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -178,22 +180,12 @@ public void setBars(@javax.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/native/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java index 3ba6eeb6d87c..93c7ad4b17b2 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -256,24 +258,12 @@ public void setComplete(@javax.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/native/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java index da51395e38f7..e5f001062f03 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -132,21 +134,12 @@ public void setMyBoolean(@javax.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/native/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnum.java index 8a5b13cb19c1..27626a28cd0d 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnum.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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java index 284de643c1ad..f4fa162b0351 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnumInteger.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnumInteger.java index ac32ba440077..9e3ec295345e 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnumInteger.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnumInteger.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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java index 356b2635800e..f3cdf262a274 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ParentPet.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ParentPet.java index 93528aa7d7d2..9d4b9e660b47 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ParentPet.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ParentPet.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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -64,18 +66,12 @@ public ParentPet petType(@javax.annotation.Nonnull String petType) { */ @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 diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java index d5b671856b55..ae945f391b6a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -275,24 +277,12 @@ public void setStatus(@javax.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/native/src/main/java/org/openapitools/client/model/Pig.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pig.java index 4ee5c3fc43c8..ff075735ed66 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pig.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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Quadrilateral.java index b2a851b351fb..754046b4c83e 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Quadrilateral.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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java index ca89b2c6f144..3b14b5e07bf1 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -73,19 +75,12 @@ public void setQuadrilateralType(@javax.annotation.Nonnull String quadrilateralT */ @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/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index c3c0fff1d5c8..4c02d91cfb2b 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -100,20 +102,12 @@ public void setBaz(@javax.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/native/src/main/java/org/openapitools/client/model/ScaleneTriangle.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ScaleneTriangle.java index d72f51aecf74..505a2129d344 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ScaleneTriangle.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ScaleneTriangle.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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -102,20 +104,12 @@ public void setTriangleType(@javax.annotation.Nonnull String triangleType) { */ @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 diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Shape.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Shape.java index 6a44b5a721ea..b16d6bc49176 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Shape.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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ShapeInterface.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ShapeInterface.java index 41fcfc600691..75d01e3b7380 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ShapeInterface.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -73,19 +75,12 @@ public void setShapeType(@javax.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/native/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ShapeOrNull.java index 07f9a1bd3aa5..bab94a62534b 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ShapeOrNull.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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java index 98b7071d41fc..782aa3c8dfb9 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -102,20 +104,12 @@ public void setQuadrilateralType(@javax.annotation.Nonnull String quadrilateralT */ @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 diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java index 12a839c0a153..8f7abe06d9ea 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -102,20 +104,12 @@ public void setSpecialModelName(@javax.annotation.Nullable String specialModelNa */ @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/native/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java index 5f7135324b9d..83c49d2caa09 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -102,20 +104,12 @@ public void setName(@javax.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/native/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index 0fd01ccbd17e..ed333dcabd4b 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/client/petstore/java/native/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; @@ -122,21 +124,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) && - super.equals(o); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(someProperty, super.hashCode(), additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Triangle.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Triangle.java index d97ae14675f0..d67364ded19a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Triangle.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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TriangleInterface.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TriangleInterface.java index b8c67a63ab6f..774f2324463c 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TriangleInterface.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -73,19 +75,12 @@ public void setTriangleType(@javax.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/native/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/User.java index 12e3f8ce519f..2ead11d78b60 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -417,25 +419,7 @@ public void setAnyTypePropNullable(@javax.annotation.Nullable Object anyTypeProp */ @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) { @@ -444,7 +428,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/native/src/main/java/org/openapitools/client/model/Whale.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Whale.java index be60877fab8c..7d49c88d862e 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Whale.java +++ b/samples/client/petstore/java/native/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.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -131,21 +133,12 @@ public void setClassName(@javax.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/native/src/main/java/org/openapitools/client/model/Zebra.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Zebra.java index 9e1fbf95636f..fbd174fee928 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Zebra.java +++ b/samples/client/petstore/java/native/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; @@ -188,22 +190,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) && - super.equals(o); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(type, className, super.hashCode(), additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/okhttp-gson-3.1/build.gradle b/samples/client/petstore/java/okhttp-gson-3.1/build.gradle index f2a6e8e06eb7..3481d0b7c6fc 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-3.1/build.gradle @@ -115,7 +115,7 @@ dependencies { implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' diff --git a/samples/client/petstore/java/okhttp-gson-3.1/build.sbt b/samples/client/petstore/java/okhttp-gson-3.1/build.sbt index fc99baef382c..a4ec728212aa 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-3.1/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2", diff --git a/samples/client/petstore/java/okhttp-gson-3.1/pom.xml b/samples/client/petstore/java/okhttp-gson-3.1/pom.xml index f35785a5ecf9..2834afabd935 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-3.1/pom.xml @@ -331,7 +331,7 @@ 1.9.0 4.12.0 2.10.1 - 3.14.0 + 3.17.0 0.2.6 1.3.5 2.0.2 diff --git a/samples/client/petstore/java/okhttp-gson-awsv4signature/build.gradle b/samples/client/petstore/java/okhttp-gson-awsv4signature/build.gradle index 9efe9b9f0a0e..96bee6a6a581 100644 --- a/samples/client/petstore/java/okhttp-gson-awsv4signature/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-awsv4signature/build.gradle @@ -116,7 +116,7 @@ dependencies { implementation 'org.openapitools:jackson-databind-nullable:0.2.6' implementation 'software.amazon.awssdk:auth:2.20.157' implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' diff --git a/samples/client/petstore/java/okhttp-gson-awsv4signature/build.sbt b/samples/client/petstore/java/okhttp-gson-awsv4signature/build.sbt index 993651032ca7..ca9e47046395 100644 --- a/samples/client/petstore/java/okhttp-gson-awsv4signature/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-awsv4signature/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "software.amazon.awssdk" % "auth" % "2.20.157", diff --git a/samples/client/petstore/java/okhttp-gson-awsv4signature/pom.xml b/samples/client/petstore/java/okhttp-gson-awsv4signature/pom.xml index 4d1adf440d55..fcca932920ac 100644 --- a/samples/client/petstore/java/okhttp-gson-awsv4signature/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-awsv4signature/pom.xml @@ -336,7 +336,7 @@ 1.9.0 4.12.0 2.10.1 - 3.14.0 + 3.17.0 0.2.6 1.3.5 2.0.2 diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle index df040d5aac19..ff5a6701b9e7 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle @@ -115,7 +115,7 @@ dependencies { implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' implementation 'io.swagger.parser.v3:swagger-parser-v3:2.0.30' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt index fe2edb8e3f11..35c2e615d1f3 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2", diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml b/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml index 093370ee3238..922ba2a9ba6e 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml @@ -336,7 +336,7 @@ 1.9.0 4.12.0 2.10.1 - 3.14.0 + 3.17.0 0.2.6 1.3.5 2.0.2 diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/build.gradle b/samples/client/petstore/java/okhttp-gson-group-parameter/build.gradle index 23a62038557c..07ac6648265f 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/build.gradle @@ -115,7 +115,7 @@ dependencies { implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/build.sbt b/samples/client/petstore/java/okhttp-gson-group-parameter/build.sbt index 824632fc6621..baea7b60bf0b 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2", diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/pom.xml b/samples/client/petstore/java/okhttp-gson-group-parameter/pom.xml index ad5944f75711..a3cb5d2afac0 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/pom.xml @@ -331,7 +331,7 @@ 1.9.0 4.12.0 2.10.1 - 3.14.0 + 3.17.0 0.2.6 1.3.5 2.0.2 diff --git a/samples/client/petstore/java/okhttp-gson-nullable-required/build.gradle b/samples/client/petstore/java/okhttp-gson-nullable-required/build.gradle index d52a031af35f..add44e0ec5fc 100644 --- a/samples/client/petstore/java/okhttp-gson-nullable-required/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-nullable-required/build.gradle @@ -115,7 +115,7 @@ dependencies { implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' diff --git a/samples/client/petstore/java/okhttp-gson-nullable-required/build.sbt b/samples/client/petstore/java/okhttp-gson-nullable-required/build.sbt index f0b139580df4..cd615f72411c 100644 --- a/samples/client/petstore/java/okhttp-gson-nullable-required/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-nullable-required/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2", diff --git a/samples/client/petstore/java/okhttp-gson-nullable-required/pom.xml b/samples/client/petstore/java/okhttp-gson-nullable-required/pom.xml index ea83c53acf89..7a2c9e5acd80 100644 --- a/samples/client/petstore/java/okhttp-gson-nullable-required/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-nullable-required/pom.xml @@ -331,7 +331,7 @@ 1.9.0 4.12.0 2.10.1 - 3.14.0 + 3.17.0 0.2.6 1.3.5 2.0.2 diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle index 51ba39863b41..aa345bbc8a92 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle @@ -115,7 +115,7 @@ dependencies { implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt index f93a3516af95..4af66177f326 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2", diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml index 8f24c134707b..bb09a11bde8a 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml @@ -338,7 +338,7 @@ 1.9.0 4.12.0 2.10.1 - 3.14.0 + 3.17.0 0.2.6 1.3.5 2.0.2 diff --git a/samples/client/petstore/java/okhttp-gson-swagger1/build.gradle b/samples/client/petstore/java/okhttp-gson-swagger1/build.gradle index 5ce050edbdd4..bfee284c1c6f 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger1/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-swagger1/build.gradle @@ -115,7 +115,7 @@ dependencies { implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' diff --git a/samples/client/petstore/java/okhttp-gson-swagger1/build.sbt b/samples/client/petstore/java/okhttp-gson-swagger1/build.sbt index ce7b54dda966..ce1336dd084f 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger1/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-swagger1/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2", diff --git a/samples/client/petstore/java/okhttp-gson-swagger1/pom.xml b/samples/client/petstore/java/okhttp-gson-swagger1/pom.xml index e7d136d699ce..938900a24d6e 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger1/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-swagger1/pom.xml @@ -337,7 +337,7 @@ 1.6.6 4.12.0 2.10.1 - 3.14.0 + 3.17.0 0.2.6 1.3.5 2.0.2 diff --git a/samples/client/petstore/java/okhttp-gson-swagger2/build.gradle b/samples/client/petstore/java/okhttp-gson-swagger2/build.gradle index 5ce050edbdd4..bfee284c1c6f 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger2/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-swagger2/build.gradle @@ -115,7 +115,7 @@ dependencies { implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' diff --git a/samples/client/petstore/java/okhttp-gson-swagger2/build.sbt b/samples/client/petstore/java/okhttp-gson-swagger2/build.sbt index ce7b54dda966..ce1336dd084f 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger2/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-swagger2/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2", diff --git a/samples/client/petstore/java/okhttp-gson-swagger2/pom.xml b/samples/client/petstore/java/okhttp-gson-swagger2/pom.xml index 5cab5823b798..fda28b6c3132 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger2/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-swagger2/pom.xml @@ -337,7 +337,7 @@ 2.2.15 4.12.0 2.10.1 - 3.14.0 + 3.17.0 0.2.6 1.3.5 2.0.2 diff --git a/samples/client/petstore/java/okhttp-gson/build.gradle b/samples/client/petstore/java/okhttp-gson/build.gradle index 5ce050edbdd4..bfee284c1c6f 100644 --- a/samples/client/petstore/java/okhttp-gson/build.gradle +++ b/samples/client/petstore/java/okhttp-gson/build.gradle @@ -115,7 +115,7 @@ dependencies { implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' diff --git a/samples/client/petstore/java/okhttp-gson/build.sbt b/samples/client/petstore/java/okhttp-gson/build.sbt index ce7b54dda966..ce1336dd084f 100644 --- a/samples/client/petstore/java/okhttp-gson/build.sbt +++ b/samples/client/petstore/java/okhttp-gson/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2", diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml index 8b36afad0dce..f7ec28d1f388 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml @@ -318,6 +318,7 @@ jersey-apache-connector ${jersey-version} + org.junit.jupiter diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml index e9b2b57c298c..35512ac069d1 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml @@ -318,6 +318,7 @@ jersey-apache-connector ${jersey-version} + org.junit.jupiter diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/pom.xml b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/pom.xml index 61c396d8d9c3..c5d9ade43f14 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/pom.xml +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger1/pom.xml @@ -328,6 +328,7 @@ jersey-apache-connector ${jersey-version} + org.junit.jupiter diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/pom.xml b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/pom.xml index 193a5d6846ae..59ace0a8a94d 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/pom.xml +++ b/samples/openapi3/client/petstore/java/jersey2-java8-swagger2/pom.xml @@ -328,6 +328,7 @@ jersey-apache-connector ${jersey-version} + org.junit.jupiter diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle b/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle index e395c9d2d6fa..da665aa10774 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle +++ b/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle @@ -107,6 +107,7 @@ ext { junit_version = "5.8.2" scribejava_apis_version = "8.3.1" tomitribe_http_signatures_version = "1.7" + commons_lang3_version = "3.17.0" } dependencies { @@ -125,6 +126,7 @@ 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 "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/openapi3/client/petstore/java/jersey2-java8/build.sbt b/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt index 73d21d4824b4..873fe19c3f15 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt +++ b/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt @@ -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" % "1.3.5" % "compile", + "org.apache.commons" % "commons-lang3" % "3.17.0" % "compile", "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" ) ) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml b/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml index a927083dc554..49f0c29b0608 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml @@ -328,6 +328,13 @@ jersey-apache-connector ${jersey-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + org.junit.jupiter @@ -347,6 +354,7 @@ 5.10.0 1.8 8.3.3 + 3.17.0 2.21.0 diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 43745cdf21ae..4bfe6ff4da78 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -326,21 +328,7 @@ public void setMapWithUndeclaredPropertiesString(@javax.annotation.Nullable Map< */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) && - Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty) && - equalsNullable(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.mapWithUndeclaredPropertiesAnytype1, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype1) && - Objects.equals(this.mapWithUndeclaredPropertiesAnytype2, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype2) && - Objects.equals(this.mapWithUndeclaredPropertiesAnytype3, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype3) && - Objects.equals(this.emptyMap, additionalPropertiesClass.emptyMap) && - Objects.equals(this.mapWithUndeclaredPropertiesString, additionalPropertiesClass.mapWithUndeclaredPropertiesString); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -349,7 +337,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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java index 4d2ce0fec2e7..7f217ced6c59 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -114,20 +116,12 @@ public void setColor(@javax.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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java index e53e2e86c5d3..a486705a439b 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -102,20 +104,12 @@ public void setOrigin(@javax.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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java index 8557a52e9948..8ed48f4669f4 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -102,20 +104,12 @@ public void setMealy(@javax.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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 5510fb44e7cd..6e6180d6ad5c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -82,19 +84,12 @@ public void setArrayArrayNumber(@javax.annotation.Nullable List */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; - return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(arrayArrayNumber); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 2d594551dab5..c0ad5cab87b2 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.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; @@ -82,19 +84,12 @@ public void setArrayNumber(@javax.annotation.Nullable List arrayNumb */ @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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java index 3ae301ac9bf7..47a40e040007 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -158,21 +160,12 @@ public void setArrayArrayOfModel(@javax.annotation.Nullable List boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -254,7 +245,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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java index 6238af12763a..6702d2f72756 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -181,20 +183,12 @@ public void setArrayEnum(@javax.annotation.Nullable List arrayEnu */ @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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumClass.java index 0150ebe31b41..4f09e72dbe2c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumClass.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; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java index 59c58ab91ebe..2cf366f2620a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -506,22 +508,7 @@ public void setOuterEnumIntegerDefaultValue(@javax.annotation.Nullable OuterEnum */ @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 +517,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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java index 1c31a6c15b79..e99102bea3a3 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.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; @@ -142,21 +144,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; - } - EquilateralTriangle equilateralTriangle = (EquilateralTriangle) o; - return Objects.equals(this.shapeType, equilateralTriangle.shapeType) && - Objects.equals(this.triangleType, equilateralTriangle.triangleType)&& - Objects.equals(this.additionalProperties, equilateralTriangle.additionalProperties); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(shapeType, triangleType, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 170ad2b8b492..8ecdae1cb265 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -112,20 +114,12 @@ public void setFiles(@javax.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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java index c3d7e4aa3d8c..6f4e938ed9ac 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -71,19 +73,12 @@ public void setBar(@javax.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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index 986bb8b5d00c..d02039382f20 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -73,19 +75,12 @@ public void setString(@javax.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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java index a51743669e2c..078dea2c5b63 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -537,34 +539,12 @@ public void setPatternWithDigitsAndDelimiter(@javax.annotation.Nullable String p */ @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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java index e0063f25c61c..9fbfd53e52fc 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java index 528c23fefd39..52ba66ff1266 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GmFruit.java index d2e59719e3b5..38aa06694ca3 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java index 4512e112c8d4..73270e37e9a1 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -84,19 +86,12 @@ public void setPetType(@javax.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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 10721debfd1d..c5d036e8ee7f 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -92,20 +94,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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java index 547f0d1bc849..bc9625b44e9b 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -82,14 +84,7 @@ public void setNullableMessage(@javax.annotation.Nullable String nullableMessage */ @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 +93,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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java index 741c289a890f..cccace584b0a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -101,20 +103,12 @@ public void setTriangleType(@javax.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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java index 7b007cb213a2..6d1c1769c6c2 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.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; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MammalAnyof.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MammalAnyof.java index 42b10eb69ada..708b89790b36 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MammalAnyof.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MammalAnyof.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; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java index dffb29de558f..141884a7f7ee 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -230,22 +232,12 @@ public void setIndirectMap(@javax.annotation.Nullable Map indir */ @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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 0cdae9a6d433..f84af4b6aa94 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -144,21 +146,12 @@ public void setMap(@javax.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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java index 35c20d8ca6a8..cf03abcff2fb 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -102,20 +104,12 @@ public void setPropertyClass(@javax.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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 15a4a419b283..8ffcda988793 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -132,21 +134,12 @@ public void setMessage(@javax.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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java index b9a89f3a17e4..2a9a907e327c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -72,19 +74,12 @@ public void setSourceURI(@javax.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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java index 1b91713f4454..eeedd9dd4ba9 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -72,19 +74,12 @@ public void set123list(@javax.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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java index 96d2ac44fe71..b3b8b7d9d1bd 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -72,19 +74,12 @@ public void setReturn(@javax.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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java index 56f543a8e558..7c709b7b4374 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -151,22 +153,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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java index f5617df68849..443983c9fdb7 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -587,26 +589,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 +598,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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java index f948d1e5e50f..bec64556a9b6 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.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; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java index 4a496bd97f4c..31fe42147472 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -72,19 +74,12 @@ public void setJustNumber(@javax.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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index e6c33ef2e1dd..de28645a6874 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -188,22 +190,12 @@ public void setBars(@javax.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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java index 6193d72decd2..9902b3c466d2 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -259,24 +261,12 @@ public void setComplete(@javax.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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java index 26773fbe640b..70a43c2a0c86 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -132,21 +134,12 @@ public void setMyBoolean(@javax.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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnum.java index d50018b999d5..608bb2c96897 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnum.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; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java index 73020e1e3b87..25b3940b7490 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.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; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumInteger.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumInteger.java index a83925c58695..c3072f8a0ae4 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumInteger.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumInteger.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; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java index 383ca4227422..0d894f96178d 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.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; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java index 7e9f542d0c0e..a5d08c1d752f 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.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; @@ -95,18 +97,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; - } - return super.equals(o); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(super.hashCode(), additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java index 1a2bbc67b03e..914785f40506 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -278,24 +280,12 @@ public void setStatus(@javax.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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java index ed0f54318a1c..9ead76fb3db2 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.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; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java index 772923318677..4c057de95478 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.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; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java index 7d2f4602c43a..179430a039a2 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -71,19 +73,12 @@ public void setQuadrilateralType(@javax.annotation.Nonnull String quadrilateralT */ @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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 1900fe83eedb..63e9d3c76813 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -99,20 +101,12 @@ public void setBaz(@javax.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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java index 757ca96e161f..fff63ed6fc29 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.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; @@ -142,21 +144,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; - } - ScaleneTriangle scaleneTriangle = (ScaleneTriangle) o; - return Objects.equals(this.shapeType, scaleneTriangle.shapeType) && - Objects.equals(this.triangleType, scaleneTriangle.triangleType)&& - Objects.equals(this.additionalProperties, scaleneTriangle.additionalProperties); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(shapeType, triangleType, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java index 001b0b8e4b28..574712cbd16a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.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; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java index 1ca563f30480..e8fe2c342ba8 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -71,19 +73,12 @@ public void setShapeType(@javax.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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java index a9e0c8e3e7dc..ab031659017a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.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; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java index 9b4b85607a6f..9a8798ee37e8 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.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; @@ -142,21 +144,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; - } - SimpleQuadrilateral simpleQuadrilateral = (SimpleQuadrilateral) o; - return Objects.equals(this.shapeType, simpleQuadrilateral.shapeType) && - Objects.equals(this.quadrilateralType, simpleQuadrilateral.quadrilateralType)&& - Objects.equals(this.additionalProperties, simpleQuadrilateral.additionalProperties); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(shapeType, quadrilateralType, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java index d2ee2257b9cf..a938622d429e 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -102,20 +104,12 @@ public void setSpecialModelName(@javax.annotation.Nullable String specialModelNa */ @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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java index ebad74cb005e..f75d60741ba9 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -101,20 +103,12 @@ public void setName(@javax.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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index 2fed072b1e7e..08c15e10f2ab 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -113,20 +115,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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java index d073c8a5133f..4620db38bb0d 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.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; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java index b736e78ae309..309a695e57e3 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -71,19 +73,12 @@ public void setTriangleType(@javax.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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java index 2a11183ef575..966580fac007 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -426,25 +428,7 @@ public void setAnyTypePropNullable(@javax.annotation.Nullable Object anyTypeProp */ @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 +437,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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java index 192047427435..cde2b928c0e2 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -132,21 +134,12 @@ public void setClassName(@javax.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/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java index f408a6fac662..aa0cfeb44570 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/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; @@ -180,21 +182,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 diff --git a/samples/server/petstore/java-microprofile/pom.xml b/samples/server/petstore/java-microprofile/pom.xml index 5b215a1c4f1c..1182edad8eb0 100644 --- a/samples/server/petstore/java-microprofile/pom.xml +++ b/samples/server/petstore/java-microprofile/pom.xml @@ -171,6 +171,6 @@ 1.1.0 2.6 1.9.1 - 1.2.0 + 1.10.0