diff --git a/bin/configs/java-native-jackson3.yaml b/bin/configs/java-native-jackson3.yaml new file mode 100644 index 000000000000..56480f296bf7 --- /dev/null +++ b/bin/configs/java-native-jackson3.yaml @@ -0,0 +1,11 @@ +generatorName: java +outputDir: samples/client/petstore/java/native-jackson3 +library: native +inputSpec: modules/openapi-generator/src/test/resources/3_0/java/native/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +templateDir: modules/openapi-generator/src/main/resources/Java +additionalProperties: + artifactId: petstore-native-jackson3 + hideGenerationTimestamp: "true" + generateBuilders: true + useReflectionEqualsHashCode: "true" + useJackson3: "true" diff --git a/docs/generators/java-microprofile.md b/docs/generators/java-microprofile.md index 7f87f275d343..71f44f1e2df5 100644 --- a/docs/generators/java-microprofile.md +++ b/docs/generators/java-microprofile.md @@ -97,6 +97,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |useBeanValidation|Use BeanValidation API annotations| |false| |useEnumCaseInsensitive|Use `equalsIgnoreCase` when String for enum comparison| |false| |useGzipFeature|Send gzip-encoded requests| |false| +|useJackson3|Use Jackson 3 instead of Jackson 2 for JSON processing. Only supported for 'native' library.| |false| |useJakartaEe|whether to use Jakarta EE namespace instead of javax| |false| |useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped. Only jersey2, jersey3, native, okhttp-gson support this option.| |false| |useOneOfInterfaces|whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface| |false| diff --git a/docs/generators/java.md b/docs/generators/java.md index 85da80e56a9e..b0b38c2e5780 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -97,6 +97,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |useBeanValidation|Use BeanValidation API annotations| |false| |useEnumCaseInsensitive|Use `equalsIgnoreCase` when String for enum comparison| |false| |useGzipFeature|Send gzip-encoded requests| |false| +|useJackson3|Use Jackson 3 instead of Jackson 2 for JSON processing. Only supported for 'native' library.| |false| |useJakartaEe|whether to use Jakarta EE namespace instead of javax| |false| |useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped. Only jersey2, jersey3, native, okhttp-gson support this option.| |false| |useOneOfInterfaces|whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface| |false| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java index 4e04e9c59205..e33c689a2f61 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java @@ -107,6 +107,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen public static final String SUPPORT_VERTX_FUTURE = "supportVertxFuture"; public static final String USE_SEALED_ONE_OF_INTERFACES = "useSealedOneOfInterfaces"; public static final String USE_UNARY_INTERCEPTOR = "useUnaryInterceptor"; + public static final String USE_JACKSON_3 = "useJackson3"; // Internal configurations public static final String SINGLE_REQUEST_PARAMETER = "singleRequestParameter"; @@ -152,6 +153,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen @Setter protected boolean supportVertxFuture = false; @Setter protected boolean useSealedOneOfInterfaces = false; @Setter protected boolean useUnaryInterceptor = false; + @Getter @Setter protected boolean useJackson3 = false; protected String authFolder; /** @@ -262,6 +264,7 @@ public JavaClientCodegen() { cliOptions.add(CliOption.newBoolean(SUPPORT_URL_QUERY, "Generate toUrlQueryString in POJO (default to true). Available on `native`, `apache-httpclient` libraries.")); cliOptions.add(CliOption.newBoolean(USE_ENUM_CASE_INSENSITIVE, "Use `equalsIgnoreCase` when String for enum comparison", useEnumCaseInsensitive)); cliOptions.add(CliOption.newBoolean(FAIL_ON_UNKNOWN_PROPERTIES, "Fail Jackson de-serialization on unknown properties", this.failOnUnknownProperties)); + cliOptions.add(CliOption.newBoolean(USE_JACKSON_3, "Use Jackson 3 instead of Jackson 2 for JSON processing. Only supported for 'native' library.", this.useJackson3)); cliOptions.add(CliOption.newBoolean(SUPPORT_VERTX_FUTURE, "Also generate api methods that return a vertx Future instead of taking a callback. Only `vertx` supports this option. Requires vertx 4 or greater.", this.supportVertxFuture)); cliOptions.add(CliOption.newBoolean(USE_SEALED_ONE_OF_INTERFACES, "Generate the oneOf interfaces as sealed interfaces. Only supported for WebClient and RestClient.", this.useSealedOneOfInterfaces)); cliOptions.add(CliOption.newBoolean(USE_UNARY_INTERCEPTOR, "If true it will generate ResponseInterceptors using a UnaryOperator. This can be usefull for manipulating the request before it gets passed, for example doing your own decryption", this.useUnaryInterceptor)); @@ -454,6 +457,12 @@ public void processOpts() { convertPropertyToBooleanAndWriteBack(WEBCLIENT_BLOCKING_OPERATIONS, op -> webclientBlockingOperations = op); convertPropertyToBooleanAndWriteBack(FAIL_ON_UNKNOWN_PROPERTIES, this::setFailOnUnknownProperties); convertPropertyToBooleanAndWriteBack(SUPPORT_VERTX_FUTURE, this::setSupportVertxFuture); + convertPropertyToBooleanAndWriteBack(USE_JACKSON_3, this::setUseJackson3); + if (useJackson3 && openApiNullable) { + LOGGER.warn("openApiNullable is not supported with useJackson3=true (jackson-databind-nullable has no Jackson 3 release). Disabling openApiNullable."); + openApiNullable = false; + additionalProperties.put(OPENAPI_NULLABLE, false); + } // add URL query deepObject support to native, apache-httpclient by default if (!additionalProperties.containsKey(SUPPORT_URL_QUERY)) { diff --git a/modules/openapi-generator/src/main/resources/Java/RFC3339DateFormat.mustache b/modules/openapi-generator/src/main/resources/Java/RFC3339DateFormat.mustache index c2c205c20681..c815d6ef908c 100644 --- a/modules/openapi-generator/src/main/resources/Java/RFC3339DateFormat.mustache +++ b/modules/openapi-generator/src/main/resources/Java/RFC3339DateFormat.mustache @@ -1,7 +1,12 @@ {{>licenseInfo}} package {{invokerPackage}}; +{{^useJackson3}} import com.fasterxml.jackson.databind.util.StdDateFormat; +{{/useJackson3}} +{{#useJackson3}} +import tools.jackson.databind.util.StdDateFormat; +{{/useJackson3}} import java.text.DateFormat; import java.text.FieldPosition; diff --git a/modules/openapi-generator/src/main/resources/Java/RFC3339InstantDeserializer.mustache b/modules/openapi-generator/src/main/resources/Java/RFC3339InstantDeserializer.mustache index ea4b0799a7de..3875c020957e 100644 --- a/modules/openapi-generator/src/main/resources/Java/RFC3339InstantDeserializer.mustache +++ b/modules/openapi-generator/src/main/resources/Java/RFC3339InstantDeserializer.mustache @@ -1,7 +1,9 @@ {{>licenseInfo}} package {{invokerPackage}}; +{{^useJackson3}} import java.io.IOException; +{{/useJackson3}} import java.time.Instant; import java.time.OffsetDateTime; import java.time.ZoneId; @@ -12,18 +14,34 @@ import java.time.temporal.TemporalAccessor; import java.util.function.BiFunction; import java.util.function.Function; +{{^useJackson3}} import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.datatype.jsr310.JavaTimeFeature; import com.fasterxml.jackson.datatype.jsr310.deser.InstantDeserializer; +{{/useJackson3}} +{{#useJackson3}} +import tools.jackson.core.JacksonException; +import tools.jackson.core.JsonParser; +import tools.jackson.databind.DeserializationContext; +import tools.jackson.databind.cfg.DateTimeFeature; +import tools.jackson.databind.ext.javatime.deser.InstantDeserializer; +{{/useJackson3}} {{>generatedAnnotation}} public class RFC3339InstantDeserializer extends InstantDeserializer { private static final long serialVersionUID = 1L; +{{^useJackson3}} private final static boolean DEFAULT_NORMALIZE_ZONE_ID = JavaTimeFeature.NORMALIZE_DESERIALIZED_ZONE_ID.enabledByDefault(); private final static boolean DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS = JavaTimeFeature.ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS.enabledByDefault(); +{{/useJackson3}} +{{#useJackson3}} + private final static boolean DEFAULT_NORMALIZE_ZONE_ID = DateTimeFeature.NORMALIZE_DESERIALIZED_ZONE_ID.enabledByDefault(); + private final static boolean DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS + = DateTimeFeature.ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS.enabledByDefault(); +{{/useJackson3}} public static final RFC3339InstantDeserializer INSTANT = new RFC3339InstantDeserializer<>( Instant.class, DateTimeFormatter.ISO_INSTANT, @@ -84,7 +102,7 @@ public class RFC3339InstantDeserializer extends InstantDeser } @Override - protected T _fromString(JsonParser p, DeserializationContext ctxt, String string0) throws IOException { + protected T _fromString(JsonParser p, DeserializationContext ctxt, String string0) throws {{^useJackson3}}IOException{{/useJackson3}}{{#useJackson3}}JacksonException{{/useJackson3}} { return super._fromString(p, ctxt, string0.replace( ' ', 'T' )); } } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/RFC3339JavaTimeModule.mustache b/modules/openapi-generator/src/main/resources/Java/RFC3339JavaTimeModule.mustache index 6b780cd438ba..30509a69f630 100644 --- a/modules/openapi-generator/src/main/resources/Java/RFC3339JavaTimeModule.mustache +++ b/modules/openapi-generator/src/main/resources/Java/RFC3339JavaTimeModule.mustache @@ -5,8 +5,13 @@ import java.time.Instant; import java.time.OffsetDateTime; import java.time.ZonedDateTime; +{{^useJackson3}} import com.fasterxml.jackson.databind.module.SimpleModule; import com.fasterxml.jackson.databind.Module.SetupContext; +{{/useJackson3}} +{{#useJackson3}} +import tools.jackson.databind.module.SimpleModule; +{{/useJackson3}} {{>generatedAnnotation}} @@ -15,8 +20,14 @@ public class RFC3339JavaTimeModule extends SimpleModule { public RFC3339JavaTimeModule() { super("RFC3339JavaTimeModule"); + {{#useJackson3}} + addDeserializer(Instant.class, RFC3339InstantDeserializer.INSTANT); + addDeserializer(OffsetDateTime.class, RFC3339InstantDeserializer.OFFSET_DATE_TIME); + addDeserializer(ZonedDateTime.class, RFC3339InstantDeserializer.ZONED_DATE_TIME); + {{/useJackson3}} } + {{^useJackson3}} @Override public void setupModule(SetupContext context) { super.setupModule(context); @@ -25,5 +36,6 @@ public class RFC3339JavaTimeModule extends SimpleModule { addDeserializer(OffsetDateTime.class, RFC3339InstantDeserializer.OFFSET_DATE_TIME); addDeserializer(ZonedDateTime.class, RFC3339InstantDeserializer.ZONED_DATE_TIME); } + {{/useJackson3}} } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache index 0fd6071d3080..beaec198ab24 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache @@ -1,6 +1,7 @@ {{>licenseInfo}} package {{invokerPackage}}; +{{^useJackson3}} import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; @@ -9,6 +10,13 @@ import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; {{#openApiNullable}} import org.openapitools.jackson.nullable.JsonNullableModule; {{/openApiNullable}} +{{/useJackson3}} +{{#useJackson3}} +import com.fasterxml.jackson.annotation.JsonInclude; +import tools.jackson.databind.DeserializationFeature; +import tools.jackson.databind.ObjectMapper; +import tools.jackson.databind.SerializationFeature; +{{/useJackson3}} import java.io.InputStream; import java.io.IOException; @@ -213,10 +221,17 @@ public class ApiClient { mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); mapper.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE); + {{^useJackson3}} mapper.registerModule(new JavaTimeModule()); + {{/useJackson3}} + {{^useJackson3}} {{#openApiNullable}} mapper.registerModule(new JsonNullableModule()); {{/openApiNullable}} + {{/useJackson3}} + {{#useJackson3}} + // FIXME: JsonNullableModule is not yet available for Jackson 3 + {{/useJackson3}} mapper.registerModule(new RFC3339JavaTimeModule()); return mapper; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/JSON.mustache index a2020732513d..4dd370cba2aa 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/JSON.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/JSON.mustache @@ -2,6 +2,7 @@ package {{invokerPackage}}; +{{^useJackson3}} import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.json.JsonMapper; @@ -12,6 +13,15 @@ import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; {{#joda}} import com.fasterxml.jackson.datatype.joda.JodaModule; {{/joda}} +{{/useJackson3}} +{{#useJackson3}} +import com.fasterxml.jackson.annotation.*; +import tools.jackson.databind.*; +import tools.jackson.databind.json.JsonMapper; +{{#joda}} +import tools.jackson.datatype.joda.JodaModule; +{{/joda}} +{{/useJackson3}} {{#models.0}} import {{modelPackage}}.*; {{/models.0}} @@ -28,6 +38,7 @@ public class JSON { private ObjectMapper mapper; public JSON() { + {{^useJackson3}} mapper = JsonMapper.builder() .serializationInclusion(JsonInclude.Include.NON_NULL) .disable(MapperFeature.ALLOW_COERCION_OF_SCALARS) @@ -51,6 +62,29 @@ public class JSON { JsonNullableModule jnm = new JsonNullableModule(); mapper.registerModule(jnm); {{/openApiNullable}} + {{/useJackson3}} + {{#useJackson3}} + mapper = JsonMapper.builder() + .serializationInclusion(JsonInclude.Include.NON_NULL) + // Note: MapperFeature.ALLOW_COERCION_OF_SCALARS was removed in Jackson 3 + {{#failOnUnknownProperties}} + .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) + {{/failOnUnknownProperties}} + {{^failOnUnknownProperties}} + .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) + {{/failOnUnknownProperties}} + .enable(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE) + .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + .enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING) + .enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING) + .defaultDateFormat(new RFC3339DateFormat()) + // Note: JavaTimeModule (jsr310) is built into jackson-databind for Jackson 3 - no explicit registration needed + .build(); + {{#joda}} + mapper.registerModule(new JodaModule()); + {{/joda}} + // FIXME: JsonNullableModule is not yet available for Jackson 3 + {{/useJackson3}} } /** diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/README.mustache index fd7d4905a16e..2c0ca32e9e12 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/README.mustache @@ -22,7 +22,7 @@ Building the API client library requires: -1. Java 11+ +{{^useJackson3}}1. Java 11+{{/useJackson3}}{{#useJackson3}}1. Java 17+{{/useJackson3}} 2. Maven/Gradle ## Installation diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/anyof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/anyof_model.mustache index 64c4dab03f56..5638af2ff469 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/anyof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/anyof_model.mustache @@ -1,10 +1,13 @@ +{{^useJackson3}} import java.io.IOException; +{{/useJackson3}} import java.util.logging.Level; import java.util.logging.Logger; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; +{{^useJackson3}} import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; @@ -16,6 +19,20 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import com.fasterxml.jackson.databind.ser.std.StdSerializer; +{{/useJackson3}} +{{#useJackson3}} +import tools.jackson.core.JacksonException; +import tools.jackson.core.JsonGenerator; +import tools.jackson.core.JsonParser; +import tools.jackson.databind.DeserializationContext; +import tools.jackson.databind.DatabindException; +import tools.jackson.databind.JsonNode; +import tools.jackson.databind.SerializerProvider; +import tools.jackson.databind.annotation.JsonDeserialize; +import tools.jackson.databind.annotation.JsonSerialize; +import tools.jackson.databind.deser.std.StdDeserializer; +import tools.jackson.databind.ser.std.StdSerializer; +{{/useJackson3}} import {{invokerPackage}}.ApiClient; import {{invokerPackage}}.JSON; @@ -35,7 +52,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } @Override - public void serialize({{classname}} value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + public void serialize({{classname}} value, JsonGenerator jgen, SerializerProvider provider) throws {{^useJackson3}}IOException, JsonProcessingException{{/useJackson3}}{{#useJackson3}}JacksonException{{/useJackson3}} { jgen.writeObject(value.getActualInstance()); } } @@ -50,7 +67,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } @Override - public {{classname}} deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + public {{classname}} deserialize(JsonParser jp, DeserializationContext ctxt) throws {{^useJackson3}}IOException, JsonProcessingException{{/useJackson3}}{{#useJackson3}}JacksonException{{/useJackson3}} { JsonNode tree = jp.readValueAsTree(); Object deserialized = null; @@ -79,19 +96,34 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } {{/anyOf}} +{{^useJackson3}} throw new IOException("Failed deserialization for {{classname}}: no match found"); +{{/useJackson3}} +{{#useJackson3}} + throw DatabindException.from(jp, "Failed deserialization for {{classname}}: no match found"); +{{/useJackson3}} } /** * Handle deserialization of the 'null' value. */ @Override +{{^useJackson3}} public {{classname}} getNullValue(DeserializationContext ctxt) throws JsonMappingException { +{{/useJackson3}} +{{#useJackson3}} + public {{classname}} getNullValue(DeserializationContext ctxt) { +{{/useJackson3}} {{#isNullable}} return null; {{/isNullable}} {{^isNullable}} +{{^useJackson3}} throw new JsonMappingException(ctxt.getParser(), "{{classname}} cannot be null"); +{{/useJackson3}} +{{#useJackson3}} + throw DatabindException.from(ctxt.getParser(), "{{classname}} cannot be null"); +{{/useJackson3}} {{/isNullable}} } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache index b65b8f3950ef..e6fcb4a466ad 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache @@ -11,8 +11,14 @@ import {{invokerPackage}}.Pair; import {{import}}; {{/imports}} +{{^useJackson3}} import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; +{{/useJackson3}} +{{#useJackson3}} +import tools.jackson.core.type.TypeReference; +import tools.jackson.databind.ObjectMapper; +{{/useJackson3}} {{#useBeanValidation}} import {{javaxPackage}}.validation.constraints.*; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/api_doc.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/api_doc.mustache index 2b125e1f9cad..eb6ca1dd1e4c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/api_doc.mustache @@ -136,10 +136,10 @@ public class Example { ## {{operationId}}WithHttpInfo {{^vendorExtensions.x-group-parameters}} -> {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}} {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) {{/vendorExtensions.x-group-parameters}} {{#vendorExtensions.x-group-parameters}} -> {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}} {{operationId}}WithHttpInfo({{#hasParams}}{{operationId}}Request{{/hasParams}}) +> {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}}WithHttpInfo({{#hasParams}}{{operationId}}Request{{/hasParams}}) {{/vendorExtensions.x-group-parameters}} {{summary}}{{#notes}} 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 d632a8ab649b..57460a6d8213 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 @@ -21,8 +21,14 @@ repositories { apply plugin: 'java' apply plugin: 'maven-publish' +{{^useJackson3}} sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 +{{/useJackson3}} +{{#useJackson3}} +sourceCompatibility = JavaVersion.VERSION_17 +targetCompatibility = JavaVersion.VERSION_17 +{{/useJackson3}} // Some text from the schema is copy pasted into the source files as UTF-8 // but the default still seems to be to use platform encoding @@ -72,7 +78,13 @@ ext { {{#swagger2AnnotationLibrary}} swagger_annotations_version = "2.2.9" {{/swagger2AnnotationLibrary}} + {{^useJackson3}} jackson_version = "2.19.2" + {{/useJackson3}} + {{#useJackson3}} + jackson3_version = "3.0.4" + jackson_annotations_version = "2.20" + {{/useJackson3}} {{#useJakartaEe}} jakarta_annotation_version = "2.1.1" beanvalidation_version = "3.0.2" @@ -98,11 +110,18 @@ dependencies { implementation "io.swagger.core.v3:swagger-annotations:$swagger_annotations_version" {{/swagger2AnnotationLibrary}} implementation "com.google.code.findbugs:jsr305:3.0.2" + {{^useJackson3}} 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_version" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" implementation "org.openapitools:jackson-databind-nullable:0.2.9" + {{/useJackson3}} + {{#useJackson3}} + implementation "tools.jackson.core:jackson-core:$jackson3_version" + implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_annotations_version" + implementation "tools.jackson.core:jackson-databind:$jackson3_version" + {{/useJackson3}} implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" {{#useBeanValidation}} implementation "jakarta.validation:jakarta.validation-api:$beanvalidation_version" @@ -114,6 +133,11 @@ dependencies { 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" +} + +test { + useJUnitPlatform() } // Use spotless plugin to automatically format code, remove unused import, etc diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/model.mustache index b3beca8d3273..643aaf9a9658 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/model.mustache @@ -58,7 +58,12 @@ import org.hibernate.validator.constraints.*; {{#model}} {{#oneOf}} {{#-first}} +{{^useJackson3}} import com.fasterxml.jackson.core.type.TypeReference; +{{/useJackson3}} +{{#useJackson3}} +import tools.jackson.core.type.TypeReference; +{{/useJackson3}} {{/-first}} {{/oneOf}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/oneof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/oneof_model.mustache index c0f78805d3fb..025c2a677e96 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/oneof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/oneof_model.mustache @@ -1,10 +1,13 @@ +{{^useJackson3}} import java.io.IOException; +{{/useJackson3}} import java.util.logging.Level; import java.util.logging.Logger; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; +{{^useJackson3}} import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; @@ -18,6 +21,21 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import com.fasterxml.jackson.databind.ser.std.StdSerializer; +{{/useJackson3}} +{{#useJackson3}} +import tools.jackson.core.JacksonException; +import tools.jackson.core.JsonGenerator; +import tools.jackson.core.JsonParser; +import tools.jackson.core.JsonToken; +import tools.jackson.databind.DeserializationContext; +import tools.jackson.databind.DatabindException; +import tools.jackson.databind.JsonNode; +import tools.jackson.databind.SerializerProvider; +import tools.jackson.databind.annotation.JsonDeserialize; +import tools.jackson.databind.annotation.JsonSerialize; +import tools.jackson.databind.deser.std.StdDeserializer; +import tools.jackson.databind.ser.std.StdSerializer; +{{/useJackson3}} import {{invokerPackage}}.ApiClient; import {{invokerPackage}}.JSON; @@ -37,7 +55,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } @Override - public void serialize({{classname}} value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + public void serialize({{classname}} value, JsonGenerator jgen, SerializerProvider provider) throws {{^useJackson3}}IOException, JsonProcessingException{{/useJackson3}}{{#useJackson3}}JacksonException{{/useJackson3}} { jgen.writeObject(value.getActualInstance()); } } @@ -52,7 +70,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } @Override - public {{classname}} deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + public {{classname}} deserialize(JsonParser jp, DeserializationContext ctxt) throws {{^useJackson3}}IOException, JsonProcessingException{{/useJackson3}}{{#useJackson3}}JacksonException{{/useJackson3}} { JsonNode tree = jp.readValueAsTree(); Object deserialized = null; {{#useOneOfDiscriminatorLookup}} @@ -73,7 +91,12 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{/discriminator}} {{/useOneOfDiscriminatorLookup}} +{{^useJackson3}} boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); +{{/useJackson3}} +{{#useJackson3}} + boolean typeCoercion = false; // MapperFeature.ALLOW_COERCION_OF_SCALARS was removed in Jackson 3 +{{/useJackson3}} int match = 0; JsonToken token = tree.traverse(jp.getCodec()).nextToken(); {{#oneOf}} @@ -112,19 +135,34 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im ret.setActualInstance(deserialized); return ret; } +{{^useJackson3}} throw new IOException(String.format(java.util.Locale.ROOT, "Failed deserialization for {{classname}}: %d classes match result, expected 1", match)); +{{/useJackson3}} +{{#useJackson3}} + throw DatabindException.from(jp, String.format(java.util.Locale.ROOT, "Failed deserialization for {{classname}}: %d classes match result, expected 1", match)); +{{/useJackson3}} } /** * Handle deserialization of the 'null' value. */ @Override +{{^useJackson3}} public {{classname}} getNullValue(DeserializationContext ctxt) throws JsonMappingException { +{{/useJackson3}} +{{#useJackson3}} + public {{classname}} getNullValue(DeserializationContext ctxt) { +{{/useJackson3}} {{#isNullable}} return null; {{/isNullable}} {{^isNullable}} +{{^useJackson3}} throw new JsonMappingException(ctxt.getParser(), "{{classname}} cannot be null"); +{{/useJackson3}} +{{#useJackson3}} + throw DatabindException.from(ctxt.getParser(), "{{classname}} cannot be null"); +{{/useJackson3}} {{/isNullable}} } } 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 b84cc87ee4f5..714e0e94db8a 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 @@ -217,6 +217,7 @@ {{/swagger2AnnotationLibrary}} + {{^useJackson3}} com.fasterxml.jackson.core jackson-core @@ -242,6 +243,26 @@ jackson-databind-nullable ${jackson-databind-nullable-version} + {{/useJackson3}} + {{#useJackson3}} + + tools.jackson.core + jackson-core + ${jackson3-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-annotations-version} + + + tools.jackson.core + jackson-databind + ${jackson3-version} + + + + {{/useJackson3}} @@ -297,10 +318,22 @@ {{#swagger2AnnotationLibrary}} 2.2.15 {{/swagger2AnnotationLibrary}} + {{^useJackson3}} 11 11 + {{/useJackson3}} + {{#useJackson3}} + 17 + 17 + {{/useJackson3}} + {{^useJackson3}} 2.19.2 0.2.9 + {{/useJackson3}} + {{#useJackson3}} + 3.0.4 + 2.20 + {{/useJackson3}} {{#useJakartaEe}} 2.1.1 3.0.2 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/travis.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/travis.mustache index c94647479234..410fd75109b7 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/travis.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/travis.mustache @@ -3,7 +3,12 @@ # language: java jdk: +{{^useJackson3}} - oraclejdk11 +{{/useJackson3}} +{{#useJackson3}} + - oraclejdk17 +{{/useJackson3}} before_install: # ensure gradlew has proper permission - chmod a+x ./gradlew diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java index 94a0a6f4535e..ee9caea63542 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java @@ -634,6 +634,36 @@ public void testJdkHttpAsyncClient() { ); } + @Test + public void testJdkHttpClientWithJackson3() { + final Path output = newTempFolder(); + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName(JAVA_GENERATOR) + .setLibrary(JavaClientCodegen.NATIVE) + .addAdditionalProperty(CodegenConstants.API_PACKAGE, "xyz.abcdef.api") + .addAdditionalProperty(CodegenConstants.INVOKER_PACKAGE, "xyz.abcdef.invoker") + .addAdditionalProperty(JavaClientCodegen.USE_JACKSON_3, true) + .setInputSpec("src/test/resources/3_0/ping.yaml") + .setOutputDir(output.toString().replace("\\", "/")); + + List files = new DefaultGenerator().opts(configurator.toClientOptInput()).generate(); + + validateJavaSourceFiles(files); + assertThat(output.resolve("src/main/java/xyz/abcdef/invoker/JSON.java")).content() + .contains("import com.fasterxml.jackson.annotation.*;") + .contains("import tools.jackson.databind.*;") + .doesNotContain("import com.fasterxml.jackson.databind"); + assertThat(output.resolve("src/main/java/xyz/abcdef/invoker/ApiClient.java")).content() + .contains("import tools.jackson.databind.ObjectMapper;") + .doesNotContain("import com.fasterxml.jackson.databind"); + assertThat(output.resolve("src/main/java/xyz/abcdef/api/DefaultApi.java")).content() + .contains("import tools.jackson.core.type.TypeReference;") + .doesNotContain("import com.fasterxml.jackson.core.type.TypeReference"); + assertThat(output.resolve("pom.xml")).content() + .contains("tools.jackson.core") + .contains("com.fasterxml.jackson.core"); + } + @Test public void testReferencedHeader() { final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/issue855.yaml"); diff --git a/samples/client/echo_api/java/native/build.gradle b/samples/client/echo_api/java/native/build.gradle index ddd6d80751c8..df28ddc530e7 100644 --- a/samples/client/echo_api/java/native/build.gradle +++ b/samples/client/echo_api/java/native/build.gradle @@ -83,6 +83,11 @@ dependencies { implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" implementation "org.apache.httpcomponents:httpmime:$httpmime_version" testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" +} + +test { + useJUnitPlatform() } // Use spotless plugin to automatically format code, remove unused import, etc diff --git a/samples/client/echo_api/java/native/docs/AuthApi.md b/samples/client/echo_api/java/native/docs/AuthApi.md index 7c1c77adca9e..01e22d38a755 100644 --- a/samples/client/echo_api/java/native/docs/AuthApi.md +++ b/samples/client/echo_api/java/native/docs/AuthApi.md @@ -80,7 +80,7 @@ This endpoint does not need any parameter. ## testAuthHttpBasicWithHttpInfo -> ApiResponse testAuthHttpBasic testAuthHttpBasicWithHttpInfo() +> ApiResponse testAuthHttpBasicWithHttpInfo() To test HTTP basic authentication @@ -217,7 +217,7 @@ This endpoint does not need any parameter. ## testAuthHttpBearerWithHttpInfo -> ApiResponse testAuthHttpBearer testAuthHttpBearerWithHttpInfo() +> ApiResponse testAuthHttpBearerWithHttpInfo() To test HTTP bearer authentication diff --git a/samples/client/echo_api/java/native/docs/BodyApi.md b/samples/client/echo_api/java/native/docs/BodyApi.md index 222c18201048..89d5a885e340 100644 --- a/samples/client/echo_api/java/native/docs/BodyApi.md +++ b/samples/client/echo_api/java/native/docs/BodyApi.md @@ -90,7 +90,7 @@ No authorization required ## testBinaryGifWithHttpInfo -> ApiResponse testBinaryGif testBinaryGifWithHttpInfo() +> ApiResponse testBinaryGifWithHttpInfo() Test binary (gif) response body @@ -220,7 +220,7 @@ No authorization required ## testBodyApplicationOctetstreamBinaryWithHttpInfo -> ApiResponse testBodyApplicationOctetstreamBinary testBodyApplicationOctetstreamBinaryWithHttpInfo(body) +> ApiResponse testBodyApplicationOctetstreamBinaryWithHttpInfo(body) Test body parameter(s) @@ -354,7 +354,7 @@ No authorization required ## testBodyMultipartFormdataArrayOfBinaryWithHttpInfo -> ApiResponse testBodyMultipartFormdataArrayOfBinary testBodyMultipartFormdataArrayOfBinaryWithHttpInfo(files) +> ApiResponse testBodyMultipartFormdataArrayOfBinaryWithHttpInfo(files) Test array of binary in multipart mime @@ -488,7 +488,7 @@ No authorization required ## testBodyMultipartFormdataSingleBinaryWithHttpInfo -> ApiResponse testBodyMultipartFormdataSingleBinary testBodyMultipartFormdataSingleBinaryWithHttpInfo(myFile) +> ApiResponse testBodyMultipartFormdataSingleBinaryWithHttpInfo(myFile) Test single binary in multipart mime @@ -622,7 +622,7 @@ No authorization required ## testEchoBodyAllOfPetWithHttpInfo -> ApiResponse testEchoBodyAllOfPet testEchoBodyAllOfPetWithHttpInfo(pet) +> ApiResponse testEchoBodyAllOfPetWithHttpInfo(pet) Test body parameter(s) @@ -756,7 +756,7 @@ No authorization required ## testEchoBodyFreeFormObjectResponseStringWithHttpInfo -> ApiResponse testEchoBodyFreeFormObjectResponseString testEchoBodyFreeFormObjectResponseStringWithHttpInfo(body) +> ApiResponse testEchoBodyFreeFormObjectResponseStringWithHttpInfo(body) Test free form object @@ -890,7 +890,7 @@ No authorization required ## testEchoBodyPetWithHttpInfo -> ApiResponse testEchoBodyPet testEchoBodyPetWithHttpInfo(pet) +> ApiResponse testEchoBodyPetWithHttpInfo(pet) Test body parameter(s) @@ -1024,7 +1024,7 @@ No authorization required ## testEchoBodyPetResponseStringWithHttpInfo -> ApiResponse testEchoBodyPetResponseString testEchoBodyPetResponseStringWithHttpInfo(pet) +> ApiResponse testEchoBodyPetResponseStringWithHttpInfo(pet) Test empty response body @@ -1158,7 +1158,7 @@ No authorization required ## testEchoBodyStringEnumWithHttpInfo -> ApiResponse testEchoBodyStringEnum testEchoBodyStringEnumWithHttpInfo(body) +> ApiResponse testEchoBodyStringEnumWithHttpInfo(body) Test string enum response body @@ -1292,7 +1292,7 @@ No authorization required ## testEchoBodyTagResponseStringWithHttpInfo -> ApiResponse testEchoBodyTagResponseString testEchoBodyTagResponseStringWithHttpInfo(tag) +> ApiResponse testEchoBodyTagResponseStringWithHttpInfo(tag) Test empty json (request body) diff --git a/samples/client/echo_api/java/native/docs/FormApi.md b/samples/client/echo_api/java/native/docs/FormApi.md index e1d52ae5e079..603d167c7a97 100644 --- a/samples/client/echo_api/java/native/docs/FormApi.md +++ b/samples/client/echo_api/java/native/docs/FormApi.md @@ -84,7 +84,7 @@ No authorization required ## testFormIntegerBooleanStringWithHttpInfo -> ApiResponse testFormIntegerBooleanString testFormIntegerBooleanStringWithHttpInfo(integerForm, booleanForm, stringForm) +> ApiResponse testFormIntegerBooleanStringWithHttpInfo(integerForm, booleanForm, stringForm) Test form parameter(s) @@ -222,7 +222,7 @@ No authorization required ## testFormObjectMultipartWithHttpInfo -> ApiResponse testFormObjectMultipart testFormObjectMultipartWithHttpInfo(marker) +> ApiResponse testFormObjectMultipartWithHttpInfo(marker) Test form parameter(s) for multipart schema @@ -366,7 +366,7 @@ No authorization required ## testFormOneofWithHttpInfo -> ApiResponse testFormOneof testFormOneofWithHttpInfo(form1, form2, form3, form4, id, name) +> ApiResponse testFormOneofWithHttpInfo(form1, form2, form3, form4, id, name) Test form parameter(s) for oneOf schema diff --git a/samples/client/echo_api/java/native/docs/HeaderApi.md b/samples/client/echo_api/java/native/docs/HeaderApi.md index 13693883d3d8..ac53327a5d0b 100644 --- a/samples/client/echo_api/java/native/docs/HeaderApi.md +++ b/samples/client/echo_api/java/native/docs/HeaderApi.md @@ -84,7 +84,7 @@ No authorization required ## testHeaderIntegerBooleanStringEnumsWithHttpInfo -> ApiResponse testHeaderIntegerBooleanStringEnums testHeaderIntegerBooleanStringEnumsWithHttpInfo(integerHeader, booleanHeader, stringHeader, enumNonrefStringHeader, enumRefStringHeader) +> ApiResponse testHeaderIntegerBooleanStringEnumsWithHttpInfo(integerHeader, booleanHeader, stringHeader, enumNonrefStringHeader, enumRefStringHeader) Test header parameter(s) diff --git a/samples/client/echo_api/java/native/docs/PathApi.md b/samples/client/echo_api/java/native/docs/PathApi.md index 6539295ad50a..a3880853e134 100644 --- a/samples/client/echo_api/java/native/docs/PathApi.md +++ b/samples/client/echo_api/java/native/docs/PathApi.md @@ -82,7 +82,7 @@ No authorization required ## testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo -> ApiResponse testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo(pathString, pathInteger, enumNonrefStringPath, enumRefStringPath) +> ApiResponse testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo(pathString, pathInteger, enumNonrefStringPath, enumRefStringPath) Test path parameter(s) diff --git a/samples/client/echo_api/java/native/docs/QueryApi.md b/samples/client/echo_api/java/native/docs/QueryApi.md index b45c540fa369..bad2da63fe00 100644 --- a/samples/client/echo_api/java/native/docs/QueryApi.md +++ b/samples/client/echo_api/java/native/docs/QueryApi.md @@ -98,7 +98,7 @@ No authorization required ## testEnumRefStringWithHttpInfo -> ApiResponse testEnumRefString testEnumRefStringWithHttpInfo(enumNonrefStringQuery, enumRefStringQuery) +> ApiResponse testEnumRefStringWithHttpInfo(enumNonrefStringQuery, enumRefStringQuery) Test query parameter(s) @@ -238,7 +238,7 @@ No authorization required ## testQueryDatetimeDateStringWithHttpInfo -> ApiResponse testQueryDatetimeDateString testQueryDatetimeDateStringWithHttpInfo(datetimeQuery, dateQuery, stringQuery) +> ApiResponse testQueryDatetimeDateStringWithHttpInfo(datetimeQuery, dateQuery, stringQuery) Test query parameter(s) @@ -380,7 +380,7 @@ No authorization required ## testQueryIntegerBooleanStringWithHttpInfo -> ApiResponse testQueryIntegerBooleanString testQueryIntegerBooleanStringWithHttpInfo(integerQuery, booleanQuery, stringQuery) +> ApiResponse testQueryIntegerBooleanStringWithHttpInfo(integerQuery, booleanQuery, stringQuery) Test query parameter(s) @@ -518,7 +518,7 @@ No authorization required ## testQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo -> ApiResponse testQueryStyleDeepObjectExplodeTrueObject testQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo(queryObject) +> ApiResponse testQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo(queryObject) Test query parameter(s) @@ -652,7 +652,7 @@ No authorization required ## testQueryStyleDeepObjectExplodeTrueObjectAllOfWithHttpInfo -> ApiResponse testQueryStyleDeepObjectExplodeTrueObjectAllOf testQueryStyleDeepObjectExplodeTrueObjectAllOfWithHttpInfo(queryObject) +> ApiResponse testQueryStyleDeepObjectExplodeTrueObjectAllOfWithHttpInfo(queryObject) Test query parameter(s) @@ -786,7 +786,7 @@ No authorization required ## testQueryStyleFormExplodeFalseArrayIntegerWithHttpInfo -> ApiResponse testQueryStyleFormExplodeFalseArrayInteger testQueryStyleFormExplodeFalseArrayIntegerWithHttpInfo(queryObject) +> ApiResponse testQueryStyleFormExplodeFalseArrayIntegerWithHttpInfo(queryObject) Test query parameter(s) @@ -920,7 +920,7 @@ No authorization required ## testQueryStyleFormExplodeFalseArrayStringWithHttpInfo -> ApiResponse testQueryStyleFormExplodeFalseArrayString testQueryStyleFormExplodeFalseArrayStringWithHttpInfo(queryObject) +> ApiResponse testQueryStyleFormExplodeFalseArrayStringWithHttpInfo(queryObject) Test query parameter(s) @@ -1054,7 +1054,7 @@ No authorization required ## testQueryStyleFormExplodeTrueArrayStringWithHttpInfo -> ApiResponse testQueryStyleFormExplodeTrueArrayString testQueryStyleFormExplodeTrueArrayStringWithHttpInfo(queryObject) +> ApiResponse testQueryStyleFormExplodeTrueArrayStringWithHttpInfo(queryObject) Test query parameter(s) @@ -1188,7 +1188,7 @@ No authorization required ## testQueryStyleFormExplodeTrueObjectWithHttpInfo -> ApiResponse testQueryStyleFormExplodeTrueObject testQueryStyleFormExplodeTrueObjectWithHttpInfo(queryObject) +> ApiResponse testQueryStyleFormExplodeTrueObjectWithHttpInfo(queryObject) Test query parameter(s) @@ -1322,7 +1322,7 @@ No authorization required ## testQueryStyleFormExplodeTrueObjectAllOfWithHttpInfo -> ApiResponse testQueryStyleFormExplodeTrueObjectAllOf testQueryStyleFormExplodeTrueObjectAllOfWithHttpInfo(queryObject) +> ApiResponse testQueryStyleFormExplodeTrueObjectAllOfWithHttpInfo(queryObject) Test query parameter(s) @@ -1458,7 +1458,7 @@ No authorization required ## testQueryStyleJsonSerializationObjectWithHttpInfo -> ApiResponse testQueryStyleJsonSerializationObject testQueryStyleJsonSerializationObjectWithHttpInfo(jsonSerializedObjectRefStringQuery, jsonSerializedObjectArrayRefStringQuery) +> ApiResponse testQueryStyleJsonSerializationObjectWithHttpInfo(jsonSerializedObjectRefStringQuery, jsonSerializedObjectArrayRefStringQuery) Test query parameter(s) diff --git a/samples/client/petstore/java/native-async/build.gradle b/samples/client/petstore/java/native-async/build.gradle index c1f5d82790fa..4dc7ea879767 100644 --- a/samples/client/petstore/java/native-async/build.gradle +++ b/samples/client/petstore/java/native-async/build.gradle @@ -83,6 +83,11 @@ dependencies { implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" implementation "org.apache.httpcomponents:httpmime:$httpmime_version" testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" +} + +test { + useJUnitPlatform() } // Use spotless plugin to automatically format code, remove unused import, etc diff --git a/samples/client/petstore/java/native-async/docs/AnotherFakeApi.md b/samples/client/petstore/java/native-async/docs/AnotherFakeApi.md index 1f312f041cd8..f42e1d692b16 100644 --- a/samples/client/petstore/java/native-async/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/native-async/docs/AnotherFakeApi.md @@ -77,7 +77,7 @@ No authorization required ## call123testSpecialTagsWithHttpInfo -> CompletableFuture> call123testSpecialTags call123testSpecialTagsWithHttpInfo(client) +> CompletableFuture> call123testSpecialTagsWithHttpInfo(client) To test special tags diff --git a/samples/client/petstore/java/native-async/docs/DefaultApi.md b/samples/client/petstore/java/native-async/docs/DefaultApi.md index f74db7fd44e1..8b771585f2fe 100644 --- a/samples/client/petstore/java/native-async/docs/DefaultApi.md +++ b/samples/client/petstore/java/native-async/docs/DefaultApi.md @@ -71,7 +71,7 @@ No authorization required ## fooGetWithHttpInfo -> CompletableFuture> fooGet fooGetWithHttpInfo() +> CompletableFuture> fooGetWithHttpInfo() diff --git a/samples/client/petstore/java/native-async/docs/FakeApi.md b/samples/client/petstore/java/native-async/docs/FakeApi.md index e10d657aaa82..87bdb78cb69f 100644 --- a/samples/client/petstore/java/native-async/docs/FakeApi.md +++ b/samples/client/petstore/java/native-async/docs/FakeApi.md @@ -111,7 +111,7 @@ No authorization required ## fakeBigDecimalMapWithHttpInfo -> CompletableFuture> fakeBigDecimalMap fakeBigDecimalMapWithHttpInfo() +> CompletableFuture> fakeBigDecimalMapWithHttpInfo() @@ -244,7 +244,7 @@ No authorization required ## fakeHealthGetWithHttpInfo -> CompletableFuture> fakeHealthGet fakeHealthGetWithHttpInfo() +> CompletableFuture> fakeHealthGetWithHttpInfo() Health check endpoint @@ -381,7 +381,7 @@ No authorization required ## fakeOuterBooleanSerializeWithHttpInfo -> CompletableFuture> fakeOuterBooleanSerialize fakeOuterBooleanSerializeWithHttpInfo(body) +> CompletableFuture> fakeOuterBooleanSerializeWithHttpInfo(body) @@ -524,7 +524,7 @@ No authorization required ## fakeOuterCompositeSerializeWithHttpInfo -> CompletableFuture> fakeOuterCompositeSerialize fakeOuterCompositeSerializeWithHttpInfo(outerComposite) +> CompletableFuture> fakeOuterCompositeSerializeWithHttpInfo(outerComposite) @@ -667,7 +667,7 @@ No authorization required ## fakeOuterNumberSerializeWithHttpInfo -> CompletableFuture> fakeOuterNumberSerialize fakeOuterNumberSerializeWithHttpInfo(body) +> CompletableFuture> fakeOuterNumberSerializeWithHttpInfo(body) @@ -810,7 +810,7 @@ No authorization required ## fakeOuterStringSerializeWithHttpInfo -> CompletableFuture> fakeOuterStringSerialize fakeOuterStringSerializeWithHttpInfo(body) +> CompletableFuture> fakeOuterStringSerializeWithHttpInfo(body) @@ -947,7 +947,7 @@ No authorization required ## getApplicationJsonUtf8WithHttpInfo -> CompletableFuture>> getApplicationJsonUtf8 getApplicationJsonUtf8WithHttpInfo() +> CompletableFuture>> getApplicationJsonUtf8WithHttpInfo() application/json UTF8 @@ -1078,7 +1078,7 @@ No authorization required ## getArrayOfEnumsWithHttpInfo -> CompletableFuture>> getArrayOfEnums getArrayOfEnumsWithHttpInfo() +> CompletableFuture>> getArrayOfEnumsWithHttpInfo() Array of Enums @@ -1214,7 +1214,7 @@ No authorization required ## testAdditionalPropertiesReferenceWithHttpInfo -> CompletableFuture> testAdditionalPropertiesReference testAdditionalPropertiesReferenceWithHttpInfo(requestBody) +> CompletableFuture> testAdditionalPropertiesReferenceWithHttpInfo(requestBody) test referenced additionalProperties @@ -1355,7 +1355,7 @@ No authorization required ## testBodyWithFileSchemaWithHttpInfo -> CompletableFuture> testBodyWithFileSchema testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass) +> CompletableFuture> testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass) @@ -1496,7 +1496,7 @@ No authorization required ## testBodyWithQueryParamsWithHttpInfo -> CompletableFuture> testBodyWithQueryParams testBodyWithQueryParamsWithHttpInfo(query, user) +> CompletableFuture> testBodyWithQueryParamsWithHttpInfo(query, user) @@ -1638,7 +1638,7 @@ No authorization required ## testClientModelWithHttpInfo -> CompletableFuture> testClientModel testClientModelWithHttpInfo(client) +> CompletableFuture> testClientModelWithHttpInfo(client) To test \"client\" model @@ -1813,7 +1813,7 @@ CompletableFuture (empty response body) ## testEndpointParametersWithHttpInfo -> CompletableFuture> testEndpointParameters testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) +> CompletableFuture> testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -2002,7 +2002,7 @@ No authorization required ## testEnumParametersWithHttpInfo -> CompletableFuture> testEnumParameters testEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) +> CompletableFuture> testEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) To test enum parameters @@ -2176,7 +2176,7 @@ CompletableFuture (empty response body) ## testGroupParametersWithHttpInfo -> CompletableFuture> testGroupParameters testGroupParametersWithHttpInfo(testGroupParametersRequest) +> CompletableFuture> testGroupParametersWithHttpInfo(testGroupParametersRequest) Fake endpoint to test group parameters (optional) @@ -2350,7 +2350,7 @@ No authorization required ## testInlineAdditionalPropertiesWithHttpInfo -> CompletableFuture> testInlineAdditionalProperties testInlineAdditionalPropertiesWithHttpInfo(requestBody) +> CompletableFuture> testInlineAdditionalPropertiesWithHttpInfo(requestBody) test inline additionalProperties @@ -2491,7 +2491,7 @@ No authorization required ## testInlineFreeformAdditionalPropertiesWithHttpInfo -> CompletableFuture> testInlineFreeformAdditionalProperties testInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest) +> CompletableFuture> testInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest) test inline free-form additionalProperties @@ -2634,7 +2634,7 @@ No authorization required ## testJsonFormDataWithHttpInfo -> CompletableFuture> testJsonFormData testJsonFormDataWithHttpInfo(param, param2) +> CompletableFuture> testJsonFormDataWithHttpInfo(param, param2) test json serialization of form data @@ -2785,7 +2785,7 @@ No authorization required ## testQueryParameterCollectionFormatWithHttpInfo -> CompletableFuture> testQueryParameterCollectionFormat testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context) +> CompletableFuture> testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context) @@ -2934,7 +2934,7 @@ No authorization required ## testStringMapReferenceWithHttpInfo -> CompletableFuture> testStringMapReference testStringMapReferenceWithHttpInfo(requestBody) +> CompletableFuture> testStringMapReferenceWithHttpInfo(requestBody) test referenced string map diff --git a/samples/client/petstore/java/native-async/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/native-async/docs/FakeClassnameTags123Api.md index b44ac8e61f15..37b45b1eb207 100644 --- a/samples/client/petstore/java/native-async/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/native-async/docs/FakeClassnameTags123Api.md @@ -84,7 +84,7 @@ CompletableFuture<[**Client**](Client.md)> ## testClassnameWithHttpInfo -> CompletableFuture> testClassname testClassnameWithHttpInfo(client) +> CompletableFuture> testClassnameWithHttpInfo(client) To test class name in snake case diff --git a/samples/client/petstore/java/native-async/docs/PetApi.md b/samples/client/petstore/java/native-async/docs/PetApi.md index 1ac2bae8504e..d9776b959b4d 100644 --- a/samples/client/petstore/java/native-async/docs/PetApi.md +++ b/samples/client/petstore/java/native-async/docs/PetApi.md @@ -98,7 +98,7 @@ CompletableFuture (empty response body) ## addPetWithHttpInfo -> CompletableFuture> addPet addPetWithHttpInfo(pet) +> CompletableFuture> addPetWithHttpInfo(pet) Add a new pet to the store @@ -252,7 +252,7 @@ CompletableFuture (empty response body) ## deletePetWithHttpInfo -> CompletableFuture> deletePet deletePetWithHttpInfo(petId, apiKey) +> CompletableFuture> deletePetWithHttpInfo(petId, apiKey) Deletes a pet @@ -408,7 +408,7 @@ CompletableFuture<[**List<Pet>**](Pet.md)> ## findPetsByStatusWithHttpInfo -> CompletableFuture>> findPetsByStatus findPetsByStatusWithHttpInfo(status) +> CompletableFuture>> findPetsByStatusWithHttpInfo(status) Finds Pets by status @@ -565,7 +565,7 @@ CompletableFuture<[**List<Pet>**](Pet.md)> ## findPetsByTagsWithHttpInfo -> CompletableFuture>> findPetsByTags findPetsByTagsWithHttpInfo(tags) +> CompletableFuture>> findPetsByTagsWithHttpInfo(tags) Finds Pets by tags @@ -724,7 +724,7 @@ CompletableFuture<[**Pet**](Pet.md)> ## getPetByIdWithHttpInfo -> CompletableFuture> getPetById getPetByIdWithHttpInfo(petId) +> CompletableFuture> getPetByIdWithHttpInfo(petId) Find pet by ID @@ -883,7 +883,7 @@ CompletableFuture (empty response body) ## updatePetWithHttpInfo -> CompletableFuture> updatePet updatePetWithHttpInfo(pet) +> CompletableFuture> updatePetWithHttpInfo(pet) Update an existing pet @@ -1041,7 +1041,7 @@ CompletableFuture (empty response body) ## updatePetWithFormWithHttpInfo -> CompletableFuture> updatePetWithForm updatePetWithFormWithHttpInfo(petId, name, status) +> CompletableFuture> updatePetWithFormWithHttpInfo(petId, name, status) Updates a pet in the store with form data @@ -1201,7 +1201,7 @@ CompletableFuture<[**ModelApiResponse**](ModelApiResponse.md)> ## uploadFileWithHttpInfo -> CompletableFuture> uploadFile uploadFileWithHttpInfo(petId, additionalMetadata, _file) +> CompletableFuture> uploadFileWithHttpInfo(petId, additionalMetadata, _file) uploads an image @@ -1362,7 +1362,7 @@ CompletableFuture<[**ModelApiResponse**](ModelApiResponse.md)> ## uploadFileWithRequiredFileWithHttpInfo -> CompletableFuture> uploadFileWithRequiredFile uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata) +> CompletableFuture> uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata) uploads an image (required) diff --git a/samples/client/petstore/java/native-async/docs/StoreApi.md b/samples/client/petstore/java/native-async/docs/StoreApi.md index 1321b7fa46ba..128bf43cc02b 100644 --- a/samples/client/petstore/java/native-async/docs/StoreApi.md +++ b/samples/client/petstore/java/native-async/docs/StoreApi.md @@ -83,7 +83,7 @@ No authorization required ## deleteOrderWithHttpInfo -> CompletableFuture> deleteOrder deleteOrderWithHttpInfo(orderId) +> CompletableFuture> deleteOrderWithHttpInfo(orderId) Delete purchase order by ID @@ -229,7 +229,7 @@ CompletableFuture<**Map<String, Integer>**> ## getInventoryWithHttpInfo -> CompletableFuture>> getInventory getInventoryWithHttpInfo() +> CompletableFuture>> getInventoryWithHttpInfo() Returns pet inventories by status @@ -377,7 +377,7 @@ No authorization required ## getOrderByIdWithHttpInfo -> CompletableFuture> getOrderById getOrderByIdWithHttpInfo(orderId) +> CompletableFuture> getOrderByIdWithHttpInfo(orderId) Find purchase order by ID @@ -523,7 +523,7 @@ No authorization required ## placeOrderWithHttpInfo -> CompletableFuture> placeOrder placeOrderWithHttpInfo(order) +> CompletableFuture> placeOrderWithHttpInfo(order) Place an order for a pet diff --git a/samples/client/petstore/java/native-async/docs/UserApi.md b/samples/client/petstore/java/native-async/docs/UserApi.md index 2c5247bdbd44..8415ae2a79e3 100644 --- a/samples/client/petstore/java/native-async/docs/UserApi.md +++ b/samples/client/petstore/java/native-async/docs/UserApi.md @@ -90,7 +90,7 @@ No authorization required ## createUserWithHttpInfo -> CompletableFuture> createUser createUserWithHttpInfo(user) +> CompletableFuture> createUserWithHttpInfo(user) Create user @@ -231,7 +231,7 @@ No authorization required ## createUsersWithArrayInputWithHttpInfo -> CompletableFuture> createUsersWithArrayInput createUsersWithArrayInputWithHttpInfo(user) +> CompletableFuture> createUsersWithArrayInputWithHttpInfo(user) Creates list of users with given input array @@ -372,7 +372,7 @@ No authorization required ## createUsersWithListInputWithHttpInfo -> CompletableFuture> createUsersWithListInput createUsersWithListInputWithHttpInfo(user) +> CompletableFuture> createUsersWithListInputWithHttpInfo(user) Creates list of users with given input array @@ -514,7 +514,7 @@ No authorization required ## deleteUserWithHttpInfo -> CompletableFuture> deleteUser deleteUserWithHttpInfo(username) +> CompletableFuture> deleteUserWithHttpInfo(username) Delete user @@ -659,7 +659,7 @@ No authorization required ## getUserByNameWithHttpInfo -> CompletableFuture> getUserByName getUserByNameWithHttpInfo(username) +> CompletableFuture> getUserByNameWithHttpInfo(username) Get user by user name @@ -807,7 +807,7 @@ No authorization required ## loginUserWithHttpInfo -> CompletableFuture> loginUser loginUserWithHttpInfo(username, password) +> CompletableFuture> loginUserWithHttpInfo(username, password) Logs user into the system @@ -948,7 +948,7 @@ No authorization required ## logoutUserWithHttpInfo -> CompletableFuture> logoutUser logoutUserWithHttpInfo() +> CompletableFuture> logoutUserWithHttpInfo() Logs out current logged in user session @@ -1088,7 +1088,7 @@ No authorization required ## updateUserWithHttpInfo -> CompletableFuture> updateUser updateUserWithHttpInfo(username, user) +> CompletableFuture> updateUserWithHttpInfo(username, user) Updated user diff --git a/samples/client/petstore/java/native-jackson3/.github/workflows/maven.yml b/samples/client/petstore/java/native-jackson3/.github/workflows/maven.yml new file mode 100644 index 000000000000..460f78bfd1b2 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/.github/workflows/maven.yml @@ -0,0 +1,30 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build OpenAPI Petstore + runs-on: ubuntu-latest + strategy: + matrix: + java: [ 17, 21 ] + steps: + - uses: actions/checkout@v4 + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/samples/client/petstore/java/native-jackson3/.gitignore b/samples/client/petstore/java/native-jackson3/.gitignore new file mode 100644 index 000000000000..a530464afa1b --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/samples/client/petstore/java/native-jackson3/.openapi-generator-ignore b/samples/client/petstore/java/native-jackson3/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/.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/native-jackson3/.openapi-generator/FILES b/samples/client/petstore/java/native-jackson3/.openapi-generator/FILES new file mode 100644 index 000000000000..8dc201491a16 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/.openapi-generator/FILES @@ -0,0 +1,198 @@ +.github/workflows/maven.yml +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/AdditionalPropertiesClass.md +docs/AllOfRefToDouble.md +docs/AllOfRefToFloat.md +docs/AllOfRefToLong.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/Apple.md +docs/AppleReq.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/Banana.md +docs/BananaReq.md +docs/BasquePig.md +docs/Capitalization.md +docs/Cat.md +docs/Category.md +docs/ChildCat.md +docs/ClassModel.md +docs/Client.md +docs/ComplexQuadrilateral.md +docs/DanishPig.md +docs/DefaultApi.md +docs/DeprecatedObject.md +docs/Dog.md +docs/Drawing.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/EquilateralTriangle.md +docs/FakeApi.md +docs/FakeBigDecimalMap200Response.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/Foo.md +docs/FooGetDefaultResponse.md +docs/FormatTest.md +docs/Fruit.md +docs/FruitReq.md +docs/GmFruit.md +docs/GrandparentAnimal.md +docs/HasOnlyReadOnly.md +docs/HealthCheckResult.md +docs/IsoscelesTriangle.md +docs/Mammal.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelFile.md +docs/ModelList.md +docs/ModelReturn.md +docs/Name.md +docs/NullableClass.md +docs/NullableShape.md +docs/NumberOnly.md +docs/ObjectWithDeprecatedFields.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/OuterEnumDefaultValue.md +docs/OuterEnumInteger.md +docs/OuterEnumIntegerDefaultValue.md +docs/ParentPet.md +docs/Pet.md +docs/PetApi.md +docs/Pig.md +docs/Quadrilateral.md +docs/QuadrilateralInterface.md +docs/ReadOnlyFirst.md +docs/ScaleneTriangle.md +docs/Shape.md +docs/ShapeInterface.md +docs/ShapeOrNull.md +docs/SimpleQuadrilateral.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md +docs/Triangle.md +docs/TriangleInterface.md +docs/User.md +docs/UserApi.md +docs/Whale.md +docs/Zebra.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/RFC3339DateFormat.java +src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java +src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AllOfRefToDouble.java +src/main/java/org/openapitools/client/model/AllOfRefToFloat.java +src/main/java/org/openapitools/client/model/AllOfRefToLong.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/Apple.java +src/main/java/org/openapitools/client/model/AppleReq.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/Banana.java +src/main/java/org/openapitools/client/model/BananaReq.java +src/main/java/org/openapitools/client/model/BasquePig.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ChildCat.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java +src/main/java/org/openapitools/client/model/DanishPig.java +src/main/java/org/openapitools/client/model/DeprecatedObject.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/Drawing.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/EquilateralTriangle.java +src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/Foo.java +src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/Fruit.java +src/main/java/org/openapitools/client/model/FruitReq.java +src/main/java/org/openapitools/client/model/GmFruit.java +src/main/java/org/openapitools/client/model/GrandparentAnimal.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/HealthCheckResult.java +src/main/java/org/openapitools/client/model/IsoscelesTriangle.java +src/main/java/org/openapitools/client/model/Mammal.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelFile.java +src/main/java/org/openapitools/client/model/ModelList.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NullableClass.java +src/main/java/org/openapitools/client/model/NullableShape.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java +src/main/java/org/openapitools/client/model/OuterEnumInteger.java +src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java +src/main/java/org/openapitools/client/model/ParentPet.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/Pig.java +src/main/java/org/openapitools/client/model/Quadrilateral.java +src/main/java/org/openapitools/client/model/QuadrilateralInterface.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/ScaleneTriangle.java +src/main/java/org/openapitools/client/model/Shape.java +src/main/java/org/openapitools/client/model/ShapeInterface.java +src/main/java/org/openapitools/client/model/ShapeOrNull.java +src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +src/main/java/org/openapitools/client/model/Triangle.java +src/main/java/org/openapitools/client/model/TriangleInterface.java +src/main/java/org/openapitools/client/model/User.java +src/main/java/org/openapitools/client/model/Whale.java +src/main/java/org/openapitools/client/model/Zebra.java diff --git a/samples/client/petstore/java/native-jackson3/.openapi-generator/VERSION b/samples/client/petstore/java/native-jackson3/.openapi-generator/VERSION new file mode 100644 index 000000000000..0610c66bc14f --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.21.0-SNAPSHOT diff --git a/samples/client/petstore/java/native-jackson3/.travis.yml b/samples/client/petstore/java/native-jackson3/.travis.yml new file mode 100644 index 000000000000..2e6048e4d7cc --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/.travis.yml @@ -0,0 +1,16 @@ +# +# Generated by: https://openapi-generator.tech +# +language: java +jdk: + - oraclejdk17 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + - mvn test + # uncomment below to test using gradle + # - gradle test + # uncomment below to test using sbt + # - sbt test diff --git a/samples/client/petstore/java/native-jackson3/README.md b/samples/client/petstore/java/native-jackson3/README.md new file mode 100644 index 000000000000..a5195c3fe8d3 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/README.md @@ -0,0 +1,341 @@ +# petstore-native-jackson3 + +OpenAPI Petstore + +- API version: 1.0.0 + +- Generator version: 7.21.0-SNAPSHOT + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + +## Requirements + +Building the API client library requires: + +1. Java 17+ +2. Maven/Gradle + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + petstore-native-jackson3 + 1.0.0 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy +compile "org.openapitools:petstore-native-jackson3:1.0.0" +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +- `target/petstore-native-jackson3-1.0.0.jar` +- `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +import org.openapitools.client.*; +import org.openapitools.client.model.*; +import org.openapitools.client.api.AnotherFakeApi; + +public class AnotherFakeApiExample { + + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + // Configure clients using the `defaultClient` object, such as + // overriding the host and port, timeout, etc. + AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.call123testSpecialTags(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +*AnotherFakeApi* | [**call123testSpecialTagsWithHttpInfo**](docs/AnotherFakeApi.md#call123testSpecialTagsWithHttpInfo) | **PATCH** /another-fake/dummy | To test special tags +*DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooGet) | **GET** /foo | +*DefaultApi* | [**fooGetWithHttpInfo**](docs/DefaultApi.md#fooGetWithHttpInfo) | **GET** /foo | +*FakeApi* | [**fakeBigDecimalMap**](docs/FakeApi.md#fakeBigDecimalMap) | **GET** /fake/BigDecimalMap | +*FakeApi* | [**fakeBigDecimalMapWithHttpInfo**](docs/FakeApi.md#fakeBigDecimalMapWithHttpInfo) | **GET** /fake/BigDecimalMap | +*FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint +*FakeApi* | [**fakeHealthGetWithHttpInfo**](docs/FakeApi.md#fakeHealthGetWithHttpInfo) | **GET** /fake/health | Health check endpoint +*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**fakeOuterBooleanSerializeWithHttpInfo**](docs/FakeApi.md#fakeOuterBooleanSerializeWithHttpInfo) | **POST** /fake/outer/boolean | +*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fakeOuterCompositeSerializeWithHttpInfo**](docs/FakeApi.md#fakeOuterCompositeSerializeWithHttpInfo) | **POST** /fake/outer/composite | +*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +*FakeApi* | [**fakeOuterNumberSerializeWithHttpInfo**](docs/FakeApi.md#fakeOuterNumberSerializeWithHttpInfo) | **POST** /fake/outer/number | +*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +*FakeApi* | [**fakeOuterStringSerializeWithHttpInfo**](docs/FakeApi.md#fakeOuterStringSerializeWithHttpInfo) | **POST** /fake/outer/string | +*FakeApi* | [**getApplicationJsonUtf8**](docs/FakeApi.md#getApplicationJsonUtf8) | **GET** /fake/application_json_utf8 | application/json UTF8 +*FakeApi* | [**getApplicationJsonUtf8WithHttpInfo**](docs/FakeApi.md#getApplicationJsonUtf8WithHttpInfo) | **GET** /fake/application_json_utf8 | application/json UTF8 +*FakeApi* | [**getArrayOfEnums**](docs/FakeApi.md#getArrayOfEnums) | **GET** /fake/array-of-enums | Array of Enums +*FakeApi* | [**getArrayOfEnumsWithHttpInfo**](docs/FakeApi.md#getArrayOfEnumsWithHttpInfo) | **GET** /fake/array-of-enums | Array of Enums +*FakeApi* | [**testAdditionalPropertiesReference**](docs/FakeApi.md#testAdditionalPropertiesReference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties +*FakeApi* | [**testAdditionalPropertiesReferenceWithHttpInfo**](docs/FakeApi.md#testAdditionalPropertiesReferenceWithHttpInfo) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties +*FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | +*FakeApi* | [**testBodyWithFileSchemaWithHttpInfo**](docs/FakeApi.md#testBodyWithFileSchemaWithHttpInfo) | **PUT** /fake/body-with-file-schema | +*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | +*FakeApi* | [**testBodyWithQueryParamsWithHttpInfo**](docs/FakeApi.md#testBodyWithQueryParamsWithHttpInfo) | **PUT** /fake/body-with-query-params | +*FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**testClientModelWithHttpInfo**](docs/FakeApi.md#testClientModelWithHttpInfo) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**testEndpointParametersWithHttpInfo**](docs/FakeApi.md#testEndpointParametersWithHttpInfo) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**testEnumParametersWithHttpInfo**](docs/FakeApi.md#testEnumParametersWithHttpInfo) | **GET** /fake | To test enum parameters +*FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +*FakeApi* | [**testGroupParametersWithHttpInfo**](docs/FakeApi.md#testGroupParametersWithHttpInfo) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testInlineAdditionalPropertiesWithHttpInfo**](docs/FakeApi.md#testInlineAdditionalPropertiesWithHttpInfo) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testInlineFreeformAdditionalProperties**](docs/FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties +*FakeApi* | [**testInlineFreeformAdditionalPropertiesWithHttpInfo**](docs/FakeApi.md#testInlineFreeformAdditionalPropertiesWithHttpInfo) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties +*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**testJsonFormDataWithHttpInfo**](docs/FakeApi.md#testJsonFormDataWithHttpInfo) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | +*FakeApi* | [**testQueryParameterCollectionFormatWithHttpInfo**](docs/FakeApi.md#testQueryParameterCollectionFormatWithHttpInfo) | **PUT** /fake/test-query-parameters | +*FakeApi* | [**testStringMapReference**](docs/FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map +*FakeApi* | [**testStringMapReferenceWithHttpInfo**](docs/FakeApi.md#testStringMapReferenceWithHttpInfo) | **POST** /fake/stringMap-reference | test referenced string map +*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case +*FakeClassnameTags123Api* | [**testClassnameWithHttpInfo**](docs/FakeClassnameTags123Api.md#testClassnameWithHttpInfo) | **PATCH** /fake_classname_test | To test class name in snake case +*PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**addPetWithHttpInfo**](docs/PetApi.md#addPetWithHttpInfo) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**deletePetWithHttpInfo**](docs/PetApi.md#deletePetWithHttpInfo) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByStatusWithHttpInfo**](docs/PetApi.md#findPetsByStatusWithHttpInfo) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**findPetsByTagsWithHttpInfo**](docs/PetApi.md#findPetsByTagsWithHttpInfo) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**getPetByIdWithHttpInfo**](docs/PetApi.md#getPetByIdWithHttpInfo) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithHttpInfo**](docs/PetApi.md#updatePetWithHttpInfo) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**updatePetWithFormWithHttpInfo**](docs/PetApi.md#updatePetWithFormWithHttpInfo) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image +*PetApi* | [**uploadFileWithHttpInfo**](docs/PetApi.md#uploadFileWithHttpInfo) | **POST** /pet/{petId}/uploadImage | uploads an image +*PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*PetApi* | [**uploadFileWithRequiredFileWithHttpInfo**](docs/PetApi.md#uploadFileWithRequiredFileWithHttpInfo) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**deleteOrderWithHttpInfo**](docs/StoreApi.md#deleteOrderWithHttpInfo) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getInventoryWithHttpInfo**](docs/StoreApi.md#getInventoryWithHttpInfo) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**getOrderByIdWithHttpInfo**](docs/StoreApi.md#getOrderByIdWithHttpInfo) | **GET** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet +*StoreApi* | [**placeOrderWithHttpInfo**](docs/StoreApi.md#placeOrderWithHttpInfo) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user +*UserApi* | [**createUserWithHttpInfo**](docs/UserApi.md#createUserWithHttpInfo) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithArrayInputWithHttpInfo**](docs/UserApi.md#createUsersWithArrayInputWithHttpInfo) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**createUsersWithListInputWithHttpInfo**](docs/UserApi.md#createUsersWithListInputWithHttpInfo) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**deleteUserWithHttpInfo**](docs/UserApi.md#deleteUserWithHttpInfo) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +*UserApi* | [**getUserByNameWithHttpInfo**](docs/UserApi.md#getUserByNameWithHttpInfo) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +*UserApi* | [**loginUserWithHttpInfo**](docs/UserApi.md#loginUserWithHttpInfo) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**logoutUserWithHttpInfo**](docs/UserApi.md#logoutUserWithHttpInfo) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateUser) | **PUT** /user/{username} | Updated user +*UserApi* | [**updateUserWithHttpInfo**](docs/UserApi.md#updateUserWithHttpInfo) | **PUT** /user/{username} | Updated user + + +## Documentation for Models + + - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [AllOfRefToDouble](docs/AllOfRefToDouble.md) + - [AllOfRefToFloat](docs/AllOfRefToFloat.md) + - [AllOfRefToLong](docs/AllOfRefToLong.md) + - [Animal](docs/Animal.md) + - [Apple](docs/Apple.md) + - [AppleReq](docs/AppleReq.md) + - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [ArrayTest](docs/ArrayTest.md) + - [Banana](docs/Banana.md) + - [BananaReq](docs/BananaReq.md) + - [BasquePig](docs/BasquePig.md) + - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) + - [Category](docs/Category.md) + - [ChildCat](docs/ChildCat.md) + - [ClassModel](docs/ClassModel.md) + - [Client](docs/Client.md) + - [ComplexQuadrilateral](docs/ComplexQuadrilateral.md) + - [DanishPig](docs/DanishPig.md) + - [DeprecatedObject](docs/DeprecatedObject.md) + - [Dog](docs/Dog.md) + - [Drawing](docs/Drawing.md) + - [EnumArrays](docs/EnumArrays.md) + - [EnumClass](docs/EnumClass.md) + - [EnumTest](docs/EnumTest.md) + - [EquilateralTriangle](docs/EquilateralTriangle.md) + - [FakeBigDecimalMap200Response](docs/FakeBigDecimalMap200Response.md) + - [FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [Foo](docs/Foo.md) + - [FooGetDefaultResponse](docs/FooGetDefaultResponse.md) + - [FormatTest](docs/FormatTest.md) + - [Fruit](docs/Fruit.md) + - [FruitReq](docs/FruitReq.md) + - [GmFruit](docs/GmFruit.md) + - [GrandparentAnimal](docs/GrandparentAnimal.md) + - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [HealthCheckResult](docs/HealthCheckResult.md) + - [IsoscelesTriangle](docs/IsoscelesTriangle.md) + - [Mammal](docs/Mammal.md) + - [MapTest](docs/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](docs/Model200Response.md) + - [ModelApiResponse](docs/ModelApiResponse.md) + - [ModelFile](docs/ModelFile.md) + - [ModelList](docs/ModelList.md) + - [ModelReturn](docs/ModelReturn.md) + - [Name](docs/Name.md) + - [NullableClass](docs/NullableClass.md) + - [NullableShape](docs/NullableShape.md) + - [NumberOnly](docs/NumberOnly.md) + - [ObjectWithDeprecatedFields](docs/ObjectWithDeprecatedFields.md) + - [Order](docs/Order.md) + - [OuterComposite](docs/OuterComposite.md) + - [OuterEnum](docs/OuterEnum.md) + - [OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [OuterEnumInteger](docs/OuterEnumInteger.md) + - [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) + - [ParentPet](docs/ParentPet.md) + - [Pet](docs/Pet.md) + - [Pig](docs/Pig.md) + - [Quadrilateral](docs/Quadrilateral.md) + - [QuadrilateralInterface](docs/QuadrilateralInterface.md) + - [ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [ScaleneTriangle](docs/ScaleneTriangle.md) + - [Shape](docs/Shape.md) + - [ShapeInterface](docs/ShapeInterface.md) + - [ShapeOrNull](docs/ShapeOrNull.md) + - [SimpleQuadrilateral](docs/SimpleQuadrilateral.md) + - [SpecialModelName](docs/SpecialModelName.md) + - [Tag](docs/Tag.md) + - [TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md) + - [Triangle](docs/Triangle.md) + - [TriangleInterface](docs/TriangleInterface.md) + - [User](docs/User.md) + - [Whale](docs/Whale.md) + - [Zebra](docs/Zebra.md) + + + +## Documentation for Authorization + + +Authentication schemes defined for the API: + +### petstore_auth + + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account + - read:pets: read your pets + + +### api_key + + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + + +### api_key_query + + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + + +### http_basic_test + + +- **Type**: HTTP basic authentication + + +### bearer_test + + +- **Type**: HTTP Bearer Token authentication (JWT) + + +### http_signature_test + + +- **Type**: HTTP signature authentication + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. +However, the instances of the api clients created from the `ApiClient` are thread-safe and can be re-used. + +## Author + + + diff --git a/samples/client/petstore/java/native-jackson3/api/openapi.yaml b/samples/client/petstore/java/native-jackson3/api/openapi.yaml new file mode 100644 index 000000000000..679fbdda6ba6 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/api/openapi.yaml @@ -0,0 +1,2525 @@ +openapi: 3.0.0 +info: + description: "This spec is mainly for testing Petstore server and contains fake\ + \ endpoints, models. Please do not use this for any other purpose. Special characters:\ + \ \" \\" + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- description: petstore server + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: "https://localhost:8080/{version}" + variables: + version: + default: v2 + enum: + - v1 + - v2 +- description: The local server without variables + url: https://127.0.0.1/no_variable +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: "#/components/schemas/_foo_get_default_response" + description: response + x-accepts: + - application/json + /pet: + post: + description: "" + operationId: addPet + requestBody: + $ref: "#/components/requestBodies/Pet" + responses: + "405": + description: Invalid input + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-content-type: application/json + x-accepts: + - application/json + put: + description: "" + operationId: updatePet + requestBody: + $ref: "#/components/requestBodies/Pet" + responses: + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + x-content-type: application/json + x-accepts: + - application/json + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - deprecated: true + description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: "#/components/schemas/Pet" + type: array + application/json: + schema: + items: + $ref: "#/components/schemas/Pet" + type: array + description: successful operation + "400": + description: Invalid status value + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-accepts: + - application/json + - application/xml + /pet/findByTags: + get: + deprecated: true + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: "#/components/schemas/Pet" + type: array + application/json: + schema: + items: + $ref: "#/components/schemas/Pet" + type: array + description: successful operation + "400": + description: Invalid tag value + security: + - http_signature_test: [] + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-accepts: + - application/json + - application/xml + /pet/{petId}: + delete: + description: "" + operationId: deletePet + parameters: + - explode: false + in: header + name: api_key + required: false + schema: + type: string + style: simple + - description: Pet id to delete + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: + - application/json + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: "#/components/schemas/Pet" + application/json: + schema: + $ref: "#/components/schemas/Pet" + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-accepts: + - application/json + - application/xml + post: + description: "" + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: "#/components/schemas/updatePetWithForm_request" + responses: + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + /pet/{petId}/uploadImage: + post: + description: "" + operationId: uploadFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: "#/components/schemas/uploadFile_request" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ApiResponse" + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-content-type: multipart/form-data + x-accepts: + - application/json + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: + - application/json + /store/order: + post: + description: "" + operationId: placeOrder + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/Order" + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: "#/components/schemas/Order" + application/json: + schema: + $ref: "#/components/schemas/Order" + description: successful operation + "400": + description: Invalid Order + summary: Place an order for a pet + tags: + - store + x-content-type: application/json + x-accepts: + - application/json + - application/xml + /store/order/{order_id}: + delete: + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + explode: false + in: path + name: order_id + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Delete purchase order by ID + tags: + - store + x-accepts: + - application/json + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generate exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + explode: false + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: "#/components/schemas/Order" + application/json: + schema: + $ref: "#/components/schemas/Order" + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: + - application/json + - application/xml + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/User" + description: Created user object + required: true + responses: + default: + description: successful operation + summary: Create user + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + /user/createWithArray: + post: + description: "" + operationId: createUsersWithArrayInput + requestBody: + $ref: "#/components/requestBodies/UserArray" + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + /user/createWithList: + post: + description: "" + operationId: createUsersWithListInput + requestBody: + $ref: "#/components/requestBodies/UserArray" + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + /user/login: + get: + description: "" + operationId: loginUser + parameters: + - description: The user name for login + explode: true + in: query + name: username + required: true + schema: + type: string + style: form + - description: The password for login in clear text + explode: true + in: query + name: password + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + explode: false + schema: + format: int32 + type: integer + style: simple + X-Expires-After: + description: date in UTC when token expires + explode: false + schema: + format: date-time + type: string + style: simple + "400": + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: + - application/json + - application/xml + /user/logout: + get: + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: + - application/json + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Delete user + tags: + - user + x-accepts: + - application/json + get: + description: "" + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: "#/components/schemas/User" + application/json: + schema: + $ref: "#/components/schemas/User" + description: successful operation + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: + - application/json + - application/xml + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/User" + description: Updated user object + required: true + responses: + "400": + description: Invalid user supplied + "404": + description: User not found + summary: Updated user + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + $ref: "#/components/requestBodies/Client" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/Client" + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + x-content-type: application/json + x-accepts: + - application/json + /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + explode: true + in: query + name: required_string_group + required: true + schema: + type: integer + style: form + - description: Required Boolean in group parameters + explode: false + in: header + name: required_boolean_group + required: true + schema: + type: boolean + style: simple + - description: Required Integer in group parameters + explode: true + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + style: form + - description: String in group parameters + explode: true + in: query + name: string_group + required: false + schema: + type: integer + style: form + - description: Boolean in group parameters + explode: false + in: header + name: boolean_group + required: false + schema: + type: boolean + style: simple + - description: Integer in group parameters + explode: true + in: query + name: int64_group + required: false + schema: + format: int64 + type: integer + style: form + responses: + "400": + description: Something wrong + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + x-accepts: + - application/json + get: + description: To test enum parameters + operationId: testEnumParameters + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + explode: false + in: header + name: enum_header_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: simple + - description: Query parameter enum test (string array) + explode: true + in: query + name: enum_query_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + explode: true + in: query + name: enum_query_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_integer + required: false + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_double + required: false + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + style: form + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: "#/components/schemas/testEnumParameters_request" + responses: + "400": + description: Invalid request + "404": + description: Not found + summary: To test enum parameters + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + $ref: "#/components/requestBodies/Client" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/Client" + description: successful operation + summary: To test "client" model + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + post: + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: "#/components/schemas/testEndpointParameters_request" + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + security: + - http_basic_test: [] + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + /fake/outer/number: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/OuterNumber" + description: Input number as post body + responses: + "200": + content: + '*/*': + schema: + $ref: "#/components/schemas/OuterNumber" + description: Output number + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/OuterString" + description: Input string as post body + responses: + "200": + content: + '*/*': + schema: + $ref: "#/components/schemas/OuterString" + description: Output string + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/OuterBoolean" + description: Input boolean as post body + responses: + "200": + content: + '*/*': + schema: + $ref: "#/components/schemas/OuterBoolean" + description: Output boolean + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/OuterComposite" + description: Input composite as post body + responses: + "200": + content: + '*/*': + schema: + $ref: "#/components/schemas/OuterComposite" + description: Output composite + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + /fake/BigDecimalMap: + get: + description: "for Java apache and Java native, test toUrlQueryString for maps\ + \ with BegDecimal keys" + operationId: fakeBigDecimalMap + responses: + "200": + content: + '*/*': + schema: + $ref: "#/components/schemas/fakeBigDecimalMap_200_response" + description: successful operation + tags: + - fake + x-accepts: + - '*/*' + /fake/jsonFormData: + get: + description: "" + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: "#/components/schemas/testJsonFormData_request" + responses: + "200": + description: successful operation + summary: test json serialization of form data + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + /fake/additionalProperties-reference: + post: + description: "" + operationId: testAdditionalPropertiesReference + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/FreeFormObject" + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/MapOfString" + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/inline-additionalProperties: + post: + description: "" + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/testInlineFreeformAdditionalProperties_request" + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams + parameters: + - explode: true + in: query + name: query + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/User" + required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /another-fake/dummy: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + $ref: "#/components/requestBodies/Client" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/Client" + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-content-type: application/json + x-accepts: + - application/json + /fake/body-with-file-schema: + put: + description: "For this test, the body for this request much reference a schema\ + \ named `File`." + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/FileSchemaTestClass" + required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/test-query-parameters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: true + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - explode: false + in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + style: form + - explode: false + in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + description: Success + tags: + - fake + x-accepts: + - application/json + /fake/{petId}/uploadImageWithRequiredFile: + post: + description: "" + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: "#/components/schemas/uploadFileWithRequiredFile_request" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ApiResponse" + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + x-content-type: multipart/form-data + x-accepts: + - application/json + /fake/health: + get: + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/HealthCheckResult" + description: The instance started successfully + summary: Health check endpoint + tags: + - fake + x-accepts: + - application/json + /fake/array-of-enums: + get: + operationId: getArrayOfEnums + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ArrayOfEnums" + description: Got named array of enums + summary: Array of Enums + tags: + - fake + x-accepts: + - application/json + /fake/application_json_utf8: + get: + operationId: get_application_json_utf8 + responses: + "200": + content: + application/json;charset=utf-8: + schema: + $ref: "#/components/schemas/ArrayOfEnums" + description: test + summary: application/json UTF8 + tags: + - fake + x-accepts: + - application/json;charset=utf-8 +components: + requestBodies: + UserArray: + content: + application/json: + examples: + simple-list: + description: Should not get into code examples + summary: Simple list example + value: + - username: foo + - username: bar + schema: + items: + $ref: "#/components/schemas/User" + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: "#/components/schemas/Client" + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: "#/components/schemas/Pet" + application/xml: + schema: + $ref: "#/components/schemas/Pet" + description: Pet object that needs to be added to the store + required: true + schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2020-02-02T20:20:20.000222Z + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + example: 2020-02-02T20:20:20.000222Z + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order + Category: + example: + name: default-name + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + objectWithNoDeclaredPropsNullable: "{}" + phone: phone + objectWithNoDeclaredProps: "{}" + id: 0 + anyTypePropNullable: "" + email: email + anyTypeProp: "" + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + objectWithNoDeclaredProps: + description: test code generation for objects Value must be a map of strings + to values. It cannot be the 'null' value. + type: object + objectWithNoDeclaredPropsNullable: + description: test code generation for nullable objects. Value must be a + map of strings to values or the 'null' value. + nullable: true + type: object + anyTypeProp: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389" + anyTypePropNullable: + description: "test code generation for any type Here the 'type' attribute\ + \ is not specified, which means the value can be anything, including the\ + \ null value, string, number, boolean, array or object. The 'nullable'\ + \ attribute does not change the allowed values." + nullable: true + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: "#/components/schemas/Category" + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: "#/components/schemas/Tag" + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + xml: + name: Return + Name: + description: Model for testing model name same as property name + properties: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: "#/components/schemas/Animal" + - properties: + breed: + type: string + type: object + Cat: + allOf: + - $ref: "#/components/schemas/Animal" + - $ref: "#/components/schemas/Address" + - properties: + declawed: + type: boolean + type: object + Address: + additionalProperties: + type: integer + type: object + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: "#/components/schemas/Animal" + type: array + format_test: + properties: + integer: + maximum: 100 + minimum: 10 + multipleOf: 2 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + format: int64 + type: integer + number: + maximum: 543.2 + minimum: 32.1 + multipleOf: 32.5 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + decimal: + format: number + type: string + string: + pattern: "/[a-z]/i" + type: string + byte: + format: byte + type: string + binary: + format: binary + type: string + date: + example: 2020-02-02 + format: date + type: string + dateTime: + example: 2007-12-03T10:15:30+01:00 + format: date-time + type: string + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: "^\\d{10}$" + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: "/^image_\\d{1,3}$/i" + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + Enum_Test: + properties: + enum_string: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_integer_only: + enum: + - 2 + - -2 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: "#/components/schemas/OuterEnum" + outerEnumInteger: + $ref: "#/components/schemas/OuterEnumInteger" + outerEnumDefaultValue: + $ref: "#/components/schemas/OuterEnumDefaultValue" + outerEnumIntegerDefaultValue: + $ref: "#/components/schemas/OuterEnumIntegerDefaultValue" + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_property: + additionalProperties: + type: string + type: object + map_of_map_property: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + anytype_1: {} + map_with_undeclared_properties_anytype_1: + type: object + map_with_undeclared_properties_anytype_2: + properties: {} + type: object + map_with_undeclared_properties_anytype_3: + additionalProperties: true + type: object + empty_map: + additionalProperties: false + description: "an object with no declared properties and no undeclared properties,\ + \ hence it's an empty map." + type: object + map_with_undeclared_properties_string: + additionalProperties: + type: string + type: object + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: "#/components/schemas/Animal" + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: "#/components/schemas/ReadOnlyFirst" + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + FreeFormObject: + additionalProperties: true + description: A schema consisting only of additional properties + type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + nullable: true + type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + type: integer + OuterEnumDefaultValue: + default: placed + enum: + - placed + - approved + - delivered + type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: "#/components/schemas/File" + files: + items: + $ref: "#/components/schemas/File" + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + _special_model.name_: + type: string + xml: + name: "$special[model.name]" + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage + properties: + NullableMessage: + nullable: true + type: string + type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + fruit: + additionalProperties: false + oneOf: + - $ref: "#/components/schemas/apple" + - $ref: "#/components/schemas/banana" + properties: + color: + type: string + apple: + nullable: true + properties: + cultivar: + pattern: "^[a-zA-Z\\s]*$" + type: string + origin: + pattern: "/^[A-Z\\s]*$/i" + type: string + type: object + banana: + properties: + lengthCm: + type: number + type: object + mammal: + discriminator: + propertyName: className + oneOf: + - $ref: "#/components/schemas/whale" + - $ref: "#/components/schemas/zebra" + - $ref: "#/components/schemas/Pig" + whale: + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + required: + - className + type: object + zebra: + additionalProperties: true + properties: + type: + enum: + - plains + - mountain + - grevys + type: string + className: + type: string + required: + - className + type: object + Pig: + discriminator: + propertyName: className + oneOf: + - $ref: "#/components/schemas/BasquePig" + - $ref: "#/components/schemas/DanishPig" + BasquePig: + properties: + className: + type: string + required: + - className + type: object + DanishPig: + properties: + className: + type: string + required: + - className + type: object + gmFruit: + additionalProperties: false + anyOf: + - $ref: "#/components/schemas/apple" + - $ref: "#/components/schemas/banana" + properties: + color: + type: string + fruitReq: + additionalProperties: false + oneOf: + - $ref: "#/components/schemas/appleReq" + - $ref: "#/components/schemas/bananaReq" + appleReq: + additionalProperties: false + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + type: object + bananaReq: + additionalProperties: false + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + type: object + Drawing: + additionalProperties: + $ref: "#/components/schemas/fruit" + properties: + mainShape: + $ref: "#/components/schemas/Shape" + shapeOrNull: + $ref: "#/components/schemas/ShapeOrNull" + nullableShape: + $ref: "#/components/schemas/NullableShape" + shapes: + items: + $ref: "#/components/schemas/Shape" + type: array + type: object + Shape: + discriminator: + propertyName: shapeType + oneOf: + - $ref: "#/components/schemas/Triangle" + - $ref: "#/components/schemas/Quadrilateral" + ShapeOrNull: + description: The value may be a shape or the 'null' value. This is introduced + in OAS schema >= 3.1. + discriminator: + propertyName: shapeType + oneOf: + - $ref: "#/components/schemas/Triangle" + - $ref: "#/components/schemas/Quadrilateral" + NullableShape: + description: The value may be a shape or the 'null' value. The 'nullable' attribute + was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema + >= 3.1. + discriminator: + propertyName: shapeType + nullable: true + oneOf: + - $ref: "#/components/schemas/Triangle" + - $ref: "#/components/schemas/Quadrilateral" + ShapeInterface: + properties: + shapeType: + type: string + required: + - shapeType + TriangleInterface: + properties: + triangleType: + type: string + required: + - triangleType + Triangle: + discriminator: + propertyName: triangleType + oneOf: + - $ref: "#/components/schemas/EquilateralTriangle" + - $ref: "#/components/schemas/IsoscelesTriangle" + - $ref: "#/components/schemas/ScaleneTriangle" + EquilateralTriangle: + allOf: + - $ref: "#/components/schemas/ShapeInterface" + - $ref: "#/components/schemas/TriangleInterface" + IsoscelesTriangle: + additionalProperties: false + allOf: + - $ref: "#/components/schemas/ShapeInterface" + - $ref: "#/components/schemas/TriangleInterface" + ScaleneTriangle: + allOf: + - $ref: "#/components/schemas/ShapeInterface" + - $ref: "#/components/schemas/TriangleInterface" + QuadrilateralInterface: + properties: + quadrilateralType: + type: string + required: + - quadrilateralType + Quadrilateral: + discriminator: + propertyName: quadrilateralType + oneOf: + - $ref: "#/components/schemas/SimpleQuadrilateral" + - $ref: "#/components/schemas/ComplexQuadrilateral" + SimpleQuadrilateral: + allOf: + - $ref: "#/components/schemas/ShapeInterface" + - $ref: "#/components/schemas/QuadrilateralInterface" + ComplexQuadrilateral: + allOf: + - $ref: "#/components/schemas/ShapeInterface" + - $ref: "#/components/schemas/QuadrilateralInterface" + GrandparentAnimal: + discriminator: + propertyName: pet_type + properties: + pet_type: + type: string + required: + - pet_type + type: object + ParentPet: + allOf: + - $ref: "#/components/schemas/GrandparentAnimal" + type: object + ChildCat: + allOf: + - $ref: "#/components/schemas/ParentPet" + - properties: + name: + type: string + pet_type: + default: ChildCat + enum: + - ChildCat + type: string + x-enum-as-string: true + type: object + ArrayOfEnums: + items: + $ref: "#/components/schemas/OuterEnum" + type: array + DateTimeTest: + default: 2010-01-01T10:10:10.000111+01:00 + example: 2010-01-01T10:10:10.000111+01:00 + format: date-time + type: string + DeprecatedObject: + deprecated: true + properties: + name: + type: string + type: object + ObjectWithDeprecatedFields: + properties: + uuid: + type: string + id: + deprecated: true + type: number + deprecatedRef: + $ref: "#/components/schemas/DeprecatedObject" + bars: + deprecated: true + items: + $ref: "#/components/schemas/Bar" + type: array + type: object + LongId: + description: Id as long + format: int64 + type: integer + Weight: + description: Weight as float + format: float + type: number + Height: + description: Height as double + format: double + type: number + AllOfRefToLong: + description: Object with allOf ref to long + properties: + id: + allOf: + - $ref: "#/components/schemas/LongId" + default: 10 + type: object + AllOfRefToFloat: + description: Object with allOf ref to float + properties: + weight: + allOf: + - $ref: "#/components/schemas/Weight" + default: 7.89 + type: object + AllOfRefToDouble: + description: Object with allOf ref to double + properties: + height: + allOf: + - $ref: "#/components/schemas/Height" + default: 32.1 + type: object + _foo_get_default_response: + example: + string: + bar: bar + properties: + string: + $ref: "#/components/schemas/Foo" + type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + testEndpointParameters_request: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + default: 2010-02-01T10:20:10.11111+01:00 + description: None + example: 2020-02-02T20:20:20.22222Z + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + fakeBigDecimalMap_200_response: + example: + someId: 0.8008281904610115 + someMap: + key: 6.027456183070403 + properties: + someId: + type: number + someMap: + additionalProperties: + type: number + type: object + type: object + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http + http_signature_test: + scheme: signature + type: http + diff --git a/samples/client/petstore/java/native-jackson3/build.gradle b/samples/client/petstore/java/native-jackson3/build.gradle new file mode 100644 index 000000000000..33b1b1c2dfab --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/build.gradle @@ -0,0 +1,115 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' +apply plugin: 'com.diffplug.spotless' + +group = 'org.openapitools' +version = '1.0.0' + +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0' + } +} + +repositories { + mavenCentral() +} + +apply plugin: 'java' +apply plugin: 'maven-publish' + +sourceCompatibility = JavaVersion.VERSION_17 +targetCompatibility = JavaVersion.VERSION_17 + +// Some text from the schema is copy pasted into the source files as UTF-8 +// but the default still seems to be to use platform encoding +tasks.withType(JavaCompile) { + configure(options) { + options.encoding = 'UTF-8' + } +} +javadoc { + options.encoding = 'UTF-8' +} + +publishing { + publications { + maven(MavenPublication) { + artifactId = 'petstore-native-jackson3' + from components.java + } + } +} + +task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath +} + +task sourcesJar(type: Jar, dependsOn: classes) { + archiveClassifier = 'sources' + from sourceSets.main.allSource +} + +task javadocJar(type: Jar, dependsOn: javadoc) { + archiveClassifier = 'javadoc' + from javadoc.destinationDir +} + +artifacts { + archives sourcesJar + archives javadocJar +} + + +ext { + jackson3_version = "3.0.4" + jackson_annotations_version = "2.20" + jakarta_annotation_version = "1.3.5" + beanvalidation_version = "2.0.2" + junit_version = "5.10.2" + httpmime_version = "4.5.13" + commons_lang3_version = "3.17.0" +} + +dependencies { + implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation "tools.jackson.core:jackson-core:$jackson3_version" + implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_annotations_version" + implementation "tools.jackson.core:jackson-databind:$jackson3_version" + 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" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" +} + +test { + useJUnitPlatform() +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + java { + // don't need to set target, it is inferred from java + // apply a specific flavor of google-java-format + googleJavaFormat('1.8').aosp().reflowLongStrings() + removeUnusedImports() + importOrder() + } +} diff --git a/samples/client/petstore/java/native-jackson3/build.sbt b/samples/client/petstore/java/native-jackson3/build.sbt new file mode 100644 index 000000000000..464090415c47 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/build.sbt @@ -0,0 +1 @@ +# TODO diff --git a/samples/client/petstore/java/native-jackson3/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/native-jackson3/docs/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..83051d9be44b --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/AdditionalPropertiesClass.md @@ -0,0 +1,20 @@ + + +# AdditionalPropertiesClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**mapProperty** | **Map<String, String>** | | [optional] | +|**mapOfMapProperty** | **Map<String, Map<String, String>>** | | [optional] | +|**anytype1** | **Object** | | [optional] | +|**mapWithUndeclaredPropertiesAnytype1** | **Object** | | [optional] | +|**mapWithUndeclaredPropertiesAnytype2** | **Object** | | [optional] | +|**mapWithUndeclaredPropertiesAnytype3** | **Map<String, Object>** | | [optional] | +|**emptyMap** | **Object** | an object with no declared properties and no undeclared properties, hence it's an empty map. | [optional] | +|**mapWithUndeclaredPropertiesString** | **Map<String, String>** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/AllOfRefToDouble.md b/samples/client/petstore/java/native-jackson3/docs/AllOfRefToDouble.md new file mode 100644 index 000000000000..516584f74348 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/AllOfRefToDouble.md @@ -0,0 +1,14 @@ + + +# AllOfRefToDouble + +Object with allOf ref to double + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**height** | **Double** | Height as double | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/AllOfRefToFloat.md b/samples/client/petstore/java/native-jackson3/docs/AllOfRefToFloat.md new file mode 100644 index 000000000000..9a60af8a2ea4 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/AllOfRefToFloat.md @@ -0,0 +1,14 @@ + + +# AllOfRefToFloat + +Object with allOf ref to float + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**weight** | **Float** | Weight as float | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/AllOfRefToLong.md b/samples/client/petstore/java/native-jackson3/docs/AllOfRefToLong.md new file mode 100644 index 000000000000..0f32d49b0857 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/AllOfRefToLong.md @@ -0,0 +1,14 @@ + + +# AllOfRefToLong + +Object with allOf ref to long + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | Id as long | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/Animal.md b/samples/client/petstore/java/native-jackson3/docs/Animal.md new file mode 100644 index 000000000000..d9b32f14c88a --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/Animal.md @@ -0,0 +1,14 @@ + + +# Animal + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**className** | **String** | | | +|**color** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/AnotherFakeApi.md b/samples/client/petstore/java/native-jackson3/docs/AnotherFakeApi.md new file mode 100644 index 000000000000..4b3378322368 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/AnotherFakeApi.md @@ -0,0 +1,144 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags | +| [**call123testSpecialTagsWithHttpInfo**](AnotherFakeApi.md#call123testSpecialTagsWithHttpInfo) | **PATCH** /another-fake/dummy | To test special tags | + + + +## call123testSpecialTags + +> Client call123testSpecialTags(client) + +To test special tags + +To test special tags and operation ID starting with number + +### 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.AnotherFakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.call123testSpecialTags(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +[**Client**](Client.md) + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +## call123testSpecialTagsWithHttpInfo + +> ApiResponse call123testSpecialTagsWithHttpInfo(client) + +To test special tags + +To test special tags and operation ID starting with number + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.AnotherFakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); + Client client = new Client(); // Client | client model + try { + ApiResponse response = apiInstance.call123testSpecialTagsWithHttpInfo(client); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +ApiResponse<[**Client**](Client.md)> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java/native-jackson3/docs/Apple.md b/samples/client/petstore/java/native-jackson3/docs/Apple.md new file mode 100644 index 000000000000..0ef7a92c74d6 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/Apple.md @@ -0,0 +1,14 @@ + + +# Apple + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**cultivar** | **String** | | [optional] | +|**origin** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/AppleReq.md b/samples/client/petstore/java/native-jackson3/docs/AppleReq.md new file mode 100644 index 000000000000..989e1cfedd1e --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/AppleReq.md @@ -0,0 +1,14 @@ + + +# AppleReq + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**cultivar** | **String** | | | +|**mealy** | **Boolean** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/native-jackson3/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..0188db3eb131 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,13 @@ + + +# ArrayOfArrayOfNumberOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayArrayNumber** | **List<List<BigDecimal>>** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/native-jackson3/docs/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..a5753530aada --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/ArrayOfNumberOnly.md @@ -0,0 +1,13 @@ + + +# ArrayOfNumberOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayNumber** | **List<BigDecimal>** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/ArrayTest.md b/samples/client/petstore/java/native-jackson3/docs/ArrayTest.md new file mode 100644 index 000000000000..36077c9df300 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/ArrayTest.md @@ -0,0 +1,15 @@ + + +# ArrayTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayOfString** | **List<String>** | | [optional] | +|**arrayArrayOfInteger** | **List<List<Long>>** | | [optional] | +|**arrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/Banana.md b/samples/client/petstore/java/native-jackson3/docs/Banana.md new file mode 100644 index 000000000000..5356d17ee700 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/Banana.md @@ -0,0 +1,13 @@ + + +# Banana + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**lengthCm** | **BigDecimal** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/BananaReq.md b/samples/client/petstore/java/native-jackson3/docs/BananaReq.md new file mode 100644 index 000000000000..22ebe1a7105f --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/BananaReq.md @@ -0,0 +1,14 @@ + + +# BananaReq + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**lengthCm** | **BigDecimal** | | | +|**sweet** | **Boolean** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/BasquePig.md b/samples/client/petstore/java/native-jackson3/docs/BasquePig.md new file mode 100644 index 000000000000..160cb71c321f --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/BasquePig.md @@ -0,0 +1,13 @@ + + +# BasquePig + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**className** | **String** | | | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/Capitalization.md b/samples/client/petstore/java/native-jackson3/docs/Capitalization.md new file mode 100644 index 000000000000..82a812711de2 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/Capitalization.md @@ -0,0 +1,18 @@ + + +# Capitalization + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**smallCamel** | **String** | | [optional] | +|**capitalCamel** | **String** | | [optional] | +|**smallSnake** | **String** | | [optional] | +|**capitalSnake** | **String** | | [optional] | +|**scAETHFlowPoints** | **String** | | [optional] | +|**ATT_NAME** | **String** | Name of the pet | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/Cat.md b/samples/client/petstore/java/native-jackson3/docs/Cat.md new file mode 100644 index 000000000000..390dd519c8ce --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/Cat.md @@ -0,0 +1,13 @@ + + +# Cat + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**declawed** | **Boolean** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/Category.md b/samples/client/petstore/java/native-jackson3/docs/Category.md new file mode 100644 index 000000000000..ab6d1ec334dc --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/Category.md @@ -0,0 +1,14 @@ + + +# Category + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**name** | **String** | | | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/ChildCat.md b/samples/client/petstore/java/native-jackson3/docs/ChildCat.md new file mode 100644 index 000000000000..258d87e56998 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/ChildCat.md @@ -0,0 +1,22 @@ + + +# ChildCat + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | | [optional] | +|**petType** | [**String**](#String) | | [optional] | + + + +## Enum: String + +| Name | Value | +|---- | -----| +| CHILD_CAT | "ChildCat" | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/ClassModel.md b/samples/client/petstore/java/native-jackson3/docs/ClassModel.md new file mode 100644 index 000000000000..af46dea1f6c8 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/ClassModel.md @@ -0,0 +1,14 @@ + + +# ClassModel + +Model for testing model with \"_class\" property + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**propertyClass** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/Client.md b/samples/client/petstore/java/native-jackson3/docs/Client.md new file mode 100644 index 000000000000..ef07b4ab8b9d --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/Client.md @@ -0,0 +1,13 @@ + + +# Client + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**client** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/ComplexQuadrilateral.md b/samples/client/petstore/java/native-jackson3/docs/ComplexQuadrilateral.md new file mode 100644 index 000000000000..d0a4b1a0a758 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/ComplexQuadrilateral.md @@ -0,0 +1,14 @@ + + +# ComplexQuadrilateral + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**shapeType** | **String** | | | +|**quadrilateralType** | **String** | | | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/DanishPig.md b/samples/client/petstore/java/native-jackson3/docs/DanishPig.md new file mode 100644 index 000000000000..0b366d3cf2ff --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/DanishPig.md @@ -0,0 +1,13 @@ + + +# DanishPig + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**className** | **String** | | | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/DefaultApi.md b/samples/client/petstore/java/native-jackson3/docs/DefaultApi.md new file mode 100644 index 000000000000..7955d54b62ea --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/DefaultApi.md @@ -0,0 +1,132 @@ +# DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**fooGet**](DefaultApi.md#fooGet) | **GET** /foo | | +| [**fooGetWithHttpInfo**](DefaultApi.md#fooGetWithHttpInfo) | **GET** /foo | | + + + +## fooGet + +> FooGetDefaultResponse fooGet() + + + +### 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.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + try { + FooGetDefaultResponse result = apiInstance.fooGet(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#fooGet"); + 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 + +[**FooGetDefaultResponse**](FooGetDefaultResponse.md) + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | response | - | + +## fooGetWithHttpInfo + +> ApiResponse fooGetWithHttpInfo() + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + try { + ApiResponse response = apiInstance.fooGetWithHttpInfo(); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#fooGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +ApiResponse<[**FooGetDefaultResponse**](FooGetDefaultResponse.md)> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | response | - | + diff --git a/samples/client/petstore/java/native-jackson3/docs/DeprecatedObject.md b/samples/client/petstore/java/native-jackson3/docs/DeprecatedObject.md new file mode 100644 index 000000000000..48de1d624425 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/DeprecatedObject.md @@ -0,0 +1,13 @@ + + +# DeprecatedObject + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/Dog.md b/samples/client/petstore/java/native-jackson3/docs/Dog.md new file mode 100644 index 000000000000..972c981c0d05 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/Dog.md @@ -0,0 +1,13 @@ + + +# Dog + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**breed** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/Drawing.md b/samples/client/petstore/java/native-jackson3/docs/Drawing.md new file mode 100644 index 000000000000..6b815fc4131b --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/Drawing.md @@ -0,0 +1,16 @@ + + +# Drawing + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**mainShape** | [**Shape**](Shape.md) | | [optional] | +|**shapeOrNull** | [**ShapeOrNull**](ShapeOrNull.md) | | [optional] | +|**nullableShape** | [**NullableShape**](NullableShape.md) | | [optional] | +|**shapes** | [**List<Shape>**](Shape.md) | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/EnumArrays.md b/samples/client/petstore/java/native-jackson3/docs/EnumArrays.md new file mode 100644 index 000000000000..b2222d5beb25 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/EnumArrays.md @@ -0,0 +1,32 @@ + + +# EnumArrays + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional] | +|**arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] | + + + +## Enum: JustSymbolEnum + +| Name | Value | +|---- | -----| +| GREATER_THAN_OR_EQUAL_TO | ">=" | +| DOLLAR | "$" | + + + +## Enum: List<ArrayEnumEnum> + +| Name | Value | +|---- | -----| +| FISH | "fish" | +| CRAB | "crab" | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/EnumClass.md b/samples/client/petstore/java/native-jackson3/docs/EnumClass.md new file mode 100644 index 000000000000..b314590a7591 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/EnumClass.md @@ -0,0 +1,15 @@ + + +# EnumClass + +## Enum + + +* `_ABC` (value: `"_abc"`) + +* `_EFG` (value: `"-efg"`) + +* `_XYZ_` (value: `"(xyz)"`) + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/EnumTest.md b/samples/client/petstore/java/native-jackson3/docs/EnumTest.md new file mode 100644 index 000000000000..3e226e18b50b --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/EnumTest.md @@ -0,0 +1,68 @@ + + +# EnumTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] | +|**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | | +|**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] | +|**enumIntegerOnly** | [**EnumIntegerOnlyEnum**](#EnumIntegerOnlyEnum) | | [optional] | +|**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] | +|**outerEnum** | **OuterEnum** | | [optional] | +|**outerEnumInteger** | **OuterEnumInteger** | | [optional] | +|**outerEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] | +|**outerEnumIntegerDefaultValue** | **OuterEnumIntegerDefaultValue** | | [optional] | + + + +## Enum: EnumStringEnum + +| Name | Value | +|---- | -----| +| UPPER | "UPPER" | +| LOWER | "lower" | +| EMPTY | "" | + + + +## Enum: EnumStringRequiredEnum + +| Name | Value | +|---- | -----| +| UPPER | "UPPER" | +| LOWER | "lower" | +| EMPTY | "" | + + + +## Enum: EnumIntegerEnum + +| Name | Value | +|---- | -----| +| NUMBER_1 | 1 | +| NUMBER_MINUS_1 | -1 | + + + +## Enum: EnumIntegerOnlyEnum + +| Name | Value | +|---- | -----| +| NUMBER_2 | 2 | +| NUMBER_MINUS_2 | -2 | + + + +## Enum: EnumNumberEnum + +| Name | Value | +|---- | -----| +| NUMBER_1_DOT_1 | 1.1 | +| NUMBER_MINUS_1_DOT_2 | -1.2 | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/EquilateralTriangle.md b/samples/client/petstore/java/native-jackson3/docs/EquilateralTriangle.md new file mode 100644 index 000000000000..eade817feb3e --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/EquilateralTriangle.md @@ -0,0 +1,14 @@ + + +# EquilateralTriangle + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**shapeType** | **String** | | | +|**triangleType** | **String** | | | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/FakeApi.md b/samples/client/petstore/java/native-jackson3/docs/FakeApi.md new file mode 100644 index 000000000000..1e572ffa370b --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/FakeApi.md @@ -0,0 +1,2829 @@ +# FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**fakeBigDecimalMap**](FakeApi.md#fakeBigDecimalMap) | **GET** /fake/BigDecimalMap | | +| [**fakeBigDecimalMapWithHttpInfo**](FakeApi.md#fakeBigDecimalMapWithHttpInfo) | **GET** /fake/BigDecimalMap | | +| [**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint | +| [**fakeHealthGetWithHttpInfo**](FakeApi.md#fakeHealthGetWithHttpInfo) | **GET** /fake/health | Health check endpoint | +| [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | | +| [**fakeOuterBooleanSerializeWithHttpInfo**](FakeApi.md#fakeOuterBooleanSerializeWithHttpInfo) | **POST** /fake/outer/boolean | | +| [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | | +| [**fakeOuterCompositeSerializeWithHttpInfo**](FakeApi.md#fakeOuterCompositeSerializeWithHttpInfo) | **POST** /fake/outer/composite | | +| [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | | +| [**fakeOuterNumberSerializeWithHttpInfo**](FakeApi.md#fakeOuterNumberSerializeWithHttpInfo) | **POST** /fake/outer/number | | +| [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | | +| [**fakeOuterStringSerializeWithHttpInfo**](FakeApi.md#fakeOuterStringSerializeWithHttpInfo) | **POST** /fake/outer/string | | +| [**getApplicationJsonUtf8**](FakeApi.md#getApplicationJsonUtf8) | **GET** /fake/application_json_utf8 | application/json UTF8 | +| [**getApplicationJsonUtf8WithHttpInfo**](FakeApi.md#getApplicationJsonUtf8WithHttpInfo) | **GET** /fake/application_json_utf8 | application/json UTF8 | +| [**getArrayOfEnums**](FakeApi.md#getArrayOfEnums) | **GET** /fake/array-of-enums | Array of Enums | +| [**getArrayOfEnumsWithHttpInfo**](FakeApi.md#getArrayOfEnumsWithHttpInfo) | **GET** /fake/array-of-enums | Array of Enums | +| [**testAdditionalPropertiesReference**](FakeApi.md#testAdditionalPropertiesReference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties | +| [**testAdditionalPropertiesReferenceWithHttpInfo**](FakeApi.md#testAdditionalPropertiesReferenceWithHttpInfo) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties | +| [**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | | +| [**testBodyWithFileSchemaWithHttpInfo**](FakeApi.md#testBodyWithFileSchemaWithHttpInfo) | **PUT** /fake/body-with-file-schema | | +| [**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | | +| [**testBodyWithQueryParamsWithHttpInfo**](FakeApi.md#testBodyWithQueryParamsWithHttpInfo) | **PUT** /fake/body-with-query-params | | +| [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model | +| [**testClientModelWithHttpInfo**](FakeApi.md#testClientModelWithHttpInfo) | **PATCH** /fake | To test \"client\" model | +| [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 | +| [**testEndpointParametersWithHttpInfo**](FakeApi.md#testEndpointParametersWithHttpInfo) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 | +| [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters | +| [**testEnumParametersWithHttpInfo**](FakeApi.md#testEnumParametersWithHttpInfo) | **GET** /fake | To test enum parameters | +| [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | +| [**testGroupParametersWithHttpInfo**](FakeApi.md#testGroupParametersWithHttpInfo) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | +| [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**testInlineAdditionalPropertiesWithHttpInfo**](FakeApi.md#testInlineAdditionalPropertiesWithHttpInfo) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**testInlineFreeformAdditionalProperties**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | +| [**testInlineFreeformAdditionalPropertiesWithHttpInfo**](FakeApi.md#testInlineFreeformAdditionalPropertiesWithHttpInfo) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | +| [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data | +| [**testJsonFormDataWithHttpInfo**](FakeApi.md#testJsonFormDataWithHttpInfo) | **GET** /fake/jsonFormData | test json serialization of form data | +| [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | | +| [**testQueryParameterCollectionFormatWithHttpInfo**](FakeApi.md#testQueryParameterCollectionFormatWithHttpInfo) | **PUT** /fake/test-query-parameters | | +| [**testStringMapReference**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map | +| [**testStringMapReferenceWithHttpInfo**](FakeApi.md#testStringMapReferenceWithHttpInfo) | **POST** /fake/stringMap-reference | test referenced string map | + + + +## fakeBigDecimalMap + +> FakeBigDecimalMap200Response fakeBigDecimalMap() + + + +for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + +### 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.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + try { + FakeBigDecimalMap200Response result = apiInstance.fakeBigDecimalMap(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeBigDecimalMap"); + 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 + +[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md) + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +## fakeBigDecimalMapWithHttpInfo + +> ApiResponse fakeBigDecimalMapWithHttpInfo() + + + +for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + try { + ApiResponse response = apiInstance.fakeBigDecimalMapWithHttpInfo(); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeBigDecimalMap"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +ApiResponse<[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md)> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## fakeHealthGet + +> HealthCheckResult fakeHealthGet() + +Health check endpoint + +### 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.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + try { + HealthCheckResult result = apiInstance.fakeHealthGet(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeHealthGet"); + 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 + +[**HealthCheckResult**](HealthCheckResult.md) + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + +## fakeHealthGetWithHttpInfo + +> ApiResponse fakeHealthGetWithHttpInfo() + +Health check endpoint + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + try { + ApiResponse response = apiInstance.fakeHealthGetWithHttpInfo(); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeHealthGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +ApiResponse<[**HealthCheckResult**](HealthCheckResult.md)> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + + +## fakeOuterBooleanSerialize + +> Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### 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.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Boolean body = true; // Boolean | Input boolean as post body + try { + Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **body** | **Boolean**| Input boolean as post body | [optional] | + +### Return type + +**Boolean** + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + +## fakeOuterBooleanSerializeWithHttpInfo + +> ApiResponse fakeOuterBooleanSerializeWithHttpInfo(body) + + + +Test serialization of outer boolean types + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Boolean body = true; // Boolean | Input boolean as post body + try { + ApiResponse response = apiInstance.fakeOuterBooleanSerializeWithHttpInfo(body); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **Boolean**| Input boolean as post body | [optional] | + +### Return type + +ApiResponse<**Boolean**> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + + +## fakeOuterCompositeSerialize + +> OuterComposite fakeOuterCompositeSerialize(outerComposite) + + + +Test serialization of object with outer number type + +### 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.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body + try { + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] | + +### Return type + +[**OuterComposite**](OuterComposite.md) + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | + +## fakeOuterCompositeSerializeWithHttpInfo + +> ApiResponse fakeOuterCompositeSerializeWithHttpInfo(outerComposite) + + + +Test serialization of object with outer number type + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body + try { + ApiResponse response = apiInstance.fakeOuterCompositeSerializeWithHttpInfo(outerComposite); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] | + +### Return type + +ApiResponse<[**OuterComposite**](OuterComposite.md)> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | + + +## fakeOuterNumberSerialize + +> BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### 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.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body + try { + BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **body** | **BigDecimal**| Input number as post body | [optional] | + +### Return type + +[**BigDecimal**](BigDecimal.md) + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + +## fakeOuterNumberSerializeWithHttpInfo + +> ApiResponse fakeOuterNumberSerializeWithHttpInfo(body) + + + +Test serialization of outer number types + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body + try { + ApiResponse response = apiInstance.fakeOuterNumberSerializeWithHttpInfo(body); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **BigDecimal**| Input number as post body | [optional] | + +### Return type + +ApiResponse<[**BigDecimal**](BigDecimal.md)> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + + +## fakeOuterStringSerialize + +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### 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.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String body = "body_example"; // String | Input string as post body + try { + String result = apiInstance.fakeOuterStringSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **body** | **String**| Input string as post body | [optional] | + +### Return type + +**String** + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | + +## fakeOuterStringSerializeWithHttpInfo + +> ApiResponse fakeOuterStringSerializeWithHttpInfo(body) + + + +Test serialization of outer string types + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String body = "body_example"; // String | Input string as post body + try { + ApiResponse response = apiInstance.fakeOuterStringSerializeWithHttpInfo(body); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **String**| Input string as post body | [optional] | + +### Return type + +ApiResponse<**String**> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | + + +## getApplicationJsonUtf8 + +> List getApplicationJsonUtf8() + +application/json UTF8 + +### 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.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + try { + List result = apiInstance.getApplicationJsonUtf8(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#getApplicationJsonUtf8"); + 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 + +[**List<OuterEnum>**](OuterEnum.md) + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json;charset=utf-8 + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | test | - | + +## getApplicationJsonUtf8WithHttpInfo + +> ApiResponse> getApplicationJsonUtf8WithHttpInfo() + +application/json UTF8 + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + try { + ApiResponse> response = apiInstance.getApplicationJsonUtf8WithHttpInfo(); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#getApplicationJsonUtf8"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +ApiResponse<[**List<OuterEnum>**](OuterEnum.md)> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json;charset=utf-8 + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | test | - | + + +## getArrayOfEnums + +> List getArrayOfEnums() + +Array of Enums + +### 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.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + try { + List result = apiInstance.getArrayOfEnums(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#getArrayOfEnums"); + 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 + +[**List<OuterEnum>**](OuterEnum.md) + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got named array of enums | - | + +## getArrayOfEnumsWithHttpInfo + +> ApiResponse> getArrayOfEnumsWithHttpInfo() + +Array of Enums + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + try { + ApiResponse> response = apiInstance.getArrayOfEnumsWithHttpInfo(); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#getArrayOfEnums"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +ApiResponse<[**List<OuterEnum>**](OuterEnum.md)> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Got named array of enums | - | + + +## testAdditionalPropertiesReference + +> void testAdditionalPropertiesReference(requestBody) + +test referenced additionalProperties + + + +### 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.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = null; // Map | request body + try { + apiInstance.testAdditionalPropertiesReference(requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testAdditionalPropertiesReference"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, Object>**](Object.md)| request body | | + +### Return type + + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +## testAdditionalPropertiesReferenceWithHttpInfo + +> ApiResponse testAdditionalPropertiesReferenceWithHttpInfo(requestBody) + +test referenced additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = null; // Map | request body + try { + ApiResponse response = apiInstance.testAdditionalPropertiesReferenceWithHttpInfo(requestBody); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testAdditionalPropertiesReference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, Object>**](Object.md)| request body | | + +### Return type + + +ApiResponse + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testBodyWithFileSchema + +> void testBodyWithFileSchema(fileSchemaTestClass) + + + +For this test, the body for this request much reference a schema named `File`. + +### 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.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | + try { + apiInstance.testBodyWithFileSchema(fileSchemaTestClass); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithFileSchema"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | | + +### Return type + + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +## testBodyWithFileSchemaWithHttpInfo + +> ApiResponse testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | + try { + ApiResponse response = apiInstance.testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithFileSchema"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | | + +### Return type + + +ApiResponse + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testBodyWithQueryParams + +> void testBodyWithQueryParams(query, user) + + + +### 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.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String query = "query_example"; // String | + User user = new User(); // User | + try { + apiInstance.testBodyWithQueryParams(query, user); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **query** | **String**| | | +| **user** | [**User**](User.md)| | | + +### Return type + + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +## testBodyWithQueryParamsWithHttpInfo + +> ApiResponse testBodyWithQueryParamsWithHttpInfo(query, user) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String query = "query_example"; // String | + User user = new User(); // User | + try { + ApiResponse response = apiInstance.testBodyWithQueryParamsWithHttpInfo(query, user); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **query** | **String**| | | +| **user** | [**User**](User.md)| | | + +### Return type + + +ApiResponse + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testClientModel + +> Client testClientModel(client) + +To test \"client\" model + +To test \"client\" model + +### 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.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.testClientModel(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testClientModel"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +[**Client**](Client.md) + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +## testClientModelWithHttpInfo + +> ApiResponse testClientModelWithHttpInfo(client) + +To test \"client\" model + +To test \"client\" model + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Client client = new Client(); // Client | client model + try { + ApiResponse response = apiInstance.testClientModelWithHttpInfo(client); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testClientModel"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +ApiResponse<[**Client**](Client.md)> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testEndpointParameters + +> void testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### 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.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure HTTP basic authorization: http_basic_test + HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); + http_basic_test.setUsername("YOUR USERNAME"); + http_basic_test.setPassword("YOUR PASSWORD"); + + FakeApi apiInstance = new FakeApi(defaultClient); + BigDecimal number = new BigDecimal(78); // BigDecimal | None + Double _double = 3.4D; // Double | None + String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None + byte[] _byte = null; // byte[] | None + Integer integer = 56; // Integer | None + Integer int32 = 56; // Integer | None + Long int64 = 56L; // Long | None + Float _float = 3.4F; // Float | None + String string = "string_example"; // String | None + File binary = new File("/path/to/file"); // File | None + LocalDate date = LocalDate.now(); // LocalDate | None + OffsetDateTime dateTime = OffsetDateTime.parse("2010-02-01T10:20:10.111110+01:00"); // OffsetDateTime | None + String password = "password_example"; // String | None + String paramCallback = "paramCallback_example"; // String | None + try { + apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEndpointParameters"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **number** | **BigDecimal**| None | | +| **_double** | **Double**| None | | +| **patternWithoutDelimiter** | **String**| None | | +| **_byte** | **byte[]**| None | | +| **integer** | **Integer**| None | [optional] | +| **int32** | **Integer**| None | [optional] | +| **int64** | **Long**| None | [optional] | +| **_float** | **Float**| None | [optional] | +| **string** | **String**| None | [optional] | +| **binary** | **File**| None | [optional] | +| **date** | **LocalDate**| None | [optional] | +| **dateTime** | **OffsetDateTime**| None | [optional] [default to 2010-02-01T10:20:10.111110+01:00] | +| **password** | **String**| None | [optional] | +| **paramCallback** | **String**| None | [optional] | + +### Return type + + +null (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + +## testEndpointParametersWithHttpInfo + +> ApiResponse testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure HTTP basic authorization: http_basic_test + HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); + http_basic_test.setUsername("YOUR USERNAME"); + http_basic_test.setPassword("YOUR PASSWORD"); + + FakeApi apiInstance = new FakeApi(defaultClient); + BigDecimal number = new BigDecimal(78); // BigDecimal | None + Double _double = 3.4D; // Double | None + String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None + byte[] _byte = null; // byte[] | None + Integer integer = 56; // Integer | None + Integer int32 = 56; // Integer | None + Long int64 = 56L; // Long | None + Float _float = 3.4F; // Float | None + String string = "string_example"; // String | None + File binary = new File("/path/to/file"); // File | None + LocalDate date = LocalDate.now(); // LocalDate | None + OffsetDateTime dateTime = OffsetDateTime.parse("2010-02-01T10:20:10.111110+01:00"); // OffsetDateTime | None + String password = "password_example"; // String | None + String paramCallback = "paramCallback_example"; // String | None + try { + ApiResponse response = apiInstance.testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEndpointParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **number** | **BigDecimal**| None | | +| **_double** | **Double**| None | | +| **patternWithoutDelimiter** | **String**| None | | +| **_byte** | **byte[]**| None | | +| **integer** | **Integer**| None | [optional] | +| **int32** | **Integer**| None | [optional] | +| **int64** | **Long**| None | [optional] | +| **_float** | **Float**| None | [optional] | +| **string** | **String**| None | [optional] | +| **binary** | **File**| None | [optional] | +| **date** | **LocalDate**| None | [optional] | +| **dateTime** | **OffsetDateTime**| None | [optional] [default to 2010-02-01T10:20:10.111110+01:00] | +| **password** | **String**| None | [optional] | +| **paramCallback** | **String**| None | [optional] | + +### Return type + + +ApiResponse + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## testEnumParameters + +> void testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### 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.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) + List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumFormStringArray = Arrays.asList("$"); // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) + try { + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEnumParameters"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] | +| **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | +| **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] | +| **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | +| **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] | +| **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] | +| **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] | +| **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | + +### Return type + + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + +## testEnumParametersWithHttpInfo + +> ApiResponse testEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) + List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumFormStringArray = Arrays.asList("$"); // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) + try { + ApiResponse response = apiInstance.testEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEnumParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] | +| **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | +| **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] | +| **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | +| **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] | +| **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] | +| **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] | +| **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | + +### Return type + + +ApiResponse + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + + +## testGroupParameters + +> void testGroupParameters(testGroupParametersRequest) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### 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.FakeApi; +import org.openapitools.client.api.FakeApi.*; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure HTTP bearer authorization: bearer_test + HttpBearerAuth bearer_test = (HttpBearerAuth) defaultClient.getAuthentication("bearer_test"); + bearer_test.setBearerToken("BEARER TOKEN"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Integer requiredStringGroup = 56; // Integer | Required String in group parameters + Boolean requiredBooleanGroup = true; // Boolean | Required Boolean in group parameters + Long requiredInt64Group = 56L; // Long | Required Integer in group parameters + Integer stringGroup = 56; // Integer | String in group parameters + Boolean booleanGroup = true; // Boolean | Boolean in group parameters + Long int64Group = 56L; // Long | Integer in group parameters + try { + APItestGroupParametersRequest request = APItestGroupParametersRequest.newBuilder() + .requiredStringGroup(requiredStringGroup) + .requiredBooleanGroup(requiredBooleanGroup) + .requiredInt64Group(requiredInt64Group) + .stringGroup(stringGroup) + .booleanGroup(booleanGroup) + .int64Group(int64Group) + .build(); + apiInstance.testGroupParameters(request); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testGroupParameters"); + 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 | +|------------- | ------------- | ------------- | -------------| +| testGroupParametersRequest | [**APItestGroupParametersRequest**](FakeApi.md#APItestGroupParametersRequest)|-|-| + +### Return type + + +null (empty response body) + +### Authorization + +[bearer_test](../README.md#bearer_test) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Something wrong | - | + +## testGroupParametersWithHttpInfo + +> ApiResponse testGroupParametersWithHttpInfo(testGroupParametersRequest) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; +import org.openapitools.client.api.FakeApi.*; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure HTTP bearer authorization: bearer_test + HttpBearerAuth bearer_test = (HttpBearerAuth) defaultClient.getAuthentication("bearer_test"); + bearer_test.setBearerToken("BEARER TOKEN"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Integer requiredStringGroup = 56; // Integer | Required String in group parameters + Boolean requiredBooleanGroup = true; // Boolean | Required Boolean in group parameters + Long requiredInt64Group = 56L; // Long | Required Integer in group parameters + Integer stringGroup = 56; // Integer | String in group parameters + Boolean booleanGroup = true; // Boolean | Boolean in group parameters + Long int64Group = 56L; // Long | Integer in group parameters + try { + APItestGroupParametersRequest request = APItestGroupParametersRequest.newBuilder() + .requiredStringGroup(requiredStringGroup) + .requiredBooleanGroup(requiredBooleanGroup) + .requiredInt64Group(requiredInt64Group) + .stringGroup(stringGroup) + .booleanGroup(booleanGroup) + .int64Group(int64Group) + .build(); + ApiResponse response = apiInstance.testGroupParametersWithHttpInfo(request); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testGroupParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| testGroupParametersRequest | [**APItestGroupParametersRequest**](FakeApi.md#APItestGroupParametersRequest)|-|-| + +### Return type + + +ApiResponse + +### Authorization + +[bearer_test](../README.md#bearer_test) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Something wrong | - | + + + +## APItestGroupParametersRequest +### Properties + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | -------------| +| **requiredStringGroup** | **Integer** | Required String in group parameters | | +| **requiredBooleanGroup** | **Boolean** | Required Boolean in group parameters | | +| **requiredInt64Group** | **Long** | Required Integer in group parameters | | +| **stringGroup** | **Integer** | String in group parameters | [optional] | +| **booleanGroup** | **Boolean** | Boolean in group parameters | [optional] | +| **int64Group** | **Long** | Integer in group parameters | [optional] | + + + +## testInlineAdditionalProperties + +> void testInlineAdditionalProperties(requestBody) + +test inline additionalProperties + + + +### 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.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + apiInstance.testInlineAdditionalProperties(requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.md)| request body | | + +### Return type + + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +## testInlineAdditionalPropertiesWithHttpInfo + +> ApiResponse testInlineAdditionalPropertiesWithHttpInfo(requestBody) + +test inline additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + ApiResponse response = apiInstance.testInlineAdditionalPropertiesWithHttpInfo(requestBody); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.md)| request body | | + +### Return type + + +ApiResponse + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testInlineFreeformAdditionalProperties + +> void testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### 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.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + try { + apiInstance.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineFreeformAdditionalProperties"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | | + +### Return type + + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +## testInlineFreeformAdditionalPropertiesWithHttpInfo + +> ApiResponse testInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + try { + ApiResponse response = apiInstance.testInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineFreeformAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body | | + +### Return type + + +ApiResponse + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testJsonFormData + +> void testJsonFormData(param, param2) + +test json serialization of 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.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String param = "param_example"; // String | field1 + String param2 = "param2_example"; // String | field2 + try { + apiInstance.testJsonFormData(param, param2); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testJsonFormData"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **param** | **String**| field1 | | +| **param2** | **String**| field2 | | + +### Return type + + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +## testJsonFormDataWithHttpInfo + +> ApiResponse testJsonFormDataWithHttpInfo(param, param2) + +test json serialization of form data + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String param = "param_example"; // String | field1 + String param2 = "param2_example"; // String | field2 + try { + ApiResponse response = apiInstance.testJsonFormDataWithHttpInfo(param, param2); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testJsonFormData"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **param** | **String**| field1 | | +| **param2** | **String**| field2 | | + +### Return type + + +ApiResponse + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testQueryParameterCollectionFormat + +> void testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### 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.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **pipe** | [**List<String>**](String.md)| | | +| **ioutil** | [**List<String>**](String.md)| | | +| **http** | [**List<String>**](String.md)| | | +| **url** | [**List<String>**](String.md)| | | +| **context** | [**List<String>**](String.md)| | | + +### Return type + + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + +## testQueryParameterCollectionFormatWithHttpInfo + +> ApiResponse testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + ApiResponse response = apiInstance.testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pipe** | [**List<String>**](String.md)| | | +| **ioutil** | [**List<String>**](String.md)| | | +| **http** | [**List<String>**](String.md)| | | +| **url** | [**List<String>**](String.md)| | | +| **context** | [**List<String>**](String.md)| | | + +### Return type + + +ApiResponse + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testStringMapReference + +> void testStringMapReference(requestBody) + +test referenced string map + + + +### 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.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + apiInstance.testStringMapReference(requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testStringMapReference"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.md)| request body | | + +### Return type + + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +## testStringMapReferenceWithHttpInfo + +> ApiResponse testStringMapReferenceWithHttpInfo(requestBody) + +test referenced string map + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + ApiResponse response = apiInstance.testStringMapReferenceWithHttpInfo(requestBody); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testStringMapReference"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.md)| request body | | + +### Return type + + +ApiResponse + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java/native-jackson3/docs/FakeBigDecimalMap200Response.md b/samples/client/petstore/java/native-jackson3/docs/FakeBigDecimalMap200Response.md new file mode 100644 index 000000000000..475be1d2d738 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/FakeBigDecimalMap200Response.md @@ -0,0 +1,14 @@ + + +# FakeBigDecimalMap200Response + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someId** | **BigDecimal** | | [optional] | +|**someMap** | **Map<String, BigDecimal>** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/native-jackson3/docs/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..a5611e635a15 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/FakeClassnameTags123Api.md @@ -0,0 +1,158 @@ +# FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case | +| [**testClassnameWithHttpInfo**](FakeClassnameTags123Api.md#testClassnameWithHttpInfo) | **PATCH** /fake_classname_test | To test class name in snake case | + + + +## testClassname + +> Client testClassname(client) + +To test class name in snake case + +To test class name in snake case + +### 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.FakeClassnameTags123Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key_query + ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query"); + api_key_query.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key_query.setApiKeyPrefix("Token"); + + FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.testClassname(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +[**Client**](Client.md) + + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +## testClassnameWithHttpInfo + +> ApiResponse testClassnameWithHttpInfo(client) + +To test class name in snake case + +To test class name in snake case + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeClassnameTags123Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key_query + ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query"); + api_key_query.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key_query.setApiKeyPrefix("Token"); + + FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(defaultClient); + Client client = new Client(); // Client | client model + try { + ApiResponse response = apiInstance.testClassnameWithHttpInfo(client); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +ApiResponse<[**Client**](Client.md)> + + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java/native-jackson3/docs/FileSchemaTestClass.md b/samples/client/petstore/java/native-jackson3/docs/FileSchemaTestClass.md new file mode 100644 index 000000000000..85d1a0636694 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/FileSchemaTestClass.md @@ -0,0 +1,14 @@ + + +# FileSchemaTestClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_file** | [**ModelFile**](ModelFile.md) | | [optional] | +|**files** | [**List<ModelFile>**](ModelFile.md) | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/Foo.md b/samples/client/petstore/java/native-jackson3/docs/Foo.md new file mode 100644 index 000000000000..6b3f0556528a --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/Foo.md @@ -0,0 +1,13 @@ + + +# Foo + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bar** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/FooGetDefaultResponse.md b/samples/client/petstore/java/native-jackson3/docs/FooGetDefaultResponse.md new file mode 100644 index 000000000000..ff3d7a3a56c3 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/FooGetDefaultResponse.md @@ -0,0 +1,13 @@ + + +# FooGetDefaultResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**string** | [**Foo**](Foo.md) | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/FormatTest.md b/samples/client/petstore/java/native-jackson3/docs/FormatTest.md new file mode 100644 index 000000000000..01b8c777ae06 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/FormatTest.md @@ -0,0 +1,28 @@ + + +# FormatTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**integer** | **Integer** | | [optional] | +|**int32** | **Integer** | | [optional] | +|**int64** | **Long** | | [optional] | +|**number** | **BigDecimal** | | | +|**_float** | **Float** | | [optional] | +|**_double** | **Double** | | [optional] | +|**decimal** | **BigDecimal** | | [optional] | +|**string** | **String** | | [optional] | +|**_byte** | **byte[]** | | | +|**binary** | **File** | | [optional] | +|**date** | **LocalDate** | | | +|**dateTime** | **OffsetDateTime** | | [optional] | +|**uuid** | **UUID** | | [optional] | +|**password** | **String** | | | +|**patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] | +|**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/Fruit.md b/samples/client/petstore/java/native-jackson3/docs/Fruit.md new file mode 100644 index 000000000000..41b3152250e1 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/Fruit.md @@ -0,0 +1,37 @@ + + +# Fruit + +## oneOf schemas +* [Apple](Apple.md) +* [Banana](Banana.md) + +## Example +```java +// Import classes: +import org.openapitools.client.model.Fruit; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; + +public class Example { + public static void main(String[] args) { + Fruit exampleFruit = new Fruit(); + + // create a new Apple + Apple exampleApple = new Apple(); + // set Fruit to Apple + exampleFruit.setActualInstance(exampleApple); + // to get back the Apple set earlier + Apple testApple = (Apple) exampleFruit.getActualInstance(); + + // create a new Banana + Banana exampleBanana = new Banana(); + // set Fruit to Banana + exampleFruit.setActualInstance(exampleBanana); + // to get back the Banana set earlier + Banana testBanana = (Banana) exampleFruit.getActualInstance(); + } +} +``` + + diff --git a/samples/client/petstore/java/native-jackson3/docs/FruitReq.md b/samples/client/petstore/java/native-jackson3/docs/FruitReq.md new file mode 100644 index 000000000000..3927b7acded2 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/FruitReq.md @@ -0,0 +1,37 @@ + + +# FruitReq + +## oneOf schemas +* [AppleReq](AppleReq.md) +* [BananaReq](BananaReq.md) + +## Example +```java +// Import classes: +import org.openapitools.client.model.FruitReq; +import org.openapitools.client.model.AppleReq; +import org.openapitools.client.model.BananaReq; + +public class Example { + public static void main(String[] args) { + FruitReq exampleFruitReq = new FruitReq(); + + // create a new AppleReq + AppleReq exampleAppleReq = new AppleReq(); + // set FruitReq to AppleReq + exampleFruitReq.setActualInstance(exampleAppleReq); + // to get back the AppleReq set earlier + AppleReq testAppleReq = (AppleReq) exampleFruitReq.getActualInstance(); + + // create a new BananaReq + BananaReq exampleBananaReq = new BananaReq(); + // set FruitReq to BananaReq + exampleFruitReq.setActualInstance(exampleBananaReq); + // to get back the BananaReq set earlier + BananaReq testBananaReq = (BananaReq) exampleFruitReq.getActualInstance(); + } +} +``` + + diff --git a/samples/client/petstore/java/native-jackson3/docs/GmFruit.md b/samples/client/petstore/java/native-jackson3/docs/GmFruit.md new file mode 100644 index 000000000000..c9dc50b92cb7 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/GmFruit.md @@ -0,0 +1,37 @@ + + +# GmFruit + +## anyOf schemas +* [Apple](Apple.md) +* [Banana](Banana.md) + +## Example +```java +// Import classes: +import org.openapitools.client.model.GmFruit; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; + +public class Example { + public static void main(String[] args) { + GmFruit exampleGmFruit = new GmFruit(); + + // create a new Apple + Apple exampleApple = new Apple(); + // set GmFruit to Apple + exampleGmFruit.setActualInstance(exampleApple); + // to get back the Apple set earlier + Apple testApple = (Apple) exampleGmFruit.getActualInstance(); + + // create a new Banana + Banana exampleBanana = new Banana(); + // set GmFruit to Banana + exampleGmFruit.setActualInstance(exampleBanana); + // to get back the Banana set earlier + Banana testBanana = (Banana) exampleGmFruit.getActualInstance(); + } +} +``` + + diff --git a/samples/client/petstore/java/native-jackson3/docs/GrandparentAnimal.md b/samples/client/petstore/java/native-jackson3/docs/GrandparentAnimal.md new file mode 100644 index 000000000000..9737408f2724 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/GrandparentAnimal.md @@ -0,0 +1,13 @@ + + +# GrandparentAnimal + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**petType** | **String** | | | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/native-jackson3/docs/HasOnlyReadOnly.md new file mode 100644 index 000000000000..29da5205dbba --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/HasOnlyReadOnly.md @@ -0,0 +1,14 @@ + + +# HasOnlyReadOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bar** | **String** | | [optional] [readonly] | +|**foo** | **String** | | [optional] [readonly] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/HealthCheckResult.md b/samples/client/petstore/java/native-jackson3/docs/HealthCheckResult.md new file mode 100644 index 000000000000..4885e6f1cada --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/HealthCheckResult.md @@ -0,0 +1,14 @@ + + +# HealthCheckResult + +Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**nullableMessage** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/IsoscelesTriangle.md b/samples/client/petstore/java/native-jackson3/docs/IsoscelesTriangle.md new file mode 100644 index 000000000000..0bd5045bc68f --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/IsoscelesTriangle.md @@ -0,0 +1,14 @@ + + +# IsoscelesTriangle + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**shapeType** | **String** | | | +|**triangleType** | **String** | | | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/Mammal.md b/samples/client/petstore/java/native-jackson3/docs/Mammal.md new file mode 100644 index 000000000000..11bbff5e2ba9 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/Mammal.md @@ -0,0 +1,46 @@ + + +# Mammal + +## oneOf schemas +* [Pig](Pig.md) +* [Whale](Whale.md) +* [Zebra](Zebra.md) + +## Example +```java +// Import classes: +import org.openapitools.client.model.Mammal; +import org.openapitools.client.model.Pig; +import org.openapitools.client.model.Whale; +import org.openapitools.client.model.Zebra; + +public class Example { + public static void main(String[] args) { + Mammal exampleMammal = new Mammal(); + + // create a new Pig + Pig examplePig = new Pig(); + // set Mammal to Pig + exampleMammal.setActualInstance(examplePig); + // to get back the Pig set earlier + Pig testPig = (Pig) exampleMammal.getActualInstance(); + + // create a new Whale + Whale exampleWhale = new Whale(); + // set Mammal to Whale + exampleMammal.setActualInstance(exampleWhale); + // to get back the Whale set earlier + Whale testWhale = (Whale) exampleMammal.getActualInstance(); + + // create a new Zebra + Zebra exampleZebra = new Zebra(); + // set Mammal to Zebra + exampleMammal.setActualInstance(exampleZebra); + // to get back the Zebra set earlier + Zebra testZebra = (Zebra) exampleMammal.getActualInstance(); + } +} +``` + + diff --git a/samples/client/petstore/java/native-jackson3/docs/MapTest.md b/samples/client/petstore/java/native-jackson3/docs/MapTest.md new file mode 100644 index 000000000000..54380188e1d6 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/MapTest.md @@ -0,0 +1,25 @@ + + +# MapTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**mapMapOfString** | **Map<String, Map<String, String>>** | | [optional] | +|**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] | +|**directMap** | **Map<String, Boolean>** | | [optional] | +|**indirectMap** | **Map<String, Boolean>** | | [optional] | + + + +## Enum: Map<String, InnerEnum> + +| Name | Value | +|---- | -----| +| UPPER | "UPPER" | +| LOWER | "lower" | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/native-jackson3/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..a5ddf0faa6a9 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,15 @@ + + +# MixedPropertiesAndAdditionalPropertiesClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**uuid** | **UUID** | | [optional] | +|**dateTime** | **OffsetDateTime** | | [optional] | +|**map** | [**Map<String, Animal>**](Animal.md) | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/Model200Response.md b/samples/client/petstore/java/native-jackson3/docs/Model200Response.md new file mode 100644 index 000000000000..109411580c62 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/Model200Response.md @@ -0,0 +1,15 @@ + + +# Model200Response + +Model for testing model name starting with number + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **Integer** | | [optional] | +|**propertyClass** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/ModelApiResponse.md b/samples/client/petstore/java/native-jackson3/docs/ModelApiResponse.md new file mode 100644 index 000000000000..e374c2dd2dec --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/ModelApiResponse.md @@ -0,0 +1,15 @@ + + +# ModelApiResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Integer** | | [optional] | +|**type** | **String** | | [optional] | +|**message** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/ModelFile.md b/samples/client/petstore/java/native-jackson3/docs/ModelFile.md new file mode 100644 index 000000000000..adcde984f527 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**sourceURI** | **String** | Test capitalization | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/ModelList.md b/samples/client/petstore/java/native-jackson3/docs/ModelList.md new file mode 100644 index 000000000000..f93ab7dde8d4 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_123list** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/ModelReturn.md b/samples/client/petstore/java/native-jackson3/docs/ModelReturn.md new file mode 100644 index 000000000000..0bd356861eb7 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/ModelReturn.md @@ -0,0 +1,14 @@ + + +# ModelReturn + +Model for testing reserved words + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_return** | **Integer** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/Name.md b/samples/client/petstore/java/native-jackson3/docs/Name.md new file mode 100644 index 000000000000..c901d9435309 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/Name.md @@ -0,0 +1,17 @@ + + +# Name + +Model for testing model name same as property name + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **Integer** | | | +|**snakeCase** | **Integer** | | [optional] [readonly] | +|**property** | **String** | | [optional] | +|**_123number** | **Integer** | | [optional] [readonly] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/NullableClass.md b/samples/client/petstore/java/native-jackson3/docs/NullableClass.md new file mode 100644 index 000000000000..fa98c5c6d984 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/NullableClass.md @@ -0,0 +1,24 @@ + + +# NullableClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**integerProp** | **Integer** | | [optional] | +|**numberProp** | **BigDecimal** | | [optional] | +|**booleanProp** | **Boolean** | | [optional] | +|**stringProp** | **String** | | [optional] | +|**dateProp** | **LocalDate** | | [optional] | +|**datetimeProp** | **OffsetDateTime** | | [optional] | +|**arrayNullableProp** | **List<Object>** | | [optional] | +|**arrayAndItemsNullableProp** | **List<Object>** | | [optional] | +|**arrayItemsNullable** | **List<Object>** | | [optional] | +|**objectNullableProp** | **Map<String, Object>** | | [optional] | +|**objectAndItemsNullableProp** | **Map<String, Object>** | | [optional] | +|**objectItemsNullable** | **Map<String, Object>** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/NullableShape.md b/samples/client/petstore/java/native-jackson3/docs/NullableShape.md new file mode 100644 index 000000000000..60c45b268406 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/NullableShape.md @@ -0,0 +1,41 @@ + + +# NullableShape + +The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1. + +## oneOf schemas +* [Quadrilateral](Quadrilateral.md) +* [Triangle](Triangle.md) + +NOTE: this class is nullable. + +## Example +```java +// Import classes: +import org.openapitools.client.model.NullableShape; +import org.openapitools.client.model.Quadrilateral; +import org.openapitools.client.model.Triangle; + +public class Example { + public static void main(String[] args) { + NullableShape exampleNullableShape = new NullableShape(); + + // create a new Quadrilateral + Quadrilateral exampleQuadrilateral = new Quadrilateral(); + // set NullableShape to Quadrilateral + exampleNullableShape.setActualInstance(exampleQuadrilateral); + // to get back the Quadrilateral set earlier + Quadrilateral testQuadrilateral = (Quadrilateral) exampleNullableShape.getActualInstance(); + + // create a new Triangle + Triangle exampleTriangle = new Triangle(); + // set NullableShape to Triangle + exampleNullableShape.setActualInstance(exampleTriangle); + // to get back the Triangle set earlier + Triangle testTriangle = (Triangle) exampleNullableShape.getActualInstance(); + } +} +``` + + diff --git a/samples/client/petstore/java/native-jackson3/docs/NumberOnly.md b/samples/client/petstore/java/native-jackson3/docs/NumberOnly.md new file mode 100644 index 000000000000..b8ed1a4cfae1 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/NumberOnly.md @@ -0,0 +1,13 @@ + + +# NumberOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**justNumber** | **BigDecimal** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/ObjectWithDeprecatedFields.md b/samples/client/petstore/java/native-jackson3/docs/ObjectWithDeprecatedFields.md new file mode 100644 index 000000000000..f1cf571f4c09 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/ObjectWithDeprecatedFields.md @@ -0,0 +1,16 @@ + + +# ObjectWithDeprecatedFields + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**uuid** | **String** | | [optional] | +|**id** | **BigDecimal** | | [optional] | +|**deprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] | +|**bars** | **List<String>** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/Order.md b/samples/client/petstore/java/native-jackson3/docs/Order.md new file mode 100644 index 000000000000..27af32855c5c --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/Order.md @@ -0,0 +1,28 @@ + + +# Order + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**petId** | **Long** | | [optional] | +|**quantity** | **Integer** | | [optional] | +|**shipDate** | **OffsetDateTime** | | [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/native-jackson3/docs/OuterComposite.md b/samples/client/petstore/java/native-jackson3/docs/OuterComposite.md new file mode 100644 index 000000000000..98b56e0763ff --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/OuterComposite.md @@ -0,0 +1,15 @@ + + +# OuterComposite + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**myNumber** | **BigDecimal** | | [optional] | +|**myString** | **String** | | [optional] | +|**myBoolean** | **Boolean** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/OuterEnum.md b/samples/client/petstore/java/native-jackson3/docs/OuterEnum.md new file mode 100644 index 000000000000..1f9b723eb8e7 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/OuterEnum.md @@ -0,0 +1,15 @@ + + +# OuterEnum + +## Enum + + +* `PLACED` (value: `"placed"`) + +* `APPROVED` (value: `"approved"`) + +* `DELIVERED` (value: `"delivered"`) + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/OuterEnumDefaultValue.md b/samples/client/petstore/java/native-jackson3/docs/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..cbc7f4ba54d2 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/OuterEnumDefaultValue.md @@ -0,0 +1,15 @@ + + +# OuterEnumDefaultValue + +## Enum + + +* `PLACED` (value: `"placed"`) + +* `APPROVED` (value: `"approved"`) + +* `DELIVERED` (value: `"delivered"`) + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/OuterEnumInteger.md b/samples/client/petstore/java/native-jackson3/docs/OuterEnumInteger.md new file mode 100644 index 000000000000..f71dea30ad00 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/OuterEnumInteger.md @@ -0,0 +1,15 @@ + + +# OuterEnumInteger + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/java/native-jackson3/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..99e6389f4278 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,15 @@ + + +# OuterEnumIntegerDefaultValue + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/ParentPet.md b/samples/client/petstore/java/native-jackson3/docs/ParentPet.md new file mode 100644 index 000000000000..4992b88a6710 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/ParentPet.md @@ -0,0 +1,12 @@ + + +# ParentPet + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/Pet.md b/samples/client/petstore/java/native-jackson3/docs/Pet.md new file mode 100644 index 000000000000..08dfd8623602 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/Pet.md @@ -0,0 +1,28 @@ + + +# Pet + + +## 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/native-jackson3/docs/PetApi.md b/samples/client/petstore/java/native-jackson3/docs/PetApi.md new file mode 100644 index 000000000000..a6b14f0ddf79 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/PetApi.md @@ -0,0 +1,1366 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store | +| [**addPetWithHttpInfo**](PetApi.md#addPetWithHttpInfo) | **POST** /pet | Add a new pet to the store | +| [**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet | +| [**deletePetWithHttpInfo**](PetApi.md#deletePetWithHttpInfo) | **DELETE** /pet/{petId} | Deletes a pet | +| [**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status | +| [**findPetsByStatusWithHttpInfo**](PetApi.md#findPetsByStatusWithHttpInfo) | **GET** /pet/findByStatus | Finds Pets by status | +| [**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags | +| [**findPetsByTagsWithHttpInfo**](PetApi.md#findPetsByTagsWithHttpInfo) | **GET** /pet/findByTags | Finds Pets by tags | +| [**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID | +| [**getPetByIdWithHttpInfo**](PetApi.md#getPetByIdWithHttpInfo) | **GET** /pet/{petId} | Find pet by ID | +| [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet | +| [**updatePetWithHttpInfo**](PetApi.md#updatePetWithHttpInfo) | **PUT** /pet | Update an existing pet | +| [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data | +| [**updatePetWithFormWithHttpInfo**](PetApi.md#updatePetWithFormWithHttpInfo) | **POST** /pet/{petId} | Updates a pet in the store with form data | +| [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image | +| [**uploadFileWithHttpInfo**](PetApi.md#uploadFileWithHttpInfo) | **POST** /pet/{petId}/uploadImage | uploads an image | +| [**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) | +| [**uploadFileWithRequiredFileWithHttpInfo**](PetApi.md#uploadFileWithRequiredFileWithHttpInfo) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) | + + + +## addPet + +> void 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:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + + PetApi apiInstance = new PetApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + try { + apiInstance.addPet(pet); + } 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 + + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + +## addPetWithHttpInfo + +> ApiResponse addPetWithHttpInfo(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.ApiResponse; +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:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + + PetApi apiInstance = new PetApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + try { + ApiResponse response = apiInstance.addPetWithHttpInfo(pet); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#addPet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | + +### Return type + + +ApiResponse + +### Authorization + +[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **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:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | Pet id to delete + String apiKey = "apiKey_example"; // String | + try { + apiInstance.deletePet(petId, apiKey); + } 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 + + +null (empty response body) + +### 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 | - | + +## deletePetWithHttpInfo + +> ApiResponse deletePetWithHttpInfo(petId, apiKey) + +Deletes a pet + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +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:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | Pet id to delete + String apiKey = "apiKey_example"; // String | + try { + ApiResponse response = apiInstance.deletePetWithHttpInfo(petId, apiKey); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#deletePet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| Pet id to delete | | +| **apiKey** | **String**| | [optional] | + +### Return type + + +ApiResponse + +### 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 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:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + + PetApi apiInstance = new PetApi(defaultClient); + List status = Arrays.asList("available"); // List | Status values that need to be considered for filter + try { + 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_signature_test](../README.md#http_signature_test) + +### 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 | - | + +## findPetsByStatusWithHttpInfo + +> ApiResponse> findPetsByStatusWithHttpInfo(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.ApiResponse; +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:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + + PetApi apiInstance = new PetApi(defaultClient); + List status = Arrays.asList("available"); // List | Status values that need to be considered for filter + try { + ApiResponse> response = apiInstance.findPetsByStatusWithHttpInfo(status); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByStatus"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + 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 + +ApiResponse<[**List<Pet>**](Pet.md)> + + +### Authorization + +[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) + +### 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 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:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + + PetApi apiInstance = new PetApi(defaultClient); + List tags = Arrays.asList(); // List | Tags to filter by + try { + 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_signature_test](../README.md#http_signature_test) + +### 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 | - | + +## findPetsByTagsWithHttpInfo + +> ApiResponse> findPetsByTagsWithHttpInfo(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.ApiResponse; +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:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + + PetApi apiInstance = new PetApi(defaultClient); + List tags = Arrays.asList(); // List | Tags to filter by + try { + ApiResponse> response = apiInstance.findPetsByTagsWithHttpInfo(tags); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tags** | [**List<String>**](String.md)| Tags to filter by | | + +### Return type + +ApiResponse<[**List<Pet>**](Pet.md)> + + +### Authorization + +[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) + +### 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:80/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 | - | + +## getPetByIdWithHttpInfo + +> ApiResponse getPetByIdWithHttpInfo(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.ApiResponse; +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:80/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 { + ApiResponse response = apiInstance.getPetByIdWithHttpInfo(petId); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#getPetById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet to return | | + +### Return type + +ApiResponse<[**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 + +> void 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:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + + PetApi apiInstance = new PetApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + try { + apiInstance.updatePet(pet); + } 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 + + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + +## updatePetWithHttpInfo + +> ApiResponse updatePetWithHttpInfo(pet) + +Update an existing pet + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +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:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + + PetApi apiInstance = new PetApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + try { + ApiResponse response = apiInstance.updatePetWithHttpInfo(pet); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#updatePet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | + +### Return type + + +ApiResponse + +### Authorization + +[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **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:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet 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 { + apiInstance.updatePetWithForm(petId, name, status); + } 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 + + +null (empty response body) + +### 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 | - | + +## updatePetWithFormWithHttpInfo + +> ApiResponse updatePetWithFormWithHttpInfo(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.ApiResponse; +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:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet 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 { + ApiResponse response = apiInstance.updatePetWithFormWithHttpInfo(petId, name, status); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#updatePetWithForm"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + 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 + + +ApiResponse + +### 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:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to update + 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 | - | + +## uploadFileWithHttpInfo + +> ApiResponse uploadFileWithHttpInfo(petId, additionalMetadata, _file) + +uploads an image + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +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:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to update + String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server + File _file = new File("/path/to/file"); // File | file to upload + try { + ApiResponse response = apiInstance.uploadFileWithHttpInfo(petId, additionalMetadata, _file); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#uploadFile"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + 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 + +ApiResponse<[**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 | - | + + +## uploadFileWithRequiredFile + +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + + + +### 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:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to update + File requiredFile = new File("/path/to/file"); // File | file to upload + String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server + try { + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet to update | | +| **requiredFile** | **File**| file to upload | | +| **additionalMetadata** | **String**| Additional data to pass to server | [optional] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +## uploadFileWithRequiredFileWithHttpInfo + +> ApiResponse uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata) + +uploads an image (required) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +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:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to update + File requiredFile = new File("/path/to/file"); // File | file to upload + String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server + try { + ApiResponse response = apiInstance.uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet to update | | +| **requiredFile** | **File**| file to upload | | +| **additionalMetadata** | **String**| Additional data to pass to server | [optional] | + +### Return type + +ApiResponse<[**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/native-jackson3/docs/Pig.md b/samples/client/petstore/java/native-jackson3/docs/Pig.md new file mode 100644 index 000000000000..f0a92bbe61b8 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/Pig.md @@ -0,0 +1,37 @@ + + +# Pig + +## oneOf schemas +* [BasquePig](BasquePig.md) +* [DanishPig](DanishPig.md) + +## Example +```java +// Import classes: +import org.openapitools.client.model.Pig; +import org.openapitools.client.model.BasquePig; +import org.openapitools.client.model.DanishPig; + +public class Example { + public static void main(String[] args) { + Pig examplePig = new Pig(); + + // create a new BasquePig + BasquePig exampleBasquePig = new BasquePig(); + // set Pig to BasquePig + examplePig.setActualInstance(exampleBasquePig); + // to get back the BasquePig set earlier + BasquePig testBasquePig = (BasquePig) examplePig.getActualInstance(); + + // create a new DanishPig + DanishPig exampleDanishPig = new DanishPig(); + // set Pig to DanishPig + examplePig.setActualInstance(exampleDanishPig); + // to get back the DanishPig set earlier + DanishPig testDanishPig = (DanishPig) examplePig.getActualInstance(); + } +} +``` + + diff --git a/samples/client/petstore/java/native-jackson3/docs/Quadrilateral.md b/samples/client/petstore/java/native-jackson3/docs/Quadrilateral.md new file mode 100644 index 000000000000..83ffea0c742f --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/Quadrilateral.md @@ -0,0 +1,37 @@ + + +# Quadrilateral + +## oneOf schemas +* [ComplexQuadrilateral](ComplexQuadrilateral.md) +* [SimpleQuadrilateral](SimpleQuadrilateral.md) + +## Example +```java +// Import classes: +import org.openapitools.client.model.Quadrilateral; +import org.openapitools.client.model.ComplexQuadrilateral; +import org.openapitools.client.model.SimpleQuadrilateral; + +public class Example { + public static void main(String[] args) { + Quadrilateral exampleQuadrilateral = new Quadrilateral(); + + // create a new ComplexQuadrilateral + ComplexQuadrilateral exampleComplexQuadrilateral = new ComplexQuadrilateral(); + // set Quadrilateral to ComplexQuadrilateral + exampleQuadrilateral.setActualInstance(exampleComplexQuadrilateral); + // to get back the ComplexQuadrilateral set earlier + ComplexQuadrilateral testComplexQuadrilateral = (ComplexQuadrilateral) exampleQuadrilateral.getActualInstance(); + + // create a new SimpleQuadrilateral + SimpleQuadrilateral exampleSimpleQuadrilateral = new SimpleQuadrilateral(); + // set Quadrilateral to SimpleQuadrilateral + exampleQuadrilateral.setActualInstance(exampleSimpleQuadrilateral); + // to get back the SimpleQuadrilateral set earlier + SimpleQuadrilateral testSimpleQuadrilateral = (SimpleQuadrilateral) exampleQuadrilateral.getActualInstance(); + } +} +``` + + diff --git a/samples/client/petstore/java/native-jackson3/docs/QuadrilateralInterface.md b/samples/client/petstore/java/native-jackson3/docs/QuadrilateralInterface.md new file mode 100644 index 000000000000..99451f3bd020 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/QuadrilateralInterface.md @@ -0,0 +1,13 @@ + + +# QuadrilateralInterface + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**quadrilateralType** | **String** | | | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/ReadOnlyFirst.md b/samples/client/petstore/java/native-jackson3/docs/ReadOnlyFirst.md new file mode 100644 index 000000000000..ad6af7ee155f --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/ReadOnlyFirst.md @@ -0,0 +1,14 @@ + + +# ReadOnlyFirst + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bar** | **String** | | [optional] [readonly] | +|**baz** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/ScaleneTriangle.md b/samples/client/petstore/java/native-jackson3/docs/ScaleneTriangle.md new file mode 100644 index 000000000000..c578f6cbfaab --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/ScaleneTriangle.md @@ -0,0 +1,14 @@ + + +# ScaleneTriangle + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**shapeType** | **String** | | | +|**triangleType** | **String** | | | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/Shape.md b/samples/client/petstore/java/native-jackson3/docs/Shape.md new file mode 100644 index 000000000000..9c237eefb048 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/Shape.md @@ -0,0 +1,37 @@ + + +# Shape + +## oneOf schemas +* [Quadrilateral](Quadrilateral.md) +* [Triangle](Triangle.md) + +## Example +```java +// Import classes: +import org.openapitools.client.model.Shape; +import org.openapitools.client.model.Quadrilateral; +import org.openapitools.client.model.Triangle; + +public class Example { + public static void main(String[] args) { + Shape exampleShape = new Shape(); + + // create a new Quadrilateral + Quadrilateral exampleQuadrilateral = new Quadrilateral(); + // set Shape to Quadrilateral + exampleShape.setActualInstance(exampleQuadrilateral); + // to get back the Quadrilateral set earlier + Quadrilateral testQuadrilateral = (Quadrilateral) exampleShape.getActualInstance(); + + // create a new Triangle + Triangle exampleTriangle = new Triangle(); + // set Shape to Triangle + exampleShape.setActualInstance(exampleTriangle); + // to get back the Triangle set earlier + Triangle testTriangle = (Triangle) exampleShape.getActualInstance(); + } +} +``` + + diff --git a/samples/client/petstore/java/native-jackson3/docs/ShapeInterface.md b/samples/client/petstore/java/native-jackson3/docs/ShapeInterface.md new file mode 100644 index 000000000000..b4f981e3b566 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/ShapeInterface.md @@ -0,0 +1,13 @@ + + +# ShapeInterface + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**shapeType** | **String** | | | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/ShapeOrNull.md b/samples/client/petstore/java/native-jackson3/docs/ShapeOrNull.md new file mode 100644 index 000000000000..0bb9b8b9025f --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/ShapeOrNull.md @@ -0,0 +1,39 @@ + + +# ShapeOrNull + +The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. + +## oneOf schemas +* [Quadrilateral](Quadrilateral.md) +* [Triangle](Triangle.md) + +## Example +```java +// Import classes: +import org.openapitools.client.model.ShapeOrNull; +import org.openapitools.client.model.Quadrilateral; +import org.openapitools.client.model.Triangle; + +public class Example { + public static void main(String[] args) { + ShapeOrNull exampleShapeOrNull = new ShapeOrNull(); + + // create a new Quadrilateral + Quadrilateral exampleQuadrilateral = new Quadrilateral(); + // set ShapeOrNull to Quadrilateral + exampleShapeOrNull.setActualInstance(exampleQuadrilateral); + // to get back the Quadrilateral set earlier + Quadrilateral testQuadrilateral = (Quadrilateral) exampleShapeOrNull.getActualInstance(); + + // create a new Triangle + Triangle exampleTriangle = new Triangle(); + // set ShapeOrNull to Triangle + exampleShapeOrNull.setActualInstance(exampleTriangle); + // to get back the Triangle set earlier + Triangle testTriangle = (Triangle) exampleShapeOrNull.getActualInstance(); + } +} +``` + + diff --git a/samples/client/petstore/java/native-jackson3/docs/SimpleQuadrilateral.md b/samples/client/petstore/java/native-jackson3/docs/SimpleQuadrilateral.md new file mode 100644 index 000000000000..52fb7d1a6a49 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/SimpleQuadrilateral.md @@ -0,0 +1,14 @@ + + +# SimpleQuadrilateral + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**shapeType** | **String** | | | +|**quadrilateralType** | **String** | | | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/SpecialModelName.md b/samples/client/petstore/java/native-jackson3/docs/SpecialModelName.md new file mode 100644 index 000000000000..e17d0d797b7f --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/SpecialModelName.md @@ -0,0 +1,14 @@ + + +# SpecialModelName + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**$specialPropertyName** | **Long** | | [optional] | +|**specialModelName** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/StoreApi.md b/samples/client/petstore/java/native-jackson3/docs/StoreApi.md new file mode 100644 index 000000000000..9cb90ed4b1a9 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/StoreApi.md @@ -0,0 +1,564 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID | +| [**deleteOrderWithHttpInfo**](StoreApi.md#deleteOrderWithHttpInfo) | **DELETE** /store/order/{order_id} | Delete purchase order by ID | +| [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status | +| [**getInventoryWithHttpInfo**](StoreApi.md#getInventoryWithHttpInfo) | **GET** /store/inventory | Returns pet inventories by status | +| [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID | +| [**getOrderByIdWithHttpInfo**](StoreApi.md#getOrderByIdWithHttpInfo) | **GET** /store/order/{order_id} | Find purchase order by ID | +| [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet | +| [**placeOrderWithHttpInfo**](StoreApi.md#placeOrderWithHttpInfo) | **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:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + String orderId = "orderId_example"; // String | ID of the order that needs to be deleted + try { + apiInstance.deleteOrder(orderId); + } 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 + + +null (empty response body) + +### 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 | - | + +## deleteOrderWithHttpInfo + +> ApiResponse deleteOrderWithHttpInfo(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.ApiResponse; +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:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + String orderId = "orderId_example"; // String | ID of the order that needs to be deleted + try { + ApiResponse response = apiInstance.deleteOrderWithHttpInfo(orderId); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#deleteOrder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | **String**| ID of the order that needs to be deleted | | + +### Return type + + +ApiResponse + +### 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 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:80/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 | - | + +## getInventoryWithHttpInfo + +> ApiResponse> getInventoryWithHttpInfo() + +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.ApiResponse; +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:80/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 { + ApiResponse> response = apiInstance.getInventoryWithHttpInfo(); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getInventory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +ApiResponse<**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:80/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 | - | + +## getOrderByIdWithHttpInfo + +> ApiResponse getOrderByIdWithHttpInfo(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.ApiResponse; +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:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + Long orderId = 56L; // Long | ID of pet that needs to be fetched + try { + ApiResponse response = apiInstance.getOrderByIdWithHttpInfo(orderId); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getOrderById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | **Long**| ID of pet that needs to be fetched | | + +### Return type + +ApiResponse<[**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:80/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 | - | + +## placeOrderWithHttpInfo + +> ApiResponse placeOrderWithHttpInfo(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.ApiResponse; +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:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + Order order = new Order(); // Order | order placed for purchasing the pet + try { + ApiResponse response = apiInstance.placeOrderWithHttpInfo(order); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#placeOrder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **order** | [**Order**](Order.md)| order placed for purchasing the pet | | + +### Return type + +ApiResponse<[**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/native-jackson3/docs/Tag.md b/samples/client/petstore/java/native-jackson3/docs/Tag.md new file mode 100644 index 000000000000..5088b2dd1c31 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/Tag.md @@ -0,0 +1,14 @@ + + +# Tag + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**name** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/java/native-jackson3/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 000000000000..dc066e6c7dac --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,13 @@ + + +# TestInlineFreeformAdditionalPropertiesRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someProperty** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/Triangle.md b/samples/client/petstore/java/native-jackson3/docs/Triangle.md new file mode 100644 index 000000000000..daf9d153ff61 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/Triangle.md @@ -0,0 +1,46 @@ + + +# Triangle + +## oneOf schemas +* [EquilateralTriangle](EquilateralTriangle.md) +* [IsoscelesTriangle](IsoscelesTriangle.md) +* [ScaleneTriangle](ScaleneTriangle.md) + +## Example +```java +// Import classes: +import org.openapitools.client.model.Triangle; +import org.openapitools.client.model.EquilateralTriangle; +import org.openapitools.client.model.IsoscelesTriangle; +import org.openapitools.client.model.ScaleneTriangle; + +public class Example { + public static void main(String[] args) { + Triangle exampleTriangle = new Triangle(); + + // create a new EquilateralTriangle + EquilateralTriangle exampleEquilateralTriangle = new EquilateralTriangle(); + // set Triangle to EquilateralTriangle + exampleTriangle.setActualInstance(exampleEquilateralTriangle); + // to get back the EquilateralTriangle set earlier + EquilateralTriangle testEquilateralTriangle = (EquilateralTriangle) exampleTriangle.getActualInstance(); + + // create a new IsoscelesTriangle + IsoscelesTriangle exampleIsoscelesTriangle = new IsoscelesTriangle(); + // set Triangle to IsoscelesTriangle + exampleTriangle.setActualInstance(exampleIsoscelesTriangle); + // to get back the IsoscelesTriangle set earlier + IsoscelesTriangle testIsoscelesTriangle = (IsoscelesTriangle) exampleTriangle.getActualInstance(); + + // create a new ScaleneTriangle + ScaleneTriangle exampleScaleneTriangle = new ScaleneTriangle(); + // set Triangle to ScaleneTriangle + exampleTriangle.setActualInstance(exampleScaleneTriangle); + // to get back the ScaleneTriangle set earlier + ScaleneTriangle testScaleneTriangle = (ScaleneTriangle) exampleTriangle.getActualInstance(); + } +} +``` + + diff --git a/samples/client/petstore/java/native-jackson3/docs/TriangleInterface.md b/samples/client/petstore/java/native-jackson3/docs/TriangleInterface.md new file mode 100644 index 000000000000..ef5fc7575f34 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/TriangleInterface.md @@ -0,0 +1,13 @@ + + +# TriangleInterface + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**triangleType** | **String** | | | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/User.md b/samples/client/petstore/java/native-jackson3/docs/User.md new file mode 100644 index 000000000000..9e97dc35485f --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/User.md @@ -0,0 +1,24 @@ + + +# User + + +## 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] | +|**objectWithNoDeclaredProps** | **Object** | test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. | [optional] | +|**objectWithNoDeclaredPropsNullable** | **Object** | test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. | [optional] | +|**anyTypeProp** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 | [optional] | +|**anyTypePropNullable** | **Object** | test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. | [optional] | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/UserApi.md b/samples/client/petstore/java/native-jackson3/docs/UserApi.md new file mode 100644 index 000000000000..5529a388da69 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/UserApi.md @@ -0,0 +1,1094 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createUser**](UserApi.md#createUser) | **POST** /user | Create user | +| [**createUserWithHttpInfo**](UserApi.md#createUserWithHttpInfo) | **POST** /user | Create user | +| [**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array | +| [**createUsersWithArrayInputWithHttpInfo**](UserApi.md#createUsersWithArrayInputWithHttpInfo) | **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 | +| [**createUsersWithListInputWithHttpInfo**](UserApi.md#createUsersWithListInputWithHttpInfo) | **POST** /user/createWithList | Creates list of users with given input array | +| [**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user | +| [**deleteUserWithHttpInfo**](UserApi.md#deleteUserWithHttpInfo) | **DELETE** /user/{username} | Delete user | +| [**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name | +| [**getUserByNameWithHttpInfo**](UserApi.md#getUserByNameWithHttpInfo) | **GET** /user/{username} | Get user by user name | +| [**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system | +| [**loginUserWithHttpInfo**](UserApi.md#loginUserWithHttpInfo) | **GET** /user/login | Logs user into the system | +| [**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session | +| [**logoutUserWithHttpInfo**](UserApi.md#logoutUserWithHttpInfo) | **GET** /user/logout | Logs out current logged in user session | +| [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user | +| [**updateUserWithHttpInfo**](UserApi.md#updateUserWithHttpInfo) | **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.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:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + User user = new User(); // User | Created user object + try { + apiInstance.createUser(user); + } 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 + + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +## createUserWithHttpInfo + +> ApiResponse createUserWithHttpInfo(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.ApiResponse; +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:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + User user = new User(); // User | Created user object + try { + ApiResponse response = apiInstance.createUserWithHttpInfo(user); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | [**User**](User.md)| Created user object | | + +### Return type + + +ApiResponse + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | 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.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:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + List user = Arrays.asList(); // List | List of user object + try { + apiInstance.createUsersWithArrayInput(user); + } 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 + + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +## createUsersWithArrayInputWithHttpInfo + +> ApiResponse createUsersWithArrayInputWithHttpInfo(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.ApiResponse; +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:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + List user = Arrays.asList(); // List | List of user object + try { + ApiResponse response = apiInstance.createUsersWithArrayInputWithHttpInfo(user); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | [**List<User>**](User.md)| List of user object | | + +### Return type + + +ApiResponse + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | 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.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:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + List user = Arrays.asList(); // List | List of user object + try { + apiInstance.createUsersWithListInput(user); + } 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 + + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +## createUsersWithListInputWithHttpInfo + +> ApiResponse createUsersWithListInputWithHttpInfo(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.ApiResponse; +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:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + List user = Arrays.asList(); // List | List of user object + try { + ApiResponse response = apiInstance.createUsersWithListInputWithHttpInfo(user); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithListInput"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | [**List<User>**](User.md)| List of user object | | + +### Return type + + +ApiResponse + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | 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.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:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The name that needs to be deleted + try { + apiInstance.deleteUser(username); + } 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 + + +null (empty response body) + +### Authorization + +No authorization required + +### 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 | - | + +## deleteUserWithHttpInfo + +> ApiResponse deleteUserWithHttpInfo(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.ApiResponse; +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:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The name that needs to be deleted + try { + ApiResponse response = apiInstance.deleteUserWithHttpInfo(username); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#deleteUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| The name that needs to be deleted | | + +### Return type + + +ApiResponse + +### Authorization + +No authorization required + +### 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:80/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 | - | + +## getUserByNameWithHttpInfo + +> ApiResponse getUserByNameWithHttpInfo(username) + +Get user by user name + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +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:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. + try { + ApiResponse response = apiInstance.getUserByNameWithHttpInfo(username); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#getUserByName"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| The name that needs to be fetched. Use user1 for testing. | | + +### Return type + +ApiResponse<[**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:80/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 | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **400** | Invalid username/password supplied | - | + +## loginUserWithHttpInfo + +> ApiResponse loginUserWithHttpInfo(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.ApiResponse; +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:80/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 { + ApiResponse response = apiInstance.loginUserWithHttpInfo(username, password); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#loginUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + 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 + +ApiResponse<**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 | * 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.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:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + try { + apiInstance.logoutUser(); + } 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 + + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + +## logoutUserWithHttpInfo + +> ApiResponse logoutUserWithHttpInfo() + +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.ApiResponse; +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:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + try { + ApiResponse response = apiInstance.logoutUserWithHttpInfo(); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#logoutUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + + +ApiResponse + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | 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.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:80/v2"); + + 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 { + apiInstance.updateUser(username, user); + } 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 + + +null (empty response body) + +### Authorization + +No authorization required + +### 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 | - | + +## updateUserWithHttpInfo + +> ApiResponse updateUserWithHttpInfo(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.ApiResponse; +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:80/v2"); + + 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 { + ApiResponse response = apiInstance.updateUserWithHttpInfo(username, user); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#updateUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| name that need to be deleted | | +| **user** | [**User**](User.md)| Updated user object | | + +### Return type + + +ApiResponse + +### Authorization + +No authorization required + +### 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/native-jackson3/docs/Whale.md b/samples/client/petstore/java/native-jackson3/docs/Whale.md new file mode 100644 index 000000000000..30ce4bb82151 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/Whale.md @@ -0,0 +1,15 @@ + + +# Whale + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**hasBaleen** | **Boolean** | | [optional] | +|**hasTeeth** | **Boolean** | | [optional] | +|**className** | **String** | | | + + + diff --git a/samples/client/petstore/java/native-jackson3/docs/Zebra.md b/samples/client/petstore/java/native-jackson3/docs/Zebra.md new file mode 100644 index 000000000000..f7c4389b6456 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/docs/Zebra.md @@ -0,0 +1,24 @@ + + +# Zebra + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | | [optional] | +|**className** | **String** | | | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| PLAINS | "plains" | +| MOUNTAIN | "mountain" | +| GREVYS | "grevys" | + + + diff --git a/samples/client/petstore/java/native-jackson3/git_push.sh b/samples/client/petstore/java/native-jackson3/git_push.sh new file mode 100644 index 000000000000..f53a75d4fabe --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/java/native-jackson3/gradle.properties b/samples/client/petstore/java/native-jackson3/gradle.properties new file mode 100644 index 000000000000..a3408578278a --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/gradle.properties @@ -0,0 +1,6 @@ +# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator). +# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option. +# +# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties +# For example, uncomment below to build for Android +#target = android diff --git a/samples/client/petstore/java/native-jackson3/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/native-jackson3/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 000000000000..e6441136f3d4 Binary files /dev/null and b/samples/client/petstore/java/native-jackson3/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/native-jackson3/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/native-jackson3/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000000..b82aa23a4f05 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/native-jackson3/gradlew b/samples/client/petstore/java/native-jackson3/gradlew new file mode 100644 index 000000000000..9d0ce634cb11 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/gradlew @@ -0,0 +1,249 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while +APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path +[ -h "$app_path" ] +do +ls=$( ls -ld "$app_path" ) +link=${ls#*' -> '} +case $link in #( +/*) app_path=$link ;; #( +*) app_path=$APP_HOME$link ;; +esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { +echo "$*" +} >&2 + +die () { +echo +echo "$*" +echo +exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( +CYGWIN* ) cygwin=true ;; #( +Darwin* ) darwin=true ;; #( +MSYS* | MINGW* ) msys=true ;; #( +NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then +if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# IBM's JDK on AIX uses strange locations for the executables +JAVACMD=$JAVA_HOME/jre/sh/java +else +JAVACMD=$JAVA_HOME/bin/java +fi +if [ ! -x "$JAVACMD" ] ; then +die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +else +JAVACMD=java +if ! command -v java >/dev/null 2>&1 +then +die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then +case $MAX_FD in #( +max*) +# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +MAX_FD=$( ulimit -H -n ) || +warn "Could not query maximum file descriptor limit" +esac +case $MAX_FD in #( +'' | soft) :;; #( +*) +# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. +# shellcheck disable=SC2039,SC3045 +ulimit -n "$MAX_FD" || +warn "Could not set maximum file descriptor limit to $MAX_FD" +esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then +APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) +CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + +JAVACMD=$( cygpath --unix "$JAVACMD" ) + +# Now convert the arguments - kludge to limit ourselves to /bin/sh +for arg do +if +case $arg in #( +-*) false ;; # don't mess with options #( +/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath +[ -e "$t" ] ;; #( +*) false ;; +esac +then +arg=$( cygpath --path --ignore --mixed "$arg" ) +fi +# Roll the args list around exactly as many times as the number of +# args, so each arg winds up back in the position where it started, but +# possibly modified. +# +# NB: a `for` loop captures its iteration list before it begins, so +# changing the positional parameters here affects neither the number of +# iterations, nor the values presented in `arg`. +shift # remove old arg +set -- "$@" "$arg" # push replacement arg +done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ +"-Dorg.gradle.appname=$APP_BASE_NAME" \ +-classpath "$CLASSPATH" \ +org.gradle.wrapper.GradleWrapperMain \ +"$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then +die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( +printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | +xargs -n1 | +sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | +tr '\n' ' ' +)" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/native-jackson3/gradlew.bat b/samples/client/petstore/java/native-jackson3/gradlew.bat new file mode 100644 index 000000000000..25da30dbdeee --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/gradlew.bat @@ -0,0 +1,92 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/samples/client/petstore/java/native-jackson3/pom.xml b/samples/client/petstore/java/native-jackson3/pom.xml new file mode 100644 index 000000000000..75b82acf922d --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/pom.xml @@ -0,0 +1,263 @@ + + 4.0.0 + org.openapitools + petstore-native-jackson3 + jar + petstore-native-jackson3 + 1.0.0 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + maven-enforcer-plugin + 3.1.0 + + + enforce-maven + + enforce + + + + + 3 + + + 11 + + + + + + + + maven-surefire-plugin + 3.2.5 + + + conf/log4j.properties + + -Xms512m -Xmx1500m + methods + 10 + + + + maven-dependency-plugin + 3.3.0 + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.3.0 + + + + test-jar + + + + + + + + maven-compiler-plugin + 3.10.1 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadocs + + jar + + + + + + maven-source-plugin + 3.2.1 + + + attach-sources + + jar-no-fork + + + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + + + .gitignore + + + + + + true + 4 + + + + + + + + + + 1.8 + + true + + + + + + + + + + + + sign-artifacts + + + + maven-gpg-plugin + 3.0.1 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + + + tools.jackson.core + jackson-core + ${jackson3-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-annotations-version} + + + tools.jackson.core + jackson-databind + ${jackson3-version} + + + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} + provided + + + org.apache.httpcomponents + httpmime + ${httpmime-version} + + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + + + org.junit.jupiter + junit-jupiter-api + ${junit-version} + test + + + + + UTF-8 + 17 + 17 + 3.0.4 + 2.20 + 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-jackson3/settings.gradle b/samples/client/petstore/java/native-jackson3/settings.gradle new file mode 100644 index 000000000000..41dbecaac46c --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "petstore-native-jackson3" \ No newline at end of file diff --git a/samples/client/petstore/java/native-jackson3/src/main/AndroidManifest.xml b/samples/client/petstore/java/native-jackson3/src/main/AndroidManifest.xml new file mode 100644 index 000000000000..54fbcb3da1e8 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 000000000000..68a838b165a9 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,485 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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; + +import com.fasterxml.jackson.annotation.JsonInclude; +import tools.jackson.databind.DeserializationFeature; +import tools.jackson.databind.ObjectMapper; +import tools.jackson.databind.SerializationFeature; + +import java.io.InputStream; +import java.io.IOException; +import java.net.URI; +import java.net.URLEncoder; +import java.net.http.HttpClient; +import java.net.http.HttpConnectTimeoutException; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.StringJoiner; +import java.util.function.Consumer; +import java.util.Optional; +import java.util.zip.GZIPInputStream; +import java.util.stream.Collectors; + +import static java.nio.charset.StandardCharsets.UTF_8; + +/** + * Configuration and utility class for API clients. + * + *

This class can be constructed and modified, then used to instantiate the + * various API classes. The API classes use the settings in this class to + * configure themselves, but otherwise do not store a link to this class.

+ * + *

This class is mutable and not synchronized, so it is not thread-safe. + * The API classes generated from this are immutable and thread-safe.

+ * + *

The setter methods of this class return the current object to facilitate + * a fluent style of configuration.

+ */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class ApiClient { + + protected HttpClient.Builder builder; + protected ObjectMapper mapper; + protected String scheme; + protected String host; + protected int port; + protected String basePath; + protected Consumer interceptor; + protected Consumer> responseInterceptor; + protected Consumer> asyncResponseInterceptor; + protected Duration readTimeout; + protected Duration connectTimeout; + + public static String valueToString(Object value) { + if (value == null) { + return ""; + } + if (value instanceof OffsetDateTime) { + return ((OffsetDateTime) value).format(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + return value.toString(); + } + + /** + * URL encode a string in the UTF-8 encoding. + * + * @param s String to encode. + * @return URL-encoded representation of the input string. + */ + public static String urlEncode(String s) { + return URLEncoder.encode(s, UTF_8).replaceAll("\\+", "%20"); + } + + /** + * Convert a URL query name/value parameter to a list of encoded {@link Pair} + * objects. + * + *

The value can be null, in which case an empty list is returned.

+ * + * @param name The query name parameter. + * @param value The query value, which may not be a collection but may be + * null. + * @return A singleton list of the {@link Pair} objects representing the input + * parameters, which is encoded for use in a URL. If the value is null, an + * empty list is returned. + */ + public static List parameterToPairs(String name, Object value) { + if (name == null || name.isEmpty() || value == null) { + return Collections.emptyList(); + } + return Collections.singletonList(new Pair(urlEncode(name), urlEncode(valueToString(value)))); + } + + /** + * Convert a URL query name/collection parameter to a list of encoded + * {@link Pair} objects. + * + * @param collectionFormat The swagger collectionFormat string (csv, tsv, etc). + * @param name The query name parameter. + * @param values A collection of values for the given query name, which may be + * null. + * @return A list of {@link Pair} objects representing the input parameters, + * which is encoded for use in a URL. If the values collection is null, an + * empty list is returned. + */ + public static List parameterToPairs( + String collectionFormat, String name, Collection values) { + if (name == null || name.isEmpty() || values == null || values.isEmpty()) { + return Collections.emptyList(); + } + + // get the collection format (default: csv) + String format = collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat; + + // create the params based on the collection format + if ("multi".equals(format)) { + return values.stream() + .map(value -> new Pair(urlEncode(name), urlEncode(valueToString(value)))) + .collect(Collectors.toList()); + } + + String delimiter; + switch(format) { + case "csv": + delimiter = urlEncode(","); + break; + case "ssv": + delimiter = urlEncode(" "); + break; + case "tsv": + delimiter = urlEncode("\t"); + break; + case "pipes": + delimiter = urlEncode("|"); + break; + default: + throw new IllegalArgumentException("Illegal collection format: " + collectionFormat); + } + + StringJoiner joiner = new StringJoiner(delimiter); + for (Object value : values) { + joiner.add(urlEncode(valueToString(value))); + } + + return Collections.singletonList(new Pair(urlEncode(name), joiner.toString())); + } + + /** + * Create an instance of ApiClient. + */ + public ApiClient() { + this.builder = createDefaultHttpClientBuilder(); + this.mapper = createDefaultObjectMapper(); + updateBaseUri("http://petstore.swagger.io:80/v2"); + interceptor = null; + readTimeout = null; + connectTimeout = null; + responseInterceptor = null; + asyncResponseInterceptor = null; + } + + /** + * Create an instance of ApiClient. + * + * @param builder Http client builder. + * @param mapper Object mapper. + * @param baseUri Base URI + */ + public ApiClient(HttpClient.Builder builder, ObjectMapper mapper, String baseUri) { + this.builder = builder; + this.mapper = mapper; + updateBaseUri(baseUri != null ? baseUri : "http://petstore.swagger.io:80/v2"); + interceptor = null; + readTimeout = null; + connectTimeout = null; + responseInterceptor = null; + asyncResponseInterceptor = null; + } + + public static ObjectMapper createDefaultObjectMapper() { + ObjectMapper mapper = new ObjectMapper(); + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); + mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); + mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); + mapper.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE); + // FIXME: JsonNullableModule is not yet available for Jackson 3 + mapper.registerModule(new RFC3339JavaTimeModule()); + return mapper; + } + + protected final String getDefaultBaseUri() { + return basePath; + } + + public static HttpClient.Builder createDefaultHttpClientBuilder() { + return HttpClient.newBuilder(); + } + + public final void updateBaseUri(String baseUri) { + URI uri = URI.create(baseUri); + scheme = uri.getScheme(); + host = uri.getHost(); + port = uri.getPort(); + basePath = uri.getRawPath(); + } + + /** + * Set a custom {@link HttpClient.Builder} object to use when creating the + * {@link HttpClient} that is used by the API client. + * + * @param builder Custom client builder. + * @return This object. + */ + public ApiClient setHttpClientBuilder(HttpClient.Builder builder) { + this.builder = builder; + return this; + } + + /** + * Get an {@link HttpClient} based on the current {@link HttpClient.Builder}. + * + *

The returned object is immutable and thread-safe.

+ * + * @return The HTTP client. + */ + public HttpClient getHttpClient() { + return builder.build(); + } + + /** + * Set a custom {@link ObjectMapper} to serialize and deserialize the request + * and response bodies. + * + * @param mapper Custom object mapper. + * @return This object. + */ + public ApiClient setObjectMapper(ObjectMapper mapper) { + this.mapper = mapper; + return this; + } + + /** + * Get a copy of the current {@link ObjectMapper}. + * + * @return A copy of the current object mapper. + */ + public ObjectMapper getObjectMapper() { + return mapper.copy(); + } + + /** + * Set a custom host name for the target service. + * + * @param host The host name of the target service. + * @return This object. + */ + public ApiClient setHost(String host) { + this.host = host; + return this; + } + + /** + * Set a custom port number for the target service. + * + * @param port The port of the target service. Set this to -1 to reset the + * value to the default for the scheme. + * @return This object. + */ + public ApiClient setPort(int port) { + this.port = port; + return this; + } + + /** + * Set a custom base path for the target service, for example '/v2'. + * + * @param basePath The base path against which the rest of the path is + * resolved. + * @return This object. + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } + + /** + * Get the base URI to resolve the endpoint paths against. + * + * @return The complete base URI that the rest of the API parameters are + * resolved against. + */ + public String getBaseUri() { + return scheme + "://" + host + (port == -1 ? "" : ":" + port) + basePath; + } + + /** + * Set a custom scheme for the target service, for example 'https'. + * + * @param scheme The scheme of the target service + * @return This object. + */ + public ApiClient setScheme(String scheme){ + this.scheme = scheme; + return this; + } + + /** + * Set a custom request interceptor. + * + *

A request interceptor is a mechanism for altering each request before it + * is sent. After the request has been fully configured but not yet built, the + * request builder is passed into this function for further modification, + * after which it is sent out.

+ * + *

This is useful for altering the requests in a custom manner, such as + * adding headers. It could also be used for logging and monitoring.

+ * + * @param interceptor A function invoked before creating each request. A value + * of null resets the interceptor to a no-op. + * @return This object. + */ + public ApiClient setRequestInterceptor(Consumer interceptor) { + this.interceptor = interceptor; + return this; + } + + /** + * Get the custom interceptor. + * + * @return The custom interceptor that was set, or null if there isn't any. + */ + public Consumer getRequestInterceptor() { + return interceptor; + } + + /** + * Set a custom response interceptor. + * + *

This is useful for logging, monitoring or extraction of header variables

+ * + * @param interceptor A function invoked before creating each request. A value + * of null resets the interceptor to a no-op. + * @return This object. + */ + public ApiClient setResponseInterceptor(Consumer> interceptor) { + this.responseInterceptor = interceptor; + return this; + } + + /** + * Get the custom response interceptor. + * + * @return The custom interceptor that was set, or null if there isn't any. + */ + public Consumer> getResponseInterceptor() { + return responseInterceptor; + } + + /** + * Set a custom async response interceptor. Use this interceptor when asyncNative is set to 'true'. + * + *

This is useful for logging, monitoring or extraction of header variables

+ * + * @param interceptor A function invoked before creating each request. A value + * of null resets the interceptor to a no-op. + * @return This object. + */ + public ApiClient setAsyncResponseInterceptor(Consumer> interceptor) { + this.asyncResponseInterceptor = interceptor; + return this; + } + + /** + * Get the custom async response interceptor. Use this interceptor when asyncNative is set to 'true'. + * + * @return The custom interceptor that was set, or null if there isn't any. + */ + public Consumer> getAsyncResponseInterceptor() { + return asyncResponseInterceptor; + } + + /** + * Set the read timeout for the http client. + * + *

This is the value used by default for each request, though it can be + * overridden on a per-request basis with a request interceptor.

+ * + * @param readTimeout The read timeout used by default by the http client. + * Setting this value to null resets the timeout to an + * effectively infinite value. + * @return This object. + */ + public ApiClient setReadTimeout(Duration readTimeout) { + this.readTimeout = readTimeout; + return this; + } + + /** + * Get the read timeout that was set. + * + * @return The read timeout, or null if no timeout was set. Null represents + * an infinite wait time. + */ + public Duration getReadTimeout() { + return readTimeout; + } + /** + * Sets the connect timeout (in milliseconds) for the http client. + * + *

In the case where a new connection needs to be established, if + * the connection cannot be established within the given {@code + * duration}, then {@link HttpClient#send(HttpRequest,BodyHandler) + * HttpClient::send} throws an {@link HttpConnectTimeoutException}, or + * {@link HttpClient#sendAsync(HttpRequest,BodyHandler) + * HttpClient::sendAsync} completes exceptionally with an + * {@code HttpConnectTimeoutException}. If a new connection does not + * need to be established, for example if a connection can be reused + * from a previous request, then this timeout duration has no effect. + * + * @param connectTimeout connection timeout in milliseconds + * + * @return This object. + */ + public ApiClient setConnectTimeout(Duration connectTimeout) { + this.connectTimeout = connectTimeout; + this.builder.connectTimeout(connectTimeout); + return this; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public Duration getConnectTimeout() { + return connectTimeout; + } + + /** + * Returns the response body InputStream, transparently decoding gzip-compressed + * payloads when the server sets {@code Content-Encoding: gzip}. + * + * @param response HTTP response whose body should be consumed + * @return Original or decompressed InputStream for the response body + * @throws IOException if the response body cannot be accessed or wrapping fails + */ + public static InputStream getResponseBody(HttpResponse response) throws IOException { + if (response == null) { + return null; + } + InputStream body = response.body(); + if (body == null) { + return null; + } + Optional encoding = response.headers().firstValue("Content-Encoding"); + if (encoding.isPresent()) { + for (String token : encoding.get().split(",")) { + if ("gzip".equalsIgnoreCase(token.trim())) { + return new GZIPInputStream(body, 8192); + } + } + } + return body; + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 000000000000..a109032ff4ca --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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; + +import java.net.http.HttpHeaders; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class ApiException extends Exception { + private static final long serialVersionUID = 1L; + + private int code = 0; + private HttpHeaders responseHeaders = null; + private String responseBody = null; + + public ApiException() {} + + public ApiException(Throwable throwable) { + super(throwable); + } + + public ApiException(String message) { + super(message); + } + + public ApiException(String message, Throwable throwable, int code, HttpHeaders responseHeaders, String responseBody) { + super(message, throwable); + this.code = code; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + public ApiException(String message, int code, HttpHeaders responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(String message, Throwable throwable, int code, HttpHeaders responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + public ApiException(int code, HttpHeaders responseHeaders, String responseBody) { + this((String) null, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + public ApiException(int code, String message, HttpHeaders responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return Headers as an HttpHeaders object + */ + public HttpHeaders getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } +} diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ApiResponse.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 000000000000..f239ba115cd0 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,60 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + * + * @param The type of data that is deserialized from response body + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } + + public int getStatusCode() { + return statusCode; + } + + public Map> getHeaders() { + return headers; + } + + public T getData() { + return data; + } +} diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/Configuration.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 000000000000..445d575ace79 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,63 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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; + +import java.util.Objects; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Supplier; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class Configuration { + public static final String VERSION = "1.0.0"; + + private static final AtomicReference defaultApiClient = new AtomicReference<>(); + private static volatile Supplier apiClientFactory = ApiClient::new; + + /** + * Get the default API client, which would be used when creating API instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + ApiClient client = defaultApiClient.get(); + if (client == null) { + client = defaultApiClient.updateAndGet(val -> { + if (val != null) { // changed by another thread + return val; + } + return apiClientFactory.get(); + }); + } + return client; + } + + /** + * Set the default API client, which would be used when creating API instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient.set(apiClient); + } + + /** + * set the callback used to create new ApiClient objects + */ + public static void setApiClientFactory(Supplier factory) { + apiClientFactory = Objects.requireNonNull(factory); + } + + private Configuration() { + } +} \ No newline at end of file diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 000000000000..9813a7802b1d --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,261 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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; + +import com.fasterxml.jackson.annotation.*; +import tools.jackson.databind.*; +import tools.jackson.databind.json.JsonMapper; +import org.openapitools.client.model.*; + +import java.text.DateFormat; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class JSON { + private ObjectMapper mapper; + + public JSON() { + mapper = JsonMapper.builder() + .serializationInclusion(JsonInclude.Include.NON_NULL) + // Note: MapperFeature.ALLOW_COERCION_OF_SCALARS was removed in Jackson 3 + .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) + .enable(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE) + .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + .enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING) + .enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING) + .defaultDateFormat(new RFC3339DateFormat()) + // Note: JavaTimeModule (jsr310) is built into jackson-databind for Jackson 3 - no explicit registration needed + .build(); + // FIXME: JsonNullableModule is not yet available for Jackson 3 + } + + /** + * Set the date format for JSON (de)serialization with Date properties. + * + * @param dateFormat Date format + */ + public void setDateFormat(DateFormat dateFormat) { + mapper.setDateFormat(dateFormat); + } + + /** + * Get the object mapper + * + * @return object mapper + */ + public ObjectMapper getMapper() { return mapper; } + + /** + * Returns the target model class that should be used to deserialize the input data. + * The discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param modelClass The class that contains the discriminator mappings. + * + * @return the target model class. + */ + public static Class getClassForElement(JsonNode node, Class modelClass) { + ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); + if (cdm != null) { + return cdm.getClassForElement(node, new HashSet>()); + } + return null; + } + + /** + * Helper class to register the discriminator mappings. + */ + @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") + private static class ClassDiscriminatorMapping { + // The model class name. + Class modelClass; + // The name of the discriminator property. + String discriminatorName; + // The discriminator mappings for a model class. + Map> discriminatorMappings; + + // Constructs a new class discriminator. + ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { + modelClass = cls; + discriminatorName = propertyName; + discriminatorMappings = new HashMap>(); + if (mappings != null) { + discriminatorMappings.putAll(mappings); + } + } + + // Return the name of the discriminator property for this model class. + String getDiscriminatorPropertyName() { + return discriminatorName; + } + + // Return the discriminator value or null if the discriminator is not + // present in the payload. + String getDiscriminatorValue(JsonNode node) { + // Determine the value of the discriminator property in the input data. + if (discriminatorName != null) { + // Get the value of the discriminator property, if present in the input payload. + node = node.get(discriminatorName); + if (node != null && node.isValueNode()) { + String discrValue = node.asText(); + if (discrValue != null) { + return discrValue; + } + } + } + return null; + } + + /** + * Returns the target model class that should be used to deserialize the input data. + * This function can be invoked for anyOf/oneOf composed models with discriminator mappings. + * The discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param visitedClasses The set of classes that have already been visited. + * + * @return the target model class. + */ + Class getClassForElement(JsonNode node, Set> visitedClasses) { + if (visitedClasses.contains(modelClass)) { + // Class has already been visited. + return null; + } + // Determine the value of the discriminator property in the input data. + String discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + return null; + } + Class cls = discriminatorMappings.get(discrValue); + // It may not be sufficient to return this cls directly because that target class + // may itself be a composed schema, possibly with its own discriminator. + visitedClasses.add(modelClass); + for (Class childClass : discriminatorMappings.values()) { + ClassDiscriminatorMapping childCdm = modelDiscriminators.get(childClass); + if (childCdm == null) { + continue; + } + if (!discriminatorName.equals(childCdm.discriminatorName)) { + discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + continue; + } + } + if (childCdm != null) { + // Recursively traverse the discriminator mappings. + Class childDiscr = childCdm.getClassForElement(node, visitedClasses); + if (childDiscr != null) { + return childDiscr; + } + } + } + return cls; + } + } + + /** + * Returns true if inst is an instance of modelClass in the OpenAPI model hierarchy. + * + * The Java class hierarchy is not implemented the same way as the OpenAPI model hierarchy, + * so it's not possible to use the instanceof keyword. + * + * @param modelClass A OpenAPI model class. + * @param inst The instance object. + * @param visitedClasses The set of classes that have already been visited. + * + * @return true if inst is an instance of modelClass in the OpenAPI model hierarchy. + */ + public static boolean isInstanceOf(Class modelClass, Object inst, Set> visitedClasses) { + if (modelClass.isInstance(inst)) { + // This handles the 'allOf' use case with single parent inheritance. + return true; + } + if (visitedClasses.contains(modelClass)) { + // This is to prevent infinite recursion when the composed schemas have + // a circular dependency. + return false; + } + visitedClasses.add(modelClass); + + // Traverse the oneOf/anyOf composed schemas. + Map> descendants = modelDescendants.get(modelClass); + if (descendants != null) { + for (Class childType : descendants.values()) { + if (isInstanceOf(childType, inst, visitedClasses)) { + return true; + } + } + } + return false; + } + + /** + * A map of discriminators for all model classes. + */ + private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); + + /** + * A map of oneOf/anyOf descendants for each model class. + */ + private static Map, Map>> modelDescendants = new HashMap<>(); + + /** + * Register a model class discriminator. + * + * @param modelClass the model class + * @param discriminatorPropertyName the name of the discriminator property + * @param mappings a map with the discriminator mappings. + */ + public static void registerDiscriminator(Class modelClass, String discriminatorPropertyName, Map> mappings) { + ClassDiscriminatorMapping m = new ClassDiscriminatorMapping(modelClass, discriminatorPropertyName, mappings); + modelDiscriminators.put(modelClass, m); + } + + /** + * Register the oneOf/anyOf descendants of the modelClass. + * + * @param modelClass the model class + * @param descendants a map of oneOf/anyOf descendants. + */ + public static void registerDescendants(Class modelClass, Map> descendants) { + modelDescendants.put(modelClass, descendants); + } + + private static JSON json; + + static { + json = new JSON(); + } + + /** + * Get the default JSON instance. + * + * @return the default JSON instance + */ + public static JSON getDefault() { + return json; + } + + /** + * Set the default JSON instance. + * + * @param json JSON instance to be used + */ + public static void setDefault(JSON json) { + JSON.json = json; + } +} diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 000000000000..2be8f43717cd --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,37 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class Pair { + private final String name; + private final String value; + + public Pair(String name, String value) { + this.name = isValidString(name) ? name : ""; + this.value = isValidString(value) ? value : ""; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private static boolean isValidString(String arg) { + return arg != null; + } +} diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/RFC3339DateFormat.java new file mode 100644 index 000000000000..590082334ec4 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -0,0 +1,58 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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; + +import tools.jackson.databind.util.StdDateFormat; + +import java.text.DateFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.text.DecimalFormat; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); + } + + @Override + public Date parse(String source) { + return parse(source, new ParsePosition(0)); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return super.clone(); + } +} diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java new file mode 100644 index 000000000000..6d285d84ce28 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/RFC3339InstantDeserializer.java @@ -0,0 +1,100 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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; + +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; +import java.time.temporal.Temporal; +import java.time.temporal.TemporalAccessor; +import java.util.function.BiFunction; +import java.util.function.Function; + +import tools.jackson.core.JacksonException; +import tools.jackson.core.JsonParser; +import tools.jackson.databind.DeserializationContext; +import tools.jackson.databind.cfg.DateTimeFeature; +import tools.jackson.databind.ext.javatime.deser.InstantDeserializer; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class RFC3339InstantDeserializer extends InstantDeserializer { + private static final long serialVersionUID = 1L; + private final static boolean DEFAULT_NORMALIZE_ZONE_ID = DateTimeFeature.NORMALIZE_DESERIALIZED_ZONE_ID.enabledByDefault(); + private final static boolean DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS + = DateTimeFeature.ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS.enabledByDefault(); + + public static final RFC3339InstantDeserializer INSTANT = new RFC3339InstantDeserializer<>( + Instant.class, DateTimeFormatter.ISO_INSTANT, + Instant::from, + a -> Instant.ofEpochMilli( a.value ), + a -> Instant.ofEpochSecond( a.integer, a.fraction ), + null, + true, // yes, replace zero offset with Z + DEFAULT_NORMALIZE_ZONE_ID, + DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS + ); + + public static final RFC3339InstantDeserializer OFFSET_DATE_TIME = new RFC3339InstantDeserializer<>( + OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, + OffsetDateTime::from, + a -> OffsetDateTime.ofInstant( Instant.ofEpochMilli( a.value ), a.zoneId ), + a -> OffsetDateTime.ofInstant( Instant.ofEpochSecond( a.integer, a.fraction ), a.zoneId ), + (d, z) -> ( d.isEqual( OffsetDateTime.MIN ) || d.isEqual( OffsetDateTime.MAX ) ? + d : + d.withOffsetSameInstant( z.getRules().getOffset( d.toLocalDateTime() ) ) ), + true, // yes, replace zero offset with Z + DEFAULT_NORMALIZE_ZONE_ID, + DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS + ); + + public static final RFC3339InstantDeserializer ZONED_DATE_TIME = new RFC3339InstantDeserializer<>( + ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, + ZonedDateTime::from, + a -> ZonedDateTime.ofInstant( Instant.ofEpochMilli( a.value ), a.zoneId ), + a -> ZonedDateTime.ofInstant( Instant.ofEpochSecond( a.integer, a.fraction ), a.zoneId ), + ZonedDateTime::withZoneSameInstant, + false, // keep zero offset and Z separate since zones explicitly supported + DEFAULT_NORMALIZE_ZONE_ID, + DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS + ); + + protected RFC3339InstantDeserializer( + Class supportedType, + DateTimeFormatter formatter, + Function parsedToValue, + Function fromMilliseconds, + Function fromNanoseconds, + BiFunction adjust, + boolean replaceZeroOffsetAsZ, + boolean normalizeZoneId, + boolean readNumericStringsAsTimestamp) { + super( + supportedType, + formatter, + parsedToValue, + fromMilliseconds, + fromNanoseconds, + adjust, + replaceZeroOffsetAsZ, + normalizeZoneId, + readNumericStringsAsTimestamp + ); + } + + @Override + protected T _fromString(JsonParser p, DeserializationContext ctxt, String string0) throws JacksonException { + return super._fromString(p, ctxt, string0.replace( ' ', 'T' )); + } +} \ No newline at end of file diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java new file mode 100644 index 000000000000..4fdeac905f2d --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/RFC3339JavaTimeModule.java @@ -0,0 +1,33 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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; + +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZonedDateTime; + +import tools.jackson.databind.module.SimpleModule; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class RFC3339JavaTimeModule extends SimpleModule { + private static final long serialVersionUID = 1L; + + public RFC3339JavaTimeModule() { + super("RFC3339JavaTimeModule"); + addDeserializer(Instant.class, RFC3339InstantDeserializer.INSTANT); + addDeserializer(OffsetDateTime.class, RFC3339InstantDeserializer.OFFSET_DATE_TIME); + addDeserializer(ZonedDateTime.class, RFC3339InstantDeserializer.ZONED_DATE_TIME); + } + + +} diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 000000000000..36af7b4ab7da --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,72 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ServerVariable.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 000000000000..6400fcaed9fb --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,37 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java new file mode 100644 index 000000000000..0ebf677bd22d --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -0,0 +1,288 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; + +import org.openapitools.client.model.Client; + +import tools.jackson.core.type.TypeReference; +import tools.jackson.databind.ObjectMapper; + +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.net.http.HttpRequest; +import java.nio.channels.Channels; +import java.nio.channels.Pipe; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; + +import java.util.ArrayList; +import java.util.StringJoiner; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class AnotherFakeApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public AnotherFakeApi() { + this(Configuration.getDefaultApiClient()); + } + + public AnotherFakeApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + InputStream responseBody = ApiClient.getResponseBody(response); + String body = null; + try { + body = responseBody == null ? null : new String(responseBody.readAllBytes()); + } finally { + if (responseBody != null) { + responseBody.close(); + } + } + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response, InputStream responseBody) throws ApiException { + if (responseBody == null) { + throw new ApiException(new IOException("Response body is empty")); + } + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(responseBody, file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

Prepare the file for download from the response.

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * To test special tags + * To test special tags and operation ID starting with number + * @param client client model (required) + * @return Client + * @throws ApiException if fails to make API call + */ + public Client call123testSpecialTags(@javax.annotation.Nonnull Client client) throws ApiException { + return call123testSpecialTags(client, null); + } + + /** + * To test special tags + * To test special tags and operation ID starting with number + * @param client client model (required) + * @param headers Optional headers to include in the request + * @return Client + * @throws ApiException if fails to make API call + */ + public Client call123testSpecialTags(@javax.annotation.Nonnull Client client, Map headers) throws ApiException { + ApiResponse localVarResponse = call123testSpecialTagsWithHttpInfo(client, headers); + return localVarResponse.getData(); + } + + /** + * To test special tags + * To test special tags and operation ID starting with number + * @param client client model (required) + * @return ApiResponse<Client> + * @throws ApiException if fails to make API call + */ + public ApiResponse call123testSpecialTagsWithHttpInfo(@javax.annotation.Nonnull Client client) throws ApiException { + return call123testSpecialTagsWithHttpInfo(client, null); + } + + /** + * To test special tags + * To test special tags and operation ID starting with number + * @param client client model (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Client> + * @throws ApiException if fails to make API call + */ + public ApiResponse call123testSpecialTagsWithHttpInfo(@javax.annotation.Nonnull Client client, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = call123testSpecialTagsRequestBuilder(client, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("call123testSpecialTags", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + Client responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder call123testSpecialTagsRequestBuilder(@javax.annotation.Nonnull Client client, Map headers) throws ApiException { + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException(400, "Missing the required parameter 'client' when calling call123testSpecialTags"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/another-fake/dummy"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(client); + localVarRequestBuilder.method("PATCH", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 000000000000..cf577c6a2e20 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,274 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; + +import org.openapitools.client.model.FooGetDefaultResponse; + +import tools.jackson.core.type.TypeReference; +import tools.jackson.databind.ObjectMapper; + +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.net.http.HttpRequest; +import java.nio.channels.Channels; +import java.nio.channels.Pipe; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; + +import java.util.ArrayList; +import java.util.StringJoiner; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class DefaultApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + InputStream responseBody = ApiClient.getResponseBody(response); + String body = null; + try { + body = responseBody == null ? null : new String(responseBody.readAllBytes()); + } finally { + if (responseBody != null) { + responseBody.close(); + } + } + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response, InputStream responseBody) throws ApiException { + if (responseBody == null) { + throw new ApiException(new IOException("Response body is empty")); + } + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(responseBody, file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

Prepare the file for download from the response.

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * + * + * @return FooGetDefaultResponse + * @throws ApiException if fails to make API call + */ + public FooGetDefaultResponse fooGet() throws ApiException { + return fooGet(null); + } + + /** + * + * + * @param headers Optional headers to include in the request + * @return FooGetDefaultResponse + * @throws ApiException if fails to make API call + */ + public FooGetDefaultResponse fooGet(Map headers) throws ApiException { + ApiResponse localVarResponse = fooGetWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * + * + * @return ApiResponse<FooGetDefaultResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse fooGetWithHttpInfo() throws ApiException { + return fooGetWithHttpInfo(null); + } + + /** + * + * + * @param headers Optional headers to include in the request + * @return ApiResponse<FooGetDefaultResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse fooGetWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = fooGetRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("fooGet", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + FooGetDefaultResponse responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder fooGetRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/foo"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/FakeApi.java new file mode 100644 index 000000000000..973a20fe0f52 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/FakeApi.java @@ -0,0 +1,2880 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; + +import java.math.BigDecimal; +import org.openapitools.client.model.Client; +import org.openapitools.client.model.FakeBigDecimalMap200Response; +import java.io.File; +import org.openapitools.client.model.FileSchemaTestClass; +import org.openapitools.client.model.HealthCheckResult; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; +import org.openapitools.client.model.User; + +import tools.jackson.core.type.TypeReference; +import tools.jackson.databind.ObjectMapper; + +import org.apache.http.HttpEntity; +import org.apache.http.NameValuePair; +import org.apache.http.entity.mime.MultipartEntityBuilder; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.client.entity.UrlEncodedFormEntity; + +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.net.http.HttpRequest; +import java.nio.channels.Channels; +import java.nio.channels.Pipe; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; + +import java.util.ArrayList; +import java.util.StringJoiner; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class FakeApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public FakeApi() { + this(Configuration.getDefaultApiClient()); + } + + public FakeApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + InputStream responseBody = ApiClient.getResponseBody(response); + String body = null; + try { + body = responseBody == null ? null : new String(responseBody.readAllBytes()); + } finally { + if (responseBody != null) { + responseBody.close(); + } + } + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response, InputStream responseBody) throws ApiException { + if (responseBody == null) { + throw new ApiException(new IOException("Response body is empty")); + } + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(responseBody, file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

Prepare the file for download from the response.

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * + * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + * @return FakeBigDecimalMap200Response + * @throws ApiException if fails to make API call + */ + public FakeBigDecimalMap200Response fakeBigDecimalMap() throws ApiException { + return fakeBigDecimalMap(null); + } + + /** + * + * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + * @param headers Optional headers to include in the request + * @return FakeBigDecimalMap200Response + * @throws ApiException if fails to make API call + */ + public FakeBigDecimalMap200Response fakeBigDecimalMap(Map headers) throws ApiException { + ApiResponse localVarResponse = fakeBigDecimalMapWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * + * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + * @return ApiResponse<FakeBigDecimalMap200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse fakeBigDecimalMapWithHttpInfo() throws ApiException { + return fakeBigDecimalMapWithHttpInfo(null); + } + + /** + * + * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + * @param headers Optional headers to include in the request + * @return ApiResponse<FakeBigDecimalMap200Response> + * @throws ApiException if fails to make API call + */ + public ApiResponse fakeBigDecimalMapWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = fakeBigDecimalMapRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("fakeBigDecimalMap", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + FakeBigDecimalMap200Response responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder fakeBigDecimalMapRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake/BigDecimalMap"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "*/*"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Health check endpoint + * + * @return HealthCheckResult + * @throws ApiException if fails to make API call + */ + public HealthCheckResult fakeHealthGet() throws ApiException { + return fakeHealthGet(null); + } + + /** + * Health check endpoint + * + * @param headers Optional headers to include in the request + * @return HealthCheckResult + * @throws ApiException if fails to make API call + */ + public HealthCheckResult fakeHealthGet(Map headers) throws ApiException { + ApiResponse localVarResponse = fakeHealthGetWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Health check endpoint + * + * @return ApiResponse<HealthCheckResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse fakeHealthGetWithHttpInfo() throws ApiException { + return fakeHealthGetWithHttpInfo(null); + } + + /** + * Health check endpoint + * + * @param headers Optional headers to include in the request + * @return ApiResponse<HealthCheckResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse fakeHealthGetWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = fakeHealthGetRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("fakeHealthGet", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + HealthCheckResult responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder fakeHealthGetRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake/health"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return Boolean + * @throws ApiException if fails to make API call + */ + public Boolean fakeOuterBooleanSerialize(@javax.annotation.Nullable Boolean body) throws ApiException { + return fakeOuterBooleanSerialize(body, null); + } + + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @param headers Optional headers to include in the request + * @return Boolean + * @throws ApiException if fails to make API call + */ + public Boolean fakeOuterBooleanSerialize(@javax.annotation.Nullable Boolean body, Map headers) throws ApiException { + ApiResponse localVarResponse = fakeOuterBooleanSerializeWithHttpInfo(body, headers); + return localVarResponse.getData(); + } + + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return ApiResponse<Boolean> + * @throws ApiException if fails to make API call + */ + public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(@javax.annotation.Nullable Boolean body) throws ApiException { + return fakeOuterBooleanSerializeWithHttpInfo(body, null); + } + + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Boolean> + * @throws ApiException if fails to make API call + */ + public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(@javax.annotation.Nullable Boolean body, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = fakeOuterBooleanSerializeRequestBuilder(body, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("fakeOuterBooleanSerialize", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + Boolean responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder fakeOuterBooleanSerializeRequestBuilder(@javax.annotation.Nullable Boolean body, Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake/outer/boolean"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "*/*"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * + * Test serialization of object with outer number type + * @param outerComposite Input composite as post body (optional) + * @return OuterComposite + * @throws ApiException if fails to make API call + */ + public OuterComposite fakeOuterCompositeSerialize(@javax.annotation.Nullable OuterComposite outerComposite) throws ApiException { + return fakeOuterCompositeSerialize(outerComposite, null); + } + + /** + * + * Test serialization of object with outer number type + * @param outerComposite Input composite as post body (optional) + * @param headers Optional headers to include in the request + * @return OuterComposite + * @throws ApiException if fails to make API call + */ + public OuterComposite fakeOuterCompositeSerialize(@javax.annotation.Nullable OuterComposite outerComposite, Map headers) throws ApiException { + ApiResponse localVarResponse = fakeOuterCompositeSerializeWithHttpInfo(outerComposite, headers); + return localVarResponse.getData(); + } + + /** + * + * Test serialization of object with outer number type + * @param outerComposite Input composite as post body (optional) + * @return ApiResponse<OuterComposite> + * @throws ApiException if fails to make API call + */ + public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(@javax.annotation.Nullable OuterComposite outerComposite) throws ApiException { + return fakeOuterCompositeSerializeWithHttpInfo(outerComposite, null); + } + + /** + * + * Test serialization of object with outer number type + * @param outerComposite Input composite as post body (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<OuterComposite> + * @throws ApiException if fails to make API call + */ + public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(@javax.annotation.Nullable OuterComposite outerComposite, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = fakeOuterCompositeSerializeRequestBuilder(outerComposite, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("fakeOuterCompositeSerialize", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + OuterComposite responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder fakeOuterCompositeSerializeRequestBuilder(@javax.annotation.Nullable OuterComposite outerComposite, Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake/outer/composite"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "*/*"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(outerComposite); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return BigDecimal + * @throws ApiException if fails to make API call + */ + public BigDecimal fakeOuterNumberSerialize(@javax.annotation.Nullable BigDecimal body) throws ApiException { + return fakeOuterNumberSerialize(body, null); + } + + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @param headers Optional headers to include in the request + * @return BigDecimal + * @throws ApiException if fails to make API call + */ + public BigDecimal fakeOuterNumberSerialize(@javax.annotation.Nullable BigDecimal body, Map headers) throws ApiException { + ApiResponse localVarResponse = fakeOuterNumberSerializeWithHttpInfo(body, headers); + return localVarResponse.getData(); + } + + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return ApiResponse<BigDecimal> + * @throws ApiException if fails to make API call + */ + public ApiResponse fakeOuterNumberSerializeWithHttpInfo(@javax.annotation.Nullable BigDecimal body) throws ApiException { + return fakeOuterNumberSerializeWithHttpInfo(body, null); + } + + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<BigDecimal> + * @throws ApiException if fails to make API call + */ + public ApiResponse fakeOuterNumberSerializeWithHttpInfo(@javax.annotation.Nullable BigDecimal body, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = fakeOuterNumberSerializeRequestBuilder(body, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("fakeOuterNumberSerialize", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + BigDecimal responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder fakeOuterNumberSerializeRequestBuilder(@javax.annotation.Nullable BigDecimal body, Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake/outer/number"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "*/*"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return String + * @throws ApiException if fails to make API call + */ + public String fakeOuterStringSerialize(@javax.annotation.Nullable String body) throws ApiException { + return fakeOuterStringSerialize(body, null); + } + + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @param headers Optional headers to include in the request + * @return String + * @throws ApiException if fails to make API call + */ + public String fakeOuterStringSerialize(@javax.annotation.Nullable String body, Map headers) throws ApiException { + ApiResponse localVarResponse = fakeOuterStringSerializeWithHttpInfo(body, headers); + return localVarResponse.getData(); + } + + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse fakeOuterStringSerializeWithHttpInfo(@javax.annotation.Nullable String body) throws ApiException { + return fakeOuterStringSerializeWithHttpInfo(body, null); + } + + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse fakeOuterStringSerializeWithHttpInfo(@javax.annotation.Nullable String body, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = fakeOuterStringSerializeRequestBuilder(body, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("fakeOuterStringSerialize", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + String responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder fakeOuterStringSerializeRequestBuilder(@javax.annotation.Nullable String body, Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake/outer/string"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "*/*"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofString(body)); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * application/json UTF8 + * + * @return List<OuterEnum> + * @throws ApiException if fails to make API call + */ + public List getApplicationJsonUtf8() throws ApiException { + return getApplicationJsonUtf8(null); + } + + /** + * application/json UTF8 + * + * @param headers Optional headers to include in the request + * @return List<OuterEnum> + * @throws ApiException if fails to make API call + */ + public List getApplicationJsonUtf8(Map headers) throws ApiException { + ApiResponse> localVarResponse = getApplicationJsonUtf8WithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * application/json UTF8 + * + * @return ApiResponse<List<OuterEnum>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getApplicationJsonUtf8WithHttpInfo() throws ApiException { + return getApplicationJsonUtf8WithHttpInfo(null); + } + + /** + * application/json UTF8 + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<OuterEnum>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getApplicationJsonUtf8WithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getApplicationJsonUtf8RequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getApplicationJsonUtf8", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + List responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference>() {}); + + + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getApplicationJsonUtf8RequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake/application_json_utf8"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json;charset=utf-8"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Array of Enums + * + * @return List<OuterEnum> + * @throws ApiException if fails to make API call + */ + public List getArrayOfEnums() throws ApiException { + return getArrayOfEnums(null); + } + + /** + * Array of Enums + * + * @param headers Optional headers to include in the request + * @return List<OuterEnum> + * @throws ApiException if fails to make API call + */ + public List getArrayOfEnums(Map headers) throws ApiException { + ApiResponse> localVarResponse = getArrayOfEnumsWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Array of Enums + * + * @return ApiResponse<List<OuterEnum>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getArrayOfEnumsWithHttpInfo() throws ApiException { + return getArrayOfEnumsWithHttpInfo(null); + } + + /** + * Array of Enums + * + * @param headers Optional headers to include in the request + * @return ApiResponse<List<OuterEnum>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getArrayOfEnumsWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getArrayOfEnumsRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getArrayOfEnums", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + List responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference>() {}); + + + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getArrayOfEnumsRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake/array-of-enums"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * test referenced additionalProperties + * + * @param requestBody request body (required) + * @throws ApiException if fails to make API call + */ + public void testAdditionalPropertiesReference(@javax.annotation.Nonnull Map requestBody) throws ApiException { + testAdditionalPropertiesReference(requestBody, null); + } + + /** + * test referenced additionalProperties + * + * @param requestBody request body (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void testAdditionalPropertiesReference(@javax.annotation.Nonnull Map requestBody, Map headers) throws ApiException { + testAdditionalPropertiesReferenceWithHttpInfo(requestBody, headers); + } + + /** + * test referenced additionalProperties + * + * @param requestBody request body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testAdditionalPropertiesReferenceWithHttpInfo(@javax.annotation.Nonnull Map requestBody) throws ApiException { + return testAdditionalPropertiesReferenceWithHttpInfo(requestBody, null); + } + + /** + * test referenced additionalProperties + * + * @param requestBody request body (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testAdditionalPropertiesReferenceWithHttpInfo(@javax.annotation.Nonnull Map requestBody, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = testAdditionalPropertiesReferenceRequestBuilder(requestBody, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testAdditionalPropertiesReference", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody != null) { + localVarResponseBody.readAllBytes(); + } + return new ApiResponse<>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder testAdditionalPropertiesReferenceRequestBuilder(@javax.annotation.Nonnull Map requestBody, Map headers) throws ApiException { + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new ApiException(400, "Missing the required parameter 'requestBody' when calling testAdditionalPropertiesReference"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake/additionalProperties-reference"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(requestBody); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * + * For this test, the body for this request much reference a schema named `File`. + * @param fileSchemaTestClass (required) + * @throws ApiException if fails to make API call + */ + public void testBodyWithFileSchema(@javax.annotation.Nonnull FileSchemaTestClass fileSchemaTestClass) throws ApiException { + testBodyWithFileSchema(fileSchemaTestClass, null); + } + + /** + * + * For this test, the body for this request much reference a schema named `File`. + * @param fileSchemaTestClass (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void testBodyWithFileSchema(@javax.annotation.Nonnull FileSchemaTestClass fileSchemaTestClass, Map headers) throws ApiException { + testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass, headers); + } + + /** + * + * For this test, the body for this request much reference a schema named `File`. + * @param fileSchemaTestClass (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testBodyWithFileSchemaWithHttpInfo(@javax.annotation.Nonnull FileSchemaTestClass fileSchemaTestClass) throws ApiException { + return testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass, null); + } + + /** + * + * For this test, the body for this request much reference a schema named `File`. + * @param fileSchemaTestClass (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testBodyWithFileSchemaWithHttpInfo(@javax.annotation.Nonnull FileSchemaTestClass fileSchemaTestClass, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = testBodyWithFileSchemaRequestBuilder(fileSchemaTestClass, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testBodyWithFileSchema", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody != null) { + localVarResponseBody.readAllBytes(); + } + return new ApiResponse<>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder testBodyWithFileSchemaRequestBuilder(@javax.annotation.Nonnull FileSchemaTestClass fileSchemaTestClass, Map headers) throws ApiException { + // verify the required parameter 'fileSchemaTestClass' is set + if (fileSchemaTestClass == null) { + throw new ApiException(400, "Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake/body-with-file-schema"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(fileSchemaTestClass); + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * + * + * @param query (required) + * @param user (required) + * @throws ApiException if fails to make API call + */ + public void testBodyWithQueryParams(@javax.annotation.Nonnull String query, @javax.annotation.Nonnull User user) throws ApiException { + testBodyWithQueryParams(query, user, null); + } + + /** + * + * + * @param query (required) + * @param user (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void testBodyWithQueryParams(@javax.annotation.Nonnull String query, @javax.annotation.Nonnull User user, Map headers) throws ApiException { + testBodyWithQueryParamsWithHttpInfo(query, user, headers); + } + + /** + * + * + * @param query (required) + * @param user (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testBodyWithQueryParamsWithHttpInfo(@javax.annotation.Nonnull String query, @javax.annotation.Nonnull User user) throws ApiException { + return testBodyWithQueryParamsWithHttpInfo(query, user, null); + } + + /** + * + * + * @param query (required) + * @param user (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testBodyWithQueryParamsWithHttpInfo(@javax.annotation.Nonnull String query, @javax.annotation.Nonnull User user, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = testBodyWithQueryParamsRequestBuilder(query, user, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testBodyWithQueryParams", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody != null) { + localVarResponseBody.readAllBytes(); + } + return new ApiResponse<>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder testBodyWithQueryParamsRequestBuilder(@javax.annotation.Nonnull String query, @javax.annotation.Nonnull User user, Map headers) throws ApiException { + // verify the required parameter 'query' is set + if (query == null) { + throw new ApiException(400, "Missing the required parameter 'query' when calling testBodyWithQueryParams"); + } + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling testBodyWithQueryParams"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake/body-with-query-params"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "query"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("query", query)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(user); + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * To test \"client\" model + * To test \"client\" model + * @param client client model (required) + * @return Client + * @throws ApiException if fails to make API call + */ + public Client testClientModel(@javax.annotation.Nonnull Client client) throws ApiException { + return testClientModel(client, null); + } + + /** + * To test \"client\" model + * To test \"client\" model + * @param client client model (required) + * @param headers Optional headers to include in the request + * @return Client + * @throws ApiException if fails to make API call + */ + public Client testClientModel(@javax.annotation.Nonnull Client client, Map headers) throws ApiException { + ApiResponse localVarResponse = testClientModelWithHttpInfo(client, headers); + return localVarResponse.getData(); + } + + /** + * To test \"client\" model + * To test \"client\" model + * @param client client model (required) + * @return ApiResponse<Client> + * @throws ApiException if fails to make API call + */ + public ApiResponse testClientModelWithHttpInfo(@javax.annotation.Nonnull Client client) throws ApiException { + return testClientModelWithHttpInfo(client, null); + } + + /** + * To test \"client\" model + * To test \"client\" model + * @param client client model (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Client> + * @throws ApiException if fails to make API call + */ + public ApiResponse testClientModelWithHttpInfo(@javax.annotation.Nonnull Client client, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = testClientModelRequestBuilder(client, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testClientModel", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + Client responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder testClientModelRequestBuilder(@javax.annotation.Nonnull Client client, Map headers) throws ApiException { + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException(400, "Missing the required parameter 'client' when calling testClientModel"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(client); + localVarRequestBuilder.method("PATCH", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional, default to 2010-02-01T10:20:10.111110+01:00) + * @param password None (optional) + * @param paramCallback None (optional) + * @throws ApiException if fails to make API call + */ + public void testEndpointParameters(@javax.annotation.Nonnull BigDecimal number, @javax.annotation.Nonnull Double _double, @javax.annotation.Nonnull String patternWithoutDelimiter, @javax.annotation.Nonnull byte[] _byte, @javax.annotation.Nullable Integer integer, @javax.annotation.Nullable Integer int32, @javax.annotation.Nullable Long int64, @javax.annotation.Nullable Float _float, @javax.annotation.Nullable String string, @javax.annotation.Nullable File binary, @javax.annotation.Nullable LocalDate date, @javax.annotation.Nullable OffsetDateTime dateTime, @javax.annotation.Nullable String password, @javax.annotation.Nullable String paramCallback) throws ApiException { + testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, null); + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional, default to 2010-02-01T10:20:10.111110+01:00) + * @param password None (optional) + * @param paramCallback None (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void testEndpointParameters(@javax.annotation.Nonnull BigDecimal number, @javax.annotation.Nonnull Double _double, @javax.annotation.Nonnull String patternWithoutDelimiter, @javax.annotation.Nonnull byte[] _byte, @javax.annotation.Nullable Integer integer, @javax.annotation.Nullable Integer int32, @javax.annotation.Nullable Long int64, @javax.annotation.Nullable Float _float, @javax.annotation.Nullable String string, @javax.annotation.Nullable File binary, @javax.annotation.Nullable LocalDate date, @javax.annotation.Nullable OffsetDateTime dateTime, @javax.annotation.Nullable String password, @javax.annotation.Nullable String paramCallback, Map headers) throws ApiException { + testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, headers); + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional, default to 2010-02-01T10:20:10.111110+01:00) + * @param password None (optional) + * @param paramCallback None (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testEndpointParametersWithHttpInfo(@javax.annotation.Nonnull BigDecimal number, @javax.annotation.Nonnull Double _double, @javax.annotation.Nonnull String patternWithoutDelimiter, @javax.annotation.Nonnull byte[] _byte, @javax.annotation.Nullable Integer integer, @javax.annotation.Nullable Integer int32, @javax.annotation.Nullable Long int64, @javax.annotation.Nullable Float _float, @javax.annotation.Nullable String string, @javax.annotation.Nullable File binary, @javax.annotation.Nullable LocalDate date, @javax.annotation.Nullable OffsetDateTime dateTime, @javax.annotation.Nullable String password, @javax.annotation.Nullable String paramCallback) throws ApiException { + return testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, null); + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional, default to 2010-02-01T10:20:10.111110+01:00) + * @param password None (optional) + * @param paramCallback None (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testEndpointParametersWithHttpInfo(@javax.annotation.Nonnull BigDecimal number, @javax.annotation.Nonnull Double _double, @javax.annotation.Nonnull String patternWithoutDelimiter, @javax.annotation.Nonnull byte[] _byte, @javax.annotation.Nullable Integer integer, @javax.annotation.Nullable Integer int32, @javax.annotation.Nullable Long int64, @javax.annotation.Nullable Float _float, @javax.annotation.Nullable String string, @javax.annotation.Nullable File binary, @javax.annotation.Nullable LocalDate date, @javax.annotation.Nullable OffsetDateTime dateTime, @javax.annotation.Nullable String password, @javax.annotation.Nullable String paramCallback, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = testEndpointParametersRequestBuilder(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testEndpointParameters", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody != null) { + localVarResponseBody.readAllBytes(); + } + return new ApiResponse<>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder testEndpointParametersRequestBuilder(@javax.annotation.Nonnull BigDecimal number, @javax.annotation.Nonnull Double _double, @javax.annotation.Nonnull String patternWithoutDelimiter, @javax.annotation.Nonnull byte[] _byte, @javax.annotation.Nullable Integer integer, @javax.annotation.Nullable Integer int32, @javax.annotation.Nullable Long int64, @javax.annotation.Nullable Float _float, @javax.annotation.Nullable String string, @javax.annotation.Nullable File binary, @javax.annotation.Nullable LocalDate date, @javax.annotation.Nullable OffsetDateTime dateTime, @javax.annotation.Nullable String password, @javax.annotation.Nullable String paramCallback, Map headers) throws ApiException { + // verify the required parameter 'number' is set + if (number == null) { + throw new ApiException(400, "Missing the required parameter 'number' when calling testEndpointParameters"); + } + // verify the required parameter '_double' is set + if (_double == null) { + throw new ApiException(400, "Missing the required parameter '_double' when calling testEndpointParameters"); + } + // verify the required parameter 'patternWithoutDelimiter' is set + if (patternWithoutDelimiter == null) { + throw new ApiException(400, "Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"); + } + // verify the required parameter '_byte' is set + if (_byte == null) { + throw new ApiException(400, "Missing the required parameter '_byte' when calling testEndpointParameters"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + List formValues = new ArrayList<>(); + if (integer != null) { + formValues.add(new BasicNameValuePair("integer", integer.toString())); + } + if (int32 != null) { + formValues.add(new BasicNameValuePair("int32", int32.toString())); + } + if (int64 != null) { + formValues.add(new BasicNameValuePair("int64", int64.toString())); + } + if (number != null) { + formValues.add(new BasicNameValuePair("number", number.toString())); + } + if (_float != null) { + formValues.add(new BasicNameValuePair("float", _float.toString())); + } + if (_double != null) { + formValues.add(new BasicNameValuePair("double", _double.toString())); + } + if (string != null) { + formValues.add(new BasicNameValuePair("string", string.toString())); + } + if (patternWithoutDelimiter != null) { + formValues.add(new BasicNameValuePair("pattern_without_delimiter", patternWithoutDelimiter.toString())); + } + if (_byte != null) { + formValues.add(new BasicNameValuePair("byte", _byte.toString())); + } + if (binary != null) { + formValues.add(new BasicNameValuePair("binary", binary.toString())); + } + if (date != null) { + formValues.add(new BasicNameValuePair("date", date.toString())); + } + if (dateTime != null) { + formValues.add(new BasicNameValuePair("dateTime", dateTime.toString())); + } + if (password != null) { + formValues.add(new BasicNameValuePair("password", password.toString())); + } + if (paramCallback != null) { + formValues.add(new BasicNameValuePair("callback", paramCallback.toString())); + } + HttpEntity entity = new UrlEncodedFormEntity(formValues, java.nio.charset.StandardCharsets.UTF_8); + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + byte[] formBytes = formOutputStream.toByteArray(); + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method("POST", HttpRequest.BodyPublishers + .ofInputStream(() -> new ByteArrayInputStream(formBytes))); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * To test enum parameters + * To test enum parameters + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @throws ApiException if fails to make API call + */ + public void testEnumParameters(@javax.annotation.Nullable List enumHeaderStringArray, @javax.annotation.Nullable String enumHeaderString, @javax.annotation.Nullable List enumQueryStringArray, @javax.annotation.Nullable String enumQueryString, @javax.annotation.Nullable Integer enumQueryInteger, @javax.annotation.Nullable Double enumQueryDouble, @javax.annotation.Nullable List enumFormStringArray, @javax.annotation.Nullable String enumFormString) throws ApiException { + testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, null); + } + + /** + * To test enum parameters + * To test enum parameters + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void testEnumParameters(@javax.annotation.Nullable List enumHeaderStringArray, @javax.annotation.Nullable String enumHeaderString, @javax.annotation.Nullable List enumQueryStringArray, @javax.annotation.Nullable String enumQueryString, @javax.annotation.Nullable Integer enumQueryInteger, @javax.annotation.Nullable Double enumQueryDouble, @javax.annotation.Nullable List enumFormStringArray, @javax.annotation.Nullable String enumFormString, Map headers) throws ApiException { + testEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, headers); + } + + /** + * To test enum parameters + * To test enum parameters + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testEnumParametersWithHttpInfo(@javax.annotation.Nullable List enumHeaderStringArray, @javax.annotation.Nullable String enumHeaderString, @javax.annotation.Nullable List enumQueryStringArray, @javax.annotation.Nullable String enumQueryString, @javax.annotation.Nullable Integer enumQueryInteger, @javax.annotation.Nullable Double enumQueryDouble, @javax.annotation.Nullable List enumFormStringArray, @javax.annotation.Nullable String enumFormString) throws ApiException { + return testEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, null); + } + + /** + * To test enum parameters + * To test enum parameters + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testEnumParametersWithHttpInfo(@javax.annotation.Nullable List enumHeaderStringArray, @javax.annotation.Nullable String enumHeaderString, @javax.annotation.Nullable List enumQueryStringArray, @javax.annotation.Nullable String enumQueryString, @javax.annotation.Nullable Integer enumQueryInteger, @javax.annotation.Nullable Double enumQueryDouble, @javax.annotation.Nullable List enumFormStringArray, @javax.annotation.Nullable String enumFormString, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = testEnumParametersRequestBuilder(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testEnumParameters", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody != null) { + localVarResponseBody.readAllBytes(); + } + return new ApiResponse<>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder testEnumParametersRequestBuilder(@javax.annotation.Nullable List enumHeaderStringArray, @javax.annotation.Nullable String enumHeaderString, @javax.annotation.Nullable List enumQueryStringArray, @javax.annotation.Nullable String enumQueryString, @javax.annotation.Nullable Integer enumQueryInteger, @javax.annotation.Nullable Double enumQueryDouble, @javax.annotation.Nullable List enumFormStringArray, @javax.annotation.Nullable String enumFormString, Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "enum_query_string_array"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enum_query_string_array", enumQueryStringArray)); + localVarQueryParameterBaseName = "enum_query_string"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enum_query_string", enumQueryString)); + localVarQueryParameterBaseName = "enum_query_integer"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enum_query_integer", enumQueryInteger)); + localVarQueryParameterBaseName = "enum_query_double"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("enum_query_double", enumQueryDouble)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + if (enumHeaderStringArray != null) { + localVarRequestBuilder.header("enum_header_string_array", enumHeaderStringArray.toString()); + } + if (enumHeaderString != null) { + localVarRequestBuilder.header("enum_header_string", enumHeaderString.toString()); + } + localVarRequestBuilder.header("Accept", "application/json"); + + List formValues = new ArrayList<>(); + for (int i=0; i < enumFormStringArray.size(); i++) { + if (enumFormStringArray.get(i) != null) { + formValues.add(new BasicNameValuePair("enum_form_string_array", enumFormStringArray.get(i).toString())); + } + } + if (enumFormString != null) { + formValues.add(new BasicNameValuePair("enum_form_string", enumFormString.toString())); + } + HttpEntity entity = new UrlEncodedFormEntity(formValues, java.nio.charset.StandardCharsets.UTF_8); + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + byte[] formBytes = formOutputStream.toByteArray(); + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method("GET", HttpRequest.BodyPublishers + .ofInputStream(() -> new ByteArrayInputStream(formBytes))); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * @param apiRequest {@link APITestGroupParametersRequest} + * @throws ApiException if fails to make API call + */ + public void testGroupParameters(APITestGroupParametersRequest apiRequest) throws ApiException { + testGroupParameters(apiRequest, null); + } + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * @param apiRequest {@link APITestGroupParametersRequest} + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void testGroupParameters(APITestGroupParametersRequest apiRequest, Map headers) throws ApiException { + @javax.annotation.Nonnull + Integer requiredStringGroup = apiRequest.requiredStringGroup(); + @javax.annotation.Nonnull + Boolean requiredBooleanGroup = apiRequest.requiredBooleanGroup(); + @javax.annotation.Nonnull + Long requiredInt64Group = apiRequest.requiredInt64Group(); + @javax.annotation.Nullable + Integer stringGroup = apiRequest.stringGroup(); + @javax.annotation.Nullable + Boolean booleanGroup = apiRequest.booleanGroup(); + @javax.annotation.Nullable + Long int64Group = apiRequest.int64Group(); + testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, headers); + } + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * @param apiRequest {@link APITestGroupParametersRequest} + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testGroupParametersWithHttpInfo(APITestGroupParametersRequest apiRequest) throws ApiException { + return testGroupParametersWithHttpInfo(apiRequest, null); + } + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * @param apiRequest {@link APITestGroupParametersRequest} + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testGroupParametersWithHttpInfo(APITestGroupParametersRequest apiRequest, Map headers) throws ApiException { + Integer requiredStringGroup = apiRequest.requiredStringGroup(); + Boolean requiredBooleanGroup = apiRequest.requiredBooleanGroup(); + Long requiredInt64Group = apiRequest.requiredInt64Group(); + Integer stringGroup = apiRequest.stringGroup(); + Boolean booleanGroup = apiRequest.booleanGroup(); + Long int64Group = apiRequest.int64Group(); + return testGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, headers); + } + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @throws ApiException if fails to make API call + */ + public void testGroupParameters(@javax.annotation.Nonnull Integer requiredStringGroup, @javax.annotation.Nonnull Boolean requiredBooleanGroup, @javax.annotation.Nonnull Long requiredInt64Group, @javax.annotation.Nullable Integer stringGroup, @javax.annotation.Nullable Boolean booleanGroup, @javax.annotation.Nullable Long int64Group) throws ApiException { + testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, null); + } + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void testGroupParameters(@javax.annotation.Nonnull Integer requiredStringGroup, @javax.annotation.Nonnull Boolean requiredBooleanGroup, @javax.annotation.Nonnull Long requiredInt64Group, @javax.annotation.Nullable Integer stringGroup, @javax.annotation.Nullable Boolean booleanGroup, @javax.annotation.Nullable Long int64Group, Map headers) throws ApiException { + testGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, headers); + } + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testGroupParametersWithHttpInfo(@javax.annotation.Nonnull Integer requiredStringGroup, @javax.annotation.Nonnull Boolean requiredBooleanGroup, @javax.annotation.Nonnull Long requiredInt64Group, @javax.annotation.Nullable Integer stringGroup, @javax.annotation.Nullable Boolean booleanGroup, @javax.annotation.Nullable Long int64Group) throws ApiException { + return testGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, null); + } + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testGroupParametersWithHttpInfo(@javax.annotation.Nonnull Integer requiredStringGroup, @javax.annotation.Nonnull Boolean requiredBooleanGroup, @javax.annotation.Nonnull Long requiredInt64Group, @javax.annotation.Nullable Integer stringGroup, @javax.annotation.Nullable Boolean booleanGroup, @javax.annotation.Nullable Long int64Group, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = testGroupParametersRequestBuilder(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testGroupParameters", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody != null) { + localVarResponseBody.readAllBytes(); + } + return new ApiResponse<>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder testGroupParametersRequestBuilder(@javax.annotation.Nonnull Integer requiredStringGroup, @javax.annotation.Nonnull Boolean requiredBooleanGroup, @javax.annotation.Nonnull Long requiredInt64Group, @javax.annotation.Nullable Integer stringGroup, @javax.annotation.Nullable Boolean booleanGroup, @javax.annotation.Nullable Long int64Group, Map headers) throws ApiException { + // verify the required parameter 'requiredStringGroup' is set + if (requiredStringGroup == null) { + throw new ApiException(400, "Missing the required parameter 'requiredStringGroup' when calling testGroupParameters"); + } + // verify the required parameter 'requiredBooleanGroup' is set + if (requiredBooleanGroup == null) { + throw new ApiException(400, "Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters"); + } + // verify the required parameter 'requiredInt64Group' is set + if (requiredInt64Group == null) { + throw new ApiException(400, "Missing the required parameter 'requiredInt64Group' when calling testGroupParameters"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "required_string_group"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("required_string_group", requiredStringGroup)); + localVarQueryParameterBaseName = "required_int64_group"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("required_int64_group", requiredInt64Group)); + localVarQueryParameterBaseName = "string_group"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("string_group", stringGroup)); + localVarQueryParameterBaseName = "int64_group"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("int64_group", int64Group)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + if (requiredBooleanGroup != null) { + localVarRequestBuilder.header("required_boolean_group", requiredBooleanGroup.toString()); + } + if (booleanGroup != null) { + localVarRequestBuilder.header("boolean_group", booleanGroup.toString()); + } + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + + public static final class APITestGroupParametersRequest { + @javax.annotation.Nonnull + private Integer requiredStringGroup; // Required String in group parameters (required) + @javax.annotation.Nonnull + private Boolean requiredBooleanGroup; // Required Boolean in group parameters (required) + @javax.annotation.Nonnull + private Long requiredInt64Group; // Required Integer in group parameters (required) + @javax.annotation.Nullable + private Integer stringGroup; // String in group parameters (optional) + @javax.annotation.Nullable + private Boolean booleanGroup; // Boolean in group parameters (optional) + @javax.annotation.Nullable + private Long int64Group; // Integer in group parameters (optional) + + private APITestGroupParametersRequest(Builder builder) { + this.requiredStringGroup = builder.requiredStringGroup; + this.requiredBooleanGroup = builder.requiredBooleanGroup; + this.requiredInt64Group = builder.requiredInt64Group; + this.stringGroup = builder.stringGroup; + this.booleanGroup = builder.booleanGroup; + this.int64Group = builder.int64Group; + } + @javax.annotation.Nonnull + public Integer requiredStringGroup() { + return requiredStringGroup; + } + @javax.annotation.Nonnull + public Boolean requiredBooleanGroup() { + return requiredBooleanGroup; + } + @javax.annotation.Nonnull + public Long requiredInt64Group() { + return requiredInt64Group; + } + @javax.annotation.Nullable + public Integer stringGroup() { + return stringGroup; + } + @javax.annotation.Nullable + public Boolean booleanGroup() { + return booleanGroup; + } + @javax.annotation.Nullable + public Long int64Group() { + return int64Group; + } + public static Builder newBuilder() { + return new Builder(); + } + + public static class Builder { + private Integer requiredStringGroup; + private Boolean requiredBooleanGroup; + private Long requiredInt64Group; + private Integer stringGroup; + private Boolean booleanGroup; + private Long int64Group; + + public Builder requiredStringGroup(@javax.annotation.Nonnull Integer requiredStringGroup) { + this.requiredStringGroup = requiredStringGroup; + return this; + } + public Builder requiredBooleanGroup(@javax.annotation.Nonnull Boolean requiredBooleanGroup) { + this.requiredBooleanGroup = requiredBooleanGroup; + return this; + } + public Builder requiredInt64Group(@javax.annotation.Nonnull Long requiredInt64Group) { + this.requiredInt64Group = requiredInt64Group; + return this; + } + public Builder stringGroup(@javax.annotation.Nullable Integer stringGroup) { + this.stringGroup = stringGroup; + return this; + } + public Builder booleanGroup(@javax.annotation.Nullable Boolean booleanGroup) { + this.booleanGroup = booleanGroup; + return this; + } + public Builder int64Group(@javax.annotation.Nullable Long int64Group) { + this.int64Group = int64Group; + return this; + } + public APITestGroupParametersRequest build() { + return new APITestGroupParametersRequest(this); + } + } + } + + /** + * test inline additionalProperties + * + * @param requestBody request body (required) + * @throws ApiException if fails to make API call + */ + public void testInlineAdditionalProperties(@javax.annotation.Nonnull Map requestBody) throws ApiException { + testInlineAdditionalProperties(requestBody, null); + } + + /** + * test inline additionalProperties + * + * @param requestBody request body (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void testInlineAdditionalProperties(@javax.annotation.Nonnull Map requestBody, Map headers) throws ApiException { + testInlineAdditionalPropertiesWithHttpInfo(requestBody, headers); + } + + /** + * test inline additionalProperties + * + * @param requestBody request body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(@javax.annotation.Nonnull Map requestBody) throws ApiException { + return testInlineAdditionalPropertiesWithHttpInfo(requestBody, null); + } + + /** + * test inline additionalProperties + * + * @param requestBody request body (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(@javax.annotation.Nonnull Map requestBody, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = testInlineAdditionalPropertiesRequestBuilder(requestBody, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testInlineAdditionalProperties", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody != null) { + localVarResponseBody.readAllBytes(); + } + return new ApiResponse<>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder testInlineAdditionalPropertiesRequestBuilder(@javax.annotation.Nonnull Map requestBody, Map headers) throws ApiException { + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new ApiException(400, "Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake/inline-additionalProperties"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(requestBody); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * test inline free-form additionalProperties + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @throws ApiException if fails to make API call + */ + public void testInlineFreeformAdditionalProperties(@javax.annotation.Nonnull TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws ApiException { + testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest, null); + } + + /** + * test inline free-form additionalProperties + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void testInlineFreeformAdditionalProperties(@javax.annotation.Nonnull TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, Map headers) throws ApiException { + testInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest, headers); + } + + /** + * test inline free-form additionalProperties + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testInlineFreeformAdditionalPropertiesWithHttpInfo(@javax.annotation.Nonnull TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) throws ApiException { + return testInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest, null); + } + + /** + * test inline free-form additionalProperties + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testInlineFreeformAdditionalPropertiesWithHttpInfo(@javax.annotation.Nonnull TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = testInlineFreeformAdditionalPropertiesRequestBuilder(testInlineFreeformAdditionalPropertiesRequest, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testInlineFreeformAdditionalProperties", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody != null) { + localVarResponseBody.readAllBytes(); + } + return new ApiResponse<>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder testInlineFreeformAdditionalPropertiesRequestBuilder(@javax.annotation.Nonnull TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest, Map headers) throws ApiException { + // verify the required parameter 'testInlineFreeformAdditionalPropertiesRequest' is set + if (testInlineFreeformAdditionalPropertiesRequest == null) { + throw new ApiException(400, "Missing the required parameter 'testInlineFreeformAdditionalPropertiesRequest' when calling testInlineFreeformAdditionalProperties"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake/inline-freeform-additionalProperties"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(testInlineFreeformAdditionalPropertiesRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @throws ApiException if fails to make API call + */ + public void testJsonFormData(@javax.annotation.Nonnull String param, @javax.annotation.Nonnull String param2) throws ApiException { + testJsonFormData(param, param2, null); + } + + /** + * test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void testJsonFormData(@javax.annotation.Nonnull String param, @javax.annotation.Nonnull String param2, Map headers) throws ApiException { + testJsonFormDataWithHttpInfo(param, param2, headers); + } + + /** + * test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testJsonFormDataWithHttpInfo(@javax.annotation.Nonnull String param, @javax.annotation.Nonnull String param2) throws ApiException { + return testJsonFormDataWithHttpInfo(param, param2, null); + } + + /** + * test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testJsonFormDataWithHttpInfo(@javax.annotation.Nonnull String param, @javax.annotation.Nonnull String param2, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = testJsonFormDataRequestBuilder(param, param2, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testJsonFormData", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody != null) { + localVarResponseBody.readAllBytes(); + } + return new ApiResponse<>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder testJsonFormDataRequestBuilder(@javax.annotation.Nonnull String param, @javax.annotation.Nonnull String param2, Map headers) throws ApiException { + // verify the required parameter 'param' is set + if (param == null) { + throw new ApiException(400, "Missing the required parameter 'param' when calling testJsonFormData"); + } + // verify the required parameter 'param2' is set + if (param2 == null) { + throw new ApiException(400, "Missing the required parameter 'param2' when calling testJsonFormData"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake/jsonFormData"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + List formValues = new ArrayList<>(); + if (param != null) { + formValues.add(new BasicNameValuePair("param", param.toString())); + } + if (param2 != null) { + formValues.add(new BasicNameValuePair("param2", param2.toString())); + } + HttpEntity entity = new UrlEncodedFormEntity(formValues, java.nio.charset.StandardCharsets.UTF_8); + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + byte[] formBytes = formOutputStream.toByteArray(); + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method("GET", HttpRequest.BodyPublishers + .ofInputStream(() -> new ByteArrayInputStream(formBytes))); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @throws ApiException if fails to make API call + */ + public void testQueryParameterCollectionFormat(@javax.annotation.Nonnull List pipe, @javax.annotation.Nonnull List ioutil, @javax.annotation.Nonnull List http, @javax.annotation.Nonnull List url, @javax.annotation.Nonnull List context) throws ApiException { + testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, null); + } + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void testQueryParameterCollectionFormat(@javax.annotation.Nonnull List pipe, @javax.annotation.Nonnull List ioutil, @javax.annotation.Nonnull List http, @javax.annotation.Nonnull List url, @javax.annotation.Nonnull List context, Map headers) throws ApiException { + testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, headers); + } + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(@javax.annotation.Nonnull List pipe, @javax.annotation.Nonnull List ioutil, @javax.annotation.Nonnull List http, @javax.annotation.Nonnull List url, @javax.annotation.Nonnull List context) throws ApiException { + return testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context, null); + } + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(@javax.annotation.Nonnull List pipe, @javax.annotation.Nonnull List ioutil, @javax.annotation.Nonnull List http, @javax.annotation.Nonnull List url, @javax.annotation.Nonnull List context, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = testQueryParameterCollectionFormatRequestBuilder(pipe, ioutil, http, url, context, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testQueryParameterCollectionFormat", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody != null) { + localVarResponseBody.readAllBytes(); + } + return new ApiResponse<>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder testQueryParameterCollectionFormatRequestBuilder(@javax.annotation.Nonnull List pipe, @javax.annotation.Nonnull List ioutil, @javax.annotation.Nonnull List http, @javax.annotation.Nonnull List url, @javax.annotation.Nonnull List context, Map headers) throws ApiException { + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new ApiException(400, "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + } + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new ApiException(400, "Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + } + // verify the required parameter 'http' is set + if (http == null) { + throw new ApiException(400, "Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + } + // verify the required parameter 'url' is set + if (url == null) { + throw new ApiException(400, "Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + } + // verify the required parameter 'context' is set + if (context == null) { + throw new ApiException(400, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake/test-query-parameters"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "pipe"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "pipe", pipe)); + localVarQueryParameterBaseName = "ioutil"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "ioutil", ioutil)); + localVarQueryParameterBaseName = "http"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("ssv", "http", http)); + localVarQueryParameterBaseName = "url"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "url", url)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "context", context)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * test referenced string map + * + * @param requestBody request body (required) + * @throws ApiException if fails to make API call + */ + public void testStringMapReference(@javax.annotation.Nonnull Map requestBody) throws ApiException { + testStringMapReference(requestBody, null); + } + + /** + * test referenced string map + * + * @param requestBody request body (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void testStringMapReference(@javax.annotation.Nonnull Map requestBody, Map headers) throws ApiException { + testStringMapReferenceWithHttpInfo(requestBody, headers); + } + + /** + * test referenced string map + * + * @param requestBody request body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testStringMapReferenceWithHttpInfo(@javax.annotation.Nonnull Map requestBody) throws ApiException { + return testStringMapReferenceWithHttpInfo(requestBody, null); + } + + /** + * test referenced string map + * + * @param requestBody request body (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testStringMapReferenceWithHttpInfo(@javax.annotation.Nonnull Map requestBody, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = testStringMapReferenceRequestBuilder(requestBody, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testStringMapReference", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody != null) { + localVarResponseBody.readAllBytes(); + } + return new ApiResponse<>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder testStringMapReferenceRequestBuilder(@javax.annotation.Nonnull Map requestBody, Map headers) throws ApiException { + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new ApiException(400, "Missing the required parameter 'requestBody' when calling testStringMapReference"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake/stringMap-reference"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(requestBody); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java new file mode 100644 index 000000000000..9cdf901bdbee --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -0,0 +1,294 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; + +import org.openapitools.client.model.Client; + +import tools.jackson.core.type.TypeReference; +import tools.jackson.databind.ObjectMapper; + +import org.apache.http.HttpEntity; +import org.apache.http.NameValuePair; +import org.apache.http.entity.mime.MultipartEntityBuilder; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.client.entity.UrlEncodedFormEntity; + +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.net.http.HttpRequest; +import java.nio.channels.Channels; +import java.nio.channels.Pipe; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; + +import java.util.ArrayList; +import java.util.StringJoiner; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class FakeClassnameTags123Api { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public FakeClassnameTags123Api() { + this(Configuration.getDefaultApiClient()); + } + + public FakeClassnameTags123Api(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + InputStream responseBody = ApiClient.getResponseBody(response); + String body = null; + try { + body = responseBody == null ? null : new String(responseBody.readAllBytes()); + } finally { + if (responseBody != null) { + responseBody.close(); + } + } + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response, InputStream responseBody) throws ApiException { + if (responseBody == null) { + throw new ApiException(new IOException("Response body is empty")); + } + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(responseBody, file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

Prepare the file for download from the response.

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * To test class name in snake case + * To test class name in snake case + * @param client client model (required) + * @return Client + * @throws ApiException if fails to make API call + */ + public Client testClassname(@javax.annotation.Nonnull Client client) throws ApiException { + return testClassname(client, null); + } + + /** + * To test class name in snake case + * To test class name in snake case + * @param client client model (required) + * @param headers Optional headers to include in the request + * @return Client + * @throws ApiException if fails to make API call + */ + public Client testClassname(@javax.annotation.Nonnull Client client, Map headers) throws ApiException { + ApiResponse localVarResponse = testClassnameWithHttpInfo(client, headers); + return localVarResponse.getData(); + } + + /** + * To test class name in snake case + * To test class name in snake case + * @param client client model (required) + * @return ApiResponse<Client> + * @throws ApiException if fails to make API call + */ + public ApiResponse testClassnameWithHttpInfo(@javax.annotation.Nonnull Client client) throws ApiException { + return testClassnameWithHttpInfo(client, null); + } + + /** + * To test class name in snake case + * To test class name in snake case + * @param client client model (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Client> + * @throws ApiException if fails to make API call + */ + public ApiResponse testClassnameWithHttpInfo(@javax.annotation.Nonnull Client client, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = testClassnameRequestBuilder(client, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("testClassname", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + Client responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder testClassnameRequestBuilder(@javax.annotation.Nonnull Client client, Map headers) throws ApiException { + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException(400, "Missing the required parameter 'client' when calling testClassname"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake_classname_test"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(client); + localVarRequestBuilder.method("PATCH", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/PetApi.java new file mode 100644 index 000000000000..242d3104cea0 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/PetApi.java @@ -0,0 +1,1352 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; + +import java.io.File; +import org.openapitools.client.model.ModelApiResponse; +import org.openapitools.client.model.Pet; + +import tools.jackson.core.type.TypeReference; +import tools.jackson.databind.ObjectMapper; + +import org.apache.http.HttpEntity; +import org.apache.http.NameValuePair; +import org.apache.http.entity.mime.MultipartEntityBuilder; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.client.entity.UrlEncodedFormEntity; + +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.net.http.HttpRequest; +import java.nio.channels.Channels; +import java.nio.channels.Pipe; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; + +import java.util.ArrayList; +import java.util.StringJoiner; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class PetApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public PetApi() { + this(Configuration.getDefaultApiClient()); + } + + public PetApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + InputStream responseBody = ApiClient.getResponseBody(response); + String body = null; + try { + body = responseBody == null ? null : new String(responseBody.readAllBytes()); + } finally { + if (responseBody != null) { + responseBody.close(); + } + } + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response, InputStream responseBody) throws ApiException { + if (responseBody == null) { + throw new ApiException(new IOException("Response body is empty")); + } + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(responseBody, file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

Prepare the file for download from the response.

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store (required) + * @throws ApiException if fails to make API call + */ + public void addPet(@javax.annotation.Nonnull Pet pet) throws ApiException { + addPet(pet, null); + } + + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void addPet(@javax.annotation.Nonnull Pet pet, Map headers) throws ApiException { + addPetWithHttpInfo(pet, headers); + } + + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse addPetWithHttpInfo(@javax.annotation.Nonnull Pet pet) throws ApiException { + return addPetWithHttpInfo(pet, null); + } + + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse addPetWithHttpInfo(@javax.annotation.Nonnull Pet pet, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = addPetRequestBuilder(pet, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("addPet", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody != null) { + localVarResponseBody.readAllBytes(); + } + return new ApiResponse<>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder addPetRequestBuilder(@javax.annotation.Nonnull Pet pet, Map headers) throws ApiException { + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException(400, "Missing the required parameter 'pet' when calling addPet"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/pet"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(pet); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @throws ApiException if fails to make API call + */ + public void deletePet(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String apiKey) throws ApiException { + deletePet(petId, apiKey, null); + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deletePet(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String apiKey, Map headers) throws ApiException { + deletePetWithHttpInfo(petId, apiKey, headers); + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deletePetWithHttpInfo(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String apiKey) throws ApiException { + return deletePetWithHttpInfo(petId, apiKey, null); + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deletePetWithHttpInfo(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String apiKey, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deletePetRequestBuilder(petId, apiKey, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("deletePet", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody != null) { + localVarResponseBody.readAllBytes(); + } + return new ApiResponse<>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deletePetRequestBuilder(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String apiKey, Map headers) throws ApiException { + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException(400, "Missing the required parameter 'petId' when calling deletePet"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/pet/{petId}" + .replace("{petId}", ApiClient.urlEncode(petId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (apiKey != null) { + localVarRequestBuilder.header("api_key", apiKey.toString()); + } + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @return List<Pet> + * @throws ApiException if fails to make API call + */ + public List findPetsByStatus(@javax.annotation.Nonnull List status) throws ApiException { + return findPetsByStatus(status, null); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @param headers Optional headers to include in the request + * @return List<Pet> + * @throws ApiException if fails to make API call + */ + public List findPetsByStatus(@javax.annotation.Nonnull List status, Map headers) throws ApiException { + ApiResponse> localVarResponse = findPetsByStatusWithHttpInfo(status, headers); + return localVarResponse.getData(); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @return ApiResponse<List<Pet>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> findPetsByStatusWithHttpInfo(@javax.annotation.Nonnull List status) throws ApiException { + return findPetsByStatusWithHttpInfo(status, null); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<Pet>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> findPetsByStatusWithHttpInfo(@javax.annotation.Nonnull List status, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = findPetsByStatusRequestBuilder(status, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("findPetsByStatus", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + List responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference>() {}); + + + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder findPetsByStatusRequestBuilder(@javax.annotation.Nonnull List status, Map headers) throws ApiException { + // verify the required parameter 'status' is set + if (status == null) { + throw new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/pet/findByStatus"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "status"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "status", status)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/xml, application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @return List<Pet> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public List findPetsByTags(@javax.annotation.Nonnull List tags) throws ApiException { + return findPetsByTags(tags, null); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @param headers Optional headers to include in the request + * @return List<Pet> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public List findPetsByTags(@javax.annotation.Nonnull List tags, Map headers) throws ApiException { + ApiResponse> localVarResponse = findPetsByTagsWithHttpInfo(tags, headers); + return localVarResponse.getData(); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @return ApiResponse<List<Pet>> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse> findPetsByTagsWithHttpInfo(@javax.annotation.Nonnull List tags) throws ApiException { + return findPetsByTagsWithHttpInfo(tags, null); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<List<Pet>> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse> findPetsByTagsWithHttpInfo(@javax.annotation.Nonnull List tags, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = findPetsByTagsRequestBuilder(tags, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("findPetsByTags", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + List responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference>() {}); + + + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder findPetsByTagsRequestBuilder(@javax.annotation.Nonnull List tags, Map headers) throws ApiException { + // verify the required parameter 'tags' is set + if (tags == null) { + throw new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/pet/findByTags"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tags"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "tags", tags)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/xml, application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return (required) + * @return Pet + * @throws ApiException if fails to make API call + */ + public Pet getPetById(@javax.annotation.Nonnull Long petId) throws ApiException { + return getPetById(petId, null); + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return (required) + * @param headers Optional headers to include in the request + * @return Pet + * @throws ApiException if fails to make API call + */ + public Pet getPetById(@javax.annotation.Nonnull Long petId, Map headers) throws ApiException { + ApiResponse localVarResponse = getPetByIdWithHttpInfo(petId, headers); + return localVarResponse.getData(); + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return (required) + * @return ApiResponse<Pet> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPetByIdWithHttpInfo(@javax.annotation.Nonnull Long petId) throws ApiException { + return getPetByIdWithHttpInfo(petId, null); + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Pet> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPetByIdWithHttpInfo(@javax.annotation.Nonnull Long petId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPetByIdRequestBuilder(petId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getPetById", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + Pet responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPetByIdRequestBuilder(@javax.annotation.Nonnull Long petId, Map headers) throws ApiException { + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetById"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/pet/{petId}" + .replace("{petId}", ApiClient.urlEncode(petId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/xml, application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store (required) + * @throws ApiException if fails to make API call + */ + public void updatePet(@javax.annotation.Nonnull Pet pet) throws ApiException { + updatePet(pet, null); + } + + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updatePet(@javax.annotation.Nonnull Pet pet, Map headers) throws ApiException { + updatePetWithHttpInfo(pet, headers); + } + + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updatePetWithHttpInfo(@javax.annotation.Nonnull Pet pet) throws ApiException { + return updatePetWithHttpInfo(pet, null); + } + + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updatePetWithHttpInfo(@javax.annotation.Nonnull Pet pet, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updatePetRequestBuilder(pet, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("updatePet", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody != null) { + localVarResponseBody.readAllBytes(); + } + return new ApiResponse<>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updatePetRequestBuilder(@javax.annotation.Nonnull Pet pet, Map headers) throws ApiException { + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException(400, "Missing the required parameter 'pet' when calling updatePet"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/pet"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(pet); + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @throws ApiException if fails to make API call + */ + public void updatePetWithForm(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String name, @javax.annotation.Nullable String status) throws ApiException { + updatePetWithForm(petId, name, status, null); + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updatePetWithForm(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String name, @javax.annotation.Nullable String status, Map headers) throws ApiException { + updatePetWithFormWithHttpInfo(petId, name, status, headers); + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updatePetWithFormWithHttpInfo(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String name, @javax.annotation.Nullable String status) throws ApiException { + return updatePetWithFormWithHttpInfo(petId, name, status, null); + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updatePetWithFormWithHttpInfo(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String name, @javax.annotation.Nullable String status, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updatePetWithFormRequestBuilder(petId, name, status, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("updatePetWithForm", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody != null) { + localVarResponseBody.readAllBytes(); + } + return new ApiResponse<>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updatePetWithFormRequestBuilder(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String name, @javax.annotation.Nullable String status, Map headers) throws ApiException { + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/pet/{petId}" + .replace("{petId}", ApiClient.urlEncode(petId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + List formValues = new ArrayList<>(); + if (name != null) { + formValues.add(new BasicNameValuePair("name", name.toString())); + } + if (status != null) { + formValues.add(new BasicNameValuePair("status", status.toString())); + } + HttpEntity entity = new UrlEncodedFormEntity(formValues, java.nio.charset.StandardCharsets.UTF_8); + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + byte[] formBytes = formOutputStream.toByteArray(); + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method("POST", HttpRequest.BodyPublishers + .ofInputStream(() -> new ByteArrayInputStream(formBytes))); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param _file file to upload (optional) + * @return ModelApiResponse + * @throws ApiException if fails to make API call + */ + public ModelApiResponse uploadFile(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String additionalMetadata, @javax.annotation.Nullable File _file) throws ApiException { + return uploadFile(petId, additionalMetadata, _file, null); + } + + /** + * uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param _file file to upload (optional) + * @param headers Optional headers to include in the request + * @return ModelApiResponse + * @throws ApiException if fails to make API call + */ + public ModelApiResponse uploadFile(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String additionalMetadata, @javax.annotation.Nullable File _file, Map headers) throws ApiException { + ApiResponse localVarResponse = uploadFileWithHttpInfo(petId, additionalMetadata, _file, headers); + return localVarResponse.getData(); + } + + /** + * uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param _file file to upload (optional) + * @return ApiResponse<ModelApiResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse uploadFileWithHttpInfo(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String additionalMetadata, @javax.annotation.Nullable File _file) throws ApiException { + return uploadFileWithHttpInfo(petId, additionalMetadata, _file, null); + } + + /** + * uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param _file file to upload (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<ModelApiResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse uploadFileWithHttpInfo(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String additionalMetadata, @javax.annotation.Nullable File _file, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uploadFileRequestBuilder(petId, additionalMetadata, _file, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("uploadFile", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + ModelApiResponse responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder uploadFileRequestBuilder(@javax.annotation.Nonnull Long petId, @javax.annotation.Nullable String additionalMetadata, @javax.annotation.Nullable File _file, Map headers) throws ApiException { + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/pet/{petId}/uploadImage" + .replace("{petId}", ApiClient.urlEncode(petId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create(); + boolean hasFiles = false; + if (additionalMetadata != null) { + multiPartBuilder.addTextBody("additionalMetadata", additionalMetadata.toString()); + } + multiPartBuilder.addBinaryBody("file", _file); + hasFiles = true; + HttpEntity entity = multiPartBuilder.build(); + HttpRequest.BodyPublisher formDataPublisher; + if (hasFiles) { + Pipe pipe; + try { + pipe = Pipe.open(); + } catch (IOException e) { + throw new RuntimeException(e); + } + new Thread(() -> { + try (OutputStream outputStream = Channels.newOutputStream(pipe.sink())) { + entity.writeTo(outputStream); + } catch (IOException e) { + e.printStackTrace(); + } + }).start(); + formDataPublisher = HttpRequest.BodyPublishers.ofInputStream(() -> Channels.newInputStream(pipe.source())); + } else { + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + byte[] formBytes = formOutputStream.toByteArray(); + formDataPublisher = HttpRequest.BodyPublishers + .ofInputStream(() -> new ByteArrayInputStream(formBytes)); + } + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method("POST", formDataPublisher); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return ModelApiResponse + * @throws ApiException if fails to make API call + */ + public ModelApiResponse uploadFileWithRequiredFile(@javax.annotation.Nonnull Long petId, @javax.annotation.Nonnull File requiredFile, @javax.annotation.Nullable String additionalMetadata) throws ApiException { + return uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata, null); + } + + /** + * uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param headers Optional headers to include in the request + * @return ModelApiResponse + * @throws ApiException if fails to make API call + */ + public ModelApiResponse uploadFileWithRequiredFile(@javax.annotation.Nonnull Long petId, @javax.annotation.Nonnull File requiredFile, @javax.annotation.Nullable String additionalMetadata, Map headers) throws ApiException { + ApiResponse localVarResponse = uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata, headers); + return localVarResponse.getData(); + } + + /** + * uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return ApiResponse<ModelApiResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse uploadFileWithRequiredFileWithHttpInfo(@javax.annotation.Nonnull Long petId, @javax.annotation.Nonnull File requiredFile, @javax.annotation.Nullable String additionalMetadata) throws ApiException { + return uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata, null); + } + + /** + * uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param headers Optional headers to include in the request + * @return ApiResponse<ModelApiResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse uploadFileWithRequiredFileWithHttpInfo(@javax.annotation.Nonnull Long petId, @javax.annotation.Nonnull File requiredFile, @javax.annotation.Nullable String additionalMetadata, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = uploadFileWithRequiredFileRequestBuilder(petId, requiredFile, additionalMetadata, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("uploadFileWithRequiredFile", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + ModelApiResponse responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder uploadFileWithRequiredFileRequestBuilder(@javax.annotation.Nonnull Long petId, @javax.annotation.Nonnull File requiredFile, @javax.annotation.Nullable String additionalMetadata, Map headers) throws ApiException { + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile"); + } + // verify the required parameter 'requiredFile' is set + if (requiredFile == null) { + throw new ApiException(400, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile" + .replace("{petId}", ApiClient.urlEncode(petId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create(); + boolean hasFiles = false; + if (additionalMetadata != null) { + multiPartBuilder.addTextBody("additionalMetadata", additionalMetadata.toString()); + } + multiPartBuilder.addBinaryBody("requiredFile", requiredFile); + hasFiles = true; + HttpEntity entity = multiPartBuilder.build(); + HttpRequest.BodyPublisher formDataPublisher; + if (hasFiles) { + Pipe pipe; + try { + pipe = Pipe.open(); + } catch (IOException e) { + throw new RuntimeException(e); + } + new Thread(() -> { + try (OutputStream outputStream = Channels.newOutputStream(pipe.sink())) { + entity.writeTo(outputStream); + } catch (IOException e) { + e.printStackTrace(); + } + }).start(); + formDataPublisher = HttpRequest.BodyPublishers.ofInputStream(() -> Channels.newInputStream(pipe.source())); + } else { + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + byte[] formBytes = formOutputStream.toByteArray(); + formDataPublisher = HttpRequest.BodyPublishers + .ofInputStream(() -> new ByteArrayInputStream(formBytes)); + } + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method("POST", formDataPublisher); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/StoreApi.java new file mode 100644 index 000000000000..3a88571403e2 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/StoreApi.java @@ -0,0 +1,625 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; + +import org.openapitools.client.model.Order; + +import tools.jackson.core.type.TypeReference; +import tools.jackson.databind.ObjectMapper; + +import org.apache.http.HttpEntity; +import org.apache.http.NameValuePair; +import org.apache.http.entity.mime.MultipartEntityBuilder; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.client.entity.UrlEncodedFormEntity; + +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.net.http.HttpRequest; +import java.nio.channels.Channels; +import java.nio.channels.Pipe; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; + +import java.util.ArrayList; +import java.util.StringJoiner; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class StoreApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public StoreApi() { + this(Configuration.getDefaultApiClient()); + } + + public StoreApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + InputStream responseBody = ApiClient.getResponseBody(response); + String body = null; + try { + body = responseBody == null ? null : new String(responseBody.readAllBytes()); + } finally { + if (responseBody != null) { + responseBody.close(); + } + } + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response, InputStream responseBody) throws ApiException { + if (responseBody == null) { + throw new ApiException(new IOException("Response body is empty")); + } + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(responseBody, file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

Prepare the file for download from the response.

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @throws ApiException if fails to make API call + */ + public void deleteOrder(@javax.annotation.Nonnull String orderId) throws ApiException { + deleteOrder(orderId, null); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteOrder(@javax.annotation.Nonnull String orderId, Map headers) throws ApiException { + deleteOrderWithHttpInfo(orderId, headers); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteOrderWithHttpInfo(@javax.annotation.Nonnull String orderId) throws ApiException { + return deleteOrderWithHttpInfo(orderId, null); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteOrderWithHttpInfo(@javax.annotation.Nonnull String orderId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteOrderRequestBuilder(orderId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("deleteOrder", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody != null) { + localVarResponseBody.readAllBytes(); + } + return new ApiResponse<>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteOrderRequestBuilder(@javax.annotation.Nonnull String orderId, Map headers) throws ApiException { + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/store/order/{order_id}" + .replace("{order_id}", ApiClient.urlEncode(orderId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return Map<String, Integer> + * @throws ApiException if fails to make API call + */ + public Map getInventory() throws ApiException { + return getInventory(null); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @param headers Optional headers to include in the request + * @return Map<String, Integer> + * @throws ApiException if fails to make API call + */ + public Map getInventory(Map headers) throws ApiException { + ApiResponse> localVarResponse = getInventoryWithHttpInfo(headers); + return localVarResponse.getData(); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return ApiResponse<Map<String, Integer>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getInventoryWithHttpInfo() throws ApiException { + return getInventoryWithHttpInfo(null); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @param headers Optional headers to include in the request + * @return ApiResponse<Map<String, Integer>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getInventoryWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getInventoryRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getInventory", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + Map responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference>() {}); + + + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getInventoryRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/store/inventory"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @return Order + * @throws ApiException if fails to make API call + */ + public Order getOrderById(@javax.annotation.Nonnull Long orderId) throws ApiException { + return getOrderById(orderId, null); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @param headers Optional headers to include in the request + * @return Order + * @throws ApiException if fails to make API call + */ + public Order getOrderById(@javax.annotation.Nonnull Long orderId, Map headers) throws ApiException { + ApiResponse localVarResponse = getOrderByIdWithHttpInfo(orderId, headers); + return localVarResponse.getData(); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @return ApiResponse<Order> + * @throws ApiException if fails to make API call + */ + public ApiResponse getOrderByIdWithHttpInfo(@javax.annotation.Nonnull Long orderId) throws ApiException { + return getOrderByIdWithHttpInfo(orderId, null); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Order> + * @throws ApiException if fails to make API call + */ + public ApiResponse getOrderByIdWithHttpInfo(@javax.annotation.Nonnull Long orderId, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getOrderByIdRequestBuilder(orderId, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getOrderById", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + Order responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getOrderByIdRequestBuilder(@javax.annotation.Nonnull Long orderId, Map headers) throws ApiException { + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/store/order/{order_id}" + .replace("{order_id}", ApiClient.urlEncode(orderId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/xml, application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet (required) + * @return Order + * @throws ApiException if fails to make API call + */ + public Order placeOrder(@javax.annotation.Nonnull Order order) throws ApiException { + return placeOrder(order, null); + } + + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet (required) + * @param headers Optional headers to include in the request + * @return Order + * @throws ApiException if fails to make API call + */ + public Order placeOrder(@javax.annotation.Nonnull Order order, Map headers) throws ApiException { + ApiResponse localVarResponse = placeOrderWithHttpInfo(order, headers); + return localVarResponse.getData(); + } + + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet (required) + * @return ApiResponse<Order> + * @throws ApiException if fails to make API call + */ + public ApiResponse placeOrderWithHttpInfo(@javax.annotation.Nonnull Order order) throws ApiException { + return placeOrderWithHttpInfo(order, null); + } + + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Order> + * @throws ApiException if fails to make API call + */ + public ApiResponse placeOrderWithHttpInfo(@javax.annotation.Nonnull Order order, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = placeOrderRequestBuilder(order, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("placeOrder", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + Order responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder placeOrderRequestBuilder(@javax.annotation.Nonnull Order order, Map headers) throws ApiException { + // verify the required parameter 'order' is set + if (order == null) { + throw new ApiException(400, "Missing the required parameter 'order' when calling placeOrder"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/store/order"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/xml, application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(order); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/UserApi.java new file mode 100644 index 000000000000..dfc7142a700f --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/api/UserApi.java @@ -0,0 +1,1076 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; + +import java.time.OffsetDateTime; +import org.openapitools.client.model.User; + +import tools.jackson.core.type.TypeReference; +import tools.jackson.databind.ObjectMapper; + +import org.apache.http.HttpEntity; +import org.apache.http.NameValuePair; +import org.apache.http.entity.mime.MultipartEntityBuilder; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.client.entity.UrlEncodedFormEntity; + +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.net.http.HttpRequest; +import java.nio.channels.Channels; +import java.nio.channels.Pipe; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; + +import java.util.ArrayList; +import java.util.StringJoiner; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class UserApi { + /** + * Utility class for extending HttpRequest.Builder functionality. + */ + private static class HttpRequestBuilderExtensions { + /** + * Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific headers. + * + * @param builder the HttpRequest.Builder to which headers will be added + * @param headers a map of header names and values to add; may be null + * @return the same HttpRequest.Builder instance with the additional headers set + */ + static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map headers) { + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + } + return builder; + } + } + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public UserApi() { + this(Configuration.getDefaultApiClient()); + } + + public UserApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + InputStream responseBody = ApiClient.getResponseBody(response); + String body = null; + try { + body = responseBody == null ? null : new String(responseBody.readAllBytes()); + } finally { + if (responseBody != null) { + responseBody.close(); + } + } + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(HttpResponse response, InputStream responseBody) throws ApiException { + if (responseBody == null) { + throw new ApiException(new IOException("Response body is empty")); + } + try { + File file = prepareDownloadFile(response); + java.nio.file.Files.copy(responseBody, file.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

Prepare the file for download from the response.

+ * + * @param response a {@link java.net.http.HttpResponse} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + private File prepareDownloadFile(HttpResponse response) throws IOException { + String filename = null; + java.util.Optional contentDisposition = response.headers().firstValue("Content-Disposition"); + if (contentDisposition.isPresent() && !"".equals(contentDisposition.get())) { + // Get filename from the Content-Disposition header. + java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + java.util.regex.Matcher matcher = pattern.matcher(contentDisposition.get()); + if (matcher.find()) + filename = matcher.group(1); + } + File file = null; + if (filename != null) { + java.nio.file.Path tempDir = java.nio.file.Files.createTempDirectory("swagger-gen-native"); + java.nio.file.Path filePath = java.nio.file.Files.createFile(tempDir.resolve(filename)); + file = filePath.toFile(); + tempDir.toFile().deleteOnExit(); // best effort cleanup + file.deleteOnExit(); // best effort cleanup + } else { + file = java.nio.file.Files.createTempFile("download-", "").toFile(); + file.deleteOnExit(); // best effort cleanup + } + return file; + } + + /** + * Create user + * This can only be done by the logged in user. + * @param user Created user object (required) + * @throws ApiException if fails to make API call + */ + public void createUser(@javax.annotation.Nonnull User user) throws ApiException { + createUser(user, null); + } + + /** + * Create user + * This can only be done by the logged in user. + * @param user Created user object (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void createUser(@javax.annotation.Nonnull User user, Map headers) throws ApiException { + createUserWithHttpInfo(user, headers); + } + + /** + * Create user + * This can only be done by the logged in user. + * @param user Created user object (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse createUserWithHttpInfo(@javax.annotation.Nonnull User user) throws ApiException { + return createUserWithHttpInfo(user, null); + } + + /** + * Create user + * This can only be done by the logged in user. + * @param user Created user object (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse createUserWithHttpInfo(@javax.annotation.Nonnull User user, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createUserRequestBuilder(user, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("createUser", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody != null) { + localVarResponseBody.readAllBytes(); + } + return new ApiResponse<>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createUserRequestBuilder(@javax.annotation.Nonnull User user, Map headers) throws ApiException { + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling createUser"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/user"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(user); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + * @throws ApiException if fails to make API call + */ + public void createUsersWithArrayInput(@javax.annotation.Nonnull List user) throws ApiException { + createUsersWithArrayInput(user, null); + } + + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void createUsersWithArrayInput(@javax.annotation.Nonnull List user, Map headers) throws ApiException { + createUsersWithArrayInputWithHttpInfo(user, headers); + } + + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse createUsersWithArrayInputWithHttpInfo(@javax.annotation.Nonnull List user) throws ApiException { + return createUsersWithArrayInputWithHttpInfo(user, null); + } + + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse createUsersWithArrayInputWithHttpInfo(@javax.annotation.Nonnull List user, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createUsersWithArrayInputRequestBuilder(user, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("createUsersWithArrayInput", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody != null) { + localVarResponseBody.readAllBytes(); + } + return new ApiResponse<>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createUsersWithArrayInputRequestBuilder(@javax.annotation.Nonnull List user, Map headers) throws ApiException { + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/user/createWithArray"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(user); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + * @throws ApiException if fails to make API call + */ + public void createUsersWithListInput(@javax.annotation.Nonnull List user) throws ApiException { + createUsersWithListInput(user, null); + } + + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void createUsersWithListInput(@javax.annotation.Nonnull List user, Map headers) throws ApiException { + createUsersWithListInputWithHttpInfo(user, headers); + } + + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse createUsersWithListInputWithHttpInfo(@javax.annotation.Nonnull List user) throws ApiException { + return createUsersWithListInputWithHttpInfo(user, null); + } + + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse createUsersWithListInputWithHttpInfo(@javax.annotation.Nonnull List user, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createUsersWithListInputRequestBuilder(user, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("createUsersWithListInput", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody != null) { + localVarResponseBody.readAllBytes(); + } + return new ApiResponse<>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createUsersWithListInputRequestBuilder(@javax.annotation.Nonnull List user, Map headers) throws ApiException { + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/user/createWithList"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(user); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @throws ApiException if fails to make API call + */ + public void deleteUser(@javax.annotation.Nonnull String username) throws ApiException { + deleteUser(username, null); + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void deleteUser(@javax.annotation.Nonnull String username, Map headers) throws ApiException { + deleteUserWithHttpInfo(username, headers); + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteUserWithHttpInfo(@javax.annotation.Nonnull String username) throws ApiException { + return deleteUserWithHttpInfo(username, null); + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteUserWithHttpInfo(@javax.annotation.Nonnull String username, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteUserRequestBuilder(username, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("deleteUser", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody != null) { + localVarResponseBody.readAllBytes(); + } + return new ApiResponse<>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteUserRequestBuilder(@javax.annotation.Nonnull String username, Map headers) throws ApiException { + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException(400, "Missing the required parameter 'username' when calling deleteUser"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/user/{username}" + .replace("{username}", ApiClient.urlEncode(username.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return User + * @throws ApiException if fails to make API call + */ + public User getUserByName(@javax.annotation.Nonnull String username) throws ApiException { + return getUserByName(username, null); + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @param headers Optional headers to include in the request + * @return User + * @throws ApiException if fails to make API call + */ + public User getUserByName(@javax.annotation.Nonnull String username, Map headers) throws ApiException { + ApiResponse localVarResponse = getUserByNameWithHttpInfo(username, headers); + return localVarResponse.getData(); + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return ApiResponse<User> + * @throws ApiException if fails to make API call + */ + public ApiResponse getUserByNameWithHttpInfo(@javax.annotation.Nonnull String username) throws ApiException { + return getUserByNameWithHttpInfo(username, null); + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<User> + * @throws ApiException if fails to make API call + */ + public ApiResponse getUserByNameWithHttpInfo(@javax.annotation.Nonnull String username, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getUserByNameRequestBuilder(username, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getUserByName", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + User responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getUserByNameRequestBuilder(@javax.annotation.Nonnull String username, Map headers) throws ApiException { + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException(400, "Missing the required parameter 'username' when calling getUserByName"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/user/{username}" + .replace("{username}", ApiClient.urlEncode(username.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/xml, application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return String + * @throws ApiException if fails to make API call + */ + public String loginUser(@javax.annotation.Nonnull String username, @javax.annotation.Nonnull String password) throws ApiException { + return loginUser(username, password, null); + } + + /** + * Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @param headers Optional headers to include in the request + * @return String + * @throws ApiException if fails to make API call + */ + public String loginUser(@javax.annotation.Nonnull String username, @javax.annotation.Nonnull String password, Map headers) throws ApiException { + ApiResponse localVarResponse = loginUserWithHttpInfo(username, password, headers); + return localVarResponse.getData(); + } + + /** + * Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse loginUserWithHttpInfo(@javax.annotation.Nonnull String username, @javax.annotation.Nonnull String password) throws ApiException { + return loginUserWithHttpInfo(username, password, null); + } + + /** + * Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse loginUserWithHttpInfo(@javax.annotation.Nonnull String username, @javax.annotation.Nonnull String password, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = loginUserRequestBuilder(username, password, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("loginUser", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody == null) { + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } + + + + String responseBody = new String(localVarResponseBody.readAllBytes()); + String responseValue = responseBody.isBlank()? null: memberVarObjectMapper.readValue(responseBody, new TypeReference() {}); + + + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + responseValue + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder loginUserRequestBuilder(@javax.annotation.Nonnull String username, @javax.annotation.Nonnull String password, Map headers) throws ApiException { + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException(400, "Missing the required parameter 'username' when calling loginUser"); + } + // verify the required parameter 'password' is set + if (password == null) { + throw new ApiException(400, "Missing the required parameter 'password' when calling loginUser"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/user/login"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "username"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("username", username)); + localVarQueryParameterBaseName = "password"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("password", password)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/xml, application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Logs out current logged in user session + * + * @throws ApiException if fails to make API call + */ + public void logoutUser() throws ApiException { + logoutUser(null); + } + + /** + * Logs out current logged in user session + * + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void logoutUser(Map headers) throws ApiException { + logoutUserWithHttpInfo(headers); + } + + /** + * Logs out current logged in user session + * + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse logoutUserWithHttpInfo() throws ApiException { + return logoutUserWithHttpInfo(null); + } + + /** + * Logs out current logged in user session + * + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse logoutUserWithHttpInfo(Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = logoutUserRequestBuilder(headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("logoutUser", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody != null) { + localVarResponseBody.readAllBytes(); + } + return new ApiResponse<>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder logoutUserRequestBuilder(Map headers) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/user/logout"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted (required) + * @param user Updated user object (required) + * @throws ApiException if fails to make API call + */ + public void updateUser(@javax.annotation.Nonnull String username, @javax.annotation.Nonnull User user) throws ApiException { + updateUser(username, user, null); + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted (required) + * @param user Updated user object (required) + * @param headers Optional headers to include in the request + * @throws ApiException if fails to make API call + */ + public void updateUser(@javax.annotation.Nonnull String username, @javax.annotation.Nonnull User user, Map headers) throws ApiException { + updateUserWithHttpInfo(username, user, headers); + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted (required) + * @param user Updated user object (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateUserWithHttpInfo(@javax.annotation.Nonnull String username, @javax.annotation.Nonnull User user) throws ApiException { + return updateUserWithHttpInfo(username, user, null); + } + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted (required) + * @param user Updated user object (required) + * @param headers Optional headers to include in the request + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateUserWithHttpInfo(@javax.annotation.Nonnull String username, @javax.annotation.Nonnull User user, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateUserRequestBuilder(username, user, headers); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + InputStream localVarResponseBody = null; + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("updateUser", localVarResponse); + } + localVarResponseBody = ApiClient.getResponseBody(localVarResponse); + if (localVarResponseBody != null) { + localVarResponseBody.readAllBytes(); + } + return new ApiResponse<>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null + ); + } finally { + if (localVarResponseBody != null) { + localVarResponseBody.close(); + } + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateUserRequestBuilder(@javax.annotation.Nonnull String username, @javax.annotation.Nonnull User user, Map headers) throws ApiException { + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser"); + } + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling updateUser"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/user/{username}" + .replace("{username}", ApiClient.urlEncode(username.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(user); + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + // Add custom headers if provided + localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 000000000000..0698d5760684 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,147 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.lang.reflect.Type; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map> getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + @JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java new file mode 100644 index 000000000000..c4574bcf27d4 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -0,0 +1,530 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * AdditionalPropertiesClass + */ +@JsonPropertyOrder({ + AdditionalPropertiesClass.JSON_PROPERTY_MAP_PROPERTY, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_OF_MAP_PROPERTY, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE1, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3, + AdditionalPropertiesClass.JSON_PROPERTY_EMPTY_MAP, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class AdditionalPropertiesClass { + public static final String JSON_PROPERTY_MAP_PROPERTY = "map_property"; + @javax.annotation.Nullable + private Map mapProperty = new HashMap<>(); + + public static final String JSON_PROPERTY_MAP_OF_MAP_PROPERTY = "map_of_map_property"; + @javax.annotation.Nullable + private Map> mapOfMapProperty = new HashMap<>(); + + public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; + @javax.annotation.Nullable + private Object anytype1 = null; + + public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1 = "map_with_undeclared_properties_anytype_1"; + @javax.annotation.Nullable + private Object mapWithUndeclaredPropertiesAnytype1; + + public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2 = "map_with_undeclared_properties_anytype_2"; + @javax.annotation.Nullable + private Object mapWithUndeclaredPropertiesAnytype2; + + public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3 = "map_with_undeclared_properties_anytype_3"; + @javax.annotation.Nullable + private Map mapWithUndeclaredPropertiesAnytype3 = new HashMap<>(); + + public static final String JSON_PROPERTY_EMPTY_MAP = "empty_map"; + @javax.annotation.Nullable + private Object emptyMap; + + public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING = "map_with_undeclared_properties_string"; + @javax.annotation.Nullable + private Map mapWithUndeclaredPropertiesString = new HashMap<>(); + + public AdditionalPropertiesClass() { + } + + public AdditionalPropertiesClass mapProperty(@javax.annotation.Nullable Map mapProperty) { + this.mapProperty = mapProperty; + return this; + } + + public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap<>(); + } + this.mapProperty.put(key, mapPropertyItem); + return this; + } + + /** + * Get mapProperty + * @return mapProperty + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MAP_PROPERTY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapProperty() { + return mapProperty; + } + + + @JsonProperty(value = JSON_PROPERTY_MAP_PROPERTY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapProperty(@javax.annotation.Nullable Map mapProperty) { + this.mapProperty = mapProperty; + } + + + public AdditionalPropertiesClass mapOfMapProperty(@javax.annotation.Nullable Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + return this; + } + + public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap<>(); + } + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); + return this; + } + + /** + * Get mapOfMapProperty + * @return mapOfMapProperty + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MAP_OF_MAP_PROPERTY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapOfMapProperty() { + return mapOfMapProperty; + } + + + @JsonProperty(value = JSON_PROPERTY_MAP_OF_MAP_PROPERTY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapOfMapProperty(@javax.annotation.Nullable Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + } + + + public AdditionalPropertiesClass anytype1(@javax.annotation.Nullable Object anytype1) { + this.anytype1 = anytype1; + return this; + } + + /** + * Get anytype1 + * @return anytype1 + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ANYTYPE1, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnytype1() { + return anytype1; + } + + + @JsonProperty(value = JSON_PROPERTY_ANYTYPE1, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAnytype1(@javax.annotation.Nullable Object anytype1) { + this.anytype1 = anytype1; + } + + + public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype1(@javax.annotation.Nullable Object mapWithUndeclaredPropertiesAnytype1) { + this.mapWithUndeclaredPropertiesAnytype1 = mapWithUndeclaredPropertiesAnytype1; + return this; + } + + /** + * Get mapWithUndeclaredPropertiesAnytype1 + * @return mapWithUndeclaredPropertiesAnytype1 + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getMapWithUndeclaredPropertiesAnytype1() { + return mapWithUndeclaredPropertiesAnytype1; + } + + + @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapWithUndeclaredPropertiesAnytype1(@javax.annotation.Nullable Object mapWithUndeclaredPropertiesAnytype1) { + this.mapWithUndeclaredPropertiesAnytype1 = mapWithUndeclaredPropertiesAnytype1; + } + + + public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype2(@javax.annotation.Nullable Object mapWithUndeclaredPropertiesAnytype2) { + this.mapWithUndeclaredPropertiesAnytype2 = mapWithUndeclaredPropertiesAnytype2; + return this; + } + + /** + * Get mapWithUndeclaredPropertiesAnytype2 + * @return mapWithUndeclaredPropertiesAnytype2 + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getMapWithUndeclaredPropertiesAnytype2() { + return mapWithUndeclaredPropertiesAnytype2; + } + + + @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapWithUndeclaredPropertiesAnytype2(@javax.annotation.Nullable Object mapWithUndeclaredPropertiesAnytype2) { + this.mapWithUndeclaredPropertiesAnytype2 = mapWithUndeclaredPropertiesAnytype2; + } + + + public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype3(@javax.annotation.Nullable Map mapWithUndeclaredPropertiesAnytype3) { + this.mapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3; + return this; + } + + public AdditionalPropertiesClass putMapWithUndeclaredPropertiesAnytype3Item(String key, Object mapWithUndeclaredPropertiesAnytype3Item) { + if (this.mapWithUndeclaredPropertiesAnytype3 == null) { + this.mapWithUndeclaredPropertiesAnytype3 = new HashMap<>(); + } + this.mapWithUndeclaredPropertiesAnytype3.put(key, mapWithUndeclaredPropertiesAnytype3Item); + return this; + } + + /** + * Get mapWithUndeclaredPropertiesAnytype3 + * @return mapWithUndeclaredPropertiesAnytype3 + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapWithUndeclaredPropertiesAnytype3() { + return mapWithUndeclaredPropertiesAnytype3; + } + + + @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMapWithUndeclaredPropertiesAnytype3(@javax.annotation.Nullable Map mapWithUndeclaredPropertiesAnytype3) { + this.mapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3; + } + + + public AdditionalPropertiesClass emptyMap(@javax.annotation.Nullable Object emptyMap) { + this.emptyMap = emptyMap; + return this; + } + + /** + * an object with no declared properties and no undeclared properties, hence it's an empty map. + * @return emptyMap + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EMPTY_MAP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getEmptyMap() { + return emptyMap; + } + + + @JsonProperty(value = JSON_PROPERTY_EMPTY_MAP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmptyMap(@javax.annotation.Nullable Object emptyMap) { + this.emptyMap = emptyMap; + } + + + public AdditionalPropertiesClass mapWithUndeclaredPropertiesString(@javax.annotation.Nullable Map mapWithUndeclaredPropertiesString) { + this.mapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString; + return this; + } + + public AdditionalPropertiesClass putMapWithUndeclaredPropertiesStringItem(String key, String mapWithUndeclaredPropertiesStringItem) { + if (this.mapWithUndeclaredPropertiesString == null) { + this.mapWithUndeclaredPropertiesString = new HashMap<>(); + } + this.mapWithUndeclaredPropertiesString.put(key, mapWithUndeclaredPropertiesStringItem); + return this; + } + + /** + * Get mapWithUndeclaredPropertiesString + * @return mapWithUndeclaredPropertiesString + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapWithUndeclaredPropertiesString() { + return mapWithUndeclaredPropertiesString; + } + + + @JsonProperty(value = JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapWithUndeclaredPropertiesString(@javax.annotation.Nullable Map mapWithUndeclaredPropertiesString) { + this.mapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString; + } + + + /** + * Return true if this AdditionalPropertiesClass object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesClass {\n"); + sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); + sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); + sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); + sb.append(" mapWithUndeclaredPropertiesAnytype1: ").append(toIndentedString(mapWithUndeclaredPropertiesAnytype1)).append("\n"); + sb.append(" mapWithUndeclaredPropertiesAnytype2: ").append(toIndentedString(mapWithUndeclaredPropertiesAnytype2)).append("\n"); + sb.append(" mapWithUndeclaredPropertiesAnytype3: ").append(toIndentedString(mapWithUndeclaredPropertiesAnytype3)).append("\n"); + sb.append(" emptyMap: ").append(toIndentedString(emptyMap)).append("\n"); + sb.append(" mapWithUndeclaredPropertiesString: ").append(toIndentedString(mapWithUndeclaredPropertiesString)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `map_property` to the URL query string + if (getMapProperty() != null) { + for (String _key : getMapProperty().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%smap_property%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getMapProperty().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getMapProperty().get(_key))))); + } + } + + // add `map_of_map_property` to the URL query string + if (getMapOfMapProperty() != null) { + for (String _key : getMapOfMapProperty().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%smap_of_map_property%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getMapOfMapProperty().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getMapOfMapProperty().get(_key))))); + } + } + + // add `anytype_1` to the URL query string + if (getAnytype1() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sanytype_1%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAnytype1())))); + } + + // add `map_with_undeclared_properties_anytype_1` to the URL query string + if (getMapWithUndeclaredPropertiesAnytype1() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smap_with_undeclared_properties_anytype_1%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMapWithUndeclaredPropertiesAnytype1())))); + } + + // add `map_with_undeclared_properties_anytype_2` to the URL query string + if (getMapWithUndeclaredPropertiesAnytype2() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smap_with_undeclared_properties_anytype_2%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMapWithUndeclaredPropertiesAnytype2())))); + } + + // add `map_with_undeclared_properties_anytype_3` to the URL query string + if (getMapWithUndeclaredPropertiesAnytype3() != null) { + for (String _key : getMapWithUndeclaredPropertiesAnytype3().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%smap_with_undeclared_properties_anytype_3%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getMapWithUndeclaredPropertiesAnytype3().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getMapWithUndeclaredPropertiesAnytype3().get(_key))))); + } + } + + // add `empty_map` to the URL query string + if (getEmptyMap() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sempty_map%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEmptyMap())))); + } + + // add `map_with_undeclared_properties_string` to the URL query string + if (getMapWithUndeclaredPropertiesString() != null) { + for (String _key : getMapWithUndeclaredPropertiesString().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%smap_with_undeclared_properties_string%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getMapWithUndeclaredPropertiesString().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getMapWithUndeclaredPropertiesString().get(_key))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private AdditionalPropertiesClass instance; + + public Builder() { + this(new AdditionalPropertiesClass()); + } + + protected Builder(AdditionalPropertiesClass instance) { + this.instance = instance; + } + + public AdditionalPropertiesClass.Builder mapProperty(Map mapProperty) { + this.instance.mapProperty = mapProperty; + return this; + } + public AdditionalPropertiesClass.Builder mapOfMapProperty(Map> mapOfMapProperty) { + this.instance.mapOfMapProperty = mapOfMapProperty; + return this; + } + public AdditionalPropertiesClass.Builder anytype1(Object anytype1) { + this.instance.anytype1 = anytype1; + return this; + } + public AdditionalPropertiesClass.Builder mapWithUndeclaredPropertiesAnytype1(Object mapWithUndeclaredPropertiesAnytype1) { + this.instance.mapWithUndeclaredPropertiesAnytype1 = mapWithUndeclaredPropertiesAnytype1; + return this; + } + public AdditionalPropertiesClass.Builder mapWithUndeclaredPropertiesAnytype2(Object mapWithUndeclaredPropertiesAnytype2) { + this.instance.mapWithUndeclaredPropertiesAnytype2 = mapWithUndeclaredPropertiesAnytype2; + return this; + } + public AdditionalPropertiesClass.Builder mapWithUndeclaredPropertiesAnytype3(Map mapWithUndeclaredPropertiesAnytype3) { + this.instance.mapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3; + return this; + } + public AdditionalPropertiesClass.Builder emptyMap(Object emptyMap) { + this.instance.emptyMap = emptyMap; + return this; + } + public AdditionalPropertiesClass.Builder mapWithUndeclaredPropertiesString(Map mapWithUndeclaredPropertiesString) { + this.instance.mapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString; + return this; + } + + + /** + * returns a built AdditionalPropertiesClass instance. + * + * The builder is not reusable. + */ + public AdditionalPropertiesClass build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static AdditionalPropertiesClass.Builder builder() { + return new AdditionalPropertiesClass.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AdditionalPropertiesClass.Builder toBuilder() { + return new AdditionalPropertiesClass.Builder() + .mapProperty(getMapProperty()) + .mapOfMapProperty(getMapOfMapProperty()) + .anytype1(getAnytype1()) + .mapWithUndeclaredPropertiesAnytype1(getMapWithUndeclaredPropertiesAnytype1()) + .mapWithUndeclaredPropertiesAnytype2(getMapWithUndeclaredPropertiesAnytype2()) + .mapWithUndeclaredPropertiesAnytype3(getMapWithUndeclaredPropertiesAnytype3()) + .emptyMap(getEmptyMap()) + .mapWithUndeclaredPropertiesString(getMapWithUndeclaredPropertiesString()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AllOfRefToDouble.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AllOfRefToDouble.java new file mode 100644 index 000000000000..87db4cf60223 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AllOfRefToDouble.java @@ -0,0 +1,200 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * Object with allOf ref to double + */ +@JsonPropertyOrder({ + AllOfRefToDouble.JSON_PROPERTY_HEIGHT +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class AllOfRefToDouble { + public static final String JSON_PROPERTY_HEIGHT = "height"; + @javax.annotation.Nullable + private Double height = 32.1d; + + public AllOfRefToDouble() { + } + + public AllOfRefToDouble height(@javax.annotation.Nullable Double height) { + this.height = height; + return this; + } + + /** + * Height as double + * @return height + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HEIGHT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getHeight() { + return height; + } + + + @JsonProperty(value = JSON_PROPERTY_HEIGHT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeight(@javax.annotation.Nullable Double height) { + this.height = height; + } + + + /** + * Return true if this AllOfRefToDouble object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AllOfRefToDouble {\n"); + sb.append(" height: ").append(toIndentedString(height)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `height` to the URL query string + if (getHeight() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sheight%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHeight())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private AllOfRefToDouble instance; + + public Builder() { + this(new AllOfRefToDouble()); + } + + protected Builder(AllOfRefToDouble instance) { + this.instance = instance; + } + + public AllOfRefToDouble.Builder height(Double height) { + this.instance.height = height; + return this; + } + + + /** + * returns a built AllOfRefToDouble instance. + * + * The builder is not reusable. + */ + public AllOfRefToDouble build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static AllOfRefToDouble.Builder builder() { + return new AllOfRefToDouble.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AllOfRefToDouble.Builder toBuilder() { + return new AllOfRefToDouble.Builder() + .height(getHeight()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AllOfRefToFloat.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AllOfRefToFloat.java new file mode 100644 index 000000000000..4159824f28b8 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AllOfRefToFloat.java @@ -0,0 +1,200 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * Object with allOf ref to float + */ +@JsonPropertyOrder({ + AllOfRefToFloat.JSON_PROPERTY_WEIGHT +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class AllOfRefToFloat { + public static final String JSON_PROPERTY_WEIGHT = "weight"; + @javax.annotation.Nullable + private Float weight = 7.89f; + + public AllOfRefToFloat() { + } + + public AllOfRefToFloat weight(@javax.annotation.Nullable Float weight) { + this.weight = weight; + return this; + } + + /** + * Weight as float + * @return weight + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_WEIGHT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getWeight() { + return weight; + } + + + @JsonProperty(value = JSON_PROPERTY_WEIGHT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWeight(@javax.annotation.Nullable Float weight) { + this.weight = weight; + } + + + /** + * Return true if this AllOfRefToFloat object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AllOfRefToFloat {\n"); + sb.append(" weight: ").append(toIndentedString(weight)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `weight` to the URL query string + if (getWeight() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sweight%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getWeight())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private AllOfRefToFloat instance; + + public Builder() { + this(new AllOfRefToFloat()); + } + + protected Builder(AllOfRefToFloat instance) { + this.instance = instance; + } + + public AllOfRefToFloat.Builder weight(Float weight) { + this.instance.weight = weight; + return this; + } + + + /** + * returns a built AllOfRefToFloat instance. + * + * The builder is not reusable. + */ + public AllOfRefToFloat build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static AllOfRefToFloat.Builder builder() { + return new AllOfRefToFloat.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AllOfRefToFloat.Builder toBuilder() { + return new AllOfRefToFloat.Builder() + .weight(getWeight()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AllOfRefToLong.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AllOfRefToLong.java new file mode 100644 index 000000000000..f4086fa632f3 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AllOfRefToLong.java @@ -0,0 +1,200 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * Object with allOf ref to long + */ +@JsonPropertyOrder({ + AllOfRefToLong.JSON_PROPERTY_ID +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class AllOfRefToLong { + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable + private Long id = 10l; + + public AllOfRefToLong() { + } + + public AllOfRefToLong id(@javax.annotation.Nullable Long id) { + this.id = id; + return this; + } + + /** + * Id as long + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + + @JsonProperty(value = JSON_PROPERTY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable Long id) { + this.id = id; + } + + + /** + * Return true if this AllOfRefToLong object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AllOfRefToLong {\n"); + sb.append(" id: ").append(toIndentedString(id)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private AllOfRefToLong instance; + + public Builder() { + this(new AllOfRefToLong()); + } + + protected Builder(AllOfRefToLong instance) { + this.instance = instance; + } + + public AllOfRefToLong.Builder id(Long id) { + this.instance.id = id; + return this; + } + + + /** + * returns a built AllOfRefToLong instance. + * + * The builder is not reusable. + */ + public AllOfRefToLong build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static AllOfRefToLong.Builder builder() { + return new AllOfRefToLong.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AllOfRefToLong.Builder toBuilder() { + return new AllOfRefToLong.Builder() + .id(getId()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Animal.java new file mode 100644 index 000000000000..c1de02eebb58 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Animal.java @@ -0,0 +1,262 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.JSON; +import org.openapitools.client.ApiClient; +/** + * Animal + */ +@JsonPropertyOrder({ + Animal.JSON_PROPERTY_CLASS_NAME, + Animal.JSON_PROPERTY_COLOR +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +@JsonIgnoreProperties( + value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the className to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = Dog.class, name = "Dog"), +}) + +public class Animal { + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @javax.annotation.Nonnull + private String className; + + public static final String JSON_PROPERTY_COLOR = "color"; + @javax.annotation.Nullable + private String color = "red"; + + public Animal() { + } + + public Animal className(@javax.annotation.Nonnull String className) { + this.className = className; + return this; + } + + /** + * Get className + * @return className + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClassName() { + return className; + } + + + @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClassName(@javax.annotation.Nonnull String className) { + this.className = className; + } + + + public Animal color(@javax.annotation.Nullable String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_COLOR, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColor() { + return color; + } + + + @JsonProperty(value = JSON_PROPERTY_COLOR, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setColor(@javax.annotation.Nullable String color) { + this.color = color; + } + + + /** + * Return true if this Animal object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Animal {\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `className` to the URL query string + if (getClassName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sclassName%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getClassName())))); + } + + // add `color` to the URL query string + if (getColor() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scolor%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getColor())))); + } + + return joiner.toString(); + } +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("Cat", Cat.class); + mappings.put("Dog", Dog.class); + mappings.put("Animal", Animal.class); + JSON.registerDiscriminator(Animal.class, "className", mappings); +} + + public static class Builder { + + private Animal instance; + + public Builder() { + this(new Animal()); + } + + protected Builder(Animal instance) { + this.instance = instance; + } + + public Animal.Builder className(String className) { + this.instance.className = className; + return this; + } + public Animal.Builder color(String color) { + this.instance.color = color; + return this; + } + + + /** + * returns a built Animal instance. + * + * The builder is not reusable. + */ + public Animal build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Animal.Builder builder() { + return new Animal.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Animal.Builder toBuilder() { + return new Animal.Builder() + .className(getClassName()) + .color(getColor()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Apple.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Apple.java new file mode 100644 index 000000000000..dbbd33c7898a --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Apple.java @@ -0,0 +1,240 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * Apple + */ +@JsonPropertyOrder({ + Apple.JSON_PROPERTY_CULTIVAR, + Apple.JSON_PROPERTY_ORIGIN +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class Apple { + public static final String JSON_PROPERTY_CULTIVAR = "cultivar"; + @javax.annotation.Nullable + private String cultivar; + + public static final String JSON_PROPERTY_ORIGIN = "origin"; + @javax.annotation.Nullable + private String origin; + + public Apple() { + } + + public Apple cultivar(@javax.annotation.Nullable String cultivar) { + this.cultivar = cultivar; + return this; + } + + /** + * Get cultivar + * @return cultivar + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CULTIVAR, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCultivar() { + return cultivar; + } + + + @JsonProperty(value = JSON_PROPERTY_CULTIVAR, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCultivar(@javax.annotation.Nullable String cultivar) { + this.cultivar = cultivar; + } + + + public Apple origin(@javax.annotation.Nullable String origin) { + this.origin = origin; + return this; + } + + /** + * Get origin + * @return origin + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ORIGIN, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOrigin() { + return origin; + } + + + @JsonProperty(value = JSON_PROPERTY_ORIGIN, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOrigin(@javax.annotation.Nullable String origin) { + this.origin = origin; + } + + + /** + * Return true if this apple object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Apple {\n"); + sb.append(" cultivar: ").append(toIndentedString(cultivar)).append("\n"); + sb.append(" origin: ").append(toIndentedString(origin)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `cultivar` to the URL query string + if (getCultivar() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scultivar%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCultivar())))); + } + + // add `origin` to the URL query string + if (getOrigin() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sorigin%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getOrigin())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private Apple instance; + + public Builder() { + this(new Apple()); + } + + protected Builder(Apple instance) { + this.instance = instance; + } + + public Apple.Builder cultivar(String cultivar) { + this.instance.cultivar = cultivar; + return this; + } + public Apple.Builder origin(String origin) { + this.instance.origin = origin; + return this; + } + + + /** + * returns a built Apple instance. + * + * The builder is not reusable. + */ + public Apple build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Apple.Builder builder() { + return new Apple.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Apple.Builder toBuilder() { + return new Apple.Builder() + .cultivar(getCultivar()) + .origin(getOrigin()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AppleReq.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AppleReq.java new file mode 100644 index 000000000000..d90f5c7d5af2 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/AppleReq.java @@ -0,0 +1,240 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * AppleReq + */ +@JsonPropertyOrder({ + AppleReq.JSON_PROPERTY_CULTIVAR, + AppleReq.JSON_PROPERTY_MEALY +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class AppleReq { + public static final String JSON_PROPERTY_CULTIVAR = "cultivar"; + @javax.annotation.Nonnull + private String cultivar; + + public static final String JSON_PROPERTY_MEALY = "mealy"; + @javax.annotation.Nullable + private Boolean mealy; + + public AppleReq() { + } + + public AppleReq cultivar(@javax.annotation.Nonnull String cultivar) { + this.cultivar = cultivar; + return this; + } + + /** + * Get cultivar + * @return cultivar + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_CULTIVAR, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCultivar() { + return cultivar; + } + + + @JsonProperty(value = JSON_PROPERTY_CULTIVAR, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCultivar(@javax.annotation.Nonnull String cultivar) { + this.cultivar = cultivar; + } + + + public AppleReq mealy(@javax.annotation.Nullable Boolean mealy) { + this.mealy = mealy; + return this; + } + + /** + * Get mealy + * @return mealy + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MEALY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getMealy() { + return mealy; + } + + + @JsonProperty(value = JSON_PROPERTY_MEALY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMealy(@javax.annotation.Nullable Boolean mealy) { + this.mealy = mealy; + } + + + /** + * Return true if this appleReq object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AppleReq {\n"); + sb.append(" cultivar: ").append(toIndentedString(cultivar)).append("\n"); + sb.append(" mealy: ").append(toIndentedString(mealy)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `cultivar` to the URL query string + if (getCultivar() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scultivar%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCultivar())))); + } + + // add `mealy` to the URL query string + if (getMealy() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smealy%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMealy())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private AppleReq instance; + + public Builder() { + this(new AppleReq()); + } + + protected Builder(AppleReq instance) { + this.instance = instance; + } + + public AppleReq.Builder cultivar(String cultivar) { + this.instance.cultivar = cultivar; + return this; + } + public AppleReq.Builder mealy(Boolean mealy) { + this.instance.mealy = mealy; + return this; + } + + + /** + * returns a built AppleReq instance. + * + * The builder is not reusable. + */ + public AppleReq build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static AppleReq.Builder builder() { + return new AppleReq.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AppleReq.Builder toBuilder() { + return new AppleReq.Builder() + .cultivar(getCultivar()) + .mealy(getMealy()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 000000000000..4e8aed59c15c --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,217 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * ArrayOfArrayOfNumberOnly + */ +@JsonPropertyOrder({ + ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class ArrayOfArrayOfNumberOnly { + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + @javax.annotation.Nullable + private List> arrayArrayNumber = new ArrayList<>(); + + public ArrayOfArrayOfNumberOnly() { + } + + public ArrayOfArrayOfNumberOnly arrayArrayNumber(@javax.annotation.Nullable List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + return this; + } + + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList<>(); + } + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; + } + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_NUMBER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + + + @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_NUMBER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayArrayNumber(@javax.annotation.Nullable List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + + /** + * Return true if this ArrayOfArrayOfNumberOnly object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfArrayOfNumberOnly {\n"); + sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ArrayArrayNumber` to the URL query string + if (getArrayArrayNumber() != null) { + for (int i = 0; i < getArrayArrayNumber().size(); i++) { + if (getArrayArrayNumber().get(i) != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sArrayArrayNumber%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getArrayArrayNumber().get(i))))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private ArrayOfArrayOfNumberOnly instance; + + public Builder() { + this(new ArrayOfArrayOfNumberOnly()); + } + + protected Builder(ArrayOfArrayOfNumberOnly instance) { + this.instance = instance; + } + + public ArrayOfArrayOfNumberOnly.Builder arrayArrayNumber(List> arrayArrayNumber) { + this.instance.arrayArrayNumber = arrayArrayNumber; + return this; + } + + + /** + * returns a built ArrayOfArrayOfNumberOnly instance. + * + * The builder is not reusable. + */ + public ArrayOfArrayOfNumberOnly build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ArrayOfArrayOfNumberOnly.Builder builder() { + return new ArrayOfArrayOfNumberOnly.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ArrayOfArrayOfNumberOnly.Builder toBuilder() { + return new ArrayOfArrayOfNumberOnly.Builder() + .arrayArrayNumber(getArrayArrayNumber()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java new file mode 100644 index 000000000000..64f879c47f14 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -0,0 +1,217 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * ArrayOfNumberOnly + */ +@JsonPropertyOrder({ + ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class ArrayOfNumberOnly { + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + @javax.annotation.Nullable + private List arrayNumber = new ArrayList<>(); + + public ArrayOfNumberOnly() { + } + + public ArrayOfNumberOnly arrayNumber(@javax.annotation.Nullable List arrayNumber) { + this.arrayNumber = arrayNumber; + return this; + } + + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList<>(); + } + this.arrayNumber.add(arrayNumberItem); + return this; + } + + /** + * Get arrayNumber + * @return arrayNumber + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ARRAY_NUMBER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayNumber() { + return arrayNumber; + } + + + @JsonProperty(value = JSON_PROPERTY_ARRAY_NUMBER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayNumber(@javax.annotation.Nullable List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + + /** + * Return true if this ArrayOfNumberOnly object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfNumberOnly {\n"); + sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ArrayNumber` to the URL query string + if (getArrayNumber() != null) { + for (int i = 0; i < getArrayNumber().size(); i++) { + if (getArrayNumber().get(i) != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sArrayNumber%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getArrayNumber().get(i))))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private ArrayOfNumberOnly instance; + + public Builder() { + this(new ArrayOfNumberOnly()); + } + + protected Builder(ArrayOfNumberOnly instance) { + this.instance = instance; + } + + public ArrayOfNumberOnly.Builder arrayNumber(List arrayNumber) { + this.instance.arrayNumber = arrayNumber; + return this; + } + + + /** + * returns a built ArrayOfNumberOnly instance. + * + * The builder is not reusable. + */ + public ArrayOfNumberOnly build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ArrayOfNumberOnly.Builder builder() { + return new ArrayOfNumberOnly.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ArrayOfNumberOnly.Builder toBuilder() { + return new ArrayOfNumberOnly.Builder() + .arrayNumber(getArrayNumber()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ArrayTest.java new file mode 100644 index 000000000000..06a7f1a88f90 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -0,0 +1,321 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.ReadOnlyFirst; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * ArrayTest + */ +@JsonPropertyOrder({ + ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class ArrayTest { + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + @javax.annotation.Nullable + private List arrayOfString = new ArrayList<>(); + + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + @javax.annotation.Nullable + private List> arrayArrayOfInteger = new ArrayList<>(); + + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + @javax.annotation.Nullable + private List> arrayArrayOfModel = new ArrayList<>(); + + public ArrayTest() { + } + + public ArrayTest arrayOfString(@javax.annotation.Nullable List arrayOfString) { + this.arrayOfString = arrayOfString; + return this; + } + + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList<>(); + } + this.arrayOfString.add(arrayOfStringItem); + return this; + } + + /** + * Get arrayOfString + * @return arrayOfString + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ARRAY_OF_STRING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayOfString() { + return arrayOfString; + } + + + @JsonProperty(value = JSON_PROPERTY_ARRAY_OF_STRING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayOfString(@javax.annotation.Nullable List arrayOfString) { + this.arrayOfString = arrayOfString; + } + + + public ArrayTest arrayArrayOfInteger(@javax.annotation.Nullable List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList<>(); + } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + + + @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayArrayOfInteger(@javax.annotation.Nullable List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + } + + + public ArrayTest arrayArrayOfModel(@javax.annotation.Nullable List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList<>(); + } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + + + @JsonProperty(value = JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayArrayOfModel(@javax.annotation.Nullable List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + + /** + * Return true if this ArrayTest object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayTest {\n"); + sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); + sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); + sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `array_of_string` to the URL query string + if (getArrayOfString() != null) { + for (int i = 0; i < getArrayOfString().size(); i++) { + joiner.add(String.format(java.util.Locale.ROOT, "%sarray_of_string%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getArrayOfString().get(i))))); + } + } + + // add `array_array_of_integer` to the URL query string + if (getArrayArrayOfInteger() != null) { + for (int i = 0; i < getArrayArrayOfInteger().size(); i++) { + joiner.add(String.format(java.util.Locale.ROOT, "%sarray_array_of_integer%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getArrayArrayOfInteger().get(i))))); + } + } + + // add `array_array_of_model` to the URL query string + if (getArrayArrayOfModel() != null) { + for (int i = 0; i < getArrayArrayOfModel().size(); i++) { + if (getArrayArrayOfModel().get(i) != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sarray_array_of_model%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getArrayArrayOfModel().get(i))))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private ArrayTest instance; + + public Builder() { + this(new ArrayTest()); + } + + protected Builder(ArrayTest instance) { + this.instance = instance; + } + + public ArrayTest.Builder arrayOfString(List arrayOfString) { + this.instance.arrayOfString = arrayOfString; + return this; + } + public ArrayTest.Builder arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.instance.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + public ArrayTest.Builder arrayArrayOfModel(List> arrayArrayOfModel) { + this.instance.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + + /** + * returns a built ArrayTest instance. + * + * The builder is not reusable. + */ + public ArrayTest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ArrayTest.Builder builder() { + return new ArrayTest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ArrayTest.Builder toBuilder() { + return new ArrayTest.Builder() + .arrayOfString(getArrayOfString()) + .arrayArrayOfInteger(getArrayArrayOfInteger()) + .arrayArrayOfModel(getArrayArrayOfModel()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Banana.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Banana.java new file mode 100644 index 000000000000..1390e42eb804 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Banana.java @@ -0,0 +1,201 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * Banana + */ +@JsonPropertyOrder({ + Banana.JSON_PROPERTY_LENGTH_CM +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class Banana { + public static final String JSON_PROPERTY_LENGTH_CM = "lengthCm"; + @javax.annotation.Nullable + private BigDecimal lengthCm; + + public Banana() { + } + + public Banana lengthCm(@javax.annotation.Nullable BigDecimal lengthCm) { + this.lengthCm = lengthCm; + return this; + } + + /** + * Get lengthCm + * @return lengthCm + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_LENGTH_CM, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getLengthCm() { + return lengthCm; + } + + + @JsonProperty(value = JSON_PROPERTY_LENGTH_CM, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLengthCm(@javax.annotation.Nullable BigDecimal lengthCm) { + this.lengthCm = lengthCm; + } + + + /** + * Return true if this banana object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Banana {\n"); + sb.append(" lengthCm: ").append(toIndentedString(lengthCm)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `lengthCm` to the URL query string + if (getLengthCm() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%slengthCm%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLengthCm())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private Banana instance; + + public Builder() { + this(new Banana()); + } + + protected Builder(Banana instance) { + this.instance = instance; + } + + public Banana.Builder lengthCm(BigDecimal lengthCm) { + this.instance.lengthCm = lengthCm; + return this; + } + + + /** + * returns a built Banana instance. + * + * The builder is not reusable. + */ + public Banana build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Banana.Builder builder() { + return new Banana.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Banana.Builder toBuilder() { + return new Banana.Builder() + .lengthCm(getLengthCm()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/BananaReq.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/BananaReq.java new file mode 100644 index 000000000000..35b7f3b44338 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/BananaReq.java @@ -0,0 +1,241 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * BananaReq + */ +@JsonPropertyOrder({ + BananaReq.JSON_PROPERTY_LENGTH_CM, + BananaReq.JSON_PROPERTY_SWEET +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class BananaReq { + public static final String JSON_PROPERTY_LENGTH_CM = "lengthCm"; + @javax.annotation.Nonnull + private BigDecimal lengthCm; + + public static final String JSON_PROPERTY_SWEET = "sweet"; + @javax.annotation.Nullable + private Boolean sweet; + + public BananaReq() { + } + + public BananaReq lengthCm(@javax.annotation.Nonnull BigDecimal lengthCm) { + this.lengthCm = lengthCm; + return this; + } + + /** + * Get lengthCm + * @return lengthCm + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_LENGTH_CM, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getLengthCm() { + return lengthCm; + } + + + @JsonProperty(value = JSON_PROPERTY_LENGTH_CM, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLengthCm(@javax.annotation.Nonnull BigDecimal lengthCm) { + this.lengthCm = lengthCm; + } + + + public BananaReq sweet(@javax.annotation.Nullable Boolean sweet) { + this.sweet = sweet; + return this; + } + + /** + * Get sweet + * @return sweet + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SWEET, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSweet() { + return sweet; + } + + + @JsonProperty(value = JSON_PROPERTY_SWEET, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSweet(@javax.annotation.Nullable Boolean sweet) { + this.sweet = sweet; + } + + + /** + * Return true if this bananaReq object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BananaReq {\n"); + sb.append(" lengthCm: ").append(toIndentedString(lengthCm)).append("\n"); + sb.append(" sweet: ").append(toIndentedString(sweet)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `lengthCm` to the URL query string + if (getLengthCm() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%slengthCm%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLengthCm())))); + } + + // add `sweet` to the URL query string + if (getSweet() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssweet%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSweet())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private BananaReq instance; + + public Builder() { + this(new BananaReq()); + } + + protected Builder(BananaReq instance) { + this.instance = instance; + } + + public BananaReq.Builder lengthCm(BigDecimal lengthCm) { + this.instance.lengthCm = lengthCm; + return this; + } + public BananaReq.Builder sweet(Boolean sweet) { + this.instance.sweet = sweet; + return this; + } + + + /** + * returns a built BananaReq instance. + * + * The builder is not reusable. + */ + public BananaReq build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static BananaReq.Builder builder() { + return new BananaReq.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BananaReq.Builder toBuilder() { + return new BananaReq.Builder() + .lengthCm(getLengthCm()) + .sweet(getSweet()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/BasquePig.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/BasquePig.java new file mode 100644 index 000000000000..b5bc6f7775f6 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/BasquePig.java @@ -0,0 +1,200 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * BasquePig + */ +@JsonPropertyOrder({ + BasquePig.JSON_PROPERTY_CLASS_NAME +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class BasquePig { + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @javax.annotation.Nonnull + private String className; + + public BasquePig() { + } + + public BasquePig className(@javax.annotation.Nonnull String className) { + this.className = className; + return this; + } + + /** + * Get className + * @return className + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClassName() { + return className; + } + + + @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClassName(@javax.annotation.Nonnull String className) { + this.className = className; + } + + + /** + * Return true if this BasquePig object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BasquePig {\n"); + sb.append(" className: ").append(toIndentedString(className)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `className` to the URL query string + if (getClassName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sclassName%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getClassName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private BasquePig instance; + + public Builder() { + this(new BasquePig()); + } + + protected Builder(BasquePig instance) { + this.instance = instance; + } + + public BasquePig.Builder className(String className) { + this.instance.className = className; + return this; + } + + + /** + * returns a built BasquePig instance. + * + * The builder is not reusable. + */ + public BasquePig build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static BasquePig.Builder builder() { + return new BasquePig.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public BasquePig.Builder toBuilder() { + return new BasquePig.Builder() + .className(getClassName()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Capitalization.java new file mode 100644 index 000000000000..9533e5ef2fc0 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Capitalization.java @@ -0,0 +1,400 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * Capitalization + */ +@JsonPropertyOrder({ + Capitalization.JSON_PROPERTY_SMALL_CAMEL, + Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, + Capitalization.JSON_PROPERTY_SMALL_SNAKE, + Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, + Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, + Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class Capitalization { + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + @javax.annotation.Nullable + private String smallCamel; + + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + @javax.annotation.Nullable + private String capitalCamel; + + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + @javax.annotation.Nullable + private String smallSnake; + + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + @javax.annotation.Nullable + private String capitalSnake; + + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + @javax.annotation.Nullable + private String scAETHFlowPoints; + + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + @javax.annotation.Nullable + private String ATT_NAME; + + public Capitalization() { + } + + public Capitalization smallCamel(@javax.annotation.Nullable String smallCamel) { + this.smallCamel = smallCamel; + return this; + } + + /** + * Get smallCamel + * @return smallCamel + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SMALL_CAMEL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallCamel() { + return smallCamel; + } + + + @JsonProperty(value = JSON_PROPERTY_SMALL_CAMEL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmallCamel(@javax.annotation.Nullable String smallCamel) { + this.smallCamel = smallCamel; + } + + + public Capitalization capitalCamel(@javax.annotation.Nullable String capitalCamel) { + this.capitalCamel = capitalCamel; + return this; + } + + /** + * Get capitalCamel + * @return capitalCamel + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CAPITAL_CAMEL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalCamel() { + return capitalCamel; + } + + + @JsonProperty(value = JSON_PROPERTY_CAPITAL_CAMEL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCapitalCamel(@javax.annotation.Nullable String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + + public Capitalization smallSnake(@javax.annotation.Nullable String smallSnake) { + this.smallSnake = smallSnake; + return this; + } + + /** + * Get smallSnake + * @return smallSnake + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SMALL_SNAKE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallSnake() { + return smallSnake; + } + + + @JsonProperty(value = JSON_PROPERTY_SMALL_SNAKE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmallSnake(@javax.annotation.Nullable String smallSnake) { + this.smallSnake = smallSnake; + } + + + public Capitalization capitalSnake(@javax.annotation.Nullable String capitalSnake) { + this.capitalSnake = capitalSnake; + return this; + } + + /** + * Get capitalSnake + * @return capitalSnake + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CAPITAL_SNAKE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalSnake() { + return capitalSnake; + } + + + @JsonProperty(value = JSON_PROPERTY_CAPITAL_SNAKE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCapitalSnake(@javax.annotation.Nullable String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + + public Capitalization scAETHFlowPoints(@javax.annotation.Nullable String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + + + @JsonProperty(value = JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScAETHFlowPoints(@javax.annotation.Nullable String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + + public Capitalization ATT_NAME(@javax.annotation.Nullable String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + return this; + } + + /** + * Name of the pet + * @return ATT_NAME + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_A_T_T_N_A_M_E, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getATTNAME() { + return ATT_NAME; + } + + + @JsonProperty(value = JSON_PROPERTY_A_T_T_N_A_M_E, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setATTNAME(@javax.annotation.Nullable String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + + /** + * Return true if this Capitalization object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Capitalization {\n"); + sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); + sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); + sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); + sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); + sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); + sb.append(" ATT_NAME: ").append(toIndentedString(ATT_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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `smallCamel` to the URL query string + if (getSmallCamel() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssmallCamel%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSmallCamel())))); + } + + // add `CapitalCamel` to the URL query string + if (getCapitalCamel() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sCapitalCamel%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCapitalCamel())))); + } + + // add `small_Snake` to the URL query string + if (getSmallSnake() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssmall_Snake%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSmallSnake())))); + } + + // add `Capital_Snake` to the URL query string + if (getCapitalSnake() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sCapital_Snake%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCapitalSnake())))); + } + + // add `SCA_ETH_Flow_Points` to the URL query string + if (getScAETHFlowPoints() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sSCA_ETH_Flow_Points%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getScAETHFlowPoints())))); + } + + // add `ATT_NAME` to the URL query string + if (getATTNAME() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sATT_NAME%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getATTNAME())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private Capitalization instance; + + public Builder() { + this(new Capitalization()); + } + + protected Builder(Capitalization instance) { + this.instance = instance; + } + + public Capitalization.Builder smallCamel(String smallCamel) { + this.instance.smallCamel = smallCamel; + return this; + } + public Capitalization.Builder capitalCamel(String capitalCamel) { + this.instance.capitalCamel = capitalCamel; + return this; + } + public Capitalization.Builder smallSnake(String smallSnake) { + this.instance.smallSnake = smallSnake; + return this; + } + public Capitalization.Builder capitalSnake(String capitalSnake) { + this.instance.capitalSnake = capitalSnake; + return this; + } + public Capitalization.Builder scAETHFlowPoints(String scAETHFlowPoints) { + this.instance.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + public Capitalization.Builder ATT_NAME(String ATT_NAME) { + this.instance.ATT_NAME = ATT_NAME; + return this; + } + + + /** + * returns a built Capitalization instance. + * + * The builder is not reusable. + */ + public Capitalization build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Capitalization.Builder builder() { + return new Capitalization.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Capitalization.Builder toBuilder() { + return new Capitalization.Builder() + .smallCamel(getSmallCamel()) + .capitalCamel(getCapitalCamel()) + .smallSnake(getSmallSnake()) + .capitalSnake(getCapitalSnake()) + .scAETHFlowPoints(getScAETHFlowPoints()) + .ATT_NAME(getATTNAME()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Cat.java new file mode 100644 index 000000000000..b4d63cf954ec --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Cat.java @@ -0,0 +1,255 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import java.util.Map; +import org.openapitools.client.model.Animal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.JSON; +import org.openapitools.client.ApiClient; +/** + * Cat + */ +@JsonPropertyOrder({ + Cat.JSON_PROPERTY_DECLAWED +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +@JsonIgnoreProperties( + value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the className to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) + +public class Cat extends Animal { + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + @javax.annotation.Nullable + private Boolean declawed; + + public Cat() { + } + + public Cat declawed(@javax.annotation.Nullable Boolean declawed) { + this.declawed = declawed; + return this; + } + + /** + * Get declawed + * @return declawed + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DECLAWED, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { + return declawed; + } + + + @JsonProperty(value = JSON_PROPERTY_DECLAWED, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeclawed(@javax.annotation.Nullable Boolean declawed) { + this.declawed = declawed; + } + + + @Override + public Cat className(@javax.annotation.Nonnull String className) { + this.setClassName(className); + return this; + } + + @Override + public Cat color(@javax.annotation.Nullable String color) { + this.setColor(color); + return this; + } + + /** + * Return true if this Cat object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `className` to the URL query string + if (getClassName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sclassName%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getClassName())))); + } + + // add `color` to the URL query string + if (getColor() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scolor%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getColor())))); + } + + // add `declawed` to the URL query string + if (getDeclawed() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdeclawed%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDeclawed())))); + } + + return joiner.toString(); + } +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("Cat", Cat.class); + JSON.registerDiscriminator(Cat.class, "className", mappings); +} + + public static class Builder extends Animal.Builder { + + private Cat instance; + + public Builder() { + this(new Cat()); + } + + protected Builder(Cat instance) { + super(instance); + this.instance = instance; + } + + public Cat.Builder declawed(Boolean declawed) { + this.instance.declawed = declawed; + return this; + } + + public Cat.Builder className(String className) { // inherited: true + super.className(className); + return this; + } + + public Cat.Builder color(String color) { // inherited: true + super.color(color); + return this; + } + + + /** + * returns a built Cat instance. + * + * The builder is not reusable. + */ + public Cat build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + super.build(); + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Cat.Builder builder() { + return new Cat.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Cat.Builder toBuilder() { + return new Cat.Builder() + .className(getClassName()) + .color(getColor()) + .declawed(getDeclawed()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Category.java new file mode 100644 index 000000000000..506b65c1b1bc --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Category.java @@ -0,0 +1,240 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * Category + */ +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class Category { + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nonnull + private String name = "default-name"; + + public Category() { + } + + public Category id(@javax.annotation.Nullable Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + + @JsonProperty(value = JSON_PROPERTY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable Long id) { + this.id = id; + } + + + public Category name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_NAME, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + /** + * Return true if this Category object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private Category instance; + + public Builder() { + this(new Category()); + } + + protected Builder(Category instance) { + this.instance = instance; + } + + public Category.Builder id(Long id) { + this.instance.id = id; + return this; + } + public Category.Builder name(String name) { + this.instance.name = name; + return this; + } + + + /** + * returns a built Category instance. + * + * The builder is not reusable. + */ + public Category build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Category.Builder builder() { + return new Category.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Category.Builder toBuilder() { + return new Category.Builder() + .id(getId()) + .name(getName()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ChildCat.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ChildCat.java new file mode 100644 index 000000000000..1dc37b473174 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ChildCat.java @@ -0,0 +1,274 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.openapitools.client.model.ParentPet; +import java.util.Set; +import java.util.HashSet; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.JSON; +import org.openapitools.client.ApiClient; +/** + * ChildCat + */ +@JsonPropertyOrder({ + ChildCat.JSON_PROPERTY_NAME, + ChildCat.JSON_PROPERTY_PET_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +@JsonIgnoreProperties( + value = "pet_type", // ignore manually set pet_type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the pet_type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "pet_type", visible = true) + +public class ChildCat extends ParentPet { + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nullable + private String name; + + public static final String JSON_PROPERTY_PET_TYPE = "pet_type"; + @javax.annotation.Nullable + private String petType = "ChildCat"; + + public ChildCat() { + } + + public ChildCat name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public static final Set PET_TYPE_VALUES = new HashSet<>(Arrays.asList( + "ChildCat" + )); + + public ChildCat petType(@javax.annotation.Nullable String petType) { + if (!PET_TYPE_VALUES.contains(petType)) { + throw new IllegalArgumentException(petType + " is invalid. Possible values for petType: " + String.join(", ", PET_TYPE_VALUES)); + } + + this.petType = petType; + return this; + } + + /** + * Get petType + * @return petType + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PET_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPetType() { + return petType; + } + + + @JsonProperty(value = JSON_PROPERTY_PET_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPetType(@javax.annotation.Nullable String petType) { + if (!PET_TYPE_VALUES.contains(petType)) { + throw new IllegalArgumentException(petType + " is invalid. Possible values for petType: " + String.join(", ", PET_TYPE_VALUES)); + } + + this.petType = petType; + } + + + /** + * Return true if this ChildCat object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChildCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" petType: ").append(toIndentedString(petType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `pet_type` to the URL query string + if (getPetType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%spet_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPetType())))); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + return joiner.toString(); + } +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("ChildCat", ChildCat.class); + JSON.registerDiscriminator(ChildCat.class, "pet_type", mappings); +} + + public static class Builder extends ParentPet.Builder { + + private ChildCat instance; + + public Builder() { + this(new ChildCat()); + } + + protected Builder(ChildCat instance) { + super(instance); + this.instance = instance; + } + + public ChildCat.Builder name(String name) { + this.instance.name = name; + return this; + } + public ChildCat.Builder petType(String petType) { + this.instance.petType = petType; + return this; + } + + + /** + * returns a built ChildCat instance. + * + * The builder is not reusable. + */ + public ChildCat build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + super.build(); + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ChildCat.Builder builder() { + return new ChildCat.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ChildCat.Builder toBuilder() { + return new ChildCat.Builder() + .petType(getPetType()) + .name(getName()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ClassModel.java new file mode 100644 index 000000000000..b90db5e44645 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ClassModel.java @@ -0,0 +1,200 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * Model for testing model with \"_class\" property + */ +@JsonPropertyOrder({ + ClassModel.JSON_PROPERTY_PROPERTY_CLASS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class ClassModel { + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + @javax.annotation.Nullable + private String propertyClass; + + public ClassModel() { + } + + public ClassModel propertyClass(@javax.annotation.Nullable String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PROPERTY_CLASS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { + return propertyClass; + } + + + @JsonProperty(value = JSON_PROPERTY_PROPERTY_CLASS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPropertyClass(@javax.annotation.Nullable String propertyClass) { + this.propertyClass = propertyClass; + } + + + /** + * Return true if this ClassModel object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClassModel {\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `_class` to the URL query string + if (getPropertyClass() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%s_class%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPropertyClass())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ClassModel instance; + + public Builder() { + this(new ClassModel()); + } + + protected Builder(ClassModel instance) { + this.instance = instance; + } + + public ClassModel.Builder propertyClass(String propertyClass) { + this.instance.propertyClass = propertyClass; + return this; + } + + + /** + * returns a built ClassModel instance. + * + * The builder is not reusable. + */ + public ClassModel build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ClassModel.Builder builder() { + return new ClassModel.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ClassModel.Builder toBuilder() { + return new ClassModel.Builder() + .propertyClass(getPropertyClass()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Client.java new file mode 100644 index 000000000000..77bbb7003ea0 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Client.java @@ -0,0 +1,200 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * Client + */ +@JsonPropertyOrder({ + Client.JSON_PROPERTY_CLIENT +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class Client { + public static final String JSON_PROPERTY_CLIENT = "client"; + @javax.annotation.Nullable + private String client; + + public Client() { + } + + public Client client(@javax.annotation.Nullable String client) { + this.client = client; + return this; + } + + /** + * Get client + * @return client + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CLIENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClient() { + return client; + } + + + @JsonProperty(value = JSON_PROPERTY_CLIENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClient(@javax.annotation.Nullable String client) { + this.client = client; + } + + + /** + * Return true if this Client object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Client {\n"); + sb.append(" client: ").append(toIndentedString(client)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `client` to the URL query string + if (getClient() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sclient%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getClient())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private Client instance; + + public Builder() { + this(new Client()); + } + + protected Builder(Client instance) { + this.instance = instance; + } + + public Client.Builder client(String client) { + this.instance.client = client; + return this; + } + + + /** + * returns a built Client instance. + * + * The builder is not reusable. + */ + public Client build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Client.Builder builder() { + return new Client.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Client.Builder toBuilder() { + return new Client.Builder() + .client(getClient()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java new file mode 100644 index 000000000000..aec838853ea0 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java @@ -0,0 +1,240 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * ComplexQuadrilateral + */ +@JsonPropertyOrder({ + ComplexQuadrilateral.JSON_PROPERTY_SHAPE_TYPE, + ComplexQuadrilateral.JSON_PROPERTY_QUADRILATERAL_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class ComplexQuadrilateral { + public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + @javax.annotation.Nonnull + private String shapeType; + + public static final String JSON_PROPERTY_QUADRILATERAL_TYPE = "quadrilateralType"; + @javax.annotation.Nonnull + private String quadrilateralType; + + public ComplexQuadrilateral() { + } + + public ComplexQuadrilateral shapeType(@javax.annotation.Nonnull String shapeType) { + this.shapeType = shapeType; + return this; + } + + /** + * Get shapeType + * @return shapeType + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getShapeType() { + return shapeType; + } + + + @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setShapeType(@javax.annotation.Nonnull String shapeType) { + this.shapeType = shapeType; + } + + + public ComplexQuadrilateral quadrilateralType(@javax.annotation.Nonnull String quadrilateralType) { + this.quadrilateralType = quadrilateralType; + return this; + } + + /** + * Get quadrilateralType + * @return quadrilateralType + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getQuadrilateralType() { + return quadrilateralType; + } + + + @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setQuadrilateralType(@javax.annotation.Nonnull String quadrilateralType) { + this.quadrilateralType = quadrilateralType; + } + + + /** + * Return true if this ComplexQuadrilateral object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ComplexQuadrilateral {\n"); + sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); + sb.append(" quadrilateralType: ").append(toIndentedString(quadrilateralType)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `shapeType` to the URL query string + if (getShapeType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sshapeType%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getShapeType())))); + } + + // add `quadrilateralType` to the URL query string + if (getQuadrilateralType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%squadrilateralType%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getQuadrilateralType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ComplexQuadrilateral instance; + + public Builder() { + this(new ComplexQuadrilateral()); + } + + protected Builder(ComplexQuadrilateral instance) { + this.instance = instance; + } + + public ComplexQuadrilateral.Builder shapeType(String shapeType) { + this.instance.shapeType = shapeType; + return this; + } + public ComplexQuadrilateral.Builder quadrilateralType(String quadrilateralType) { + this.instance.quadrilateralType = quadrilateralType; + return this; + } + + + /** + * returns a built ComplexQuadrilateral instance. + * + * The builder is not reusable. + */ + public ComplexQuadrilateral build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ComplexQuadrilateral.Builder builder() { + return new ComplexQuadrilateral.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ComplexQuadrilateral.Builder toBuilder() { + return new ComplexQuadrilateral.Builder() + .shapeType(getShapeType()) + .quadrilateralType(getQuadrilateralType()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/DanishPig.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/DanishPig.java new file mode 100644 index 000000000000..52a025f9ee32 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/DanishPig.java @@ -0,0 +1,200 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * DanishPig + */ +@JsonPropertyOrder({ + DanishPig.JSON_PROPERTY_CLASS_NAME +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class DanishPig { + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @javax.annotation.Nonnull + private String className; + + public DanishPig() { + } + + public DanishPig className(@javax.annotation.Nonnull String className) { + this.className = className; + return this; + } + + /** + * Get className + * @return className + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClassName() { + return className; + } + + + @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClassName(@javax.annotation.Nonnull String className) { + this.className = className; + } + + + /** + * Return true if this DanishPig object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DanishPig {\n"); + sb.append(" className: ").append(toIndentedString(className)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `className` to the URL query string + if (getClassName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sclassName%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getClassName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private DanishPig instance; + + public Builder() { + this(new DanishPig()); + } + + protected Builder(DanishPig instance) { + this.instance = instance; + } + + public DanishPig.Builder className(String className) { + this.instance.className = className; + return this; + } + + + /** + * returns a built DanishPig instance. + * + * The builder is not reusable. + */ + public DanishPig build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static DanishPig.Builder builder() { + return new DanishPig.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public DanishPig.Builder toBuilder() { + return new DanishPig.Builder() + .className(getClassName()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/DeprecatedObject.java new file mode 100644 index 000000000000..c421abfa4d1a --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -0,0 +1,202 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * DeprecatedObject + * @deprecated + */ +@Deprecated +@JsonPropertyOrder({ + DeprecatedObject.JSON_PROPERTY_NAME +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class DeprecatedObject { + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nullable + private String name; + + public DeprecatedObject() { + } + + public DeprecatedObject name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + /** + * Return true if this DeprecatedObject object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeprecatedObject {\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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private DeprecatedObject instance; + + public Builder() { + this(new DeprecatedObject()); + } + + protected Builder(DeprecatedObject instance) { + this.instance = instance; + } + + public DeprecatedObject.Builder name(String name) { + this.instance.name = name; + return this; + } + + + /** + * returns a built DeprecatedObject instance. + * + * The builder is not reusable. + */ + public DeprecatedObject build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static DeprecatedObject.Builder builder() { + return new DeprecatedObject.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public DeprecatedObject.Builder toBuilder() { + return new DeprecatedObject.Builder() + .name(getName()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Dog.java new file mode 100644 index 000000000000..e1804768b7be --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Dog.java @@ -0,0 +1,254 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.openapitools.client.model.Animal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.JSON; +import org.openapitools.client.ApiClient; +/** + * Dog + */ +@JsonPropertyOrder({ + Dog.JSON_PROPERTY_BREED +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +@JsonIgnoreProperties( + value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the className to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) + +public class Dog extends Animal { + public static final String JSON_PROPERTY_BREED = "breed"; + @javax.annotation.Nullable + private String breed; + + public Dog() { + } + + public Dog breed(@javax.annotation.Nullable String breed) { + this.breed = breed; + return this; + } + + /** + * Get breed + * @return breed + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BREED, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { + return breed; + } + + + @JsonProperty(value = JSON_PROPERTY_BREED, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBreed(@javax.annotation.Nullable String breed) { + this.breed = breed; + } + + + @Override + public Dog className(@javax.annotation.Nonnull String className) { + this.setClassName(className); + return this; + } + + @Override + public Dog color(@javax.annotation.Nullable String color) { + this.setColor(color); + return this; + } + + /** + * Return true if this Dog object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dog {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" breed: ").append(toIndentedString(breed)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `className` to the URL query string + if (getClassName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sclassName%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getClassName())))); + } + + // add `color` to the URL query string + if (getColor() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scolor%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getColor())))); + } + + // add `breed` to the URL query string + if (getBreed() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sbreed%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getBreed())))); + } + + return joiner.toString(); + } +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("Dog", Dog.class); + JSON.registerDiscriminator(Dog.class, "className", mappings); +} + + public static class Builder extends Animal.Builder { + + private Dog instance; + + public Builder() { + this(new Dog()); + } + + protected Builder(Dog instance) { + super(instance); + this.instance = instance; + } + + public Dog.Builder breed(String breed) { + this.instance.breed = breed; + return this; + } + + public Dog.Builder className(String className) { // inherited: true + super.className(className); + return this; + } + + public Dog.Builder color(String color) { // inherited: true + super.color(color); + return this; + } + + + /** + * returns a built Dog instance. + * + * The builder is not reusable. + */ + public Dog build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + super.build(); + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Dog.Builder builder() { + return new Dog.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Dog.Builder toBuilder() { + return new Dog.Builder() + .className(getClassName()) + .color(getColor()) + .breed(getBreed()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Drawing.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Drawing.java new file mode 100644 index 000000000000..e3861c8e227a --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Drawing.java @@ -0,0 +1,387 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.Fruit; +import org.openapitools.client.model.NullableShape; +import org.openapitools.client.model.Shape; +import org.openapitools.client.model.ShapeOrNull; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * Drawing + */ +@JsonPropertyOrder({ + Drawing.JSON_PROPERTY_MAIN_SHAPE, + Drawing.JSON_PROPERTY_SHAPE_OR_NULL, + Drawing.JSON_PROPERTY_NULLABLE_SHAPE, + Drawing.JSON_PROPERTY_SHAPES +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class Drawing { + public static final String JSON_PROPERTY_MAIN_SHAPE = "mainShape"; + @javax.annotation.Nullable + private Shape mainShape; + + public static final String JSON_PROPERTY_SHAPE_OR_NULL = "shapeOrNull"; + @javax.annotation.Nullable + private ShapeOrNull shapeOrNull; + + public static final String JSON_PROPERTY_NULLABLE_SHAPE = "nullableShape"; + @javax.annotation.Nullable + private NullableShape nullableShape; + + public static final String JSON_PROPERTY_SHAPES = "shapes"; + @javax.annotation.Nullable + private List shapes = new ArrayList<>(); + + public Drawing() { + } + + public Drawing mainShape(@javax.annotation.Nullable Shape mainShape) { + this.mainShape = mainShape; + return this; + } + + /** + * Get mainShape + * @return mainShape + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MAIN_SHAPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Shape getMainShape() { + return mainShape; + } + + + @JsonProperty(value = JSON_PROPERTY_MAIN_SHAPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMainShape(@javax.annotation.Nullable Shape mainShape) { + this.mainShape = mainShape; + } + + + public Drawing shapeOrNull(@javax.annotation.Nullable ShapeOrNull shapeOrNull) { + this.shapeOrNull = shapeOrNull; + return this; + } + + /** + * Get shapeOrNull + * @return shapeOrNull + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SHAPE_OR_NULL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ShapeOrNull getShapeOrNull() { + return shapeOrNull; + } + + + @JsonProperty(value = JSON_PROPERTY_SHAPE_OR_NULL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShapeOrNull(@javax.annotation.Nullable ShapeOrNull shapeOrNull) { + this.shapeOrNull = shapeOrNull; + } + + + public Drawing nullableShape(@javax.annotation.Nullable NullableShape nullableShape) { + this.nullableShape = nullableShape; + return this; + } + + /** + * Get nullableShape + * @return nullableShape + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NULLABLE_SHAPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public NullableShape getNullableShape() { + return nullableShape; + } + + + @JsonProperty(value = JSON_PROPERTY_NULLABLE_SHAPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNullableShape(@javax.annotation.Nullable NullableShape nullableShape) { + this.nullableShape = nullableShape; + } + + + public Drawing shapes(@javax.annotation.Nullable List shapes) { + this.shapes = shapes; + return this; + } + + public Drawing addShapesItem(Shape shapesItem) { + if (this.shapes == null) { + this.shapes = new ArrayList<>(); + } + this.shapes.add(shapesItem); + return this; + } + + /** + * Get shapes + * @return shapes + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SHAPES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getShapes() { + return shapes; + } + + + @JsonProperty(value = JSON_PROPERTY_SHAPES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShapes(@javax.annotation.Nullable List shapes) { + this.shapes = shapes; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * @param key the name of the property + * @param value the value of the property + * @return self reference + */ + @JsonAnySetter + public Drawing putAdditionalProperty(String key, Fruit value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) properties. + * @return the additional (undeclared) properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * @param key the name of the property + * @return the additional (undeclared) property with the specified name + */ + public Fruit getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this Drawing object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Drawing {\n"); + sb.append(" mainShape: ").append(toIndentedString(mainShape)).append("\n"); + sb.append(" shapeOrNull: ").append(toIndentedString(shapeOrNull)).append("\n"); + sb.append(" nullableShape: ").append(toIndentedString(nullableShape)).append("\n"); + sb.append(" shapes: ").append(toIndentedString(shapes)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `mainShape` to the URL query string + if (getMainShape() != null) { + joiner.add(getMainShape().toUrlQueryString(prefix + "mainShape" + suffix)); + } + + // add `shapeOrNull` to the URL query string + if (getShapeOrNull() != null) { + joiner.add(getShapeOrNull().toUrlQueryString(prefix + "shapeOrNull" + suffix)); + } + + // add `nullableShape` to the URL query string + if (getNullableShape() != null) { + joiner.add(getNullableShape().toUrlQueryString(prefix + "nullableShape" + suffix)); + } + + // add `shapes` to the URL query string + if (getShapes() != null) { + for (int i = 0; i < getShapes().size(); i++) { + if (getShapes().get(i) != null) { + joiner.add(getShapes().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%sshapes%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private Drawing instance; + + public Builder() { + this(new Drawing()); + } + + protected Builder(Drawing instance) { + this.instance = instance; + } + + public Drawing.Builder mainShape(Shape mainShape) { + this.instance.mainShape = mainShape; + return this; + } + public Drawing.Builder shapeOrNull(ShapeOrNull shapeOrNull) { + this.instance.shapeOrNull = shapeOrNull; + return this; + } + public Drawing.Builder nullableShape(NullableShape nullableShape) { + this.instance.nullableShape = nullableShape; + return this; + } + public Drawing.Builder shapes(List shapes) { + this.instance.shapes = shapes; + return this; + } + + + /** + * returns a built Drawing instance. + * + * The builder is not reusable. + */ + public Drawing build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Drawing.Builder builder() { + return new Drawing.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Drawing.Builder toBuilder() { + return new Drawing.Builder() + .mainShape(getMainShape()) + .shapeOrNull(getShapeOrNull()) + .nullableShape(getNullableShape()) + .shapes(getShapes()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/EnumArrays.java new file mode 100644 index 000000000000..64c32c2581a7 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -0,0 +1,324 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * EnumArrays + */ +@JsonPropertyOrder({ + EnumArrays.JSON_PROPERTY_JUST_SYMBOL, + EnumArrays.JSON_PROPERTY_ARRAY_ENUM +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class EnumArrays { + /** + * Gets or Sets justSymbol + */ + public enum JustSymbolEnum { + GREATER_THAN_OR_EQUAL_TO(String.valueOf(">=")), + + DOLLAR(String.valueOf("$")); + + private String value; + + JustSymbolEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static JustSymbolEnum fromValue(String value) { + for (JustSymbolEnum b : JustSymbolEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + @javax.annotation.Nullable + private JustSymbolEnum justSymbol; + + /** + * Gets or Sets arrayEnum + */ + public enum ArrayEnumEnum { + FISH(String.valueOf("fish")), + + CRAB(String.valueOf("crab")); + + private String value; + + ArrayEnumEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ArrayEnumEnum fromValue(String value) { + for (ArrayEnumEnum b : ArrayEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + @javax.annotation.Nullable + private List arrayEnum = new ArrayList<>(); + + public EnumArrays() { + } + + public EnumArrays justSymbol(@javax.annotation.Nullable JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + return this; + } + + /** + * Get justSymbol + * @return justSymbol + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_JUST_SYMBOL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JustSymbolEnum getJustSymbol() { + return justSymbol; + } + + + @JsonProperty(value = JSON_PROPERTY_JUST_SYMBOL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setJustSymbol(@javax.annotation.Nullable JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + } + + + public EnumArrays arrayEnum(@javax.annotation.Nullable List arrayEnum) { + this.arrayEnum = arrayEnum; + return this; + } + + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList<>(); + } + this.arrayEnum.add(arrayEnumItem); + return this; + } + + /** + * Get arrayEnum + * @return arrayEnum + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ARRAY_ENUM, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayEnum() { + return arrayEnum; + } + + + @JsonProperty(value = JSON_PROPERTY_ARRAY_ENUM, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayEnum(@javax.annotation.Nullable List arrayEnum) { + this.arrayEnum = arrayEnum; + } + + + /** + * Return true if this EnumArrays object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumArrays {\n"); + sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); + sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `just_symbol` to the URL query string + if (getJustSymbol() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sjust_symbol%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getJustSymbol())))); + } + + // add `array_enum` to the URL query string + if (getArrayEnum() != null) { + for (int i = 0; i < getArrayEnum().size(); i++) { + joiner.add(String.format(java.util.Locale.ROOT, "%sarray_enum%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getArrayEnum().get(i))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private EnumArrays instance; + + public Builder() { + this(new EnumArrays()); + } + + protected Builder(EnumArrays instance) { + this.instance = instance; + } + + public EnumArrays.Builder justSymbol(JustSymbolEnum justSymbol) { + this.instance.justSymbol = justSymbol; + return this; + } + public EnumArrays.Builder arrayEnum(List arrayEnum) { + this.instance.arrayEnum = arrayEnum; + return this; + } + + + /** + * returns a built EnumArrays instance. + * + * The builder is not reusable. + */ + public EnumArrays build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static EnumArrays.Builder builder() { + return new EnumArrays.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public EnumArrays.Builder toBuilder() { + return new EnumArrays.Builder() + .justSymbol(getJustSymbol()) + .arrayEnum(getArrayEnum()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/EnumClass.java new file mode 100644 index 000000000000..fe2eb0dfea77 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/EnumClass.java @@ -0,0 +1,82 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets EnumClass + */ +public enum EnumClass { + + _ABC("_abc"), + + _EFG("-efg"), + + _XYZ_("(xyz)"); + + private String value; + + EnumClass(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumClass fromValue(String value) { + for (EnumClass b : EnumClass.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/EnumTest.java new file mode 100644 index 000000000000..2bd4adfe73d6 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/EnumTest.java @@ -0,0 +1,703 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.OuterEnumDefaultValue; +import org.openapitools.client.model.OuterEnumInteger; +import org.openapitools.client.model.OuterEnumIntegerDefaultValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * EnumTest + */ +@JsonPropertyOrder({ + EnumTest.JSON_PROPERTY_ENUM_STRING, + EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, + EnumTest.JSON_PROPERTY_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_ENUM_INTEGER_ONLY, + EnumTest.JSON_PROPERTY_ENUM_NUMBER, + EnumTest.JSON_PROPERTY_OUTER_ENUM, + EnumTest.JSON_PROPERTY_OUTER_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE, + EnumTest.JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class EnumTest { + /** + * Gets or Sets enumString + */ + public enum EnumStringEnum { + UPPER(String.valueOf("UPPER")), + + LOWER(String.valueOf("lower")), + + EMPTY(String.valueOf("")); + + private String value; + + EnumStringEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringEnum fromValue(String value) { + for (EnumStringEnum b : EnumStringEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + @javax.annotation.Nullable + private EnumStringEnum enumString; + + /** + * Gets or Sets enumStringRequired + */ + public enum EnumStringRequiredEnum { + UPPER(String.valueOf("UPPER")), + + LOWER(String.valueOf("lower")), + + EMPTY(String.valueOf("")); + + private String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringRequiredEnum fromValue(String value) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + @javax.annotation.Nonnull + private EnumStringRequiredEnum enumStringRequired; + + /** + * Gets or Sets enumInteger + */ + public enum EnumIntegerEnum { + NUMBER_1(Integer.valueOf(1)), + + NUMBER_MINUS_1(Integer.valueOf(-1)); + + private Integer value; + + EnumIntegerEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumIntegerEnum fromValue(Integer value) { + for (EnumIntegerEnum b : EnumIntegerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + @javax.annotation.Nullable + private EnumIntegerEnum enumInteger; + + /** + * Gets or Sets enumIntegerOnly + */ + public enum EnumIntegerOnlyEnum { + NUMBER_2(Integer.valueOf(2)), + + NUMBER_MINUS_2(Integer.valueOf(-2)); + + private Integer value; + + EnumIntegerOnlyEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumIntegerOnlyEnum fromValue(Integer value) { + for (EnumIntegerOnlyEnum b : EnumIntegerOnlyEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ENUM_INTEGER_ONLY = "enum_integer_only"; + @javax.annotation.Nullable + private EnumIntegerOnlyEnum enumIntegerOnly; + + /** + * Gets or Sets enumNumber + */ + public enum EnumNumberEnum { + NUMBER_1_DOT_1(Double.valueOf(1.1)), + + NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); + + private Double value; + + EnumNumberEnum(Double value) { + this.value = value; + } + + @JsonValue + public Double getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumNumberEnum fromValue(Double value) { + for (EnumNumberEnum b : EnumNumberEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + @javax.annotation.Nullable + private EnumNumberEnum enumNumber; + + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + @javax.annotation.Nullable + private OuterEnum outerEnum; + + public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER = "outerEnumInteger"; + @javax.annotation.Nullable + private OuterEnumInteger outerEnumInteger; + + public static final String JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE = "outerEnumDefaultValue"; + @javax.annotation.Nullable + private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; + + public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE = "outerEnumIntegerDefaultValue"; + @javax.annotation.Nullable + private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; + + public EnumTest() { + } + + public EnumTest enumString(@javax.annotation.Nullable EnumStringEnum enumString) { + this.enumString = enumString; + return this; + } + + /** + * Get enumString + * @return enumString + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENUM_STRING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumStringEnum getEnumString() { + return enumString; + } + + + @JsonProperty(value = JSON_PROPERTY_ENUM_STRING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnumString(@javax.annotation.Nullable EnumStringEnum enumString) { + this.enumString = enumString; + } + + + public EnumTest enumStringRequired(@javax.annotation.Nonnull EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_ENUM_STRING_REQUIRED, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + + @JsonProperty(value = JSON_PROPERTY_ENUM_STRING_REQUIRED, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEnumStringRequired(@javax.annotation.Nonnull EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + + + public EnumTest enumInteger(@javax.annotation.Nullable EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return this; + } + + /** + * Get enumInteger + * @return enumInteger + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENUM_INTEGER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + + + @JsonProperty(value = JSON_PROPERTY_ENUM_INTEGER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnumInteger(@javax.annotation.Nullable EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + + public EnumTest enumIntegerOnly(@javax.annotation.Nullable EnumIntegerOnlyEnum enumIntegerOnly) { + this.enumIntegerOnly = enumIntegerOnly; + return this; + } + + /** + * Get enumIntegerOnly + * @return enumIntegerOnly + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENUM_INTEGER_ONLY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumIntegerOnlyEnum getEnumIntegerOnly() { + return enumIntegerOnly; + } + + + @JsonProperty(value = JSON_PROPERTY_ENUM_INTEGER_ONLY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnumIntegerOnly(@javax.annotation.Nullable EnumIntegerOnlyEnum enumIntegerOnly) { + this.enumIntegerOnly = enumIntegerOnly; + } + + + public EnumTest enumNumber(@javax.annotation.Nullable EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return this; + } + + /** + * Get enumNumber + * @return enumNumber + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ENUM_NUMBER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + + + @JsonProperty(value = JSON_PROPERTY_ENUM_NUMBER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnumNumber(@javax.annotation.Nullable EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + + public EnumTest outerEnum(@javax.annotation.Nullable OuterEnum outerEnum) { + this.outerEnum = outerEnum; + return this; + } + + /** + * Get outerEnum + * @return outerEnum + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnum getOuterEnum() { + return outerEnum; + } + + + @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOuterEnum(@javax.annotation.Nullable OuterEnum outerEnum) { + this.outerEnum = outerEnum; + } + + + public EnumTest outerEnumInteger(@javax.annotation.Nullable OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + return this; + } + + /** + * Get outerEnumInteger + * @return outerEnumInteger + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_INTEGER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnumInteger getOuterEnumInteger() { + return outerEnumInteger; + } + + + @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_INTEGER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOuterEnumInteger(@javax.annotation.Nullable OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + } + + + public EnumTest outerEnumDefaultValue(@javax.annotation.Nullable OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + return this; + } + + /** + * Get outerEnumDefaultValue + * @return outerEnumDefaultValue + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnumDefaultValue getOuterEnumDefaultValue() { + return outerEnumDefaultValue; + } + + + @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOuterEnumDefaultValue(@javax.annotation.Nullable OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + } + + + public EnumTest outerEnumIntegerDefaultValue(@javax.annotation.Nullable OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + return this; + } + + /** + * Get outerEnumIntegerDefaultValue + * @return outerEnumIntegerDefaultValue + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { + return outerEnumIntegerDefaultValue; + } + + + @JsonProperty(value = JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOuterEnumIntegerDefaultValue(@javax.annotation.Nullable OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + } + + + /** + * Return true if this Enum_Test object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumIntegerOnly: ").append(toIndentedString(enumIntegerOnly)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); + sb.append(" outerEnumInteger: ").append(toIndentedString(outerEnumInteger)).append("\n"); + sb.append(" outerEnumDefaultValue: ").append(toIndentedString(outerEnumDefaultValue)).append("\n"); + sb.append(" outerEnumIntegerDefaultValue: ").append(toIndentedString(outerEnumIntegerDefaultValue)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `enum_string` to the URL query string + if (getEnumString() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%senum_string%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEnumString())))); + } + + // add `enum_string_required` to the URL query string + if (getEnumStringRequired() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%senum_string_required%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEnumStringRequired())))); + } + + // add `enum_integer` to the URL query string + if (getEnumInteger() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%senum_integer%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEnumInteger())))); + } + + // add `enum_integer_only` to the URL query string + if (getEnumIntegerOnly() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%senum_integer_only%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEnumIntegerOnly())))); + } + + // add `enum_number` to the URL query string + if (getEnumNumber() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%senum_number%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEnumNumber())))); + } + + // add `outerEnum` to the URL query string + if (getOuterEnum() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%souterEnum%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getOuterEnum())))); + } + + // add `outerEnumInteger` to the URL query string + if (getOuterEnumInteger() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%souterEnumInteger%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getOuterEnumInteger())))); + } + + // add `outerEnumDefaultValue` to the URL query string + if (getOuterEnumDefaultValue() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%souterEnumDefaultValue%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getOuterEnumDefaultValue())))); + } + + // add `outerEnumIntegerDefaultValue` to the URL query string + if (getOuterEnumIntegerDefaultValue() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%souterEnumIntegerDefaultValue%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getOuterEnumIntegerDefaultValue())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private EnumTest instance; + + public Builder() { + this(new EnumTest()); + } + + protected Builder(EnumTest instance) { + this.instance = instance; + } + + public EnumTest.Builder enumString(EnumStringEnum enumString) { + this.instance.enumString = enumString; + return this; + } + public EnumTest.Builder enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.instance.enumStringRequired = enumStringRequired; + return this; + } + public EnumTest.Builder enumInteger(EnumIntegerEnum enumInteger) { + this.instance.enumInteger = enumInteger; + return this; + } + public EnumTest.Builder enumIntegerOnly(EnumIntegerOnlyEnum enumIntegerOnly) { + this.instance.enumIntegerOnly = enumIntegerOnly; + return this; + } + public EnumTest.Builder enumNumber(EnumNumberEnum enumNumber) { + this.instance.enumNumber = enumNumber; + return this; + } + public EnumTest.Builder outerEnum(OuterEnum outerEnum) { + this.instance.outerEnum = outerEnum; + return this; + } + public EnumTest.Builder outerEnumInteger(OuterEnumInteger outerEnumInteger) { + this.instance.outerEnumInteger = outerEnumInteger; + return this; + } + public EnumTest.Builder outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.instance.outerEnumDefaultValue = outerEnumDefaultValue; + return this; + } + public EnumTest.Builder outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.instance.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + return this; + } + + + /** + * returns a built EnumTest instance. + * + * The builder is not reusable. + */ + public EnumTest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static EnumTest.Builder builder() { + return new EnumTest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public EnumTest.Builder toBuilder() { + return new EnumTest.Builder() + .enumString(getEnumString()) + .enumStringRequired(getEnumStringRequired()) + .enumInteger(getEnumInteger()) + .enumIntegerOnly(getEnumIntegerOnly()) + .enumNumber(getEnumNumber()) + .outerEnum(getOuterEnum()) + .outerEnumInteger(getOuterEnumInteger()) + .outerEnumDefaultValue(getOuterEnumDefaultValue()) + .outerEnumIntegerDefaultValue(getOuterEnumIntegerDefaultValue()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java new file mode 100644 index 000000000000..fd5f3ca43816 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java @@ -0,0 +1,240 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * EquilateralTriangle + */ +@JsonPropertyOrder({ + EquilateralTriangle.JSON_PROPERTY_SHAPE_TYPE, + EquilateralTriangle.JSON_PROPERTY_TRIANGLE_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class EquilateralTriangle { + public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + @javax.annotation.Nonnull + private String shapeType; + + public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; + @javax.annotation.Nonnull + private String triangleType; + + public EquilateralTriangle() { + } + + public EquilateralTriangle shapeType(@javax.annotation.Nonnull String shapeType) { + this.shapeType = shapeType; + return this; + } + + /** + * Get shapeType + * @return shapeType + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getShapeType() { + return shapeType; + } + + + @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setShapeType(@javax.annotation.Nonnull String shapeType) { + this.shapeType = shapeType; + } + + + public EquilateralTriangle triangleType(@javax.annotation.Nonnull String triangleType) { + this.triangleType = triangleType; + return this; + } + + /** + * Get triangleType + * @return triangleType + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTriangleType() { + return triangleType; + } + + + @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTriangleType(@javax.annotation.Nonnull String triangleType) { + this.triangleType = triangleType; + } + + + /** + * Return true if this EquilateralTriangle object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EquilateralTriangle {\n"); + sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); + sb.append(" triangleType: ").append(toIndentedString(triangleType)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `shapeType` to the URL query string + if (getShapeType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sshapeType%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getShapeType())))); + } + + // add `triangleType` to the URL query string + if (getTriangleType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%striangleType%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTriangleType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private EquilateralTriangle instance; + + public Builder() { + this(new EquilateralTriangle()); + } + + protected Builder(EquilateralTriangle instance) { + this.instance = instance; + } + + public EquilateralTriangle.Builder shapeType(String shapeType) { + this.instance.shapeType = shapeType; + return this; + } + public EquilateralTriangle.Builder triangleType(String triangleType) { + this.instance.triangleType = triangleType; + return this; + } + + + /** + * returns a built EquilateralTriangle instance. + * + * The builder is not reusable. + */ + public EquilateralTriangle build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static EquilateralTriangle.Builder builder() { + return new EquilateralTriangle.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public EquilateralTriangle.Builder toBuilder() { + return new EquilateralTriangle.Builder() + .shapeType(getShapeType()) + .triangleType(getTriangleType()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java new file mode 100644 index 000000000000..c08b2aa4eaad --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java @@ -0,0 +1,255 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * FakeBigDecimalMap200Response + */ +@JsonPropertyOrder({ + FakeBigDecimalMap200Response.JSON_PROPERTY_SOME_ID, + FakeBigDecimalMap200Response.JSON_PROPERTY_SOME_MAP +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class FakeBigDecimalMap200Response { + public static final String JSON_PROPERTY_SOME_ID = "someId"; + @javax.annotation.Nullable + private BigDecimal someId; + + public static final String JSON_PROPERTY_SOME_MAP = "someMap"; + @javax.annotation.Nullable + private Map someMap = new HashMap<>(); + + public FakeBigDecimalMap200Response() { + } + + public FakeBigDecimalMap200Response someId(@javax.annotation.Nullable BigDecimal someId) { + this.someId = someId; + return this; + } + + /** + * Get someId + * @return someId + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SOME_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getSomeId() { + return someId; + } + + + @JsonProperty(value = JSON_PROPERTY_SOME_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSomeId(@javax.annotation.Nullable BigDecimal someId) { + this.someId = someId; + } + + + public FakeBigDecimalMap200Response someMap(@javax.annotation.Nullable Map someMap) { + this.someMap = someMap; + return this; + } + + public FakeBigDecimalMap200Response putSomeMapItem(String key, BigDecimal someMapItem) { + if (this.someMap == null) { + this.someMap = new HashMap<>(); + } + this.someMap.put(key, someMapItem); + return this; + } + + /** + * Get someMap + * @return someMap + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SOME_MAP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getSomeMap() { + return someMap; + } + + + @JsonProperty(value = JSON_PROPERTY_SOME_MAP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSomeMap(@javax.annotation.Nullable Map someMap) { + this.someMap = someMap; + } + + + /** + * Return true if this fakeBigDecimalMap_200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FakeBigDecimalMap200Response {\n"); + sb.append(" someId: ").append(toIndentedString(someId)).append("\n"); + sb.append(" someMap: ").append(toIndentedString(someMap)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `someId` to the URL query string + if (getSomeId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssomeId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSomeId())))); + } + + // add `someMap` to the URL query string + if (getSomeMap() != null) { + for (String _key : getSomeMap().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssomeMap%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getSomeMap().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getSomeMap().get(_key))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private FakeBigDecimalMap200Response instance; + + public Builder() { + this(new FakeBigDecimalMap200Response()); + } + + protected Builder(FakeBigDecimalMap200Response instance) { + this.instance = instance; + } + + public FakeBigDecimalMap200Response.Builder someId(BigDecimal someId) { + this.instance.someId = someId; + return this; + } + public FakeBigDecimalMap200Response.Builder someMap(Map someMap) { + this.instance.someMap = someMap; + return this; + } + + + /** + * returns a built FakeBigDecimalMap200Response instance. + * + * The builder is not reusable. + */ + public FakeBigDecimalMap200Response build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static FakeBigDecimalMap200Response.Builder builder() { + return new FakeBigDecimalMap200Response.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public FakeBigDecimalMap200Response.Builder toBuilder() { + return new FakeBigDecimalMap200Response.Builder() + .someId(getSomeId()) + .someMap(getSomeMap()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java new file mode 100644 index 000000000000..be23ad63f7a6 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -0,0 +1,256 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.ModelFile; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * FileSchemaTestClass + */ +@JsonPropertyOrder({ + FileSchemaTestClass.JSON_PROPERTY_FILE, + FileSchemaTestClass.JSON_PROPERTY_FILES +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class FileSchemaTestClass { + public static final String JSON_PROPERTY_FILE = "file"; + @javax.annotation.Nullable + private ModelFile _file; + + public static final String JSON_PROPERTY_FILES = "files"; + @javax.annotation.Nullable + private List files = new ArrayList<>(); + + public FileSchemaTestClass() { + } + + public FileSchemaTestClass _file(@javax.annotation.Nullable ModelFile _file) { + this._file = _file; + return this; + } + + /** + * Get _file + * @return _file + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FILE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelFile getFile() { + return _file; + } + + + @JsonProperty(value = JSON_PROPERTY_FILE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFile(@javax.annotation.Nullable ModelFile _file) { + this._file = _file; + } + + + public FileSchemaTestClass files(@javax.annotation.Nullable List files) { + this.files = files; + return this; + } + + public FileSchemaTestClass addFilesItem(ModelFile filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Get files + * @return files + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FILES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { + return files; + } + + + @JsonProperty(value = JSON_PROPERTY_FILES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(@javax.annotation.Nullable List files) { + this.files = files; + } + + + /** + * Return true if this FileSchemaTestClass object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileSchemaTestClass {\n"); + sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `file` to the URL query string + if (getFile() != null) { + joiner.add(getFile().toUrlQueryString(prefix + "file" + suffix)); + } + + // add `files` to the URL query string + if (getFiles() != null) { + for (int i = 0; i < getFiles().size(); i++) { + if (getFiles().get(i) != null) { + joiner.add(getFiles().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%sfiles%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private FileSchemaTestClass instance; + + public Builder() { + this(new FileSchemaTestClass()); + } + + protected Builder(FileSchemaTestClass instance) { + this.instance = instance; + } + + public FileSchemaTestClass.Builder _file(ModelFile _file) { + this.instance._file = _file; + return this; + } + public FileSchemaTestClass.Builder files(List files) { + this.instance.files = files; + return this; + } + + + /** + * returns a built FileSchemaTestClass instance. + * + * The builder is not reusable. + */ + public FileSchemaTestClass build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static FileSchemaTestClass.Builder builder() { + return new FileSchemaTestClass.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public FileSchemaTestClass.Builder toBuilder() { + return new FileSchemaTestClass.Builder() + ._file(getFile()) + .files(getFiles()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Foo.java new file mode 100644 index 000000000000..4da52339463a --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Foo.java @@ -0,0 +1,200 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * Foo + */ +@JsonPropertyOrder({ + Foo.JSON_PROPERTY_BAR +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class Foo { + public static final String JSON_PROPERTY_BAR = "bar"; + @javax.annotation.Nullable + private String bar = "bar"; + + public Foo() { + } + + public Foo bar(@javax.annotation.Nullable String bar) { + this.bar = bar; + return this; + } + + /** + * Get bar + * @return bar + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BAR, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { + return bar; + } + + + @JsonProperty(value = JSON_PROPERTY_BAR, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBar(@javax.annotation.Nullable String bar) { + this.bar = bar; + } + + + /** + * Return true if this Foo object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Foo {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `bar` to the URL query string + if (getBar() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sbar%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getBar())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private Foo instance; + + public Builder() { + this(new Foo()); + } + + protected Builder(Foo instance) { + this.instance = instance; + } + + public Foo.Builder bar(String bar) { + this.instance.bar = bar; + return this; + } + + + /** + * returns a built Foo instance. + * + * The builder is not reusable. + */ + public Foo build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Foo.Builder builder() { + return new Foo.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Foo.Builder toBuilder() { + return new Foo.Builder() + .bar(getBar()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java new file mode 100644 index 000000000000..fb0a2805a66d --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -0,0 +1,201 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.openapitools.client.model.Foo; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * FooGetDefaultResponse + */ +@JsonPropertyOrder({ + FooGetDefaultResponse.JSON_PROPERTY_STRING +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class FooGetDefaultResponse { + public static final String JSON_PROPERTY_STRING = "string"; + @javax.annotation.Nullable + private Foo string; + + public FooGetDefaultResponse() { + } + + public FooGetDefaultResponse string(@javax.annotation.Nullable Foo string) { + this.string = string; + return this; + } + + /** + * Get string + * @return string + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STRING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Foo getString() { + return string; + } + + + @JsonProperty(value = JSON_PROPERTY_STRING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setString(@javax.annotation.Nullable Foo string) { + this.string = string; + } + + + /** + * Return true if this _foo_get_default_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FooGetDefaultResponse {\n"); + sb.append(" string: ").append(toIndentedString(string)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `string` to the URL query string + if (getString() != null) { + joiner.add(getString().toUrlQueryString(prefix + "string" + suffix)); + } + + return joiner.toString(); + } + + public static class Builder { + + private FooGetDefaultResponse instance; + + public Builder() { + this(new FooGetDefaultResponse()); + } + + protected Builder(FooGetDefaultResponse instance) { + this.instance = instance; + } + + public FooGetDefaultResponse.Builder string(Foo string) { + this.instance.string = string; + return this; + } + + + /** + * returns a built FooGetDefaultResponse instance. + * + * The builder is not reusable. + */ + public FooGetDefaultResponse build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static FooGetDefaultResponse.Builder builder() { + return new FooGetDefaultResponse.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public FooGetDefaultResponse.Builder toBuilder() { + return new FooGetDefaultResponse.Builder() + .string(getString()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FormatTest.java new file mode 100644 index 000000000000..98fb126f343a --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FormatTest.java @@ -0,0 +1,815 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.File; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * FormatTest + */ +@JsonPropertyOrder({ + FormatTest.JSON_PROPERTY_INTEGER, + FormatTest.JSON_PROPERTY_INT32, + FormatTest.JSON_PROPERTY_INT64, + FormatTest.JSON_PROPERTY_NUMBER, + FormatTest.JSON_PROPERTY_FLOAT, + FormatTest.JSON_PROPERTY_DOUBLE, + FormatTest.JSON_PROPERTY_DECIMAL, + FormatTest.JSON_PROPERTY_STRING, + FormatTest.JSON_PROPERTY_BYTE, + FormatTest.JSON_PROPERTY_BINARY, + FormatTest.JSON_PROPERTY_DATE, + FormatTest.JSON_PROPERTY_DATE_TIME, + FormatTest.JSON_PROPERTY_UUID, + FormatTest.JSON_PROPERTY_PASSWORD, + FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS, + FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class FormatTest { + public static final String JSON_PROPERTY_INTEGER = "integer"; + @javax.annotation.Nullable + private Integer integer; + + public static final String JSON_PROPERTY_INT32 = "int32"; + @javax.annotation.Nullable + private Integer int32; + + public static final String JSON_PROPERTY_INT64 = "int64"; + @javax.annotation.Nullable + private Long int64; + + public static final String JSON_PROPERTY_NUMBER = "number"; + @javax.annotation.Nonnull + private BigDecimal number; + + public static final String JSON_PROPERTY_FLOAT = "float"; + @javax.annotation.Nullable + private Float _float; + + public static final String JSON_PROPERTY_DOUBLE = "double"; + @javax.annotation.Nullable + private Double _double; + + public static final String JSON_PROPERTY_DECIMAL = "decimal"; + @javax.annotation.Nullable + private BigDecimal decimal; + + public static final String JSON_PROPERTY_STRING = "string"; + @javax.annotation.Nullable + private String string; + + public static final String JSON_PROPERTY_BYTE = "byte"; + @javax.annotation.Nonnull + private byte[] _byte; + + public static final String JSON_PROPERTY_BINARY = "binary"; + @javax.annotation.Nullable + private File binary; + + public static final String JSON_PROPERTY_DATE = "date"; + @javax.annotation.Nonnull + private LocalDate date; + + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @javax.annotation.Nullable + private OffsetDateTime dateTime; + + public static final String JSON_PROPERTY_UUID = "uuid"; + @javax.annotation.Nullable + private UUID uuid; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + @javax.annotation.Nonnull + private String password; + + public static final String JSON_PROPERTY_PATTERN_WITH_DIGITS = "pattern_with_digits"; + @javax.annotation.Nullable + private String patternWithDigits; + + public static final String JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER = "pattern_with_digits_and_delimiter"; + @javax.annotation.Nullable + private String patternWithDigitsAndDelimiter; + + public FormatTest() { + } + + public FormatTest integer(@javax.annotation.Nullable Integer integer) { + this.integer = integer; + return this; + } + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_INTEGER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInteger() { + return integer; + } + + + @JsonProperty(value = JSON_PROPERTY_INTEGER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInteger(@javax.annotation.Nullable Integer integer) { + this.integer = integer; + } + + + public FormatTest int32(@javax.annotation.Nullable Integer int32) { + this.int32 = int32; + return this; + } + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_INT32, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInt32() { + return int32; + } + + + @JsonProperty(value = JSON_PROPERTY_INT32, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInt32(@javax.annotation.Nullable Integer int32) { + this.int32 = int32; + } + + + public FormatTest int64(@javax.annotation.Nullable Long int64) { + this.int64 = int64; + return this; + } + + /** + * Get int64 + * @return int64 + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_INT64, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getInt64() { + return int64; + } + + + @JsonProperty(value = JSON_PROPERTY_INT64, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInt64(@javax.annotation.Nullable Long int64) { + this.int64 = int64; + } + + + public FormatTest number(@javax.annotation.Nonnull BigDecimal number) { + this.number = number; + return this; + } + + /** + * Get number + * minimum: 32.1 + * maximum: 543.2 + * @return number + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_NUMBER, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumber() { + return number; + } + + + @JsonProperty(value = JSON_PROPERTY_NUMBER, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumber(@javax.annotation.Nonnull BigDecimal number) { + this.number = number; + } + + + public FormatTest _float(@javax.annotation.Nullable Float _float) { + this._float = _float; + return this; + } + + /** + * Get _float + * minimum: 54.3 + * maximum: 987.6 + * @return _float + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FLOAT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getFloat() { + return _float; + } + + + @JsonProperty(value = JSON_PROPERTY_FLOAT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFloat(@javax.annotation.Nullable Float _float) { + this._float = _float; + } + + + public FormatTest _double(@javax.annotation.Nullable Double _double) { + this._double = _double; + return this; + } + + /** + * Get _double + * minimum: 67.8 + * maximum: 123.4 + * @return _double + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DOUBLE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getDouble() { + return _double; + } + + + @JsonProperty(value = JSON_PROPERTY_DOUBLE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDouble(@javax.annotation.Nullable Double _double) { + this._double = _double; + } + + + public FormatTest decimal(@javax.annotation.Nullable BigDecimal decimal) { + this.decimal = decimal; + return this; + } + + /** + * Get decimal + * @return decimal + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DECIMAL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getDecimal() { + return decimal; + } + + + @JsonProperty(value = JSON_PROPERTY_DECIMAL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDecimal(@javax.annotation.Nullable BigDecimal decimal) { + this.decimal = decimal; + } + + + public FormatTest string(@javax.annotation.Nullable String string) { + this.string = string; + return this; + } + + /** + * Get string + * @return string + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STRING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getString() { + return string; + } + + + @JsonProperty(value = JSON_PROPERTY_STRING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setString(@javax.annotation.Nullable String string) { + this.string = string; + } + + + public FormatTest _byte(@javax.annotation.Nonnull byte[] _byte) { + this._byte = _byte; + return this; + } + + /** + * Get _byte + * @return _byte + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_BYTE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public byte[] getByte() { + return _byte; + } + + + @JsonProperty(value = JSON_PROPERTY_BYTE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setByte(@javax.annotation.Nonnull byte[] _byte) { + this._byte = _byte; + } + + + public FormatTest binary(@javax.annotation.Nullable File binary) { + this.binary = binary; + return this; + } + + /** + * Get binary + * @return binary + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BINARY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public File getBinary() { + return binary; + } + + + @JsonProperty(value = JSON_PROPERTY_BINARY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBinary(@javax.annotation.Nullable File binary) { + this.binary = binary; + } + + + public FormatTest date(@javax.annotation.Nonnull LocalDate date) { + this.date = date; + return this; + } + + /** + * Get date + * @return date + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_DATE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LocalDate getDate() { + return date; + } + + + @JsonProperty(value = JSON_PROPERTY_DATE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDate(@javax.annotation.Nonnull LocalDate date) { + this.date = date; + } + + + public FormatTest dateTime(@javax.annotation.Nullable OffsetDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATE_TIME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { + return dateTime; + } + + + @JsonProperty(value = JSON_PROPERTY_DATE_TIME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateTime(@javax.annotation.Nullable OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + + public FormatTest uuid(@javax.annotation.Nullable UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UUID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { + return uuid; + } + + + @JsonProperty(value = JSON_PROPERTY_UUID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUuid(@javax.annotation.Nullable UUID uuid) { + this.uuid = uuid; + } + + + public FormatTest password(@javax.annotation.Nonnull String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPassword() { + return password; + } + + + @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPassword(@javax.annotation.Nonnull String password) { + this.password = password; + } + + + public FormatTest patternWithDigits(@javax.annotation.Nullable String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + return this; + } + + /** + * A string that is a 10 digit number. Can have leading zeros. + * @return patternWithDigits + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PATTERN_WITH_DIGITS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPatternWithDigits() { + return patternWithDigits; + } + + + @JsonProperty(value = JSON_PROPERTY_PATTERN_WITH_DIGITS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPatternWithDigits(@javax.annotation.Nullable String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + } + + + public FormatTest patternWithDigitsAndDelimiter(@javax.annotation.Nullable String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + return this; + } + + /** + * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + * @return patternWithDigitsAndDelimiter + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPatternWithDigitsAndDelimiter() { + return patternWithDigitsAndDelimiter; + } + + + @JsonProperty(value = JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPatternWithDigitsAndDelimiter(@javax.annotation.Nullable String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + } + + + /** + * Return true if this format_test object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FormatTest {\n"); + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" decimal: ").append(toIndentedString(decimal)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" password: ").append("*").append("\n"); + sb.append(" patternWithDigits: ").append(toIndentedString(patternWithDigits)).append("\n"); + sb.append(" patternWithDigitsAndDelimiter: ").append(toIndentedString(patternWithDigitsAndDelimiter)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `integer` to the URL query string + if (getInteger() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sinteger%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getInteger())))); + } + + // add `int32` to the URL query string + if (getInt32() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sint32%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getInt32())))); + } + + // add `int64` to the URL query string + if (getInt64() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sint64%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getInt64())))); + } + + // add `number` to the URL query string + if (getNumber() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%snumber%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNumber())))); + } + + // add `float` to the URL query string + if (getFloat() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sfloat%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getFloat())))); + } + + // add `double` to the URL query string + if (getDouble() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdouble%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDouble())))); + } + + // add `decimal` to the URL query string + if (getDecimal() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdecimal%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDecimal())))); + } + + // add `string` to the URL query string + if (getString() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstring%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getString())))); + } + + // add `byte` to the URL query string + if (getByte() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sbyte%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getByte())))); + } + + // add `binary` to the URL query string + if (getBinary() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sbinary%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getBinary())))); + } + + // add `date` to the URL query string + if (getDate() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdate%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDate())))); + } + + // add `dateTime` to the URL query string + if (getDateTime() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdateTime%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDateTime())))); + } + + // add `uuid` to the URL query string + if (getUuid() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%suuid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUuid())))); + } + + // add `password` to the URL query string + if (getPassword() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%spassword%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPassword())))); + } + + // add `pattern_with_digits` to the URL query string + if (getPatternWithDigits() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%spattern_with_digits%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPatternWithDigits())))); + } + + // add `pattern_with_digits_and_delimiter` to the URL query string + if (getPatternWithDigitsAndDelimiter() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%spattern_with_digits_and_delimiter%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPatternWithDigitsAndDelimiter())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private FormatTest instance; + + public Builder() { + this(new FormatTest()); + } + + protected Builder(FormatTest instance) { + this.instance = instance; + } + + public FormatTest.Builder integer(Integer integer) { + this.instance.integer = integer; + return this; + } + public FormatTest.Builder int32(Integer int32) { + this.instance.int32 = int32; + return this; + } + public FormatTest.Builder int64(Long int64) { + this.instance.int64 = int64; + return this; + } + public FormatTest.Builder number(BigDecimal number) { + this.instance.number = number; + return this; + } + public FormatTest.Builder _float(Float _float) { + this.instance._float = _float; + return this; + } + public FormatTest.Builder _double(Double _double) { + this.instance._double = _double; + return this; + } + public FormatTest.Builder decimal(BigDecimal decimal) { + this.instance.decimal = decimal; + return this; + } + public FormatTest.Builder string(String string) { + this.instance.string = string; + return this; + } + public FormatTest.Builder _byte(byte[] _byte) { + this.instance._byte = _byte; + return this; + } + public FormatTest.Builder binary(File binary) { + this.instance.binary = binary; + return this; + } + public FormatTest.Builder date(LocalDate date) { + this.instance.date = date; + return this; + } + public FormatTest.Builder dateTime(OffsetDateTime dateTime) { + this.instance.dateTime = dateTime; + return this; + } + public FormatTest.Builder uuid(UUID uuid) { + this.instance.uuid = uuid; + return this; + } + public FormatTest.Builder password(String password) { + this.instance.password = password; + return this; + } + public FormatTest.Builder patternWithDigits(String patternWithDigits) { + this.instance.patternWithDigits = patternWithDigits; + return this; + } + public FormatTest.Builder patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.instance.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + return this; + } + + + /** + * returns a built FormatTest instance. + * + * The builder is not reusable. + */ + public FormatTest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static FormatTest.Builder builder() { + return new FormatTest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public FormatTest.Builder toBuilder() { + return new FormatTest.Builder() + .integer(getInteger()) + .int32(getInt32()) + .int64(getInt64()) + .number(getNumber()) + ._float(getFloat()) + ._double(getDouble()) + .decimal(getDecimal()) + .string(getString()) + ._byte(getByte()) + .binary(getBinary()) + .date(getDate()) + .dateTime(getDateTime()) + .uuid(getUuid()) + .password(getPassword()) + .patternWithDigits(getPatternWithDigits()) + .patternWithDigitsAndDelimiter(getPatternWithDigitsAndDelimiter()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Fruit.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Fruit.java new file mode 100644 index 000000000000..500bedb573cc --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Fruit.java @@ -0,0 +1,298 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.Arrays; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import tools.jackson.core.type.TypeReference; + +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import tools.jackson.core.JacksonException; +import tools.jackson.core.JsonGenerator; +import tools.jackson.core.JsonParser; +import tools.jackson.core.JsonToken; +import tools.jackson.databind.DeserializationContext; +import tools.jackson.databind.DatabindException; +import tools.jackson.databind.JsonNode; +import tools.jackson.databind.SerializerProvider; +import tools.jackson.databind.annotation.JsonDeserialize; +import tools.jackson.databind.annotation.JsonSerialize; +import tools.jackson.databind.deser.std.StdDeserializer; +import tools.jackson.databind.ser.std.StdSerializer; +import org.openapitools.client.ApiClient; +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +@JsonDeserialize(using = Fruit.FruitDeserializer.class) +@JsonSerialize(using = Fruit.FruitSerializer.class) +public class Fruit extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Fruit.class.getName()); + + public static class FruitSerializer extends StdSerializer { + public FruitSerializer(Class t) { + super(t); + } + + public FruitSerializer() { + this(null); + } + + @Override + public void serialize(Fruit value, JsonGenerator jgen, SerializerProvider provider) throws JacksonException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class FruitDeserializer extends StdDeserializer { + public FruitDeserializer() { + this(Fruit.class); + } + + public FruitDeserializer(Class vc) { + super(vc); + } + + @Override + public Fruit deserialize(JsonParser jp, DeserializationContext ctxt) throws JacksonException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + boolean typeCoercion = false; // MapperFeature.ALLOW_COERCION_OF_SCALARS was removed in Jackson 3 + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize Apple + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Apple.class.equals(Integer.class) || Apple.class.equals(Long.class) || Apple.class.equals(Float.class) || Apple.class.equals(Double.class) || Apple.class.equals(Boolean.class) || Apple.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((Apple.class.equals(Integer.class) || Apple.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((Apple.class.equals(Float.class) || Apple.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (Apple.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (Apple.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Apple.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'Apple'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Apple'", e); + } + + // deserialize Banana + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Banana.class.equals(Integer.class) || Banana.class.equals(Long.class) || Banana.class.equals(Float.class) || Banana.class.equals(Double.class) || Banana.class.equals(Boolean.class) || Banana.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((Banana.class.equals(Integer.class) || Banana.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((Banana.class.equals(Float.class) || Banana.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (Banana.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (Banana.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Banana.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'Banana'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Banana'", e); + } + + if (match == 1) { + Fruit ret = new Fruit(); + ret.setActualInstance(deserialized); + return ret; + } + throw DatabindException.from(jp, String.format(java.util.Locale.ROOT, "Failed deserialization for Fruit: %d classes match result, expected 1", match)); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public Fruit getNullValue(DeserializationContext ctxt) { + throw DatabindException.from(ctxt.getParser(), "Fruit cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap<>(); + + public Fruit() { + super("oneOf", Boolean.FALSE); + } + + public Fruit(Apple o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Fruit(Banana o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Apple", Apple.class); + schemas.put("Banana", Banana.class); + JSON.registerDescendants(Fruit.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map> getSchemas() { + return Fruit.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Apple, Banana + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(Apple.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(Banana.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Apple, Banana"); + } + + /** + * Get the actual instance, which can be the following: + * Apple, Banana + * + * @return The actual instance (Apple, Banana) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Apple`. If the actual instance is not `Apple`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Apple` + * @throws ClassCastException if the instance is not `Apple` + */ + public Apple getApple() throws ClassCastException { + return (Apple)super.getActualInstance(); + } + + /** + * Get the actual instance of `Banana`. If the actual instance is not `Banana`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Banana` + * @throws ClassCastException if the instance is not `Banana` + */ + public Banana getBanana() throws ClassCastException { + return (Banana)super.getActualInstance(); + } + + + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + if (getActualInstance() instanceof Apple) { + if (getActualInstance() != null) { + joiner.add(((Apple)getActualInstance()).toUrlQueryString(prefix + "one_of_0" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof Banana) { + if (getActualInstance() != null) { + joiner.add(((Banana)getActualInstance()).toUrlQueryString(prefix + "one_of_1" + suffix)); + } + return joiner.toString(); + } + return null; + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FruitReq.java new file mode 100644 index 000000000000..ea53d1905933 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/FruitReq.java @@ -0,0 +1,298 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.Arrays; +import org.openapitools.client.model.AppleReq; +import org.openapitools.client.model.BananaReq; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import tools.jackson.core.type.TypeReference; + +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import tools.jackson.core.JacksonException; +import tools.jackson.core.JsonGenerator; +import tools.jackson.core.JsonParser; +import tools.jackson.core.JsonToken; +import tools.jackson.databind.DeserializationContext; +import tools.jackson.databind.DatabindException; +import tools.jackson.databind.JsonNode; +import tools.jackson.databind.SerializerProvider; +import tools.jackson.databind.annotation.JsonDeserialize; +import tools.jackson.databind.annotation.JsonSerialize; +import tools.jackson.databind.deser.std.StdDeserializer; +import tools.jackson.databind.ser.std.StdSerializer; +import org.openapitools.client.ApiClient; +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +@JsonDeserialize(using = FruitReq.FruitReqDeserializer.class) +@JsonSerialize(using = FruitReq.FruitReqSerializer.class) +public class FruitReq extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(FruitReq.class.getName()); + + public static class FruitReqSerializer extends StdSerializer { + public FruitReqSerializer(Class t) { + super(t); + } + + public FruitReqSerializer() { + this(null); + } + + @Override + public void serialize(FruitReq value, JsonGenerator jgen, SerializerProvider provider) throws JacksonException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class FruitReqDeserializer extends StdDeserializer { + public FruitReqDeserializer() { + this(FruitReq.class); + } + + public FruitReqDeserializer(Class vc) { + super(vc); + } + + @Override + public FruitReq deserialize(JsonParser jp, DeserializationContext ctxt) throws JacksonException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + boolean typeCoercion = false; // MapperFeature.ALLOW_COERCION_OF_SCALARS was removed in Jackson 3 + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize AppleReq + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (AppleReq.class.equals(Integer.class) || AppleReq.class.equals(Long.class) || AppleReq.class.equals(Float.class) || AppleReq.class.equals(Double.class) || AppleReq.class.equals(Boolean.class) || AppleReq.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((AppleReq.class.equals(Integer.class) || AppleReq.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((AppleReq.class.equals(Float.class) || AppleReq.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (AppleReq.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (AppleReq.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(AppleReq.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'AppleReq'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'AppleReq'", e); + } + + // deserialize BananaReq + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (BananaReq.class.equals(Integer.class) || BananaReq.class.equals(Long.class) || BananaReq.class.equals(Float.class) || BananaReq.class.equals(Double.class) || BananaReq.class.equals(Boolean.class) || BananaReq.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((BananaReq.class.equals(Integer.class) || BananaReq.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((BananaReq.class.equals(Float.class) || BananaReq.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (BananaReq.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (BananaReq.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(BananaReq.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'BananaReq'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'BananaReq'", e); + } + + if (match == 1) { + FruitReq ret = new FruitReq(); + ret.setActualInstance(deserialized); + return ret; + } + throw DatabindException.from(jp, String.format(java.util.Locale.ROOT, "Failed deserialization for FruitReq: %d classes match result, expected 1", match)); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public FruitReq getNullValue(DeserializationContext ctxt) { + throw DatabindException.from(ctxt.getParser(), "FruitReq cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap<>(); + + public FruitReq() { + super("oneOf", Boolean.FALSE); + } + + public FruitReq(AppleReq o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public FruitReq(BananaReq o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("AppleReq", AppleReq.class); + schemas.put("BananaReq", BananaReq.class); + JSON.registerDescendants(FruitReq.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map> getSchemas() { + return FruitReq.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * AppleReq, BananaReq + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(AppleReq.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(BananaReq.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be AppleReq, BananaReq"); + } + + /** + * Get the actual instance, which can be the following: + * AppleReq, BananaReq + * + * @return The actual instance (AppleReq, BananaReq) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `AppleReq`. If the actual instance is not `AppleReq`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AppleReq` + * @throws ClassCastException if the instance is not `AppleReq` + */ + public AppleReq getAppleReq() throws ClassCastException { + return (AppleReq)super.getActualInstance(); + } + + /** + * Get the actual instance of `BananaReq`. If the actual instance is not `BananaReq`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `BananaReq` + * @throws ClassCastException if the instance is not `BananaReq` + */ + public BananaReq getBananaReq() throws ClassCastException { + return (BananaReq)super.getActualInstance(); + } + + + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + if (getActualInstance() instanceof AppleReq) { + if (getActualInstance() != null) { + joiner.add(((AppleReq)getActualInstance()).toUrlQueryString(prefix + "one_of_0" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof BananaReq) { + if (getActualInstance() != null) { + joiner.add(((BananaReq)getActualInstance()).toUrlQueryString(prefix + "one_of_1" + suffix)); + } + return joiner.toString(); + } + return null; + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/GmFruit.java new file mode 100644 index 000000000000..8f151ac15a21 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/GmFruit.java @@ -0,0 +1,247 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.Arrays; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import tools.jackson.core.JacksonException; +import tools.jackson.core.JsonGenerator; +import tools.jackson.core.JsonParser; +import tools.jackson.databind.DeserializationContext; +import tools.jackson.databind.DatabindException; +import tools.jackson.databind.JsonNode; +import tools.jackson.databind.SerializerProvider; +import tools.jackson.databind.annotation.JsonDeserialize; +import tools.jackson.databind.annotation.JsonSerialize; +import tools.jackson.databind.deser.std.StdDeserializer; +import tools.jackson.databind.ser.std.StdSerializer; +import org.openapitools.client.ApiClient; +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +@JsonDeserialize(using=GmFruit.GmFruitDeserializer.class) +@JsonSerialize(using = GmFruit.GmFruitSerializer.class) +public class GmFruit extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(GmFruit.class.getName()); + + public static class GmFruitSerializer extends StdSerializer { + public GmFruitSerializer(Class t) { + super(t); + } + + public GmFruitSerializer() { + this(null); + } + + @Override + public void serialize(GmFruit value, JsonGenerator jgen, SerializerProvider provider) throws JacksonException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class GmFruitDeserializer extends StdDeserializer { + public GmFruitDeserializer() { + this(GmFruit.class); + } + + public GmFruitDeserializer(Class vc) { + super(vc); + } + + @Override + public GmFruit deserialize(JsonParser jp, DeserializationContext ctxt) throws JacksonException { + JsonNode tree = jp.readValueAsTree(); + + Object deserialized = null; + // deserialize Apple + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Apple.class); + GmFruit ret = new GmFruit(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'GmFruit'", e); + } + + // deserialize Banana + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Banana.class); + GmFruit ret = new GmFruit(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue, log to help debugging + log.log(Level.FINER, "Input data does not match 'GmFruit'", e); + } + + throw DatabindException.from(jp, "Failed deserialization for GmFruit: no match found"); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public GmFruit getNullValue(DeserializationContext ctxt) { + throw DatabindException.from(ctxt.getParser(), "GmFruit cannot be null"); + } + } + + // store a list of schema names defined in anyOf + public static final Map> schemas = new HashMap>(); + + public GmFruit() { + super("anyOf", Boolean.FALSE); + } + + public GmFruit(Apple o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + public GmFruit(Banana o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Apple", Apple.class); + schemas.put("Banana", Banana.class); + JSON.registerDescendants(GmFruit.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map> getSchemas() { + return GmFruit.schemas; + } + + /** + * Set the instance that matches the anyOf child schema, check + * the instance parameter is valid against the anyOf child schemas: + * Apple, Banana + * + * It could be an instance of the 'anyOf' schemas. + * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(Apple.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(Banana.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Apple, Banana"); + } + + /** + * Get the actual instance, which can be the following: + * Apple, Banana + * + * @return The actual instance (Apple, Banana) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Apple`. If the actual instance is not `Apple`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Apple` + * @throws ClassCastException if the instance is not `Apple` + */ + public Apple getApple() throws ClassCastException { + return (Apple)super.getActualInstance(); + } + + /** + * Get the actual instance of `Banana`. If the actual instance is not `Banana`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Banana` + * @throws ClassCastException if the instance is not `Banana` + */ + public Banana getBanana() throws ClassCastException { + return (Banana)super.getActualInstance(); + } + + + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + return null; + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java new file mode 100644 index 000000000000..7f221420d99d --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java @@ -0,0 +1,222 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.JSON; +import org.openapitools.client.ApiClient; +/** + * GrandparentAnimal + */ +@JsonPropertyOrder({ + GrandparentAnimal.JSON_PROPERTY_PET_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +@JsonIgnoreProperties( + value = "pet_type", // ignore manually set pet_type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the pet_type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "pet_type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = ChildCat.class, name = "ChildCat"), + @JsonSubTypes.Type(value = ParentPet.class, name = "ParentPet"), +}) + +public class GrandparentAnimal { + public static final String JSON_PROPERTY_PET_TYPE = "pet_type"; + @javax.annotation.Nonnull + private String petType; + + public GrandparentAnimal() { + } + + public GrandparentAnimal petType(@javax.annotation.Nonnull String petType) { + this.petType = petType; + return this; + } + + /** + * Get petType + * @return petType + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_PET_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPetType() { + return petType; + } + + + @JsonProperty(value = JSON_PROPERTY_PET_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPetType(@javax.annotation.Nonnull String petType) { + this.petType = petType; + } + + + /** + * Return true if this GrandparentAnimal object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GrandparentAnimal {\n"); + sb.append(" petType: ").append(toIndentedString(petType)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `pet_type` to the URL query string + if (getPetType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%spet_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPetType())))); + } + + return joiner.toString(); + } +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("ChildCat", ChildCat.class); + mappings.put("ParentPet", ParentPet.class); + mappings.put("GrandparentAnimal", GrandparentAnimal.class); + JSON.registerDiscriminator(GrandparentAnimal.class, "pet_type", mappings); +} + + public static class Builder { + + private GrandparentAnimal instance; + + public Builder() { + this(new GrandparentAnimal()); + } + + protected Builder(GrandparentAnimal instance) { + this.instance = instance; + } + + public GrandparentAnimal.Builder petType(String petType) { + this.instance.petType = petType; + return this; + } + + + /** + * returns a built GrandparentAnimal instance. + * + * The builder is not reusable. + */ + public GrandparentAnimal build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static GrandparentAnimal.Builder builder() { + return new GrandparentAnimal.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public GrandparentAnimal.Builder toBuilder() { + return new GrandparentAnimal.Builder() + .petType(getPetType()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java new file mode 100644 index 000000000000..2c86c78e99f3 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -0,0 +1,230 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * HasOnlyReadOnly + */ +@JsonPropertyOrder({ + HasOnlyReadOnly.JSON_PROPERTY_BAR, + HasOnlyReadOnly.JSON_PROPERTY_FOO +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class HasOnlyReadOnly { + public static final String JSON_PROPERTY_BAR = "bar"; + @javax.annotation.Nullable + private String bar; + + public static final String JSON_PROPERTY_FOO = "foo"; + @javax.annotation.Nullable + private String foo; + + public HasOnlyReadOnly() { + } + + @JsonCreator + public HasOnlyReadOnly( + @JsonProperty(JSON_PROPERTY_BAR) String bar, + @JsonProperty(JSON_PROPERTY_FOO) String foo + ) { + this(); + this.bar = bar; + this.foo = foo; + } + + /** + * Get bar + * @return bar + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BAR, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { + return bar; + } + + + + + /** + * Get foo + * @return foo + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FOO, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFoo() { + return foo; + } + + + + + /** + * Return true if this hasOnlyReadOnly object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasOnlyReadOnly {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" foo: ").append(toIndentedString(foo)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `bar` to the URL query string + if (getBar() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sbar%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getBar())))); + } + + // add `foo` to the URL query string + if (getFoo() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sfoo%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getFoo())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private HasOnlyReadOnly instance; + + public Builder() { + this(new HasOnlyReadOnly()); + } + + protected Builder(HasOnlyReadOnly instance) { + this.instance = instance; + } + + public HasOnlyReadOnly.Builder bar(String bar) { + this.instance.bar = bar; + return this; + } + public HasOnlyReadOnly.Builder foo(String foo) { + this.instance.foo = foo; + return this; + } + + + /** + * returns a built HasOnlyReadOnly instance. + * + * The builder is not reusable. + */ + public HasOnlyReadOnly build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static HasOnlyReadOnly.Builder builder() { + return new HasOnlyReadOnly.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public HasOnlyReadOnly.Builder toBuilder() { + return new HasOnlyReadOnly.Builder() + .bar(getBar()) + .foo(getFoo()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/HealthCheckResult.java new file mode 100644 index 000000000000..64bbe7fe3c5b --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -0,0 +1,200 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + */ +@JsonPropertyOrder({ + HealthCheckResult.JSON_PROPERTY_NULLABLE_MESSAGE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class HealthCheckResult { + public static final String JSON_PROPERTY_NULLABLE_MESSAGE = "NullableMessage"; + @javax.annotation.Nullable + private String nullableMessage; + + public HealthCheckResult() { + } + + public HealthCheckResult nullableMessage(@javax.annotation.Nullable String nullableMessage) { + this.nullableMessage = nullableMessage; + return this; + } + + /** + * Get nullableMessage + * @return nullableMessage + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NULLABLE_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNullableMessage() { + return nullableMessage; + } + + + @JsonProperty(value = JSON_PROPERTY_NULLABLE_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNullableMessage(@javax.annotation.Nullable String nullableMessage) { + this.nullableMessage = nullableMessage; + } + + + /** + * Return true if this HealthCheckResult object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HealthCheckResult {\n"); + sb.append(" nullableMessage: ").append(toIndentedString(nullableMessage)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `NullableMessage` to the URL query string + if (getNullableMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sNullableMessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNullableMessage())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private HealthCheckResult instance; + + public Builder() { + this(new HealthCheckResult()); + } + + protected Builder(HealthCheckResult instance) { + this.instance = instance; + } + + public HealthCheckResult.Builder nullableMessage(String nullableMessage) { + this.instance.nullableMessage = nullableMessage; + return this; + } + + + /** + * returns a built HealthCheckResult instance. + * + * The builder is not reusable. + */ + public HealthCheckResult build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static HealthCheckResult.Builder builder() { + return new HealthCheckResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public HealthCheckResult.Builder toBuilder() { + return new HealthCheckResult.Builder() + .nullableMessage(getNullableMessage()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java new file mode 100644 index 000000000000..020f3970943e --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java @@ -0,0 +1,240 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * IsoscelesTriangle + */ +@JsonPropertyOrder({ + IsoscelesTriangle.JSON_PROPERTY_SHAPE_TYPE, + IsoscelesTriangle.JSON_PROPERTY_TRIANGLE_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class IsoscelesTriangle { + public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + @javax.annotation.Nonnull + private String shapeType; + + public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; + @javax.annotation.Nonnull + private String triangleType; + + public IsoscelesTriangle() { + } + + public IsoscelesTriangle shapeType(@javax.annotation.Nonnull String shapeType) { + this.shapeType = shapeType; + return this; + } + + /** + * Get shapeType + * @return shapeType + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getShapeType() { + return shapeType; + } + + + @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setShapeType(@javax.annotation.Nonnull String shapeType) { + this.shapeType = shapeType; + } + + + public IsoscelesTriangle triangleType(@javax.annotation.Nonnull String triangleType) { + this.triangleType = triangleType; + return this; + } + + /** + * Get triangleType + * @return triangleType + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTriangleType() { + return triangleType; + } + + + @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTriangleType(@javax.annotation.Nonnull String triangleType) { + this.triangleType = triangleType; + } + + + /** + * Return true if this IsoscelesTriangle object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IsoscelesTriangle {\n"); + sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); + sb.append(" triangleType: ").append(toIndentedString(triangleType)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `shapeType` to the URL query string + if (getShapeType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sshapeType%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getShapeType())))); + } + + // add `triangleType` to the URL query string + if (getTriangleType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%striangleType%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTriangleType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private IsoscelesTriangle instance; + + public Builder() { + this(new IsoscelesTriangle()); + } + + protected Builder(IsoscelesTriangle instance) { + this.instance = instance; + } + + public IsoscelesTriangle.Builder shapeType(String shapeType) { + this.instance.shapeType = shapeType; + return this; + } + public IsoscelesTriangle.Builder triangleType(String triangleType) { + this.instance.triangleType = triangleType; + return this; + } + + + /** + * returns a built IsoscelesTriangle instance. + * + * The builder is not reusable. + */ + public IsoscelesTriangle build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static IsoscelesTriangle.Builder builder() { + return new IsoscelesTriangle.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public IsoscelesTriangle.Builder toBuilder() { + return new IsoscelesTriangle.Builder() + .shapeType(getShapeType()) + .triangleType(getTriangleType()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Mammal.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Mammal.java new file mode 100644 index 000000000000..6f401b1ebe46 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Mammal.java @@ -0,0 +1,362 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.openapitools.client.model.Pig; +import org.openapitools.client.model.Whale; +import org.openapitools.client.model.Zebra; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import tools.jackson.core.type.TypeReference; + +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import tools.jackson.core.JacksonException; +import tools.jackson.core.JsonGenerator; +import tools.jackson.core.JsonParser; +import tools.jackson.core.JsonToken; +import tools.jackson.databind.DeserializationContext; +import tools.jackson.databind.DatabindException; +import tools.jackson.databind.JsonNode; +import tools.jackson.databind.SerializerProvider; +import tools.jackson.databind.annotation.JsonDeserialize; +import tools.jackson.databind.annotation.JsonSerialize; +import tools.jackson.databind.deser.std.StdDeserializer; +import tools.jackson.databind.ser.std.StdSerializer; +import org.openapitools.client.ApiClient; +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +@JsonDeserialize(using = Mammal.MammalDeserializer.class) +@JsonSerialize(using = Mammal.MammalSerializer.class) +public class Mammal extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Mammal.class.getName()); + + public static class MammalSerializer extends StdSerializer { + public MammalSerializer(Class t) { + super(t); + } + + public MammalSerializer() { + this(null); + } + + @Override + public void serialize(Mammal value, JsonGenerator jgen, SerializerProvider provider) throws JacksonException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class MammalDeserializer extends StdDeserializer { + public MammalDeserializer() { + this(Mammal.class); + } + + public MammalDeserializer(Class vc) { + super(vc); + } + + @Override + public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) throws JacksonException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + boolean typeCoercion = false; // MapperFeature.ALLOW_COERCION_OF_SCALARS was removed in Jackson 3 + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize Pig + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Pig.class.equals(Integer.class) || Pig.class.equals(Long.class) || Pig.class.equals(Float.class) || Pig.class.equals(Double.class) || Pig.class.equals(Boolean.class) || Pig.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((Pig.class.equals(Integer.class) || Pig.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((Pig.class.equals(Float.class) || Pig.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (Pig.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (Pig.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Pig.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'Pig'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Pig'", e); + } + + // deserialize Whale + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Whale.class.equals(Integer.class) || Whale.class.equals(Long.class) || Whale.class.equals(Float.class) || Whale.class.equals(Double.class) || Whale.class.equals(Boolean.class) || Whale.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((Whale.class.equals(Integer.class) || Whale.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((Whale.class.equals(Float.class) || Whale.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (Whale.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (Whale.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Whale.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'Whale'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Whale'", e); + } + + // deserialize Zebra + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Zebra.class.equals(Integer.class) || Zebra.class.equals(Long.class) || Zebra.class.equals(Float.class) || Zebra.class.equals(Double.class) || Zebra.class.equals(Boolean.class) || Zebra.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((Zebra.class.equals(Integer.class) || Zebra.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((Zebra.class.equals(Float.class) || Zebra.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (Zebra.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (Zebra.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Zebra.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'Zebra'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Zebra'", e); + } + + if (match == 1) { + Mammal ret = new Mammal(); + ret.setActualInstance(deserialized); + return ret; + } + throw DatabindException.from(jp, String.format(java.util.Locale.ROOT, "Failed deserialization for Mammal: %d classes match result, expected 1", match)); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public Mammal getNullValue(DeserializationContext ctxt) { + throw DatabindException.from(ctxt.getParser(), "Mammal cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap<>(); + + public Mammal() { + super("oneOf", Boolean.FALSE); + } + + public Mammal(Pig o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Mammal(Whale o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Mammal(Zebra o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Pig", Pig.class); + schemas.put("Whale", Whale.class); + schemas.put("Zebra", Zebra.class); + JSON.registerDescendants(Mammal.class, Collections.unmodifiableMap(schemas)); + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("Pig", Pig.class); + mappings.put("whale", Whale.class); + mappings.put("zebra", Zebra.class); + mappings.put("mammal", Mammal.class); + JSON.registerDiscriminator(Mammal.class, "className", mappings); + } + + @Override + public Map> getSchemas() { + return Mammal.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Pig, Whale, Zebra + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(Pig.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(Whale.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(Zebra.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Pig, Whale, Zebra"); + } + + /** + * Get the actual instance, which can be the following: + * Pig, Whale, Zebra + * + * @return The actual instance (Pig, Whale, Zebra) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Pig`. If the actual instance is not `Pig`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Pig` + * @throws ClassCastException if the instance is not `Pig` + */ + public Pig getPig() throws ClassCastException { + return (Pig)super.getActualInstance(); + } + + /** + * Get the actual instance of `Whale`. If the actual instance is not `Whale`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Whale` + * @throws ClassCastException if the instance is not `Whale` + */ + public Whale getWhale() throws ClassCastException { + return (Whale)super.getActualInstance(); + } + + /** + * Get the actual instance of `Zebra`. If the actual instance is not `Zebra`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Zebra` + * @throws ClassCastException if the instance is not `Zebra` + */ + public Zebra getZebra() throws ClassCastException { + return (Zebra)super.getActualInstance(); + } + + + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + if (getActualInstance() instanceof Whale) { + if (getActualInstance() != null) { + joiner.add(((Whale)getActualInstance()).toUrlQueryString(prefix + "one_of_0" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof Zebra) { + if (getActualInstance() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sone_of_1%s=%s", prefix, suffix, ApiClient.urlEncode(String.valueOf(getActualInstance())))); + } + return joiner.toString(); + } + if (getActualInstance() instanceof Pig) { + if (getActualInstance() != null) { + joiner.add(((Pig)getActualInstance()).toUrlQueryString(prefix + "one_of_2" + suffix)); + } + return joiner.toString(); + } + return null; + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/MapTest.java new file mode 100644 index 000000000000..e1c3390f206e --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/MapTest.java @@ -0,0 +1,405 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * MapTest + */ +@JsonPropertyOrder({ + MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, + MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, + MapTest.JSON_PROPERTY_DIRECT_MAP, + MapTest.JSON_PROPERTY_INDIRECT_MAP +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class MapTest { + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + @javax.annotation.Nullable + private Map> mapMapOfString = new HashMap<>(); + + /** + * Gets or Sets inner + */ + public enum InnerEnum { + UPPER(String.valueOf("UPPER")), + + LOWER(String.valueOf("lower")); + + private String value; + + InnerEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static InnerEnum fromValue(String value) { + for (InnerEnum b : InnerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + @javax.annotation.Nullable + private Map mapOfEnumString = new HashMap<>(); + + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + @javax.annotation.Nullable + private Map directMap = new HashMap<>(); + + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + @javax.annotation.Nullable + private Map indirectMap = new HashMap<>(); + + public MapTest() { + } + + public MapTest mapMapOfString(@javax.annotation.Nullable Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + return this; + } + + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap<>(); + } + this.mapMapOfString.put(key, mapMapOfStringItem); + return this; + } + + /** + * Get mapMapOfString + * @return mapMapOfString + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MAP_MAP_OF_STRING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapMapOfString() { + return mapMapOfString; + } + + + @JsonProperty(value = JSON_PROPERTY_MAP_MAP_OF_STRING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapMapOfString(@javax.annotation.Nullable Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + + public MapTest mapOfEnumString(@javax.annotation.Nullable Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + return this; + } + + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap<>(); + } + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + /** + * Get mapOfEnumString + * @return mapOfEnumString + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MAP_OF_ENUM_STRING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapOfEnumString() { + return mapOfEnumString; + } + + + @JsonProperty(value = JSON_PROPERTY_MAP_OF_ENUM_STRING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapOfEnumString(@javax.annotation.Nullable Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + + public MapTest directMap(@javax.annotation.Nullable Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap<>(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DIRECT_MAP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getDirectMap() { + return directMap; + } + + + @JsonProperty(value = JSON_PROPERTY_DIRECT_MAP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDirectMap(@javax.annotation.Nullable Map directMap) { + this.directMap = directMap; + } + + + public MapTest indirectMap(@javax.annotation.Nullable Map indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + + /** + * Get indirectMap + * @return indirectMap + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_INDIRECT_MAP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getIndirectMap() { + return indirectMap; + } + + + @JsonProperty(value = JSON_PROPERTY_INDIRECT_MAP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndirectMap(@javax.annotation.Nullable Map indirectMap) { + this.indirectMap = indirectMap; + } + + + /** + * Return true if this MapTest object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MapTest {\n"); + sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); + sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `map_map_of_string` to the URL query string + if (getMapMapOfString() != null) { + for (String _key : getMapMapOfString().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%smap_map_of_string%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getMapMapOfString().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getMapMapOfString().get(_key))))); + } + } + + // add `map_of_enum_string` to the URL query string + if (getMapOfEnumString() != null) { + for (String _key : getMapOfEnumString().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%smap_of_enum_string%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getMapOfEnumString().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getMapOfEnumString().get(_key))))); + } + } + + // add `direct_map` to the URL query string + if (getDirectMap() != null) { + for (String _key : getDirectMap().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdirect_map%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getDirectMap().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getDirectMap().get(_key))))); + } + } + + // add `indirect_map` to the URL query string + if (getIndirectMap() != null) { + for (String _key : getIndirectMap().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sindirect_map%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getIndirectMap().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getIndirectMap().get(_key))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private MapTest instance; + + public Builder() { + this(new MapTest()); + } + + protected Builder(MapTest instance) { + this.instance = instance; + } + + public MapTest.Builder mapMapOfString(Map> mapMapOfString) { + this.instance.mapMapOfString = mapMapOfString; + return this; + } + public MapTest.Builder mapOfEnumString(Map mapOfEnumString) { + this.instance.mapOfEnumString = mapOfEnumString; + return this; + } + public MapTest.Builder directMap(Map directMap) { + this.instance.directMap = directMap; + return this; + } + public MapTest.Builder indirectMap(Map indirectMap) { + this.instance.indirectMap = indirectMap; + return this; + } + + + /** + * returns a built MapTest instance. + * + * The builder is not reusable. + */ + public MapTest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MapTest.Builder builder() { + return new MapTest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MapTest.Builder toBuilder() { + return new MapTest.Builder() + .mapMapOfString(getMapMapOfString()) + .mapOfEnumString(getMapOfEnumString()) + .directMap(getDirectMap()) + .indirectMap(getIndirectMap()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java new file mode 100644 index 000000000000..ad771b309057 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -0,0 +1,298 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.openapitools.client.model.Animal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * MixedPropertiesAndAdditionalPropertiesClass + */ +@JsonPropertyOrder({ + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class MixedPropertiesAndAdditionalPropertiesClass { + public static final String JSON_PROPERTY_UUID = "uuid"; + @javax.annotation.Nullable + private UUID uuid; + + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + @javax.annotation.Nullable + private OffsetDateTime dateTime; + + public static final String JSON_PROPERTY_MAP = "map"; + @javax.annotation.Nullable + private Map map = new HashMap<>(); + + public MixedPropertiesAndAdditionalPropertiesClass() { + } + + public MixedPropertiesAndAdditionalPropertiesClass uuid(@javax.annotation.Nullable UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UUID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { + return uuid; + } + + + @JsonProperty(value = JSON_PROPERTY_UUID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUuid(@javax.annotation.Nullable UUID uuid) { + this.uuid = uuid; + } + + + public MixedPropertiesAndAdditionalPropertiesClass dateTime(@javax.annotation.Nullable OffsetDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATE_TIME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { + return dateTime; + } + + + @JsonProperty(value = JSON_PROPERTY_DATE_TIME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateTime(@javax.annotation.Nullable OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + + public MixedPropertiesAndAdditionalPropertiesClass map(@javax.annotation.Nullable Map map) { + this.map = map; + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap<>(); + } + this.map.put(key, mapItem); + return this; + } + + /** + * Get map + * @return map + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MAP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMap() { + return map; + } + + + @JsonProperty(value = JSON_PROPERTY_MAP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMap(@javax.annotation.Nullable Map map) { + this.map = map; + } + + + /** + * Return true if this MixedPropertiesAndAdditionalPropertiesClass object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" map: ").append(toIndentedString(map)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `uuid` to the URL query string + if (getUuid() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%suuid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUuid())))); + } + + // add `dateTime` to the URL query string + if (getDateTime() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdateTime%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDateTime())))); + } + + // add `map` to the URL query string + if (getMap() != null) { + for (String _key : getMap().keySet()) { + if (getMap().get(_key) != null) { + joiner.add(getMap().get(_key).toUrlQueryString(String.format(java.util.Locale.ROOT, "%smap%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix)))); + } + } + } + + return joiner.toString(); + } + + public static class Builder { + + private MixedPropertiesAndAdditionalPropertiesClass instance; + + public Builder() { + this(new MixedPropertiesAndAdditionalPropertiesClass()); + } + + protected Builder(MixedPropertiesAndAdditionalPropertiesClass instance) { + this.instance = instance; + } + + public MixedPropertiesAndAdditionalPropertiesClass.Builder uuid(UUID uuid) { + this.instance.uuid = uuid; + return this; + } + public MixedPropertiesAndAdditionalPropertiesClass.Builder dateTime(OffsetDateTime dateTime) { + this.instance.dateTime = dateTime; + return this; + } + public MixedPropertiesAndAdditionalPropertiesClass.Builder map(Map map) { + this.instance.map = map; + return this; + } + + + /** + * returns a built MixedPropertiesAndAdditionalPropertiesClass instance. + * + * The builder is not reusable. + */ + public MixedPropertiesAndAdditionalPropertiesClass build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static MixedPropertiesAndAdditionalPropertiesClass.Builder builder() { + return new MixedPropertiesAndAdditionalPropertiesClass.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MixedPropertiesAndAdditionalPropertiesClass.Builder toBuilder() { + return new MixedPropertiesAndAdditionalPropertiesClass.Builder() + .uuid(getUuid()) + .dateTime(getDateTime()) + .map(getMap()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Model200Response.java new file mode 100644 index 000000000000..33f7a63fa2c1 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Model200Response.java @@ -0,0 +1,240 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * Model for testing model name starting with number + */ +@JsonPropertyOrder({ + Model200Response.JSON_PROPERTY_NAME, + Model200Response.JSON_PROPERTY_PROPERTY_CLASS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class Model200Response { + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nullable + private Integer name; + + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + @javax.annotation.Nullable + private String propertyClass; + + public Model200Response() { + } + + public Model200Response name(@javax.annotation.Nullable Integer name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@javax.annotation.Nullable Integer name) { + this.name = name; + } + + + public Model200Response propertyClass(@javax.annotation.Nullable String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PROPERTY_CLASS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { + return propertyClass; + } + + + @JsonProperty(value = JSON_PROPERTY_PROPERTY_CLASS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPropertyClass(@javax.annotation.Nullable String propertyClass) { + this.propertyClass = propertyClass; + } + + + /** + * Return true if this 200_response object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200Response {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `class` to the URL query string + if (getPropertyClass() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sclass%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPropertyClass())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private Model200Response instance; + + public Builder() { + this(new Model200Response()); + } + + protected Builder(Model200Response instance) { + this.instance = instance; + } + + public Model200Response.Builder name(Integer name) { + this.instance.name = name; + return this; + } + public Model200Response.Builder propertyClass(String propertyClass) { + this.instance.propertyClass = propertyClass; + return this; + } + + + /** + * returns a built Model200Response instance. + * + * The builder is not reusable. + */ + public Model200Response build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Model200Response.Builder builder() { + return new Model200Response.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Model200Response.Builder toBuilder() { + return new Model200Response.Builder() + .name(getName()) + .propertyClass(getPropertyClass()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ModelApiResponse.java new file mode 100644 index 000000000000..8d4088ac1cde --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -0,0 +1,280 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * ModelApiResponse + */ +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class ModelApiResponse { + public static final String JSON_PROPERTY_CODE = "code"; + @javax.annotation.Nullable + private Integer code; + + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nullable + private String type; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @javax.annotation.Nullable + private String message; + + public ModelApiResponse() { + } + + public ModelApiResponse code(@javax.annotation.Nullable Integer code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CODE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCode() { + return code; + } + + + @JsonProperty(value = JSON_PROPERTY_CODE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCode(@javax.annotation.Nullable Integer code) { + this.code = code; + } + + + public ModelApiResponse type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public ModelApiResponse message(@javax.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; + } + + + /** + * Return true if this ApiResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `code` to the URL query string + if (getCode() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scode%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCode())))); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smessage%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMessage())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ModelApiResponse instance; + + public Builder() { + this(new ModelApiResponse()); + } + + protected Builder(ModelApiResponse instance) { + this.instance = instance; + } + + public ModelApiResponse.Builder code(Integer code) { + this.instance.code = code; + return this; + } + public ModelApiResponse.Builder type(String type) { + this.instance.type = type; + return this; + } + public ModelApiResponse.Builder message(String message) { + this.instance.message = message; + return this; + } + + + /** + * returns a built ModelApiResponse instance. + * + * The builder is not reusable. + */ + public ModelApiResponse build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ModelApiResponse.Builder builder() { + return new ModelApiResponse.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ModelApiResponse.Builder toBuilder() { + return new ModelApiResponse.Builder() + .code(getCode()) + .type(getType()) + .message(getMessage()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..f8778237598a --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,200 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * Must be named `File` for test. + */ +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + @javax.annotation.Nullable + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(@javax.annotation.Nullable String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SOURCE_U_R_I, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(value = JSON_PROPERTY_SOURCE_U_R_I, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(@javax.annotation.Nullable String sourceURI) { + this.sourceURI = sourceURI; + } + + + /** + * Return true if this File object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `sourceURI` to the URL query string + if (getSourceURI() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssourceURI%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSourceURI())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ModelFile instance; + + public Builder() { + this(new ModelFile()); + } + + protected Builder(ModelFile instance) { + this.instance = instance; + } + + public ModelFile.Builder sourceURI(String sourceURI) { + this.instance.sourceURI = sourceURI; + return this; + } + + + /** + * returns a built ModelFile instance. + * + * The builder is not reusable. + */ + public ModelFile build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ModelFile.Builder builder() { + return new ModelFile.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ModelFile.Builder toBuilder() { + return new ModelFile.Builder() + .sourceURI(getSourceURI()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..8d71e5146952 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,200 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + @javax.annotation.Nullable + private String _123list; + + public ModelList() { + } + + public ModelList _123list(@javax.annotation.Nullable String _123list) { + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_123LIST, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String get123list() { + return _123list; + } + + + @JsonProperty(value = JSON_PROPERTY_123LIST, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(@javax.annotation.Nullable String _123list) { + this._123list = _123list; + } + + + /** + * Return true if this List object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `123-list` to the URL query string + if (get123list() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%s123-list%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(get123list())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ModelList instance; + + public Builder() { + this(new ModelList()); + } + + protected Builder(ModelList instance) { + this.instance = instance; + } + + public ModelList.Builder _123list(String _123list) { + this.instance._123list = _123list; + return this; + } + + + /** + * returns a built ModelList instance. + * + * The builder is not reusable. + */ + public ModelList build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ModelList.Builder builder() { + return new ModelList.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ModelList.Builder toBuilder() { + return new ModelList.Builder() + ._123list(get123list()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ModelReturn.java new file mode 100644 index 000000000000..878f5890db60 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -0,0 +1,200 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * Model for testing reserved words + */ +@JsonPropertyOrder({ + ModelReturn.JSON_PROPERTY_RETURN +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class ModelReturn { + public static final String JSON_PROPERTY_RETURN = "return"; + @javax.annotation.Nullable + private Integer _return; + + public ModelReturn() { + } + + public ModelReturn _return(@javax.annotation.Nullable Integer _return) { + this._return = _return; + return this; + } + + /** + * Get _return + * @return _return + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_RETURN, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getReturn() { + return _return; + } + + + @JsonProperty(value = JSON_PROPERTY_RETURN, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReturn(@javax.annotation.Nullable Integer _return) { + this._return = _return; + } + + + /** + * Return true if this Return object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelReturn {\n"); + sb.append(" _return: ").append(toIndentedString(_return)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `return` to the URL query string + if (getReturn() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sreturn%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getReturn())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ModelReturn instance; + + public Builder() { + this(new ModelReturn()); + } + + protected Builder(ModelReturn instance) { + this.instance = instance; + } + + public ModelReturn.Builder _return(Integer _return) { + this.instance._return = _return; + return this; + } + + + /** + * returns a built ModelReturn instance. + * + * The builder is not reusable. + */ + public ModelReturn build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ModelReturn.Builder builder() { + return new ModelReturn.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ModelReturn.Builder toBuilder() { + return new ModelReturn.Builder() + ._return(getReturn()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Name.java new file mode 100644 index 000000000000..3fdecf6fb353 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Name.java @@ -0,0 +1,310 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * Model for testing model name same as property name + */ +@JsonPropertyOrder({ + Name.JSON_PROPERTY_NAME, + Name.JSON_PROPERTY_SNAKE_CASE, + Name.JSON_PROPERTY_PROPERTY, + Name.JSON_PROPERTY_123NUMBER +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class Name { + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nonnull + private Integer name; + + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + @javax.annotation.Nullable + private Integer snakeCase; + + public static final String JSON_PROPERTY_PROPERTY = "property"; + @javax.annotation.Nullable + private String property; + + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + @javax.annotation.Nullable + private Integer _123number; + + public Name() { + } + + @JsonCreator + public Name( + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, + @JsonProperty(JSON_PROPERTY_123NUMBER) Integer _123number + ) { + this(); + this.snakeCase = snakeCase; + this._123number = _123number; + } + + public Name name(@javax.annotation.Nonnull Integer name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_NAME, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(@javax.annotation.Nonnull Integer name) { + this.name = name; + } + + + /** + * Get snakeCase + * @return snakeCase + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SNAKE_CASE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSnakeCase() { + return snakeCase; + } + + + + + public Name property(@javax.annotation.Nullable String property) { + this.property = property; + return this; + } + + /** + * Get property + * @return property + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PROPERTY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProperty() { + return property; + } + + + @JsonProperty(value = JSON_PROPERTY_PROPERTY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperty(@javax.annotation.Nullable String property) { + this.property = property; + } + + + /** + * Get _123number + * @return _123number + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_123NUMBER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer get123number() { + return _123number; + } + + + + + /** + * Return true if this Name object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" _123number: ").append(toIndentedString(_123number)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `snake_case` to the URL query string + if (getSnakeCase() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssnake_case%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSnakeCase())))); + } + + // add `property` to the URL query string + if (getProperty() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sproperty%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getProperty())))); + } + + // add `123Number` to the URL query string + if (get123number() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%s123Number%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(get123number())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private Name instance; + + public Builder() { + this(new Name()); + } + + protected Builder(Name instance) { + this.instance = instance; + } + + public Name.Builder name(Integer name) { + this.instance.name = name; + return this; + } + public Name.Builder snakeCase(Integer snakeCase) { + this.instance.snakeCase = snakeCase; + return this; + } + public Name.Builder property(String property) { + this.instance.property = property; + return this; + } + public Name.Builder _123number(Integer _123number) { + this.instance._123number = _123number; + return this; + } + + + /** + * returns a built Name instance. + * + * The builder is not reusable. + */ + public Name build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Name.Builder builder() { + return new Name.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Name.Builder toBuilder() { + return new Name.Builder() + .name(getName()) + .snakeCase(getSnakeCase()) + .property(getProperty()) + ._123number(get123number()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/NullableClass.java new file mode 100644 index 000000000000..03a3f56c7ff2 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/NullableClass.java @@ -0,0 +1,767 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * NullableClass + */ +@JsonPropertyOrder({ + NullableClass.JSON_PROPERTY_INTEGER_PROP, + NullableClass.JSON_PROPERTY_NUMBER_PROP, + NullableClass.JSON_PROPERTY_BOOLEAN_PROP, + NullableClass.JSON_PROPERTY_STRING_PROP, + NullableClass.JSON_PROPERTY_DATE_PROP, + NullableClass.JSON_PROPERTY_DATETIME_PROP, + NullableClass.JSON_PROPERTY_ARRAY_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_ARRAY_ITEMS_NULLABLE, + NullableClass.JSON_PROPERTY_OBJECT_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_OBJECT_ITEMS_NULLABLE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class NullableClass { + public static final String JSON_PROPERTY_INTEGER_PROP = "integer_prop"; + @javax.annotation.Nullable + private Integer integerProp; + + public static final String JSON_PROPERTY_NUMBER_PROP = "number_prop"; + @javax.annotation.Nullable + private BigDecimal numberProp; + + public static final String JSON_PROPERTY_BOOLEAN_PROP = "boolean_prop"; + @javax.annotation.Nullable + private Boolean booleanProp; + + public static final String JSON_PROPERTY_STRING_PROP = "string_prop"; + @javax.annotation.Nullable + private String stringProp; + + public static final String JSON_PROPERTY_DATE_PROP = "date_prop"; + @javax.annotation.Nullable + private LocalDate dateProp; + + public static final String JSON_PROPERTY_DATETIME_PROP = "datetime_prop"; + @javax.annotation.Nullable + private OffsetDateTime datetimeProp; + + public static final String JSON_PROPERTY_ARRAY_NULLABLE_PROP = "array_nullable_prop"; + @javax.annotation.Nullable + private List arrayNullableProp; + + public static final String JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP = "array_and_items_nullable_prop"; + @javax.annotation.Nullable + private List arrayAndItemsNullableProp; + + public static final String JSON_PROPERTY_ARRAY_ITEMS_NULLABLE = "array_items_nullable"; + @javax.annotation.Nullable + private List arrayItemsNullable = new ArrayList<>(); + + public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop"; + @javax.annotation.Nullable + private Map objectNullableProp; + + public static final String JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP = "object_and_items_nullable_prop"; + @javax.annotation.Nullable + private Map objectAndItemsNullableProp; + + public static final String JSON_PROPERTY_OBJECT_ITEMS_NULLABLE = "object_items_nullable"; + @javax.annotation.Nullable + private Map objectItemsNullable = new HashMap<>(); + + public NullableClass() { + } + + public NullableClass integerProp(@javax.annotation.Nullable Integer integerProp) { + this.integerProp = integerProp; + return this; + } + + /** + * Get integerProp + * @return integerProp + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_INTEGER_PROP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getIntegerProp() { + return integerProp; + } + + + @JsonProperty(value = JSON_PROPERTY_INTEGER_PROP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIntegerProp(@javax.annotation.Nullable Integer integerProp) { + this.integerProp = integerProp; + } + + + public NullableClass numberProp(@javax.annotation.Nullable BigDecimal numberProp) { + this.numberProp = numberProp; + return this; + } + + /** + * Get numberProp + * @return numberProp + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NUMBER_PROP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNumberProp() { + return numberProp; + } + + + @JsonProperty(value = JSON_PROPERTY_NUMBER_PROP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumberProp(@javax.annotation.Nullable BigDecimal numberProp) { + this.numberProp = numberProp; + } + + + public NullableClass booleanProp(@javax.annotation.Nullable Boolean booleanProp) { + this.booleanProp = booleanProp; + return this; + } + + /** + * Get booleanProp + * @return booleanProp + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BOOLEAN_PROP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getBooleanProp() { + return booleanProp; + } + + + @JsonProperty(value = JSON_PROPERTY_BOOLEAN_PROP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBooleanProp(@javax.annotation.Nullable Boolean booleanProp) { + this.booleanProp = booleanProp; + } + + + public NullableClass stringProp(@javax.annotation.Nullable String stringProp) { + this.stringProp = stringProp; + return this; + } + + /** + * Get stringProp + * @return stringProp + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STRING_PROP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStringProp() { + return stringProp; + } + + + @JsonProperty(value = JSON_PROPERTY_STRING_PROP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStringProp(@javax.annotation.Nullable String stringProp) { + this.stringProp = stringProp; + } + + + public NullableClass dateProp(@javax.annotation.Nullable LocalDate dateProp) { + this.dateProp = dateProp; + return this; + } + + /** + * Get dateProp + * @return dateProp + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATE_PROP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LocalDate getDateProp() { + return dateProp; + } + + + @JsonProperty(value = JSON_PROPERTY_DATE_PROP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateProp(@javax.annotation.Nullable LocalDate dateProp) { + this.dateProp = dateProp; + } + + + public NullableClass datetimeProp(@javax.annotation.Nullable OffsetDateTime datetimeProp) { + this.datetimeProp = datetimeProp; + return this; + } + + /** + * Get datetimeProp + * @return datetimeProp + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATETIME_PROP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDatetimeProp() { + return datetimeProp; + } + + + @JsonProperty(value = JSON_PROPERTY_DATETIME_PROP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDatetimeProp(@javax.annotation.Nullable OffsetDateTime datetimeProp) { + this.datetimeProp = datetimeProp; + } + + + public NullableClass arrayNullableProp(@javax.annotation.Nullable List arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + return this; + } + + public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) { + if (this.arrayNullableProp == null) { + this.arrayNullableProp = new ArrayList<>(); + } + this.arrayNullableProp.add(arrayNullablePropItem); + return this; + } + + /** + * Get arrayNullableProp + * @return arrayNullableProp + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ARRAY_NULLABLE_PROP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayNullableProp() { + return arrayNullableProp; + } + + + @JsonProperty(value = JSON_PROPERTY_ARRAY_NULLABLE_PROP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayNullableProp(@javax.annotation.Nullable List arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + } + + + public NullableClass arrayAndItemsNullableProp(@javax.annotation.Nullable List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + return this; + } + + public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) { + if (this.arrayAndItemsNullableProp == null) { + this.arrayAndItemsNullableProp = new ArrayList<>(); + } + this.arrayAndItemsNullableProp.add(arrayAndItemsNullablePropItem); + return this; + } + + /** + * Get arrayAndItemsNullableProp + * @return arrayAndItemsNullableProp + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayAndItemsNullableProp() { + return arrayAndItemsNullableProp; + } + + + @JsonProperty(value = JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayAndItemsNullableProp(@javax.annotation.Nullable List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + } + + + public NullableClass arrayItemsNullable(@javax.annotation.Nullable List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + return this; + } + + public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) { + if (this.arrayItemsNullable == null) { + this.arrayItemsNullable = new ArrayList<>(); + } + this.arrayItemsNullable.add(arrayItemsNullableItem); + return this; + } + + /** + * Get arrayItemsNullable + * @return arrayItemsNullable + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ARRAY_ITEMS_NULLABLE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayItemsNullable() { + return arrayItemsNullable; + } + + + @JsonProperty(value = JSON_PROPERTY_ARRAY_ITEMS_NULLABLE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayItemsNullable(@javax.annotation.Nullable List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + } + + + public NullableClass objectNullableProp(@javax.annotation.Nullable Map objectNullableProp) { + this.objectNullableProp = objectNullableProp; + return this; + } + + public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) { + if (this.objectNullableProp == null) { + this.objectNullableProp = new HashMap<>(); + } + this.objectNullableProp.put(key, objectNullablePropItem); + return this; + } + + /** + * Get objectNullableProp + * @return objectNullableProp + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_OBJECT_NULLABLE_PROP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getObjectNullableProp() { + return objectNullableProp; + } + + + @JsonProperty(value = JSON_PROPERTY_OBJECT_NULLABLE_PROP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setObjectNullableProp(@javax.annotation.Nullable Map objectNullableProp) { + this.objectNullableProp = objectNullableProp; + } + + + public NullableClass objectAndItemsNullableProp(@javax.annotation.Nullable Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + return this; + } + + public NullableClass putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) { + if (this.objectAndItemsNullableProp == null) { + this.objectAndItemsNullableProp = new HashMap<>(); + } + this.objectAndItemsNullableProp.put(key, objectAndItemsNullablePropItem); + return this; + } + + /** + * Get objectAndItemsNullableProp + * @return objectAndItemsNullableProp + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getObjectAndItemsNullableProp() { + return objectAndItemsNullableProp; + } + + + @JsonProperty(value = JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setObjectAndItemsNullableProp(@javax.annotation.Nullable Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + } + + + public NullableClass objectItemsNullable(@javax.annotation.Nullable Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + return this; + } + + public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNullableItem) { + if (this.objectItemsNullable == null) { + this.objectItemsNullable = new HashMap<>(); + } + this.objectItemsNullable.put(key, objectItemsNullableItem); + return this; + } + + /** + * Get objectItemsNullable + * @return objectItemsNullable + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_OBJECT_ITEMS_NULLABLE, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getObjectItemsNullable() { + return objectItemsNullable; + } + + + @JsonProperty(value = JSON_PROPERTY_OBJECT_ITEMS_NULLABLE, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setObjectItemsNullable(@javax.annotation.Nullable Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * @param key the name of the property + * @param value the value of the property + * @return self reference + */ + @JsonAnySetter + public NullableClass putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) properties. + * @return the additional (undeclared) properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * @param key the name of the property + * @return the additional (undeclared) property with the specified name + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this NullableClass object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NullableClass {\n"); + sb.append(" integerProp: ").append(toIndentedString(integerProp)).append("\n"); + sb.append(" numberProp: ").append(toIndentedString(numberProp)).append("\n"); + sb.append(" booleanProp: ").append(toIndentedString(booleanProp)).append("\n"); + sb.append(" stringProp: ").append(toIndentedString(stringProp)).append("\n"); + sb.append(" dateProp: ").append(toIndentedString(dateProp)).append("\n"); + sb.append(" datetimeProp: ").append(toIndentedString(datetimeProp)).append("\n"); + sb.append(" arrayNullableProp: ").append(toIndentedString(arrayNullableProp)).append("\n"); + sb.append(" arrayAndItemsNullableProp: ").append(toIndentedString(arrayAndItemsNullableProp)).append("\n"); + sb.append(" arrayItemsNullable: ").append(toIndentedString(arrayItemsNullable)).append("\n"); + sb.append(" objectNullableProp: ").append(toIndentedString(objectNullableProp)).append("\n"); + sb.append(" objectAndItemsNullableProp: ").append(toIndentedString(objectAndItemsNullableProp)).append("\n"); + sb.append(" objectItemsNullable: ").append(toIndentedString(objectItemsNullable)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `integer_prop` to the URL query string + if (getIntegerProp() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sinteger_prop%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getIntegerProp())))); + } + + // add `number_prop` to the URL query string + if (getNumberProp() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%snumber_prop%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getNumberProp())))); + } + + // add `boolean_prop` to the URL query string + if (getBooleanProp() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sboolean_prop%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getBooleanProp())))); + } + + // add `string_prop` to the URL query string + if (getStringProp() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstring_prop%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStringProp())))); + } + + // add `date_prop` to the URL query string + if (getDateProp() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdate_prop%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDateProp())))); + } + + // add `datetime_prop` to the URL query string + if (getDatetimeProp() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdatetime_prop%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getDatetimeProp())))); + } + + // add `array_nullable_prop` to the URL query string + if (getArrayNullableProp() != null) { + for (int i = 0; i < getArrayNullableProp().size(); i++) { + joiner.add(String.format(java.util.Locale.ROOT, "%sarray_nullable_prop%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getArrayNullableProp().get(i))))); + } + } + + // add `array_and_items_nullable_prop` to the URL query string + if (getArrayAndItemsNullableProp() != null) { + for (int i = 0; i < getArrayAndItemsNullableProp().size(); i++) { + joiner.add(String.format(java.util.Locale.ROOT, "%sarray_and_items_nullable_prop%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getArrayAndItemsNullableProp().get(i))))); + } + } + + // add `array_items_nullable` to the URL query string + if (getArrayItemsNullable() != null) { + for (int i = 0; i < getArrayItemsNullable().size(); i++) { + joiner.add(String.format(java.util.Locale.ROOT, "%sarray_items_nullable%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getArrayItemsNullable().get(i))))); + } + } + + // add `object_nullable_prop` to the URL query string + if (getObjectNullableProp() != null) { + for (String _key : getObjectNullableProp().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sobject_nullable_prop%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getObjectNullableProp().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getObjectNullableProp().get(_key))))); + } + } + + // add `object_and_items_nullable_prop` to the URL query string + if (getObjectAndItemsNullableProp() != null) { + for (String _key : getObjectAndItemsNullableProp().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sobject_and_items_nullable_prop%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getObjectAndItemsNullableProp().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getObjectAndItemsNullableProp().get(_key))))); + } + } + + // add `object_items_nullable` to the URL query string + if (getObjectItemsNullable() != null) { + for (String _key : getObjectItemsNullable().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sobject_items_nullable%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getObjectItemsNullable().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getObjectItemsNullable().get(_key))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private NullableClass instance; + + public Builder() { + this(new NullableClass()); + } + + protected Builder(NullableClass instance) { + this.instance = instance; + } + + public NullableClass.Builder integerProp(Integer integerProp) { + this.instance.integerProp = integerProp; + return this; + } + public NullableClass.Builder numberProp(BigDecimal numberProp) { + this.instance.numberProp = numberProp; + return this; + } + public NullableClass.Builder booleanProp(Boolean booleanProp) { + this.instance.booleanProp = booleanProp; + return this; + } + public NullableClass.Builder stringProp(String stringProp) { + this.instance.stringProp = stringProp; + return this; + } + public NullableClass.Builder dateProp(LocalDate dateProp) { + this.instance.dateProp = dateProp; + return this; + } + public NullableClass.Builder datetimeProp(OffsetDateTime datetimeProp) { + this.instance.datetimeProp = datetimeProp; + return this; + } + public NullableClass.Builder arrayNullableProp(List arrayNullableProp) { + this.instance.arrayNullableProp = arrayNullableProp; + return this; + } + public NullableClass.Builder arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.instance.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + return this; + } + public NullableClass.Builder arrayItemsNullable(List arrayItemsNullable) { + this.instance.arrayItemsNullable = arrayItemsNullable; + return this; + } + public NullableClass.Builder objectNullableProp(Map objectNullableProp) { + this.instance.objectNullableProp = objectNullableProp; + return this; + } + public NullableClass.Builder objectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.instance.objectAndItemsNullableProp = objectAndItemsNullableProp; + return this; + } + public NullableClass.Builder objectItemsNullable(Map objectItemsNullable) { + this.instance.objectItemsNullable = objectItemsNullable; + return this; + } + + + /** + * returns a built NullableClass instance. + * + * The builder is not reusable. + */ + public NullableClass build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static NullableClass.Builder builder() { + return new NullableClass.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NullableClass.Builder toBuilder() { + return new NullableClass.Builder() + .integerProp(getIntegerProp()) + .numberProp(getNumberProp()) + .booleanProp(getBooleanProp()) + .stringProp(getStringProp()) + .dateProp(getDateProp()) + .datetimeProp(getDatetimeProp()) + .arrayNullableProp(getArrayNullableProp()) + .arrayAndItemsNullableProp(getArrayAndItemsNullableProp()) + .arrayItemsNullable(getArrayItemsNullable()) + .objectNullableProp(getObjectNullableProp()) + .objectAndItemsNullableProp(getObjectAndItemsNullableProp()) + .objectItemsNullable(getObjectItemsNullable()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/NullableShape.java new file mode 100644 index 000000000000..8a700390663f --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/NullableShape.java @@ -0,0 +1,313 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.openapitools.client.model.Quadrilateral; +import org.openapitools.client.model.Triangle; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import tools.jackson.core.type.TypeReference; + +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import tools.jackson.core.JacksonException; +import tools.jackson.core.JsonGenerator; +import tools.jackson.core.JsonParser; +import tools.jackson.core.JsonToken; +import tools.jackson.databind.DeserializationContext; +import tools.jackson.databind.DatabindException; +import tools.jackson.databind.JsonNode; +import tools.jackson.databind.SerializerProvider; +import tools.jackson.databind.annotation.JsonDeserialize; +import tools.jackson.databind.annotation.JsonSerialize; +import tools.jackson.databind.deser.std.StdDeserializer; +import tools.jackson.databind.ser.std.StdSerializer; +import org.openapitools.client.ApiClient; +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +@JsonDeserialize(using = NullableShape.NullableShapeDeserializer.class) +@JsonSerialize(using = NullableShape.NullableShapeSerializer.class) +public class NullableShape extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(NullableShape.class.getName()); + + public static class NullableShapeSerializer extends StdSerializer { + public NullableShapeSerializer(Class t) { + super(t); + } + + public NullableShapeSerializer() { + this(null); + } + + @Override + public void serialize(NullableShape value, JsonGenerator jgen, SerializerProvider provider) throws JacksonException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class NullableShapeDeserializer extends StdDeserializer { + public NullableShapeDeserializer() { + this(NullableShape.class); + } + + public NullableShapeDeserializer(Class vc) { + super(vc); + } + + @Override + public NullableShape deserialize(JsonParser jp, DeserializationContext ctxt) throws JacksonException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + boolean typeCoercion = false; // MapperFeature.ALLOW_COERCION_OF_SCALARS was removed in Jackson 3 + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize Quadrilateral + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class) || Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class) || Quadrilateral.class.equals(Boolean.class) || Quadrilateral.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (Quadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (Quadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= (token == JsonToken.VALUE_NULL); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'Quadrilateral'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Quadrilateral'", e); + } + + // deserialize Triangle + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class) || Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class) || Triangle.class.equals(Boolean.class) || Triangle.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (Triangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (Triangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= (token == JsonToken.VALUE_NULL); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'Triangle'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Triangle'", e); + } + + if (match == 1) { + NullableShape ret = new NullableShape(); + ret.setActualInstance(deserialized); + return ret; + } + throw DatabindException.from(jp, String.format(java.util.Locale.ROOT, "Failed deserialization for NullableShape: %d classes match result, expected 1", match)); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public NullableShape getNullValue(DeserializationContext ctxt) { + return null; + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap<>(); + + public NullableShape() { + super("oneOf", Boolean.TRUE); + } + + public NullableShape(Quadrilateral o) { + super("oneOf", Boolean.TRUE); + setActualInstance(o); + } + + public NullableShape(Triangle o) { + super("oneOf", Boolean.TRUE); + setActualInstance(o); + } + + static { + schemas.put("Quadrilateral", Quadrilateral.class); + schemas.put("Triangle", Triangle.class); + JSON.registerDescendants(NullableShape.class, Collections.unmodifiableMap(schemas)); + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("Quadrilateral", Quadrilateral.class); + mappings.put("Triangle", Triangle.class); + mappings.put("NullableShape", NullableShape.class); + JSON.registerDiscriminator(NullableShape.class, "shapeType", mappings); + } + + @Override + public Map> getSchemas() { + return NullableShape.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Quadrilateral, Triangle + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance == null) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(Triangle.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Quadrilateral, Triangle"); + } + + /** + * Get the actual instance, which can be the following: + * Quadrilateral, Triangle + * + * @return The actual instance (Quadrilateral, Triangle) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Quadrilateral` + * @throws ClassCastException if the instance is not `Quadrilateral` + */ + public Quadrilateral getQuadrilateral() throws ClassCastException { + return (Quadrilateral)super.getActualInstance(); + } + + /** + * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Triangle` + * @throws ClassCastException if the instance is not `Triangle` + */ + public Triangle getTriangle() throws ClassCastException { + return (Triangle)super.getActualInstance(); + } + + + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + if (getActualInstance() instanceof Triangle) { + if (getActualInstance() != null) { + joiner.add(((Triangle)getActualInstance()).toUrlQueryString(prefix + "one_of_0" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof Quadrilateral) { + if (getActualInstance() != null) { + joiner.add(((Quadrilateral)getActualInstance()).toUrlQueryString(prefix + "one_of_1" + suffix)); + } + return joiner.toString(); + } + return null; + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/NumberOnly.java new file mode 100644 index 000000000000..0410b7b2cae2 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -0,0 +1,201 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * NumberOnly + */ +@JsonPropertyOrder({ + NumberOnly.JSON_PROPERTY_JUST_NUMBER +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class NumberOnly { + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + @javax.annotation.Nullable + private BigDecimal justNumber; + + public NumberOnly() { + } + + public NumberOnly justNumber(@javax.annotation.Nullable BigDecimal justNumber) { + this.justNumber = justNumber; + return this; + } + + /** + * Get justNumber + * @return justNumber + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_JUST_NUMBER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getJustNumber() { + return justNumber; + } + + + @JsonProperty(value = JSON_PROPERTY_JUST_NUMBER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setJustNumber(@javax.annotation.Nullable BigDecimal justNumber) { + this.justNumber = justNumber; + } + + + /** + * Return true if this NumberOnly object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberOnly {\n"); + sb.append(" justNumber: ").append(toIndentedString(justNumber)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `JustNumber` to the URL query string + if (getJustNumber() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sJustNumber%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getJustNumber())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private NumberOnly instance; + + public Builder() { + this(new NumberOnly()); + } + + protected Builder(NumberOnly instance) { + this.instance = instance; + } + + public NumberOnly.Builder justNumber(BigDecimal justNumber) { + this.instance.justNumber = justNumber; + return this; + } + + + /** + * returns a built NumberOnly instance. + * + * The builder is not reusable. + */ + public NumberOnly build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static NumberOnly.Builder builder() { + return new NumberOnly.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NumberOnly.Builder toBuilder() { + return new NumberOnly.Builder() + .justNumber(getJustNumber()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java new file mode 100644 index 000000000000..5bab96a21742 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -0,0 +1,342 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.DeprecatedObject; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * ObjectWithDeprecatedFields + */ +@JsonPropertyOrder({ + ObjectWithDeprecatedFields.JSON_PROPERTY_UUID, + ObjectWithDeprecatedFields.JSON_PROPERTY_ID, + ObjectWithDeprecatedFields.JSON_PROPERTY_DEPRECATED_REF, + ObjectWithDeprecatedFields.JSON_PROPERTY_BARS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class ObjectWithDeprecatedFields { + public static final String JSON_PROPERTY_UUID = "uuid"; + @javax.annotation.Nullable + private String uuid; + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable + private BigDecimal id; + + public static final String JSON_PROPERTY_DEPRECATED_REF = "deprecatedRef"; + @javax.annotation.Nullable + private DeprecatedObject deprecatedRef; + + public static final String JSON_PROPERTY_BARS = "bars"; + @javax.annotation.Nullable + private List bars = new ArrayList<>(); + + public ObjectWithDeprecatedFields() { + } + + public ObjectWithDeprecatedFields uuid(@javax.annotation.Nullable String uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_UUID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUuid() { + return uuid; + } + + + @JsonProperty(value = JSON_PROPERTY_UUID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUuid(@javax.annotation.Nullable String uuid) { + this.uuid = uuid; + } + + + public ObjectWithDeprecatedFields id(@javax.annotation.Nullable BigDecimal id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + * @deprecated + */ + @Deprecated + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getId() { + return id; + } + + + @JsonProperty(value = JSON_PROPERTY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable BigDecimal id) { + this.id = id; + } + + + public ObjectWithDeprecatedFields deprecatedRef(@javax.annotation.Nullable DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + return this; + } + + /** + * Get deprecatedRef + * @return deprecatedRef + * @deprecated + */ + @Deprecated + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DEPRECATED_REF, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeprecatedObject getDeprecatedRef() { + return deprecatedRef; + } + + + @JsonProperty(value = JSON_PROPERTY_DEPRECATED_REF, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeprecatedRef(@javax.annotation.Nullable DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + } + + + public ObjectWithDeprecatedFields bars(@javax.annotation.Nullable List bars) { + this.bars = bars; + return this; + } + + public ObjectWithDeprecatedFields addBarsItem(String barsItem) { + if (this.bars == null) { + this.bars = new ArrayList<>(); + } + this.bars.add(barsItem); + return this; + } + + /** + * Get bars + * @return bars + * @deprecated + */ + @Deprecated + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BARS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getBars() { + return bars; + } + + + @JsonProperty(value = JSON_PROPERTY_BARS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBars(@javax.annotation.Nullable List bars) { + this.bars = bars; + } + + + /** + * Return true if this ObjectWithDeprecatedFields object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObjectWithDeprecatedFields {\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" deprecatedRef: ").append(toIndentedString(deprecatedRef)).append("\n"); + sb.append(" bars: ").append(toIndentedString(bars)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `uuid` to the URL query string + if (getUuid() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%suuid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUuid())))); + } + + // add `id` to the URL query string + if (getId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `deprecatedRef` to the URL query string + if (getDeprecatedRef() != null) { + joiner.add(getDeprecatedRef().toUrlQueryString(prefix + "deprecatedRef" + suffix)); + } + + // add `bars` to the URL query string + if (getBars() != null) { + for (int i = 0; i < getBars().size(); i++) { + joiner.add(String.format(java.util.Locale.ROOT, "%sbars%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getBars().get(i))))); + } + } + + return joiner.toString(); + } + + public static class Builder { + + private ObjectWithDeprecatedFields instance; + + public Builder() { + this(new ObjectWithDeprecatedFields()); + } + + protected Builder(ObjectWithDeprecatedFields instance) { + this.instance = instance; + } + + public ObjectWithDeprecatedFields.Builder uuid(String uuid) { + this.instance.uuid = uuid; + return this; + } + public ObjectWithDeprecatedFields.Builder id(BigDecimal id) { + this.instance.id = id; + return this; + } + public ObjectWithDeprecatedFields.Builder deprecatedRef(DeprecatedObject deprecatedRef) { + this.instance.deprecatedRef = deprecatedRef; + return this; + } + public ObjectWithDeprecatedFields.Builder bars(List bars) { + this.instance.bars = bars; + return this; + } + + + /** + * returns a built ObjectWithDeprecatedFields instance. + * + * The builder is not reusable. + */ + public ObjectWithDeprecatedFields build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ObjectWithDeprecatedFields.Builder builder() { + return new ObjectWithDeprecatedFields.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ObjectWithDeprecatedFields.Builder toBuilder() { + return new ObjectWithDeprecatedFields.Builder() + .uuid(getUuid()) + .id(getId()) + .deprecatedRef(getDeprecatedRef()) + .bars(getBars()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Order.java new file mode 100644 index 000000000000..20e8b5ddbbee --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Order.java @@ -0,0 +1,438 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * Order + */ +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class Order { + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable + private Long id; + + public static final String JSON_PROPERTY_PET_ID = "petId"; + @javax.annotation.Nullable + private Long petId; + + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + @javax.annotation.Nullable + private Integer quantity; + + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + @javax.annotation.Nullable + private OffsetDateTime shipDate; + + /** + * Order Status + */ + public enum StatusEnum { + PLACED(String.valueOf("placed")), + + APPROVED(String.valueOf("approved")), + + DELIVERED(String.valueOf("delivered")); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + @javax.annotation.Nullable + private StatusEnum status; + + public static final String JSON_PROPERTY_COMPLETE = "complete"; + @javax.annotation.Nullable + private Boolean complete = false; + + public Order() { + } + + public Order id(@javax.annotation.Nullable Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + + @JsonProperty(value = JSON_PROPERTY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable Long id) { + this.id = id; + } + + + public Order petId(@javax.annotation.Nullable Long petId) { + this.petId = petId; + return this; + } + + /** + * Get petId + * @return petId + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PET_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPetId() { + return petId; + } + + + @JsonProperty(value = JSON_PROPERTY_PET_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPetId(@javax.annotation.Nullable Long petId) { + this.petId = petId; + } + + + public Order quantity(@javax.annotation.Nullable Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * @return quantity + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_QUANTITY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getQuantity() { + return quantity; + } + + + @JsonProperty(value = JSON_PROPERTY_QUANTITY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQuantity(@javax.annotation.Nullable Integer quantity) { + this.quantity = quantity; + } + + + public Order shipDate(@javax.annotation.Nullable OffsetDateTime shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Get shipDate + * @return shipDate + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SHIP_DATE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getShipDate() { + return shipDate; + } + + + @JsonProperty(value = JSON_PROPERTY_SHIP_DATE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShipDate(@javax.annotation.Nullable OffsetDateTime shipDate) { + this.shipDate = shipDate; + } + + + public Order status(@javax.annotation.Nullable StatusEnum status) { + this.status = status; + return this; + } + + /** + * Order Status + * @return status + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@javax.annotation.Nullable StatusEnum status) { + this.status = status; + } + + + public Order complete(@javax.annotation.Nullable Boolean complete) { + this.complete = complete; + return this; + } + + /** + * Get complete + * @return complete + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_COMPLETE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getComplete() { + return complete; + } + + + @JsonProperty(value = JSON_PROPERTY_COMPLETE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setComplete(@javax.annotation.Nullable Boolean complete) { + this.complete = complete; + } + + + /** + * Return true if this Order object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `petId` to the URL query string + if (getPetId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%spetId%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPetId())))); + } + + // add `quantity` to the URL query string + if (getQuantity() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%squantity%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getQuantity())))); + } + + // add `shipDate` to the URL query string + if (getShipDate() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sshipDate%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getShipDate())))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + // add `complete` to the URL query string + if (getComplete() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%scomplete%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getComplete())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private Order instance; + + public Builder() { + this(new Order()); + } + + protected Builder(Order instance) { + this.instance = instance; + } + + public Order.Builder id(Long id) { + this.instance.id = id; + return this; + } + public Order.Builder petId(Long petId) { + this.instance.petId = petId; + return this; + } + public Order.Builder quantity(Integer quantity) { + this.instance.quantity = quantity; + return this; + } + public Order.Builder shipDate(OffsetDateTime shipDate) { + this.instance.shipDate = shipDate; + return this; + } + public Order.Builder status(StatusEnum status) { + this.instance.status = status; + return this; + } + public Order.Builder complete(Boolean complete) { + this.instance.complete = complete; + return this; + } + + + /** + * returns a built Order instance. + * + * The builder is not reusable. + */ + public Order build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Order.Builder builder() { + return new Order.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Order.Builder toBuilder() { + return new Order.Builder() + .id(getId()) + .petId(getPetId()) + .quantity(getQuantity()) + .shipDate(getShipDate()) + .status(getStatus()) + .complete(getComplete()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/OuterComposite.java new file mode 100644 index 000000000000..8f5623dfb275 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -0,0 +1,281 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * OuterComposite + */ +@JsonPropertyOrder({ + OuterComposite.JSON_PROPERTY_MY_NUMBER, + OuterComposite.JSON_PROPERTY_MY_STRING, + OuterComposite.JSON_PROPERTY_MY_BOOLEAN +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class OuterComposite { + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + @javax.annotation.Nullable + private BigDecimal myNumber; + + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + @javax.annotation.Nullable + private String myString; + + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + @javax.annotation.Nullable + private Boolean myBoolean; + + public OuterComposite() { + } + + public OuterComposite myNumber(@javax.annotation.Nullable BigDecimal myNumber) { + this.myNumber = myNumber; + return this; + } + + /** + * Get myNumber + * @return myNumber + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MY_NUMBER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getMyNumber() { + return myNumber; + } + + + @JsonProperty(value = JSON_PROPERTY_MY_NUMBER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMyNumber(@javax.annotation.Nullable BigDecimal myNumber) { + this.myNumber = myNumber; + } + + + public OuterComposite myString(@javax.annotation.Nullable String myString) { + this.myString = myString; + return this; + } + + /** + * Get myString + * @return myString + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MY_STRING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMyString() { + return myString; + } + + + @JsonProperty(value = JSON_PROPERTY_MY_STRING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMyString(@javax.annotation.Nullable String myString) { + this.myString = myString; + } + + + public OuterComposite myBoolean(@javax.annotation.Nullable Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MY_BOOLEAN, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getMyBoolean() { + return myBoolean; + } + + + @JsonProperty(value = JSON_PROPERTY_MY_BOOLEAN, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMyBoolean(@javax.annotation.Nullable Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + + /** + * Return true if this OuterComposite object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `my_number` to the URL query string + if (getMyNumber() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smy_number%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMyNumber())))); + } + + // add `my_string` to the URL query string + if (getMyString() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smy_string%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMyString())))); + } + + // add `my_boolean` to the URL query string + if (getMyBoolean() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%smy_boolean%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getMyBoolean())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private OuterComposite instance; + + public Builder() { + this(new OuterComposite()); + } + + protected Builder(OuterComposite instance) { + this.instance = instance; + } + + public OuterComposite.Builder myNumber(BigDecimal myNumber) { + this.instance.myNumber = myNumber; + return this; + } + public OuterComposite.Builder myString(String myString) { + this.instance.myString = myString; + return this; + } + public OuterComposite.Builder myBoolean(Boolean myBoolean) { + this.instance.myBoolean = myBoolean; + return this; + } + + + /** + * returns a built OuterComposite instance. + * + * The builder is not reusable. + */ + public OuterComposite build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static OuterComposite.Builder builder() { + return new OuterComposite.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public OuterComposite.Builder toBuilder() { + return new OuterComposite.Builder() + .myNumber(getMyNumber()) + .myString(getMyString()) + .myBoolean(getMyBoolean()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/OuterEnum.java new file mode 100644 index 000000000000..ec55a4f7e73e --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -0,0 +1,82 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnum + */ +public enum OuterEnum { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnum fromValue(String value) { + for (OuterEnum b : OuterEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java new file mode 100644 index 000000000000..3f15ec369add --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java @@ -0,0 +1,82 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumDefaultValue + */ +public enum OuterEnumDefaultValue { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnumDefaultValue(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumDefaultValue fromValue(String value) { + for (OuterEnumDefaultValue b : OuterEnumDefaultValue.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/OuterEnumInteger.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/OuterEnumInteger.java new file mode 100644 index 000000000000..d8d14a080c24 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/OuterEnumInteger.java @@ -0,0 +1,82 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumInteger + */ +public enum OuterEnumInteger { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumInteger(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumInteger fromValue(Integer value) { + for (OuterEnumInteger b : OuterEnumInteger.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java new file mode 100644 index 000000000000..4ed2d786f084 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java @@ -0,0 +1,82 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumIntegerDefaultValue + */ +public enum OuterEnumIntegerDefaultValue { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumIntegerDefaultValue(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumIntegerDefaultValue fromValue(Integer value) { + for (OuterEnumIntegerDefaultValue b : OuterEnumIntegerDefaultValue.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format(java.util.Locale.ROOT, "%s=%s", prefix, this.toString()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ParentPet.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ParentPet.java new file mode 100644 index 000000000000..6b92af76761b --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ParentPet.java @@ -0,0 +1,201 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.openapitools.client.model.GrandparentAnimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.JSON; +import org.openapitools.client.ApiClient; +/** + * ParentPet + */ +@JsonPropertyOrder({ +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +@JsonIgnoreProperties( + value = "pet_type", // ignore manually set pet_type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the pet_type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "pet_type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = ChildCat.class, name = "ChildCat"), +}) + +public class ParentPet extends GrandparentAnimal { + public ParentPet() { + } + + @Override + public ParentPet petType(@javax.annotation.Nonnull String petType) { + this.setPetType(petType); + return this; + } + + /** + * Return true if this ParentPet object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ParentPet {\n"); + sb.append(" ").append(toIndentedString(super.toString())).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `pet_type` to the URL query string + if (getPetType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%spet_type%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPetType())))); + } + + return joiner.toString(); + } +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("ChildCat", ChildCat.class); + mappings.put("ParentPet", ParentPet.class); + JSON.registerDiscriminator(ParentPet.class, "pet_type", mappings); +} + + public static class Builder extends GrandparentAnimal.Builder { + + private ParentPet instance; + + public Builder() { + this(new ParentPet()); + } + + protected Builder(ParentPet instance) { + super(instance); + this.instance = instance; + } + + + public ParentPet.Builder petType(String petType) { // inherited: true + super.petType(petType); + return this; + } + + + /** + * returns a built ParentPet instance. + * + * The builder is not reusable. + */ + public ParentPet build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + super.build(); + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ParentPet.Builder builder() { + return new ParentPet.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ParentPet.Builder toBuilder() { + return new ParentPet.Builder() + .petType(getPetType()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Pet.java new file mode 100644 index 000000000000..d924329e6900 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Pet.java @@ -0,0 +1,466 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +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 com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * Pet + */ +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class Pet { + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable + private Long id; + + public static final String JSON_PROPERTY_CATEGORY = "category"; + @javax.annotation.Nullable + private Category category; + + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nonnull + private String name; + + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + @javax.annotation.Nonnull + private List photoUrls = new ArrayList<>(); + + public static final String JSON_PROPERTY_TAGS = "tags"; + @javax.annotation.Nullable + private List tags = new ArrayList<>(); + + /** + * pet status in the store + */ + public enum StatusEnum { + AVAILABLE(String.valueOf("available")), + + PENDING(String.valueOf("pending")), + + SOLD(String.valueOf("sold")); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + @javax.annotation.Nullable + private StatusEnum status; + + public Pet() { + } + + public Pet id(@javax.annotation.Nullable Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + + @JsonProperty(value = JSON_PROPERTY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable Long id) { + this.id = id; + } + + + public Pet category(@javax.annotation.Nullable Category category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CATEGORY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Category getCategory() { + return category; + } + + + @JsonProperty(value = JSON_PROPERTY_CATEGORY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCategory(@javax.annotation.Nullable Category category) { + this.category = category; + } + + + public Pet name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_NAME, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public Pet photoUrls(@javax.annotation.Nonnull 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 photoUrls + * @return photoUrls + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_PHOTO_URLS, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getPhotoUrls() { + return photoUrls; + } + + + @JsonProperty(value = JSON_PROPERTY_PHOTO_URLS, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPhotoUrls(@javax.annotation.Nonnull List photoUrls) { + this.photoUrls = photoUrls; + } + + + public Pet tags(@javax.annotation.Nullable 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; + } + + /** + * Get tags + * @return tags + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TAGS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + + @JsonProperty(value = JSON_PROPERTY_TAGS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTags(@javax.annotation.Nullable List tags) { + this.tags = tags; + } + + + public Pet status(@javax.annotation.Nullable StatusEnum status) { + this.status = status; + return this; + } + + /** + * pet status in the store + * @return status + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@javax.annotation.Nullable StatusEnum status) { + this.status = status; + } + + + /** + * Return true if this Pet object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `category` to the URL query string + if (getCategory() != null) { + joiner.add(getCategory().toUrlQueryString(prefix + "category" + suffix)); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + // add `photoUrls` to the URL query string + if (getPhotoUrls() != null) { + for (int i = 0; i < getPhotoUrls().size(); i++) { + joiner.add(String.format(java.util.Locale.ROOT, "%sphotoUrls%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix), + ApiClient.urlEncode(ApiClient.valueToString(getPhotoUrls().get(i))))); + } + } + + // add `tags` to the URL query string + if (getTags() != null) { + for (int i = 0; i < getTags().size(); i++) { + if (getTags().get(i) != null) { + joiner.add(getTags().get(i).toUrlQueryString(String.format(java.util.Locale.ROOT, "%stags%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sstatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getStatus())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private Pet instance; + + public Builder() { + this(new Pet()); + } + + protected Builder(Pet instance) { + this.instance = instance; + } + + public Pet.Builder id(Long id) { + this.instance.id = id; + return this; + } + public Pet.Builder category(Category category) { + this.instance.category = category; + return this; + } + public Pet.Builder name(String name) { + this.instance.name = name; + return this; + } + public Pet.Builder photoUrls(List photoUrls) { + this.instance.photoUrls = photoUrls; + return this; + } + public Pet.Builder tags(List tags) { + this.instance.tags = tags; + return this; + } + public Pet.Builder status(StatusEnum status) { + this.instance.status = status; + return this; + } + + + /** + * returns a built Pet instance. + * + * The builder is not reusable. + */ + public Pet build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Pet.Builder builder() { + return new Pet.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Pet.Builder toBuilder() { + return new Pet.Builder() + .id(getId()) + .category(getCategory()) + .name(getName()) + .photoUrls(getPhotoUrls()) + .tags(getTags()) + .status(getStatus()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Pig.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Pig.java new file mode 100644 index 000000000000..99fc9c066b16 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Pig.java @@ -0,0 +1,306 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.openapitools.client.model.BasquePig; +import org.openapitools.client.model.DanishPig; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import tools.jackson.core.type.TypeReference; + +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import tools.jackson.core.JacksonException; +import tools.jackson.core.JsonGenerator; +import tools.jackson.core.JsonParser; +import tools.jackson.core.JsonToken; +import tools.jackson.databind.DeserializationContext; +import tools.jackson.databind.DatabindException; +import tools.jackson.databind.JsonNode; +import tools.jackson.databind.SerializerProvider; +import tools.jackson.databind.annotation.JsonDeserialize; +import tools.jackson.databind.annotation.JsonSerialize; +import tools.jackson.databind.deser.std.StdDeserializer; +import tools.jackson.databind.ser.std.StdSerializer; +import org.openapitools.client.ApiClient; +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +@JsonDeserialize(using = Pig.PigDeserializer.class) +@JsonSerialize(using = Pig.PigSerializer.class) +public class Pig extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Pig.class.getName()); + + public static class PigSerializer extends StdSerializer { + public PigSerializer(Class t) { + super(t); + } + + public PigSerializer() { + this(null); + } + + @Override + public void serialize(Pig value, JsonGenerator jgen, SerializerProvider provider) throws JacksonException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class PigDeserializer extends StdDeserializer { + public PigDeserializer() { + this(Pig.class); + } + + public PigDeserializer(Class vc) { + super(vc); + } + + @Override + public Pig deserialize(JsonParser jp, DeserializationContext ctxt) throws JacksonException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + boolean typeCoercion = false; // MapperFeature.ALLOW_COERCION_OF_SCALARS was removed in Jackson 3 + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize BasquePig + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (BasquePig.class.equals(Integer.class) || BasquePig.class.equals(Long.class) || BasquePig.class.equals(Float.class) || BasquePig.class.equals(Double.class) || BasquePig.class.equals(Boolean.class) || BasquePig.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((BasquePig.class.equals(Integer.class) || BasquePig.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((BasquePig.class.equals(Float.class) || BasquePig.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (BasquePig.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (BasquePig.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(BasquePig.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'BasquePig'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'BasquePig'", e); + } + + // deserialize DanishPig + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (DanishPig.class.equals(Integer.class) || DanishPig.class.equals(Long.class) || DanishPig.class.equals(Float.class) || DanishPig.class.equals(Double.class) || DanishPig.class.equals(Boolean.class) || DanishPig.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((DanishPig.class.equals(Integer.class) || DanishPig.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((DanishPig.class.equals(Float.class) || DanishPig.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (DanishPig.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (DanishPig.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(DanishPig.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'DanishPig'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'DanishPig'", e); + } + + if (match == 1) { + Pig ret = new Pig(); + ret.setActualInstance(deserialized); + return ret; + } + throw DatabindException.from(jp, String.format(java.util.Locale.ROOT, "Failed deserialization for Pig: %d classes match result, expected 1", match)); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public Pig getNullValue(DeserializationContext ctxt) { + throw DatabindException.from(ctxt.getParser(), "Pig cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap<>(); + + public Pig() { + super("oneOf", Boolean.FALSE); + } + + public Pig(BasquePig o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Pig(DanishPig o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("BasquePig", BasquePig.class); + schemas.put("DanishPig", DanishPig.class); + JSON.registerDescendants(Pig.class, Collections.unmodifiableMap(schemas)); + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("BasquePig", BasquePig.class); + mappings.put("DanishPig", DanishPig.class); + mappings.put("Pig", Pig.class); + JSON.registerDiscriminator(Pig.class, "className", mappings); + } + + @Override + public Map> getSchemas() { + return Pig.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * BasquePig, DanishPig + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(BasquePig.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(DanishPig.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be BasquePig, DanishPig"); + } + + /** + * Get the actual instance, which can be the following: + * BasquePig, DanishPig + * + * @return The actual instance (BasquePig, DanishPig) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `BasquePig`. If the actual instance is not `BasquePig`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `BasquePig` + * @throws ClassCastException if the instance is not `BasquePig` + */ + public BasquePig getBasquePig() throws ClassCastException { + return (BasquePig)super.getActualInstance(); + } + + /** + * Get the actual instance of `DanishPig`. If the actual instance is not `DanishPig`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `DanishPig` + * @throws ClassCastException if the instance is not `DanishPig` + */ + public DanishPig getDanishPig() throws ClassCastException { + return (DanishPig)super.getActualInstance(); + } + + + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + if (getActualInstance() instanceof BasquePig) { + if (getActualInstance() != null) { + joiner.add(((BasquePig)getActualInstance()).toUrlQueryString(prefix + "one_of_0" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof DanishPig) { + if (getActualInstance() != null) { + joiner.add(((DanishPig)getActualInstance()).toUrlQueryString(prefix + "one_of_1" + suffix)); + } + return joiner.toString(); + } + return null; + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Quadrilateral.java new file mode 100644 index 000000000000..41147fca06d2 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -0,0 +1,306 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.openapitools.client.model.ComplexQuadrilateral; +import org.openapitools.client.model.SimpleQuadrilateral; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import tools.jackson.core.type.TypeReference; + +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import tools.jackson.core.JacksonException; +import tools.jackson.core.JsonGenerator; +import tools.jackson.core.JsonParser; +import tools.jackson.core.JsonToken; +import tools.jackson.databind.DeserializationContext; +import tools.jackson.databind.DatabindException; +import tools.jackson.databind.JsonNode; +import tools.jackson.databind.SerializerProvider; +import tools.jackson.databind.annotation.JsonDeserialize; +import tools.jackson.databind.annotation.JsonSerialize; +import tools.jackson.databind.deser.std.StdDeserializer; +import tools.jackson.databind.ser.std.StdSerializer; +import org.openapitools.client.ApiClient; +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +@JsonDeserialize(using = Quadrilateral.QuadrilateralDeserializer.class) +@JsonSerialize(using = Quadrilateral.QuadrilateralSerializer.class) +public class Quadrilateral extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Quadrilateral.class.getName()); + + public static class QuadrilateralSerializer extends StdSerializer { + public QuadrilateralSerializer(Class t) { + super(t); + } + + public QuadrilateralSerializer() { + this(null); + } + + @Override + public void serialize(Quadrilateral value, JsonGenerator jgen, SerializerProvider provider) throws JacksonException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class QuadrilateralDeserializer extends StdDeserializer { + public QuadrilateralDeserializer() { + this(Quadrilateral.class); + } + + public QuadrilateralDeserializer(Class vc) { + super(vc); + } + + @Override + public Quadrilateral deserialize(JsonParser jp, DeserializationContext ctxt) throws JacksonException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + boolean typeCoercion = false; // MapperFeature.ALLOW_COERCION_OF_SCALARS was removed in Jackson 3 + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize ComplexQuadrilateral + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ComplexQuadrilateral.class.equals(Integer.class) || ComplexQuadrilateral.class.equals(Long.class) || ComplexQuadrilateral.class.equals(Float.class) || ComplexQuadrilateral.class.equals(Double.class) || ComplexQuadrilateral.class.equals(Boolean.class) || ComplexQuadrilateral.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((ComplexQuadrilateral.class.equals(Integer.class) || ComplexQuadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((ComplexQuadrilateral.class.equals(Float.class) || ComplexQuadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (ComplexQuadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (ComplexQuadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(ComplexQuadrilateral.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'ComplexQuadrilateral'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'ComplexQuadrilateral'", e); + } + + // deserialize SimpleQuadrilateral + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (SimpleQuadrilateral.class.equals(Integer.class) || SimpleQuadrilateral.class.equals(Long.class) || SimpleQuadrilateral.class.equals(Float.class) || SimpleQuadrilateral.class.equals(Double.class) || SimpleQuadrilateral.class.equals(Boolean.class) || SimpleQuadrilateral.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((SimpleQuadrilateral.class.equals(Integer.class) || SimpleQuadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((SimpleQuadrilateral.class.equals(Float.class) || SimpleQuadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (SimpleQuadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (SimpleQuadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(SimpleQuadrilateral.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'SimpleQuadrilateral'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'SimpleQuadrilateral'", e); + } + + if (match == 1) { + Quadrilateral ret = new Quadrilateral(); + ret.setActualInstance(deserialized); + return ret; + } + throw DatabindException.from(jp, String.format(java.util.Locale.ROOT, "Failed deserialization for Quadrilateral: %d classes match result, expected 1", match)); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public Quadrilateral getNullValue(DeserializationContext ctxt) { + throw DatabindException.from(ctxt.getParser(), "Quadrilateral cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap<>(); + + public Quadrilateral() { + super("oneOf", Boolean.FALSE); + } + + public Quadrilateral(ComplexQuadrilateral o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Quadrilateral(SimpleQuadrilateral o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("ComplexQuadrilateral", ComplexQuadrilateral.class); + schemas.put("SimpleQuadrilateral", SimpleQuadrilateral.class); + JSON.registerDescendants(Quadrilateral.class, Collections.unmodifiableMap(schemas)); + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("ComplexQuadrilateral", ComplexQuadrilateral.class); + mappings.put("SimpleQuadrilateral", SimpleQuadrilateral.class); + mappings.put("Quadrilateral", Quadrilateral.class); + JSON.registerDiscriminator(Quadrilateral.class, "quadrilateralType", mappings); + } + + @Override + public Map> getSchemas() { + return Quadrilateral.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * ComplexQuadrilateral, SimpleQuadrilateral + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(ComplexQuadrilateral.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(SimpleQuadrilateral.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be ComplexQuadrilateral, SimpleQuadrilateral"); + } + + /** + * Get the actual instance, which can be the following: + * ComplexQuadrilateral, SimpleQuadrilateral + * + * @return The actual instance (ComplexQuadrilateral, SimpleQuadrilateral) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `ComplexQuadrilateral`. If the actual instance is not `ComplexQuadrilateral`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ComplexQuadrilateral` + * @throws ClassCastException if the instance is not `ComplexQuadrilateral` + */ + public ComplexQuadrilateral getComplexQuadrilateral() throws ClassCastException { + return (ComplexQuadrilateral)super.getActualInstance(); + } + + /** + * Get the actual instance of `SimpleQuadrilateral`. If the actual instance is not `SimpleQuadrilateral`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SimpleQuadrilateral` + * @throws ClassCastException if the instance is not `SimpleQuadrilateral` + */ + public SimpleQuadrilateral getSimpleQuadrilateral() throws ClassCastException { + return (SimpleQuadrilateral)super.getActualInstance(); + } + + + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + if (getActualInstance() instanceof SimpleQuadrilateral) { + if (getActualInstance() != null) { + joiner.add(((SimpleQuadrilateral)getActualInstance()).toUrlQueryString(prefix + "one_of_0" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof ComplexQuadrilateral) { + if (getActualInstance() != null) { + joiner.add(((ComplexQuadrilateral)getActualInstance()).toUrlQueryString(prefix + "one_of_1" + suffix)); + } + return joiner.toString(); + } + return null; + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java new file mode 100644 index 000000000000..1c47be77c907 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java @@ -0,0 +1,200 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * QuadrilateralInterface + */ +@JsonPropertyOrder({ + QuadrilateralInterface.JSON_PROPERTY_QUADRILATERAL_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class QuadrilateralInterface { + public static final String JSON_PROPERTY_QUADRILATERAL_TYPE = "quadrilateralType"; + @javax.annotation.Nonnull + private String quadrilateralType; + + public QuadrilateralInterface() { + } + + public QuadrilateralInterface quadrilateralType(@javax.annotation.Nonnull String quadrilateralType) { + this.quadrilateralType = quadrilateralType; + return this; + } + + /** + * Get quadrilateralType + * @return quadrilateralType + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getQuadrilateralType() { + return quadrilateralType; + } + + + @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setQuadrilateralType(@javax.annotation.Nonnull String quadrilateralType) { + this.quadrilateralType = quadrilateralType; + } + + + /** + * Return true if this QuadrilateralInterface object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QuadrilateralInterface {\n"); + sb.append(" quadrilateralType: ").append(toIndentedString(quadrilateralType)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `quadrilateralType` to the URL query string + if (getQuadrilateralType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%squadrilateralType%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getQuadrilateralType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private QuadrilateralInterface instance; + + public Builder() { + this(new QuadrilateralInterface()); + } + + protected Builder(QuadrilateralInterface instance) { + this.instance = instance; + } + + public QuadrilateralInterface.Builder quadrilateralType(String quadrilateralType) { + this.instance.quadrilateralType = quadrilateralType; + return this; + } + + + /** + * returns a built QuadrilateralInterface instance. + * + * The builder is not reusable. + */ + public QuadrilateralInterface build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static QuadrilateralInterface.Builder builder() { + return new QuadrilateralInterface.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public QuadrilateralInterface.Builder toBuilder() { + return new QuadrilateralInterface.Builder() + .quadrilateralType(getQuadrilateralType()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java new file mode 100644 index 000000000000..7c436cb400cd --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -0,0 +1,238 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * ReadOnlyFirst + */ +@JsonPropertyOrder({ + ReadOnlyFirst.JSON_PROPERTY_BAR, + ReadOnlyFirst.JSON_PROPERTY_BAZ +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class ReadOnlyFirst { + public static final String JSON_PROPERTY_BAR = "bar"; + @javax.annotation.Nullable + private String bar; + + public static final String JSON_PROPERTY_BAZ = "baz"; + @javax.annotation.Nullable + private String baz; + + public ReadOnlyFirst() { + } + + @JsonCreator + public ReadOnlyFirst( + @JsonProperty(JSON_PROPERTY_BAR) String bar + ) { + this(); + this.bar = bar; + } + + /** + * Get bar + * @return bar + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BAR, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { + return bar; + } + + + + + public ReadOnlyFirst baz(@javax.annotation.Nullable String baz) { + this.baz = baz; + return this; + } + + /** + * Get baz + * @return baz + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BAZ, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBaz() { + return baz; + } + + + @JsonProperty(value = JSON_PROPERTY_BAZ, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBaz(@javax.annotation.Nullable String baz) { + this.baz = baz; + } + + + /** + * Return true if this ReadOnlyFirst object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadOnlyFirst {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" baz: ").append(toIndentedString(baz)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `bar` to the URL query string + if (getBar() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sbar%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getBar())))); + } + + // add `baz` to the URL query string + if (getBaz() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sbaz%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getBaz())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ReadOnlyFirst instance; + + public Builder() { + this(new ReadOnlyFirst()); + } + + protected Builder(ReadOnlyFirst instance) { + this.instance = instance; + } + + public ReadOnlyFirst.Builder bar(String bar) { + this.instance.bar = bar; + return this; + } + public ReadOnlyFirst.Builder baz(String baz) { + this.instance.baz = baz; + return this; + } + + + /** + * returns a built ReadOnlyFirst instance. + * + * The builder is not reusable. + */ + public ReadOnlyFirst build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ReadOnlyFirst.Builder builder() { + return new ReadOnlyFirst.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ReadOnlyFirst.Builder toBuilder() { + return new ReadOnlyFirst.Builder() + .bar(getBar()) + .baz(getBaz()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java new file mode 100644 index 000000000000..39bfeb27239c --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java @@ -0,0 +1,240 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * ScaleneTriangle + */ +@JsonPropertyOrder({ + ScaleneTriangle.JSON_PROPERTY_SHAPE_TYPE, + ScaleneTriangle.JSON_PROPERTY_TRIANGLE_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class ScaleneTriangle { + public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + @javax.annotation.Nonnull + private String shapeType; + + public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; + @javax.annotation.Nonnull + private String triangleType; + + public ScaleneTriangle() { + } + + public ScaleneTriangle shapeType(@javax.annotation.Nonnull String shapeType) { + this.shapeType = shapeType; + return this; + } + + /** + * Get shapeType + * @return shapeType + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getShapeType() { + return shapeType; + } + + + @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setShapeType(@javax.annotation.Nonnull String shapeType) { + this.shapeType = shapeType; + } + + + public ScaleneTriangle triangleType(@javax.annotation.Nonnull String triangleType) { + this.triangleType = triangleType; + return this; + } + + /** + * Get triangleType + * @return triangleType + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTriangleType() { + return triangleType; + } + + + @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTriangleType(@javax.annotation.Nonnull String triangleType) { + this.triangleType = triangleType; + } + + + /** + * Return true if this ScaleneTriangle object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScaleneTriangle {\n"); + sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); + sb.append(" triangleType: ").append(toIndentedString(triangleType)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `shapeType` to the URL query string + if (getShapeType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sshapeType%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getShapeType())))); + } + + // add `triangleType` to the URL query string + if (getTriangleType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%striangleType%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTriangleType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ScaleneTriangle instance; + + public Builder() { + this(new ScaleneTriangle()); + } + + protected Builder(ScaleneTriangle instance) { + this.instance = instance; + } + + public ScaleneTriangle.Builder shapeType(String shapeType) { + this.instance.shapeType = shapeType; + return this; + } + public ScaleneTriangle.Builder triangleType(String triangleType) { + this.instance.triangleType = triangleType; + return this; + } + + + /** + * returns a built ScaleneTriangle instance. + * + * The builder is not reusable. + */ + public ScaleneTriangle build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ScaleneTriangle.Builder builder() { + return new ScaleneTriangle.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ScaleneTriangle.Builder toBuilder() { + return new ScaleneTriangle.Builder() + .shapeType(getShapeType()) + .triangleType(getTriangleType()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Shape.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Shape.java new file mode 100644 index 000000000000..df98135fee60 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Shape.java @@ -0,0 +1,306 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.openapitools.client.model.Quadrilateral; +import org.openapitools.client.model.Triangle; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import tools.jackson.core.type.TypeReference; + +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import tools.jackson.core.JacksonException; +import tools.jackson.core.JsonGenerator; +import tools.jackson.core.JsonParser; +import tools.jackson.core.JsonToken; +import tools.jackson.databind.DeserializationContext; +import tools.jackson.databind.DatabindException; +import tools.jackson.databind.JsonNode; +import tools.jackson.databind.SerializerProvider; +import tools.jackson.databind.annotation.JsonDeserialize; +import tools.jackson.databind.annotation.JsonSerialize; +import tools.jackson.databind.deser.std.StdDeserializer; +import tools.jackson.databind.ser.std.StdSerializer; +import org.openapitools.client.ApiClient; +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +@JsonDeserialize(using = Shape.ShapeDeserializer.class) +@JsonSerialize(using = Shape.ShapeSerializer.class) +public class Shape extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Shape.class.getName()); + + public static class ShapeSerializer extends StdSerializer { + public ShapeSerializer(Class t) { + super(t); + } + + public ShapeSerializer() { + this(null); + } + + @Override + public void serialize(Shape value, JsonGenerator jgen, SerializerProvider provider) throws JacksonException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class ShapeDeserializer extends StdDeserializer { + public ShapeDeserializer() { + this(Shape.class); + } + + public ShapeDeserializer(Class vc) { + super(vc); + } + + @Override + public Shape deserialize(JsonParser jp, DeserializationContext ctxt) throws JacksonException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + boolean typeCoercion = false; // MapperFeature.ALLOW_COERCION_OF_SCALARS was removed in Jackson 3 + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize Quadrilateral + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class) || Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class) || Quadrilateral.class.equals(Boolean.class) || Quadrilateral.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (Quadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (Quadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'Quadrilateral'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Quadrilateral'", e); + } + + // deserialize Triangle + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class) || Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class) || Triangle.class.equals(Boolean.class) || Triangle.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (Triangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (Triangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'Triangle'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Triangle'", e); + } + + if (match == 1) { + Shape ret = new Shape(); + ret.setActualInstance(deserialized); + return ret; + } + throw DatabindException.from(jp, String.format(java.util.Locale.ROOT, "Failed deserialization for Shape: %d classes match result, expected 1", match)); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public Shape getNullValue(DeserializationContext ctxt) { + throw DatabindException.from(ctxt.getParser(), "Shape cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap<>(); + + public Shape() { + super("oneOf", Boolean.FALSE); + } + + public Shape(Quadrilateral o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Shape(Triangle o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Quadrilateral", Quadrilateral.class); + schemas.put("Triangle", Triangle.class); + JSON.registerDescendants(Shape.class, Collections.unmodifiableMap(schemas)); + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("Quadrilateral", Quadrilateral.class); + mappings.put("Triangle", Triangle.class); + mappings.put("Shape", Shape.class); + JSON.registerDiscriminator(Shape.class, "shapeType", mappings); + } + + @Override + public Map> getSchemas() { + return Shape.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Quadrilateral, Triangle + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(Triangle.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Quadrilateral, Triangle"); + } + + /** + * Get the actual instance, which can be the following: + * Quadrilateral, Triangle + * + * @return The actual instance (Quadrilateral, Triangle) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Quadrilateral` + * @throws ClassCastException if the instance is not `Quadrilateral` + */ + public Quadrilateral getQuadrilateral() throws ClassCastException { + return (Quadrilateral)super.getActualInstance(); + } + + /** + * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Triangle` + * @throws ClassCastException if the instance is not `Triangle` + */ + public Triangle getTriangle() throws ClassCastException { + return (Triangle)super.getActualInstance(); + } + + + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + if (getActualInstance() instanceof Triangle) { + if (getActualInstance() != null) { + joiner.add(((Triangle)getActualInstance()).toUrlQueryString(prefix + "one_of_0" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof Quadrilateral) { + if (getActualInstance() != null) { + joiner.add(((Quadrilateral)getActualInstance()).toUrlQueryString(prefix + "one_of_1" + suffix)); + } + return joiner.toString(); + } + return null; + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ShapeInterface.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ShapeInterface.java new file mode 100644 index 000000000000..2039b965b374 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ShapeInterface.java @@ -0,0 +1,200 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * ShapeInterface + */ +@JsonPropertyOrder({ + ShapeInterface.JSON_PROPERTY_SHAPE_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class ShapeInterface { + public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + @javax.annotation.Nonnull + private String shapeType; + + public ShapeInterface() { + } + + public ShapeInterface shapeType(@javax.annotation.Nonnull String shapeType) { + this.shapeType = shapeType; + return this; + } + + /** + * Get shapeType + * @return shapeType + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getShapeType() { + return shapeType; + } + + + @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setShapeType(@javax.annotation.Nonnull String shapeType) { + this.shapeType = shapeType; + } + + + /** + * Return true if this ShapeInterface object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ShapeInterface {\n"); + sb.append(" shapeType: ").append(toIndentedString(shapeType)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `shapeType` to the URL query string + if (getShapeType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sshapeType%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getShapeType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private ShapeInterface instance; + + public Builder() { + this(new ShapeInterface()); + } + + protected Builder(ShapeInterface instance) { + this.instance = instance; + } + + public ShapeInterface.Builder shapeType(String shapeType) { + this.instance.shapeType = shapeType; + return this; + } + + + /** + * returns a built ShapeInterface instance. + * + * The builder is not reusable. + */ + public ShapeInterface build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ShapeInterface.Builder builder() { + return new ShapeInterface.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ShapeInterface.Builder toBuilder() { + return new ShapeInterface.Builder() + .shapeType(getShapeType()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ShapeOrNull.java new file mode 100644 index 000000000000..6789c7799d93 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -0,0 +1,306 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.openapitools.client.model.Quadrilateral; +import org.openapitools.client.model.Triangle; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import tools.jackson.core.type.TypeReference; + +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import tools.jackson.core.JacksonException; +import tools.jackson.core.JsonGenerator; +import tools.jackson.core.JsonParser; +import tools.jackson.core.JsonToken; +import tools.jackson.databind.DeserializationContext; +import tools.jackson.databind.DatabindException; +import tools.jackson.databind.JsonNode; +import tools.jackson.databind.SerializerProvider; +import tools.jackson.databind.annotation.JsonDeserialize; +import tools.jackson.databind.annotation.JsonSerialize; +import tools.jackson.databind.deser.std.StdDeserializer; +import tools.jackson.databind.ser.std.StdSerializer; +import org.openapitools.client.ApiClient; +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +@JsonDeserialize(using = ShapeOrNull.ShapeOrNullDeserializer.class) +@JsonSerialize(using = ShapeOrNull.ShapeOrNullSerializer.class) +public class ShapeOrNull extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(ShapeOrNull.class.getName()); + + public static class ShapeOrNullSerializer extends StdSerializer { + public ShapeOrNullSerializer(Class t) { + super(t); + } + + public ShapeOrNullSerializer() { + this(null); + } + + @Override + public void serialize(ShapeOrNull value, JsonGenerator jgen, SerializerProvider provider) throws JacksonException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class ShapeOrNullDeserializer extends StdDeserializer { + public ShapeOrNullDeserializer() { + this(ShapeOrNull.class); + } + + public ShapeOrNullDeserializer(Class vc) { + super(vc); + } + + @Override + public ShapeOrNull deserialize(JsonParser jp, DeserializationContext ctxt) throws JacksonException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + boolean typeCoercion = false; // MapperFeature.ALLOW_COERCION_OF_SCALARS was removed in Jackson 3 + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize Quadrilateral + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class) || Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class) || Quadrilateral.class.equals(Boolean.class) || Quadrilateral.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (Quadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (Quadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'Quadrilateral'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Quadrilateral'", e); + } + + // deserialize Triangle + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class) || Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class) || Triangle.class.equals(Boolean.class) || Triangle.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (Triangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (Triangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'Triangle'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Triangle'", e); + } + + if (match == 1) { + ShapeOrNull ret = new ShapeOrNull(); + ret.setActualInstance(deserialized); + return ret; + } + throw DatabindException.from(jp, String.format(java.util.Locale.ROOT, "Failed deserialization for ShapeOrNull: %d classes match result, expected 1", match)); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public ShapeOrNull getNullValue(DeserializationContext ctxt) { + throw DatabindException.from(ctxt.getParser(), "ShapeOrNull cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap<>(); + + public ShapeOrNull() { + super("oneOf", Boolean.FALSE); + } + + public ShapeOrNull(Quadrilateral o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public ShapeOrNull(Triangle o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Quadrilateral", Quadrilateral.class); + schemas.put("Triangle", Triangle.class); + JSON.registerDescendants(ShapeOrNull.class, Collections.unmodifiableMap(schemas)); + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("Quadrilateral", Quadrilateral.class); + mappings.put("Triangle", Triangle.class); + mappings.put("ShapeOrNull", ShapeOrNull.class); + JSON.registerDiscriminator(ShapeOrNull.class, "shapeType", mappings); + } + + @Override + public Map> getSchemas() { + return ShapeOrNull.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Quadrilateral, Triangle + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(Triangle.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Quadrilateral, Triangle"); + } + + /** + * Get the actual instance, which can be the following: + * Quadrilateral, Triangle + * + * @return The actual instance (Quadrilateral, Triangle) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Quadrilateral`. If the actual instance is not `Quadrilateral`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Quadrilateral` + * @throws ClassCastException if the instance is not `Quadrilateral` + */ + public Quadrilateral getQuadrilateral() throws ClassCastException { + return (Quadrilateral)super.getActualInstance(); + } + + /** + * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Triangle` + * @throws ClassCastException if the instance is not `Triangle` + */ + public Triangle getTriangle() throws ClassCastException { + return (Triangle)super.getActualInstance(); + } + + + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + if (getActualInstance() instanceof Triangle) { + if (getActualInstance() != null) { + joiner.add(((Triangle)getActualInstance()).toUrlQueryString(prefix + "one_of_0" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof Quadrilateral) { + if (getActualInstance() != null) { + joiner.add(((Quadrilateral)getActualInstance()).toUrlQueryString(prefix + "one_of_1" + suffix)); + } + return joiner.toString(); + } + return null; + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java new file mode 100644 index 000000000000..397edad8ae0f --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java @@ -0,0 +1,240 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * SimpleQuadrilateral + */ +@JsonPropertyOrder({ + SimpleQuadrilateral.JSON_PROPERTY_SHAPE_TYPE, + SimpleQuadrilateral.JSON_PROPERTY_QUADRILATERAL_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class SimpleQuadrilateral { + public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + @javax.annotation.Nonnull + private String shapeType; + + public static final String JSON_PROPERTY_QUADRILATERAL_TYPE = "quadrilateralType"; + @javax.annotation.Nonnull + private String quadrilateralType; + + public SimpleQuadrilateral() { + } + + public SimpleQuadrilateral shapeType(@javax.annotation.Nonnull String shapeType) { + this.shapeType = shapeType; + return this; + } + + /** + * Get shapeType + * @return shapeType + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getShapeType() { + return shapeType; + } + + + @JsonProperty(value = JSON_PROPERTY_SHAPE_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setShapeType(@javax.annotation.Nonnull String shapeType) { + this.shapeType = shapeType; + } + + + public SimpleQuadrilateral quadrilateralType(@javax.annotation.Nonnull String quadrilateralType) { + this.quadrilateralType = quadrilateralType; + return this; + } + + /** + * Get quadrilateralType + * @return quadrilateralType + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getQuadrilateralType() { + return quadrilateralType; + } + + + @JsonProperty(value = JSON_PROPERTY_QUADRILATERAL_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setQuadrilateralType(@javax.annotation.Nonnull String quadrilateralType) { + this.quadrilateralType = quadrilateralType; + } + + + /** + * Return true if this SimpleQuadrilateral object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SimpleQuadrilateral {\n"); + sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); + sb.append(" quadrilateralType: ").append(toIndentedString(quadrilateralType)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `shapeType` to the URL query string + if (getShapeType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sshapeType%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getShapeType())))); + } + + // add `quadrilateralType` to the URL query string + if (getQuadrilateralType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%squadrilateralType%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getQuadrilateralType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SimpleQuadrilateral instance; + + public Builder() { + this(new SimpleQuadrilateral()); + } + + protected Builder(SimpleQuadrilateral instance) { + this.instance = instance; + } + + public SimpleQuadrilateral.Builder shapeType(String shapeType) { + this.instance.shapeType = shapeType; + return this; + } + public SimpleQuadrilateral.Builder quadrilateralType(String quadrilateralType) { + this.instance.quadrilateralType = quadrilateralType; + return this; + } + + + /** + * returns a built SimpleQuadrilateral instance. + * + * The builder is not reusable. + */ + public SimpleQuadrilateral build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SimpleQuadrilateral.Builder builder() { + return new SimpleQuadrilateral.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SimpleQuadrilateral.Builder toBuilder() { + return new SimpleQuadrilateral.Builder() + .shapeType(getShapeType()) + .quadrilateralType(getQuadrilateralType()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/SpecialModelName.java new file mode 100644 index 000000000000..f948bb3f9176 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -0,0 +1,240 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * SpecialModelName + */ +@JsonPropertyOrder({ + SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME, + SpecialModelName.JSON_PROPERTY_SPECIAL_MODEL_NAME +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class SpecialModelName { + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + @javax.annotation.Nullable + private Long $specialPropertyName; + + public static final String JSON_PROPERTY_SPECIAL_MODEL_NAME = "_special_model.name_"; + @javax.annotation.Nullable + private String specialModelName; + + public SpecialModelName() { + } + + public SpecialModelName $specialPropertyName(@javax.annotation.Nullable Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + return this; + } + + /** + * Get $specialPropertyName + * @return $specialPropertyName + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long get$SpecialPropertyName() { + return $specialPropertyName; + } + + + @JsonProperty(value = JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set$SpecialPropertyName(@javax.annotation.Nullable Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + } + + + public SpecialModelName specialModelName(@javax.annotation.Nullable String specialModelName) { + this.specialModelName = specialModelName; + return this; + } + + /** + * Get specialModelName + * @return specialModelName + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SPECIAL_MODEL_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSpecialModelName() { + return specialModelName; + } + + + @JsonProperty(value = JSON_PROPERTY_SPECIAL_MODEL_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSpecialModelName(@javax.annotation.Nullable String specialModelName) { + this.specialModelName = specialModelName; + } + + + /** + * Return true if this _special_model.name_ object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialModelName {\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); + sb.append(" specialModelName: ").append(toIndentedString(specialModelName)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `$special[property.name]` to the URL query string + if (get$SpecialPropertyName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%s$special[property.name]%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(get$SpecialPropertyName())))); + } + + // add `_special_model.name_` to the URL query string + if (getSpecialModelName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%s_special_model.name_%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSpecialModelName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private SpecialModelName instance; + + public Builder() { + this(new SpecialModelName()); + } + + protected Builder(SpecialModelName instance) { + this.instance = instance; + } + + public SpecialModelName.Builder $specialPropertyName(Long $specialPropertyName) { + this.instance.$specialPropertyName = $specialPropertyName; + return this; + } + public SpecialModelName.Builder specialModelName(String specialModelName) { + this.instance.specialModelName = specialModelName; + return this; + } + + + /** + * returns a built SpecialModelName instance. + * + * The builder is not reusable. + */ + public SpecialModelName build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SpecialModelName.Builder builder() { + return new SpecialModelName.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SpecialModelName.Builder toBuilder() { + return new SpecialModelName.Builder() + .$specialPropertyName(get$SpecialPropertyName()) + .specialModelName(getSpecialModelName()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Tag.java new file mode 100644 index 000000000000..6ef417202e61 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Tag.java @@ -0,0 +1,240 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * Tag + */ +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class Tag { + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nullable + private String name; + + public Tag() { + } + + public Tag id(@javax.annotation.Nullable Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + + @JsonProperty(value = JSON_PROPERTY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable Long id) { + this.id = id; + } + + + public Tag name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + /** + * Return true if this Tag object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private Tag instance; + + public Builder() { + this(new Tag()); + } + + protected Builder(Tag instance) { + this.instance = instance; + } + + public Tag.Builder id(Long id) { + this.instance.id = id; + return this; + } + public Tag.Builder name(String name) { + this.instance.name = name; + return this; + } + + + /** + * returns a built Tag instance. + * + * The builder is not reusable. + */ + public Tag build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Tag.Builder builder() { + return new Tag.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Tag.Builder toBuilder() { + return new Tag.Builder() + .id(getId()) + .name(getName()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 000000000000..70e8127bbbf7 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,248 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * TestInlineFreeformAdditionalPropertiesRequest + */ +@JsonPropertyOrder({ + TestInlineFreeformAdditionalPropertiesRequest.JSON_PROPERTY_SOME_PROPERTY +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class TestInlineFreeformAdditionalPropertiesRequest { + public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty"; + @javax.annotation.Nullable + private String someProperty; + + public TestInlineFreeformAdditionalPropertiesRequest() { + } + + public TestInlineFreeformAdditionalPropertiesRequest someProperty(@javax.annotation.Nullable String someProperty) { + this.someProperty = someProperty; + return this; + } + + /** + * Get someProperty + * @return someProperty + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SOME_PROPERTY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSomeProperty() { + return someProperty; + } + + + @JsonProperty(value = JSON_PROPERTY_SOME_PROPERTY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSomeProperty(@javax.annotation.Nullable String someProperty) { + this.someProperty = someProperty; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * @param key the name of the property + * @param value the value of the property + * @return self reference + */ + @JsonAnySetter + public TestInlineFreeformAdditionalPropertiesRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) properties. + * @return the additional (undeclared) properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * @param key the name of the property + * @return the additional (undeclared) property with the specified name + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this testInlineFreeformAdditionalProperties_request object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `someProperty` to the URL query string + if (getSomeProperty() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%ssomeProperty%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getSomeProperty())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private TestInlineFreeformAdditionalPropertiesRequest instance; + + public Builder() { + this(new TestInlineFreeformAdditionalPropertiesRequest()); + } + + protected Builder(TestInlineFreeformAdditionalPropertiesRequest instance) { + this.instance = instance; + } + + public TestInlineFreeformAdditionalPropertiesRequest.Builder someProperty(String someProperty) { + this.instance.someProperty = someProperty; + return this; + } + + + /** + * returns a built TestInlineFreeformAdditionalPropertiesRequest instance. + * + * The builder is not reusable. + */ + public TestInlineFreeformAdditionalPropertiesRequest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TestInlineFreeformAdditionalPropertiesRequest.Builder builder() { + return new TestInlineFreeformAdditionalPropertiesRequest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TestInlineFreeformAdditionalPropertiesRequest.Builder toBuilder() { + return new TestInlineFreeformAdditionalPropertiesRequest.Builder() + .someProperty(getSomeProperty()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Triangle.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Triangle.java new file mode 100644 index 000000000000..6ae8d495362c --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Triangle.java @@ -0,0 +1,362 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.openapitools.client.model.EquilateralTriangle; +import org.openapitools.client.model.IsoscelesTriangle; +import org.openapitools.client.model.ScaleneTriangle; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import tools.jackson.core.type.TypeReference; + +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import tools.jackson.core.JacksonException; +import tools.jackson.core.JsonGenerator; +import tools.jackson.core.JsonParser; +import tools.jackson.core.JsonToken; +import tools.jackson.databind.DeserializationContext; +import tools.jackson.databind.DatabindException; +import tools.jackson.databind.JsonNode; +import tools.jackson.databind.SerializerProvider; +import tools.jackson.databind.annotation.JsonDeserialize; +import tools.jackson.databind.annotation.JsonSerialize; +import tools.jackson.databind.deser.std.StdDeserializer; +import tools.jackson.databind.ser.std.StdSerializer; +import org.openapitools.client.ApiClient; +import org.openapitools.client.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +@JsonDeserialize(using = Triangle.TriangleDeserializer.class) +@JsonSerialize(using = Triangle.TriangleSerializer.class) +public class Triangle extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(Triangle.class.getName()); + + public static class TriangleSerializer extends StdSerializer { + public TriangleSerializer(Class t) { + super(t); + } + + public TriangleSerializer() { + this(null); + } + + @Override + public void serialize(Triangle value, JsonGenerator jgen, SerializerProvider provider) throws JacksonException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class TriangleDeserializer extends StdDeserializer { + public TriangleDeserializer() { + this(Triangle.class); + } + + public TriangleDeserializer(Class vc) { + super(vc); + } + + @Override + public Triangle deserialize(JsonParser jp, DeserializationContext ctxt) throws JacksonException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + boolean typeCoercion = false; // MapperFeature.ALLOW_COERCION_OF_SCALARS was removed in Jackson 3 + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize EquilateralTriangle + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (EquilateralTriangle.class.equals(Integer.class) || EquilateralTriangle.class.equals(Long.class) || EquilateralTriangle.class.equals(Float.class) || EquilateralTriangle.class.equals(Double.class) || EquilateralTriangle.class.equals(Boolean.class) || EquilateralTriangle.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((EquilateralTriangle.class.equals(Integer.class) || EquilateralTriangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((EquilateralTriangle.class.equals(Float.class) || EquilateralTriangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (EquilateralTriangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (EquilateralTriangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(EquilateralTriangle.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'EquilateralTriangle'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'EquilateralTriangle'", e); + } + + // deserialize IsoscelesTriangle + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (IsoscelesTriangle.class.equals(Integer.class) || IsoscelesTriangle.class.equals(Long.class) || IsoscelesTriangle.class.equals(Float.class) || IsoscelesTriangle.class.equals(Double.class) || IsoscelesTriangle.class.equals(Boolean.class) || IsoscelesTriangle.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((IsoscelesTriangle.class.equals(Integer.class) || IsoscelesTriangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((IsoscelesTriangle.class.equals(Float.class) || IsoscelesTriangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (IsoscelesTriangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (IsoscelesTriangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(IsoscelesTriangle.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'IsoscelesTriangle'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'IsoscelesTriangle'", e); + } + + // deserialize ScaleneTriangle + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ScaleneTriangle.class.equals(Integer.class) || ScaleneTriangle.class.equals(Long.class) || ScaleneTriangle.class.equals(Float.class) || ScaleneTriangle.class.equals(Double.class) || ScaleneTriangle.class.equals(Boolean.class) || ScaleneTriangle.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((ScaleneTriangle.class.equals(Integer.class) || ScaleneTriangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((ScaleneTriangle.class.equals(Float.class) || ScaleneTriangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (ScaleneTriangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (ScaleneTriangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(ScaleneTriangle.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'ScaleneTriangle'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'ScaleneTriangle'", e); + } + + if (match == 1) { + Triangle ret = new Triangle(); + ret.setActualInstance(deserialized); + return ret; + } + throw DatabindException.from(jp, String.format(java.util.Locale.ROOT, "Failed deserialization for Triangle: %d classes match result, expected 1", match)); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public Triangle getNullValue(DeserializationContext ctxt) { + throw DatabindException.from(ctxt.getParser(), "Triangle cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap<>(); + + public Triangle() { + super("oneOf", Boolean.FALSE); + } + + public Triangle(EquilateralTriangle o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Triangle(IsoscelesTriangle o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public Triangle(ScaleneTriangle o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("EquilateralTriangle", EquilateralTriangle.class); + schemas.put("IsoscelesTriangle", IsoscelesTriangle.class); + schemas.put("ScaleneTriangle", ScaleneTriangle.class); + JSON.registerDescendants(Triangle.class, Collections.unmodifiableMap(schemas)); + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("EquilateralTriangle", EquilateralTriangle.class); + mappings.put("IsoscelesTriangle", IsoscelesTriangle.class); + mappings.put("ScaleneTriangle", ScaleneTriangle.class); + mappings.put("Triangle", Triangle.class); + JSON.registerDiscriminator(Triangle.class, "triangleType", mappings); + } + + @Override + public Map> getSchemas() { + return Triangle.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(EquilateralTriangle.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(IsoscelesTriangle.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(ScaleneTriangle.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle"); + } + + /** + * Get the actual instance, which can be the following: + * EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle + * + * @return The actual instance (EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `EquilateralTriangle`. If the actual instance is not `EquilateralTriangle`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `EquilateralTriangle` + * @throws ClassCastException if the instance is not `EquilateralTriangle` + */ + public EquilateralTriangle getEquilateralTriangle() throws ClassCastException { + return (EquilateralTriangle)super.getActualInstance(); + } + + /** + * Get the actual instance of `IsoscelesTriangle`. If the actual instance is not `IsoscelesTriangle`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `IsoscelesTriangle` + * @throws ClassCastException if the instance is not `IsoscelesTriangle` + */ + public IsoscelesTriangle getIsoscelesTriangle() throws ClassCastException { + return (IsoscelesTriangle)super.getActualInstance(); + } + + /** + * Get the actual instance of `ScaleneTriangle`. If the actual instance is not `ScaleneTriangle`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ScaleneTriangle` + * @throws ClassCastException if the instance is not `ScaleneTriangle` + */ + public ScaleneTriangle getScaleneTriangle() throws ClassCastException { + return (ScaleneTriangle)super.getActualInstance(); + } + + + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + if (getActualInstance() instanceof EquilateralTriangle) { + if (getActualInstance() != null) { + joiner.add(((EquilateralTriangle)getActualInstance()).toUrlQueryString(prefix + "one_of_0" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof IsoscelesTriangle) { + if (getActualInstance() != null) { + joiner.add(((IsoscelesTriangle)getActualInstance()).toUrlQueryString(prefix + "one_of_1" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof ScaleneTriangle) { + if (getActualInstance() != null) { + joiner.add(((ScaleneTriangle)getActualInstance()).toUrlQueryString(prefix + "one_of_2" + suffix)); + } + return joiner.toString(); + } + return null; + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/TriangleInterface.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/TriangleInterface.java new file mode 100644 index 000000000000..073285644bdb --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/TriangleInterface.java @@ -0,0 +1,200 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * TriangleInterface + */ +@JsonPropertyOrder({ + TriangleInterface.JSON_PROPERTY_TRIANGLE_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class TriangleInterface { + public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; + @javax.annotation.Nonnull + private String triangleType; + + public TriangleInterface() { + } + + public TriangleInterface triangleType(@javax.annotation.Nonnull String triangleType) { + this.triangleType = triangleType; + return this; + } + + /** + * Get triangleType + * @return triangleType + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTriangleType() { + return triangleType; + } + + + @JsonProperty(value = JSON_PROPERTY_TRIANGLE_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTriangleType(@javax.annotation.Nonnull String triangleType) { + this.triangleType = triangleType; + } + + + /** + * Return true if this TriangleInterface object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TriangleInterface {\n"); + sb.append(" triangleType: ").append(toIndentedString(triangleType)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `triangleType` to the URL query string + if (getTriangleType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%striangleType%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getTriangleType())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private TriangleInterface instance; + + public Builder() { + this(new TriangleInterface()); + } + + protected Builder(TriangleInterface instance) { + this.instance = instance; + } + + public TriangleInterface.Builder triangleType(String triangleType) { + this.instance.triangleType = triangleType; + return this; + } + + + /** + * returns a built TriangleInterface instance. + * + * The builder is not reusable. + */ + public TriangleInterface build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TriangleInterface.Builder builder() { + return new TriangleInterface.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TriangleInterface.Builder toBuilder() { + return new TriangleInterface.Builder() + .triangleType(getTriangleType()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/User.java new file mode 100644 index 000000000000..f9e4d73ae73d --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/User.java @@ -0,0 +1,640 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * User + */ +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS, + User.JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS, + User.JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE, + User.JSON_PROPERTY_ANY_TYPE_PROP, + User.JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class User { + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable + private Long id; + + public static final String JSON_PROPERTY_USERNAME = "username"; + @javax.annotation.Nullable + private String username; + + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + @javax.annotation.Nullable + private String firstName; + + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + @javax.annotation.Nullable + private String lastName; + + public static final String JSON_PROPERTY_EMAIL = "email"; + @javax.annotation.Nullable + private String email; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + @javax.annotation.Nullable + private String password; + + public static final String JSON_PROPERTY_PHONE = "phone"; + @javax.annotation.Nullable + private String phone; + + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + @javax.annotation.Nullable + private Integer userStatus; + + public static final String JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS = "objectWithNoDeclaredProps"; + @javax.annotation.Nullable + private Object objectWithNoDeclaredProps; + + public static final String JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE = "objectWithNoDeclaredPropsNullable"; + @javax.annotation.Nullable + private Object objectWithNoDeclaredPropsNullable; + + public static final String JSON_PROPERTY_ANY_TYPE_PROP = "anyTypeProp"; + @javax.annotation.Nullable + private Object anyTypeProp = null; + + public static final String JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE = "anyTypePropNullable"; + @javax.annotation.Nullable + private Object anyTypePropNullable = null; + + public User() { + } + + public User id(@javax.annotation.Nullable Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + + @JsonProperty(value = JSON_PROPERTY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable Long id) { + this.id = id; + } + + + public User username(@javax.annotation.Nullable String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_USERNAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { + return username; + } + + + @JsonProperty(value = JSON_PROPERTY_USERNAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(@javax.annotation.Nullable String username) { + this.username = username; + } + + + public User firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FIRST_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFirstName() { + return firstName; + } + + + @JsonProperty(value = JSON_PROPERTY_FIRST_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public User lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_LAST_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastName() { + return lastName; + } + + + @JsonProperty(value = JSON_PROPERTY_LAST_NAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public User email(@javax.annotation.Nullable String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EMAIL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { + return email; + } + + + @JsonProperty(value = JSON_PROPERTY_EMAIL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(@javax.annotation.Nullable String email) { + this.email = email; + } + + + public User password(@javax.annotation.Nullable String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { + return password; + } + + + @JsonProperty(value = JSON_PROPERTY_PASSWORD, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(@javax.annotation.Nullable String password) { + this.password = password; + } + + + public User phone(@javax.annotation.Nullable String phone) { + this.phone = phone; + return this; + } + + /** + * Get phone + * @return phone + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PHONE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPhone() { + return phone; + } + + + @JsonProperty(value = JSON_PROPERTY_PHONE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPhone(@javax.annotation.Nullable String phone) { + this.phone = phone; + } + + + public User userStatus(@javax.annotation.Nullable Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + /** + * User Status + * @return userStatus + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_USER_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUserStatus() { + return userStatus; + } + + + @JsonProperty(value = JSON_PROPERTY_USER_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserStatus(@javax.annotation.Nullable Integer userStatus) { + this.userStatus = userStatus; + } + + + public User objectWithNoDeclaredProps(@javax.annotation.Nullable Object objectWithNoDeclaredProps) { + this.objectWithNoDeclaredProps = objectWithNoDeclaredProps; + return this; + } + + /** + * test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. + * @return objectWithNoDeclaredProps + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getObjectWithNoDeclaredProps() { + return objectWithNoDeclaredProps; + } + + + @JsonProperty(value = JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setObjectWithNoDeclaredProps(@javax.annotation.Nullable Object objectWithNoDeclaredProps) { + this.objectWithNoDeclaredProps = objectWithNoDeclaredProps; + } + + + public User objectWithNoDeclaredPropsNullable(@javax.annotation.Nullable Object objectWithNoDeclaredPropsNullable) { + this.objectWithNoDeclaredPropsNullable = objectWithNoDeclaredPropsNullable; + return this; + } + + /** + * test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. + * @return objectWithNoDeclaredPropsNullable + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getObjectWithNoDeclaredPropsNullable() { + return objectWithNoDeclaredPropsNullable; + } + + + @JsonProperty(value = JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setObjectWithNoDeclaredPropsNullable(@javax.annotation.Nullable Object objectWithNoDeclaredPropsNullable) { + this.objectWithNoDeclaredPropsNullable = objectWithNoDeclaredPropsNullable; + } + + + public User anyTypeProp(@javax.annotation.Nullable Object anyTypeProp) { + this.anyTypeProp = anyTypeProp; + return this; + } + + /** + * test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + * @return anyTypeProp + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ANY_TYPE_PROP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnyTypeProp() { + return anyTypeProp; + } + + + @JsonProperty(value = JSON_PROPERTY_ANY_TYPE_PROP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAnyTypeProp(@javax.annotation.Nullable Object anyTypeProp) { + this.anyTypeProp = anyTypeProp; + } + + + public User anyTypePropNullable(@javax.annotation.Nullable Object anyTypePropNullable) { + this.anyTypePropNullable = anyTypePropNullable; + return this; + } + + /** + * test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. + * @return anyTypePropNullable + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAnyTypePropNullable() { + return anyTypePropNullable; + } + + + @JsonProperty(value = JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAnyTypePropNullable(@javax.annotation.Nullable Object anyTypePropNullable) { + this.anyTypePropNullable = anyTypePropNullable; + } + + + /** + * Return true if this User object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @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(" objectWithNoDeclaredProps: ").append(toIndentedString(objectWithNoDeclaredProps)).append("\n"); + sb.append(" objectWithNoDeclaredPropsNullable: ").append(toIndentedString(objectWithNoDeclaredPropsNullable)).append("\n"); + sb.append(" anyTypeProp: ").append(toIndentedString(anyTypeProp)).append("\n"); + sb.append(" anyTypePropNullable: ").append(toIndentedString(anyTypePropNullable)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId())))); + } + + // add `username` to the URL query string + if (getUsername() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%susername%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUsername())))); + } + + // add `firstName` to the URL query string + if (getFirstName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sfirstName%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getFirstName())))); + } + + // add `lastName` to the URL query string + if (getLastName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%slastName%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getLastName())))); + } + + // add `email` to the URL query string + if (getEmail() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%semail%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getEmail())))); + } + + // add `password` to the URL query string + if (getPassword() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%spassword%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPassword())))); + } + + // add `phone` to the URL query string + if (getPhone() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sphone%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getPhone())))); + } + + // add `userStatus` to the URL query string + if (getUserStatus() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%suserStatus%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getUserStatus())))); + } + + // add `objectWithNoDeclaredProps` to the URL query string + if (getObjectWithNoDeclaredProps() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sobjectWithNoDeclaredProps%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getObjectWithNoDeclaredProps())))); + } + + // add `objectWithNoDeclaredPropsNullable` to the URL query string + if (getObjectWithNoDeclaredPropsNullable() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sobjectWithNoDeclaredPropsNullable%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getObjectWithNoDeclaredPropsNullable())))); + } + + // add `anyTypeProp` to the URL query string + if (getAnyTypeProp() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sanyTypeProp%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAnyTypeProp())))); + } + + // add `anyTypePropNullable` to the URL query string + if (getAnyTypePropNullable() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sanyTypePropNullable%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAnyTypePropNullable())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private User instance; + + public Builder() { + this(new User()); + } + + protected Builder(User instance) { + this.instance = instance; + } + + public User.Builder id(Long id) { + this.instance.id = id; + return this; + } + public User.Builder username(String username) { + this.instance.username = username; + return this; + } + public User.Builder firstName(String firstName) { + this.instance.firstName = firstName; + return this; + } + public User.Builder lastName(String lastName) { + this.instance.lastName = lastName; + return this; + } + public User.Builder email(String email) { + this.instance.email = email; + return this; + } + public User.Builder password(String password) { + this.instance.password = password; + return this; + } + public User.Builder phone(String phone) { + this.instance.phone = phone; + return this; + } + public User.Builder userStatus(Integer userStatus) { + this.instance.userStatus = userStatus; + return this; + } + public User.Builder objectWithNoDeclaredProps(Object objectWithNoDeclaredProps) { + this.instance.objectWithNoDeclaredProps = objectWithNoDeclaredProps; + return this; + } + public User.Builder objectWithNoDeclaredPropsNullable(Object objectWithNoDeclaredPropsNullable) { + this.instance.objectWithNoDeclaredPropsNullable = objectWithNoDeclaredPropsNullable; + return this; + } + public User.Builder anyTypeProp(Object anyTypeProp) { + this.instance.anyTypeProp = anyTypeProp; + return this; + } + public User.Builder anyTypePropNullable(Object anyTypePropNullable) { + this.instance.anyTypePropNullable = anyTypePropNullable; + return this; + } + + + /** + * returns a built User instance. + * + * The builder is not reusable. + */ + public User build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static User.Builder builder() { + return new User.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public User.Builder toBuilder() { + return new User.Builder() + .id(getId()) + .username(getUsername()) + .firstName(getFirstName()) + .lastName(getLastName()) + .email(getEmail()) + .password(getPassword()) + .phone(getPhone()) + .userStatus(getUserStatus()) + .objectWithNoDeclaredProps(getObjectWithNoDeclaredProps()) + .objectWithNoDeclaredPropsNullable(getObjectWithNoDeclaredPropsNullable()) + .anyTypeProp(getAnyTypeProp()) + .anyTypePropNullable(getAnyTypePropNullable()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Whale.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Whale.java new file mode 100644 index 000000000000..e72e4a3de003 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Whale.java @@ -0,0 +1,280 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.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; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * Whale + */ +@JsonPropertyOrder({ + Whale.JSON_PROPERTY_HAS_BALEEN, + Whale.JSON_PROPERTY_HAS_TEETH, + Whale.JSON_PROPERTY_CLASS_NAME +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class Whale { + public static final String JSON_PROPERTY_HAS_BALEEN = "hasBaleen"; + @javax.annotation.Nullable + private Boolean hasBaleen; + + public static final String JSON_PROPERTY_HAS_TEETH = "hasTeeth"; + @javax.annotation.Nullable + private Boolean hasTeeth; + + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @javax.annotation.Nonnull + private String className; + + public Whale() { + } + + public Whale hasBaleen(@javax.annotation.Nullable Boolean hasBaleen) { + this.hasBaleen = hasBaleen; + return this; + } + + /** + * Get hasBaleen + * @return hasBaleen + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HAS_BALEEN, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasBaleen() { + return hasBaleen; + } + + + @JsonProperty(value = JSON_PROPERTY_HAS_BALEEN, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasBaleen(@javax.annotation.Nullable Boolean hasBaleen) { + this.hasBaleen = hasBaleen; + } + + + public Whale hasTeeth(@javax.annotation.Nullable Boolean hasTeeth) { + this.hasTeeth = hasTeeth; + return this; + } + + /** + * Get hasTeeth + * @return hasTeeth + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_HAS_TEETH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasTeeth() { + return hasTeeth; + } + + + @JsonProperty(value = JSON_PROPERTY_HAS_TEETH, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasTeeth(@javax.annotation.Nullable Boolean hasTeeth) { + this.hasTeeth = hasTeeth; + } + + + public Whale className(@javax.annotation.Nonnull String className) { + this.className = className; + return this; + } + + /** + * Get className + * @return className + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClassName() { + return className; + } + + + @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClassName(@javax.annotation.Nonnull String className) { + this.className = className; + } + + + /** + * Return true if this whale object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Whale {\n"); + sb.append(" hasBaleen: ").append(toIndentedString(hasBaleen)).append("\n"); + sb.append(" hasTeeth: ").append(toIndentedString(hasTeeth)).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `hasBaleen` to the URL query string + if (getHasBaleen() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%shasBaleen%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHasBaleen())))); + } + + // add `hasTeeth` to the URL query string + if (getHasTeeth() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%shasTeeth%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getHasTeeth())))); + } + + // add `className` to the URL query string + if (getClassName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sclassName%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getClassName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private Whale instance; + + public Builder() { + this(new Whale()); + } + + protected Builder(Whale instance) { + this.instance = instance; + } + + public Whale.Builder hasBaleen(Boolean hasBaleen) { + this.instance.hasBaleen = hasBaleen; + return this; + } + public Whale.Builder hasTeeth(Boolean hasTeeth) { + this.instance.hasTeeth = hasTeeth; + return this; + } + public Whale.Builder className(String className) { + this.instance.className = className; + return this; + } + + + /** + * returns a built Whale instance. + * + * The builder is not reusable. + */ + public Whale build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Whale.Builder builder() { + return new Whale.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Whale.Builder toBuilder() { + return new Whale.Builder() + .hasBaleen(getHasBaleen()) + .hasTeeth(getHasTeeth()) + .className(getClassName()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Zebra.java b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Zebra.java new file mode 100644 index 000000000000..8b4808d4ebd4 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/main/java/org/openapitools/client/model/Zebra.java @@ -0,0 +1,325 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.openapitools.client.ApiClient; +/** + * Zebra + */ +@JsonPropertyOrder({ + Zebra.JSON_PROPERTY_TYPE, + Zebra.JSON_PROPERTY_CLASS_NAME +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") +public class Zebra { + /** + * Gets or Sets type + */ + public enum TypeEnum { + PLAINS(String.valueOf("plains")), + + MOUNTAIN(String.valueOf("mountain")), + + GREVYS(String.valueOf("grevys")); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nullable + private TypeEnum type; + + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + @javax.annotation.Nonnull + private String className; + + public Zebra() { + } + + public Zebra type(@javax.annotation.Nullable TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TypeEnum getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@javax.annotation.Nullable TypeEnum type) { + this.type = type; + } + + + public Zebra className(@javax.annotation.Nonnull String className) { + this.className = className; + return this; + } + + /** + * Get className + * @return className + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClassName() { + return className; + } + + + @JsonProperty(value = JSON_PROPERTY_CLASS_NAME, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClassName(@javax.annotation.Nonnull String className) { + this.className = className; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * @param key the name of the property + * @param value the value of the property + * @return self reference + */ + @JsonAnySetter + public Zebra putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) properties. + * @return the additional (undeclared) properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * @param key the name of the property + * @return the additional (undeclared) property with the specified name + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this zebra object is equal to o. + */ + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Zebra {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%stype%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getType())))); + } + + // add `className` to the URL query string + if (getClassName() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sclassName%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getClassName())))); + } + + return joiner.toString(); + } + + public static class Builder { + + private Zebra instance; + + public Builder() { + this(new Zebra()); + } + + protected Builder(Zebra instance) { + this.instance = instance; + } + + public Zebra.Builder type(TypeEnum type) { + this.instance.type = type; + return this; + } + public Zebra.Builder className(String className) { + this.instance.className = className; + return this; + } + + + /** + * returns a built Zebra instance. + * + * The builder is not reusable. + */ + public Zebra build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Zebra.Builder builder() { + return new Zebra.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Zebra.Builder toBuilder() { + return new Zebra.Builder() + .type(getType()) + .className(getClassName()); + } + +} + diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java new file mode 100644 index 000000000000..20196cb83d97 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -0,0 +1,54 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.ApiException; +import org.openapitools.client.model.Client; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + + +/** + * API tests for AnotherFakeApi + */ +@Disabled +public class AnotherFakeApiTest { + + private final AnotherFakeApi api = new AnotherFakeApi(); + + + /** + * To test special tags + * + * To test special tags and operation ID starting with number + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void call123testSpecialTagsTest() throws ApiException { + Client client = null; + Client response = + api.call123testSpecialTags(client); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 000000000000..2571ef053445 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,53 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.ApiException; +import org.openapitools.client.model.FooGetDefaultResponse; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + + +/** + * API tests for DefaultApi + */ +@Disabled +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + + /** + * + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fooGetTest() throws ApiException { + FooGetDefaultResponse response = + api.fooGet(); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/api/FakeApiTest.java new file mode 100644 index 000000000000..b67953dddcdf --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -0,0 +1,424 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.ApiException; +import java.math.BigDecimal; +import org.openapitools.client.model.Client; +import org.openapitools.client.model.FakeBigDecimalMap200Response; +import java.io.File; +import org.openapitools.client.model.FileSchemaTestClass; +import org.openapitools.client.model.HealthCheckResult; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; +import org.openapitools.client.model.User; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + + +/** + * API tests for FakeApi + */ +@Disabled +public class FakeApiTest { + + private final FakeApi api = new FakeApi(); + + + /** + * + * + * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeBigDecimalMapTest() throws ApiException { + FakeBigDecimalMap200Response response = + api.fakeBigDecimalMap(); + + // TODO: test validations + } + + /** + * Health check endpoint + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeHealthGetTest() throws ApiException { + HealthCheckResult response = + api.fakeHealthGet(); + + // TODO: test validations + } + + /** + * + * + * Test serialization of outer boolean types + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterBooleanSerializeTest() throws ApiException { + Boolean body = null; + Boolean response = + api.fakeOuterBooleanSerialize(body); + + // TODO: test validations + } + + /** + * + * + * Test serialization of object with outer number type + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterCompositeSerializeTest() throws ApiException { + OuterComposite outerComposite = null; + OuterComposite response = + api.fakeOuterCompositeSerialize(outerComposite); + + // TODO: test validations + } + + /** + * + * + * Test serialization of outer number types + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterNumberSerializeTest() throws ApiException { + BigDecimal body = null; + BigDecimal response = + api.fakeOuterNumberSerialize(body); + + // TODO: test validations + } + + /** + * + * + * Test serialization of outer string types + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterStringSerializeTest() throws ApiException { + String body = null; + String response = + api.fakeOuterStringSerialize(body); + + // TODO: test validations + } + + /** + * application/json UTF8 + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getApplicationJsonUtf8Test() throws ApiException { + List response = + api.getApplicationJsonUtf8(); + + // TODO: test validations + } + + /** + * Array of Enums + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getArrayOfEnumsTest() throws ApiException { + List response = + api.getArrayOfEnums(); + + // TODO: test validations + } + + /** + * test referenced additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testAdditionalPropertiesReferenceTest() throws ApiException { + Map requestBody = null; + + api.testAdditionalPropertiesReference(requestBody); + + // TODO: test validations + } + + /** + * + * + * For this test, the body for this request much reference a schema named `File`. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithFileSchemaTest() throws ApiException { + FileSchemaTestClass fileSchemaTestClass = null; + + api.testBodyWithFileSchema(fileSchemaTestClass); + + // TODO: test validations + } + + /** + * + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithQueryParamsTest() throws ApiException { + String query = null; + User user = null; + + api.testBodyWithQueryParams(query, user); + + // TODO: test validations + } + + /** + * To test \"client\" model + * + * To test \"client\" model + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testClientModelTest() throws ApiException { + Client client = null; + Client response = + api.testClientModel(client); + + // TODO: test validations + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testEndpointParametersTest() throws ApiException { + BigDecimal number = null; + Double _double = null; + String patternWithoutDelimiter = null; + byte[] _byte = null; + Integer integer = null; + Integer int32 = null; + Long int64 = null; + Float _float = null; + String string = null; + File binary = null; + LocalDate date = null; + OffsetDateTime dateTime = null; + String password = null; + String paramCallback = null; + + api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + + // TODO: test validations + } + + /** + * To test enum parameters + * + * To test enum parameters + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testEnumParametersTest() throws ApiException { + List enumHeaderStringArray = null; + String enumHeaderString = null; + List enumQueryStringArray = null; + String enumQueryString = null; + Integer enumQueryInteger = null; + Double enumQueryDouble = null; + List enumFormStringArray = null; + String enumFormString = null; + + api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + + // TODO: test validations + } + + /** + * Fake endpoint to test group parameters (optional) + * + * Fake endpoint to test group parameters (optional) + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testGroupParametersTest() throws ApiException { + Integer requiredStringGroup = null; + Boolean requiredBooleanGroup = null; + Long requiredInt64Group = null; + Integer stringGroup = null; + Boolean booleanGroup = null; + Long int64Group = null; + + FakeApi.APItestGroupParametersRequest request = FakeApi.APItestGroupParametersRequest.newBuilder() + .requiredStringGroup(requiredStringGroup) + .requiredBooleanGroup(requiredBooleanGroup) + .requiredInt64Group(requiredInt64Group) + .stringGroup(stringGroup) + .booleanGroup(booleanGroup) + .int64Group(int64Group) + .build(); + + api.testGroupParameters(request); + + // TODO: test validations + } + + /** + * test inline additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testInlineAdditionalPropertiesTest() throws ApiException { + Map requestBody = null; + + api.testInlineAdditionalProperties(requestBody); + + // TODO: test validations + } + + /** + * test inline free-form additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testInlineFreeformAdditionalPropertiesTest() throws ApiException { + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = null; + + api.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + + // TODO: test validations + } + + /** + * test json serialization of form data + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testJsonFormDataTest() throws ApiException { + String param = null; + String param2 = null; + + api.testJsonFormData(param, param2); + + // TODO: test validations + } + + /** + * + * + * To test the collection format in query parameters + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testQueryParameterCollectionFormatTest() throws ApiException { + List pipe = null; + List ioutil = null; + List http = null; + List url = null; + List context = null; + + api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + + // TODO: test validations + } + + /** + * test referenced string map + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testStringMapReferenceTest() throws ApiException { + Map requestBody = null; + + api.testStringMapReference(requestBody); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java new file mode 100644 index 000000000000..421d2506d7e9 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -0,0 +1,54 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.ApiException; +import org.openapitools.client.model.Client; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + + +/** + * API tests for FakeClassnameTags123Api + */ +@Disabled +public class FakeClassnameTags123ApiTest { + + private final FakeClassnameTags123Api api = new FakeClassnameTags123Api(); + + + /** + * To test class name in snake case + * + * To test class name in snake case + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testClassnameTest() throws ApiException { + Client client = null; + Client response = + api.testClassname(client); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/api/PetApiTest.java new file mode 100644 index 000000000000..7de9898c8e79 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -0,0 +1,199 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.ApiException; +import java.io.File; +import org.openapitools.client.model.ModelApiResponse; +import org.openapitools.client.model.Pet; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + + +/** + * API tests for PetApi + */ +@Disabled +public class PetApiTest { + + private final PetApi api = new PetApi(); + + + /** + * Add a new pet to the store + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void addPetTest() throws ApiException { + Pet pet = null; + + api.addPet(pet); + + // TODO: test validations + } + + /** + * Deletes a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deletePetTest() throws ApiException { + Long petId = null; + String apiKey = null; + + api.deletePet(petId, apiKey); + + // TODO: test validations + } + + /** + * 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() throws ApiException { + List status = null; + List response = + api.findPetsByStatus(status); + + // TODO: test validations + } + + /** + * 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() throws ApiException { + List tags = null; + List response = + api.findPetsByTags(tags); + + // TODO: test validations + } + + /** + * Find pet by ID + * + * Returns a single pet + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getPetByIdTest() throws ApiException { + Long petId = null; + Pet response = + api.getPetById(petId); + + // TODO: test validations + } + + /** + * Update an existing pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updatePetTest() throws ApiException { + Pet pet = null; + + api.updatePet(pet); + + // TODO: test validations + } + + /** + * Updates a pet in the store with form data + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updatePetWithFormTest() throws ApiException { + Long petId = null; + String name = null; + String status = null; + + api.updatePetWithForm(petId, name, status); + + // TODO: test validations + } + + /** + * uploads an image + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void uploadFileTest() throws ApiException { + Long petId = null; + String additionalMetadata = null; + File _file = null; + ModelApiResponse response = + api.uploadFile(petId, additionalMetadata, _file); + + // TODO: test validations + } + + /** + * uploads an image (required) + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void uploadFileWithRequiredFileTest() throws ApiException { + Long petId = null; + File requiredFile = null; + String additionalMetadata = null; + ModelApiResponse response = + api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/api/StoreApiTest.java new file mode 100644 index 000000000000..b29f783bc29a --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -0,0 +1,104 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.ApiException; +import org.openapitools.client.model.Order; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + + +/** + * API tests for StoreApi + */ +@Disabled +public class StoreApiTest { + + private final StoreApi api = new StoreApi(); + + + /** + * 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() throws ApiException { + String orderId = null; + + api.deleteOrder(orderId); + + // TODO: test validations + } + + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getInventoryTest() throws ApiException { + Map response = + api.getInventory(); + + // TODO: test validations + } + + /** + * 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() throws ApiException { + Long orderId = null; + Order response = + api.getOrderById(orderId); + + // TODO: test validations + } + + /** + * Place an order for a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void placeOrderTest() throws ApiException { + Order order = null; + Order response = + api.placeOrder(order); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/api/UserApiTest.java new file mode 100644 index 000000000000..e975634ddc18 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -0,0 +1,175 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.ApiException; +import java.time.OffsetDateTime; +import org.openapitools.client.model.User; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + + +/** + * API tests for UserApi + */ +@Disabled +public class UserApiTest { + + private final UserApi api = new UserApi(); + + + /** + * Create user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUserTest() throws ApiException { + User user = null; + + api.createUser(user); + + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUsersWithArrayInputTest() throws ApiException { + List user = null; + + api.createUsersWithArrayInput(user); + + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUsersWithListInputTest() throws ApiException { + List user = null; + + api.createUsersWithListInput(user); + + // TODO: test validations + } + + /** + * Delete user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteUserTest() throws ApiException { + String username = null; + + api.deleteUser(username); + + // TODO: test validations + } + + /** + * Get user by user name + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getUserByNameTest() throws ApiException { + String username = null; + User response = + api.getUserByName(username); + + // TODO: test validations + } + + /** + * Logs user into the system + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void loginUserTest() throws ApiException { + String username = null; + String password = null; + String response = + api.loginUser(username, password); + + // TODO: test validations + } + + /** + * Logs out current logged in user session + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void logoutUserTest() throws ApiException { + + api.logoutUser(); + + // TODO: test validations + } + + /** + * Updated user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updateUserTest() throws ApiException { + String username = null; + User user = null; + + api.updateUser(username, user); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java new file mode 100644 index 000000000000..da4858096fb9 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -0,0 +1,110 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AdditionalPropertiesClass + */ +class AdditionalPropertiesClassTest { + private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); + + /** + * Model tests for AdditionalPropertiesClass + */ + @Test + void testAdditionalPropertiesClass() { + // TODO: test AdditionalPropertiesClass + } + + /** + * Test the property 'mapProperty' + */ + @Test + void mapPropertyTest() { + // TODO: test mapProperty + } + + /** + * Test the property 'mapOfMapProperty' + */ + @Test + void mapOfMapPropertyTest() { + // TODO: test mapOfMapProperty + } + + /** + * Test the property 'anytype1' + */ + @Test + void anytype1Test() { + // TODO: test anytype1 + } + + /** + * Test the property 'mapWithUndeclaredPropertiesAnytype1' + */ + @Test + void mapWithUndeclaredPropertiesAnytype1Test() { + // TODO: test mapWithUndeclaredPropertiesAnytype1 + } + + /** + * Test the property 'mapWithUndeclaredPropertiesAnytype2' + */ + @Test + void mapWithUndeclaredPropertiesAnytype2Test() { + // TODO: test mapWithUndeclaredPropertiesAnytype2 + } + + /** + * Test the property 'mapWithUndeclaredPropertiesAnytype3' + */ + @Test + void mapWithUndeclaredPropertiesAnytype3Test() { + // TODO: test mapWithUndeclaredPropertiesAnytype3 + } + + /** + * Test the property 'emptyMap' + */ + @Test + void emptyMapTest() { + // TODO: test emptyMap + } + + /** + * Test the property 'mapWithUndeclaredPropertiesString' + */ + @Test + void mapWithUndeclaredPropertiesStringTest() { + // TODO: test mapWithUndeclaredPropertiesString + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/AllOfRefToDoubleTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/AllOfRefToDoubleTest.java new file mode 100644 index 000000000000..feca3f4b5d44 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/AllOfRefToDoubleTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AllOfRefToDouble + */ +class AllOfRefToDoubleTest { + private final AllOfRefToDouble model = new AllOfRefToDouble(); + + /** + * Model tests for AllOfRefToDouble + */ + @Test + void testAllOfRefToDouble() { + // TODO: test AllOfRefToDouble + } + + /** + * Test the property 'height' + */ + @Test + void heightTest() { + // TODO: test height + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/AllOfRefToFloatTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/AllOfRefToFloatTest.java new file mode 100644 index 000000000000..2cb55d9c7ac9 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/AllOfRefToFloatTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AllOfRefToFloat + */ +class AllOfRefToFloatTest { + private final AllOfRefToFloat model = new AllOfRefToFloat(); + + /** + * Model tests for AllOfRefToFloat + */ + @Test + void testAllOfRefToFloat() { + // TODO: test AllOfRefToFloat + } + + /** + * Test the property 'weight' + */ + @Test + void weightTest() { + // TODO: test weight + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/AllOfRefToLongTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/AllOfRefToLongTest.java new file mode 100644 index 000000000000..e85d5187272a --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/AllOfRefToLongTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AllOfRefToLong + */ +class AllOfRefToLongTest { + private final AllOfRefToLong model = new AllOfRefToLong(); + + /** + * Model tests for AllOfRefToLong + */ + @Test + void testAllOfRefToLong() { + // TODO: test AllOfRefToLong + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/AnimalTest.java new file mode 100644 index 000000000000..021edad01849 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonIgnoreProperties; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonSubTypes; +import tools.jackson.annotation.JsonTypeInfo; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Animal + */ +class AnimalTest { + private final Animal model = new Animal(); + + /** + * Model tests for Animal + */ + @Test + void testAnimal() { + // TODO: test Animal + } + + /** + * Test the property 'className' + */ + @Test + void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + void colorTest() { + // TODO: test color + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/AppleReqTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/AppleReqTest.java new file mode 100644 index 000000000000..7f08151fac1c --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/AppleReqTest.java @@ -0,0 +1,56 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for AppleReq + */ +class AppleReqTest { + private final AppleReq model = new AppleReq(); + + /** + * Model tests for AppleReq + */ + @Test + void testAppleReq() { + // TODO: test AppleReq + } + + /** + * Test the property 'cultivar' + */ + @Test + void cultivarTest() { + // TODO: test cultivar + } + + /** + * Test the property 'mealy' + */ + @Test + void mealyTest() { + // TODO: test mealy + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/AppleTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/AppleTest.java new file mode 100644 index 000000000000..5d9bcbbf8c99 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/AppleTest.java @@ -0,0 +1,56 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Apple + */ +class AppleTest { + private final Apple model = new Apple(); + + /** + * Model tests for Apple + */ + @Test + void testApple() { + // TODO: test Apple + } + + /** + * Test the property 'cultivar' + */ + @Test + void cultivarTest() { + // TODO: test cultivar + } + + /** + * Test the property 'origin' + */ + @Test + void originTest() { + // TODO: test origin + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java new file mode 100644 index 000000000000..f0b7fc2c91e3 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayOfArrayOfNumberOnly + */ +class ArrayOfArrayOfNumberOnlyTest { + private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfArrayOfNumberOnly + */ + @Test + void testArrayOfArrayOfNumberOnly() { + // TODO: test ArrayOfArrayOfNumberOnly + } + + /** + * Test the property 'arrayArrayNumber' + */ + @Test + void arrayArrayNumberTest() { + // TODO: test arrayArrayNumber + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java new file mode 100644 index 000000000000..a4204900e179 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayOfNumberOnly + */ +class ArrayOfNumberOnlyTest { + private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfNumberOnly + */ + @Test + void testArrayOfNumberOnly() { + // TODO: test ArrayOfNumberOnly + } + + /** + * Test the property 'arrayNumber' + */ + @Test + void arrayNumberTest() { + // TODO: test arrayNumber + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ArrayTestTest.java new file mode 100644 index 000000000000..537998b8182b --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -0,0 +1,67 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.ReadOnlyFirst; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ArrayTest + */ +class ArrayTestTest { + private final ArrayTest model = new ArrayTest(); + + /** + * Model tests for ArrayTest + */ + @Test + void testArrayTest() { + // TODO: test ArrayTest + } + + /** + * Test the property 'arrayOfString' + */ + @Test + void arrayOfStringTest() { + // TODO: test arrayOfString + } + + /** + * Test the property 'arrayArrayOfInteger' + */ + @Test + void arrayArrayOfIntegerTest() { + // TODO: test arrayArrayOfInteger + } + + /** + * Test the property 'arrayArrayOfModel' + */ + @Test + void arrayArrayOfModelTest() { + // TODO: test arrayArrayOfModel + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/BananaReqTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/BananaReqTest.java new file mode 100644 index 000000000000..29171be328fb --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/BananaReqTest.java @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.math.BigDecimal; +import java.util.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for BananaReq + */ +class BananaReqTest { + private final BananaReq model = new BananaReq(); + + /** + * Model tests for BananaReq + */ + @Test + void testBananaReq() { + // TODO: test BananaReq + } + + /** + * Test the property 'lengthCm' + */ + @Test + void lengthCmTest() { + // TODO: test lengthCm + } + + /** + * Test the property 'sweet' + */ + @Test + void sweetTest() { + // TODO: test sweet + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/BananaTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/BananaTest.java new file mode 100644 index 000000000000..878fe2e18e95 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/BananaTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.math.BigDecimal; +import java.util.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Banana + */ +class BananaTest { + private final Banana model = new Banana(); + + /** + * Model tests for Banana + */ + @Test + void testBanana() { + // TODO: test Banana + } + + /** + * Test the property 'lengthCm' + */ + @Test + void lengthCmTest() { + // TODO: test lengthCm + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/BasquePigTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/BasquePigTest.java new file mode 100644 index 000000000000..cb0bd4b6a6d7 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/BasquePigTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for BasquePig + */ +class BasquePigTest { + private final BasquePig model = new BasquePig(); + + /** + * Model tests for BasquePig + */ + @Test + void testBasquePig() { + // TODO: test BasquePig + } + + /** + * Test the property 'className' + */ + @Test + void classNameTest() { + // TODO: test className + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/CapitalizationTest.java new file mode 100644 index 000000000000..2780d44db324 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -0,0 +1,88 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Capitalization + */ +class CapitalizationTest { + private final Capitalization model = new Capitalization(); + + /** + * Model tests for Capitalization + */ + @Test + void testCapitalization() { + // TODO: test Capitalization + } + + /** + * Test the property 'smallCamel' + */ + @Test + void smallCamelTest() { + // TODO: test smallCamel + } + + /** + * Test the property 'capitalCamel' + */ + @Test + void capitalCamelTest() { + // TODO: test capitalCamel + } + + /** + * Test the property 'smallSnake' + */ + @Test + void smallSnakeTest() { + // TODO: test smallSnake + } + + /** + * Test the property 'capitalSnake' + */ + @Test + void capitalSnakeTest() { + // TODO: test capitalSnake + } + + /** + * Test the property 'scAETHFlowPoints' + */ + @Test + void scAETHFlowPointsTest() { + // TODO: test scAETHFlowPoints + } + + /** + * Test the property 'ATT_NAME' + */ + @Test + void ATT_NAMETest() { + // TODO: test ATT_NAME + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/CatTest.java new file mode 100644 index 000000000000..34c7dc0936d3 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/CatTest.java @@ -0,0 +1,69 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import java.util.Map; +import org.openapitools.client.model.Animal; +import tools.jackson.annotation.JsonIgnoreProperties; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonSubTypes; +import tools.jackson.annotation.JsonTypeInfo; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Cat + */ +class CatTest { + private final Cat model = new Cat(); + + /** + * Model tests for Cat + */ + @Test + void testCat() { + // TODO: test Cat + } + + /** + * Test the property 'className' + */ + @Test + void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + void declawedTest() { + // TODO: test declawed + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/CategoryTest.java new file mode 100644 index 000000000000..7a79a250ec6c --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -0,0 +1,56 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +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/native-jackson3/src/test/java/org/openapitools/client/model/ChildCatTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ChildCatTest.java new file mode 100644 index 000000000000..3df2e04f6009 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ChildCatTest.java @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import org.openapitools.client.model.ParentPet; +import tools.jackson.annotation.JsonIgnoreProperties; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonSubTypes; +import tools.jackson.annotation.JsonTypeInfo; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import java.util.Set; +import java.util.HashSet; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ChildCat + */ +class ChildCatTest { + private final ChildCat model = new ChildCat(); + + /** + * Model tests for ChildCat + */ + @Test + void testChildCat() { + // TODO: test ChildCat + } + + /** + * Test the property 'petType' + */ + @Test + void petTypeTest() { + // TODO: test petType + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ClassModelTest.java new file mode 100644 index 000000000000..9caf1a0b038c --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ClassModel + */ +class ClassModelTest { + private final ClassModel model = new ClassModel(); + + /** + * Model tests for ClassModel + */ + @Test + void testClassModel() { + // TODO: test ClassModel + } + + /** + * Test the property 'propertyClass' + */ + @Test + void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ClientTest.java new file mode 100644 index 000000000000..d45b889b2d81 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ClientTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Client + */ +class ClientTest { + private final Client model = new Client(); + + /** + * Model tests for Client + */ + @Test + void testClient() { + // TODO: test Client + } + + /** + * Test the property 'client' + */ + @Test + void clientTest() { + // TODO: test client + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ComplexQuadrilateralTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ComplexQuadrilateralTest.java new file mode 100644 index 000000000000..f3f3e2b3b006 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ComplexQuadrilateralTest.java @@ -0,0 +1,56 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ComplexQuadrilateral + */ +class ComplexQuadrilateralTest { + private final ComplexQuadrilateral model = new ComplexQuadrilateral(); + + /** + * Model tests for ComplexQuadrilateral + */ + @Test + void testComplexQuadrilateral() { + // TODO: test ComplexQuadrilateral + } + + /** + * Test the property 'shapeType' + */ + @Test + void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'quadrilateralType' + */ + @Test + void quadrilateralTypeTest() { + // TODO: test quadrilateralType + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/DanishPigTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/DanishPigTest.java new file mode 100644 index 000000000000..242a224a0dd8 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/DanishPigTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for DanishPig + */ +class DanishPigTest { + private final DanishPig model = new DanishPig(); + + /** + * Model tests for DanishPig + */ + @Test + void testDanishPig() { + // TODO: test DanishPig + } + + /** + * Test the property 'className' + */ + @Test + void classNameTest() { + // TODO: test className + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java new file mode 100644 index 000000000000..b007e37186df --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for DeprecatedObject + */ +class DeprecatedObjectTest { + private final DeprecatedObject model = new DeprecatedObject(); + + /** + * Model tests for DeprecatedObject + */ + @Test + void testDeprecatedObject() { + // TODO: test DeprecatedObject + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/DogTest.java new file mode 100644 index 000000000000..ca21ddfc8160 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/DogTest.java @@ -0,0 +1,68 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import org.openapitools.client.model.Animal; +import tools.jackson.annotation.JsonIgnoreProperties; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonSubTypes; +import tools.jackson.annotation.JsonTypeInfo; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Dog + */ +class DogTest { + private final Dog model = new Dog(); + + /** + * Model tests for Dog + */ + @Test + void testDog() { + // TODO: test Dog + } + + /** + * Test the property 'className' + */ + @Test + void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + void colorTest() { + // TODO: test color + } + + /** + * Test the property 'breed' + */ + @Test + void breedTest() { + // TODO: test breed + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/DrawingTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/DrawingTest.java new file mode 100644 index 000000000000..989aa0f07fd6 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/DrawingTest.java @@ -0,0 +1,82 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Fruit; +import org.openapitools.client.model.NullableShape; +import org.openapitools.client.model.Shape; +import org.openapitools.client.model.ShapeOrNull; +import org.openapitools.jackson.nullable.JsonNullable; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Drawing + */ +class DrawingTest { + private final Drawing model = new Drawing(); + + /** + * Model tests for Drawing + */ + @Test + void testDrawing() { + // TODO: test Drawing + } + + /** + * Test the property 'mainShape' + */ + @Test + void mainShapeTest() { + // TODO: test mainShape + } + + /** + * Test the property 'shapeOrNull' + */ + @Test + void shapeOrNullTest() { + // TODO: test shapeOrNull + } + + /** + * Test the property 'nullableShape' + */ + @Test + void nullableShapeTest() { + // TODO: test nullableShape + } + + /** + * Test the property 'shapes' + */ + @Test + void shapesTest() { + // TODO: test shapes + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/EnumArraysTest.java new file mode 100644 index 000000000000..c47067067957 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -0,0 +1,58 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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 tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for EnumArrays + */ +class EnumArraysTest { + private final EnumArrays model = new EnumArrays(); + + /** + * Model tests for EnumArrays + */ + @Test + void testEnumArrays() { + // TODO: test EnumArrays + } + + /** + * Test the property 'justSymbol' + */ + @Test + void justSymbolTest() { + // TODO: test justSymbol + } + + /** + * Test the property 'arrayEnum' + */ + @Test + void arrayEnumTest() { + // TODO: test arrayEnum + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/EnumClassTest.java new file mode 100644 index 000000000000..48aa1a737fce --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -0,0 +1,32 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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 EnumClass + */ +class EnumClassTest { + /** + * Model tests for EnumClass + */ + @Test + void testEnumClass() { + // TODO: test EnumClass + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/EnumTestTest.java new file mode 100644 index 000000000000..0e874bedae47 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -0,0 +1,120 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.OuterEnumDefaultValue; +import org.openapitools.client.model.OuterEnumInteger; +import org.openapitools.client.model.OuterEnumIntegerDefaultValue; +import org.openapitools.jackson.nullable.JsonNullable; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for EnumTest + */ +class EnumTestTest { + private final EnumTest model = new EnumTest(); + + /** + * Model tests for EnumTest + */ + @Test + void testEnumTest() { + // TODO: test EnumTest + } + + /** + * Test the property 'enumString' + */ + @Test + void enumStringTest() { + // TODO: test enumString + } + + /** + * Test the property 'enumStringRequired' + */ + @Test + void enumStringRequiredTest() { + // TODO: test enumStringRequired + } + + /** + * Test the property 'enumInteger' + */ + @Test + void enumIntegerTest() { + // TODO: test enumInteger + } + + /** + * Test the property 'enumIntegerOnly' + */ + @Test + void enumIntegerOnlyTest() { + // TODO: test enumIntegerOnly + } + + /** + * Test the property 'enumNumber' + */ + @Test + void enumNumberTest() { + // TODO: test enumNumber + } + + /** + * Test the property 'outerEnum' + */ + @Test + void outerEnumTest() { + // TODO: test outerEnum + } + + /** + * Test the property 'outerEnumInteger' + */ + @Test + void outerEnumIntegerTest() { + // TODO: test outerEnumInteger + } + + /** + * Test the property 'outerEnumDefaultValue' + */ + @Test + void outerEnumDefaultValueTest() { + // TODO: test outerEnumDefaultValue + } + + /** + * Test the property 'outerEnumIntegerDefaultValue' + */ + @Test + void outerEnumIntegerDefaultValueTest() { + // TODO: test outerEnumIntegerDefaultValue + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/EquilateralTriangleTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/EquilateralTriangleTest.java new file mode 100644 index 000000000000..7ebded43b561 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/EquilateralTriangleTest.java @@ -0,0 +1,56 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for EquilateralTriangle + */ +class EquilateralTriangleTest { + private final EquilateralTriangle model = new EquilateralTriangle(); + + /** + * Model tests for EquilateralTriangle + */ + @Test + void testEquilateralTriangle() { + // TODO: test EquilateralTriangle + } + + /** + * Test the property 'shapeType' + */ + @Test + void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'triangleType' + */ + @Test + void triangleTypeTest() { + // TODO: test triangleType + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java new file mode 100644 index 000000000000..142e7301b2e0 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.math.BigDecimal; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FakeBigDecimalMap200Response + */ +class FakeBigDecimalMap200ResponseTest { + private final FakeBigDecimalMap200Response model = new FakeBigDecimalMap200Response(); + + /** + * Model tests for FakeBigDecimalMap200Response + */ + @Test + void testFakeBigDecimalMap200Response() { + // TODO: test FakeBigDecimalMap200Response + } + + /** + * Test the property 'someId' + */ + @Test + void someIdTest() { + // TODO: test someId + } + + /** + * Test the property 'someMap' + */ + @Test + void someMapTest() { + // TODO: test someMap + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java new file mode 100644 index 000000000000..d50496a5e3c9 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.ModelFile; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FileSchemaTestClass + */ +class FileSchemaTestClassTest { + private final FileSchemaTestClass model = new FileSchemaTestClass(); + + /** + * Model tests for FileSchemaTestClass + */ + @Test + void testFileSchemaTestClass() { + // TODO: test FileSchemaTestClass + } + + /** + * Test the property '_file' + */ + @Test + void _fileTest() { + // TODO: test _file + } + + /** + * Test the property 'files' + */ + @Test + void filesTest() { + // TODO: test files + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java new file mode 100644 index 000000000000..0697e1cd32b2 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import org.openapitools.client.model.Foo; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FooGetDefaultResponse + */ +class FooGetDefaultResponseTest { + private final FooGetDefaultResponse model = new FooGetDefaultResponse(); + + /** + * Model tests for FooGetDefaultResponse + */ + @Test + void testFooGetDefaultResponse() { + // TODO: test FooGetDefaultResponse + } + + /** + * Test the property 'string' + */ + @Test + void stringTest() { + // TODO: test string + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/FooTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/FooTest.java new file mode 100644 index 000000000000..c9544d9a9c8c --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/FooTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Foo + */ +class FooTest { + private final Foo model = new Foo(); + + /** + * Model tests for Foo + */ + @Test + void testFoo() { + // TODO: test Foo + } + + /** + * Test the property 'bar' + */ + @Test + void barTest() { + // TODO: test bar + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/FormatTestTest.java new file mode 100644 index 000000000000..1d6a90761a18 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -0,0 +1,173 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.io.File; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.UUID; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FormatTest + */ +class FormatTestTest { + private final FormatTest model = new FormatTest(); + + /** + * Model tests for FormatTest + */ + @Test + void testFormatTest() { + // TODO: test FormatTest + } + + /** + * Test the property 'integer' + */ + @Test + void integerTest() { + // TODO: test integer + } + + /** + * Test the property 'int32' + */ + @Test + void int32Test() { + // TODO: test int32 + } + + /** + * Test the property 'int64' + */ + @Test + void int64Test() { + // TODO: test int64 + } + + /** + * Test the property 'number' + */ + @Test + void numberTest() { + // TODO: test number + } + + /** + * Test the property '_float' + */ + @Test + void _floatTest() { + // TODO: test _float + } + + /** + * Test the property '_double' + */ + @Test + void _doubleTest() { + // TODO: test _double + } + + /** + * Test the property 'decimal' + */ + @Test + void decimalTest() { + // TODO: test decimal + } + + /** + * Test the property 'string' + */ + @Test + void stringTest() { + // TODO: test string + } + + /** + * Test the property '_byte' + */ + @Test + void _byteTest() { + // TODO: test _byte + } + + /** + * Test the property 'binary' + */ + @Test + void binaryTest() { + // TODO: test binary + } + + /** + * Test the property 'date' + */ + @Test + void dateTest() { + // TODO: test date + } + + /** + * Test the property 'dateTime' + */ + @Test + void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'uuid' + */ + @Test + void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'password' + */ + @Test + void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'patternWithDigits' + */ + @Test + void patternWithDigitsTest() { + // TODO: test patternWithDigits + } + + /** + * Test the property 'patternWithDigitsAndDelimiter' + */ + @Test + void patternWithDigitsAndDelimiterTest() { + // TODO: test patternWithDigitsAndDelimiter + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/FruitReqTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/FruitReqTest.java new file mode 100644 index 000000000000..f7805b3ec3f9 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/FruitReqTest.java @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.math.BigDecimal; +import java.util.Arrays; +import org.openapitools.client.model.AppleReq; +import org.openapitools.client.model.BananaReq; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FruitReq + */ +class FruitReqTest { + private final FruitReq model = new FruitReq(); + + /** + * Model tests for FruitReq + */ + @Test + void testFruitReq() { + // TODO: test FruitReq + } + + /** + * Test the property 'cultivar' + */ + @Test + void cultivarTest() { + // TODO: test cultivar + } + + /** + * Test the property 'mealy' + */ + @Test + void mealyTest() { + // TODO: test mealy + } + + /** + * Test the property 'lengthCm' + */ + @Test + void lengthCmTest() { + // TODO: test lengthCm + } + + /** + * Test the property 'sweet' + */ + @Test + void sweetTest() { + // TODO: test sweet + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/FruitTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/FruitTest.java new file mode 100644 index 000000000000..e599664c46df --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/FruitTest.java @@ -0,0 +1,67 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.math.BigDecimal; +import java.util.Arrays; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Fruit + */ +class FruitTest { + private final Fruit model = new Fruit(); + + /** + * Model tests for Fruit + */ + @Test + void testFruit() { + // TODO: test Fruit + } + + /** + * Test the property 'cultivar' + */ + @Test + void cultivarTest() { + // TODO: test cultivar + } + + /** + * Test the property 'origin' + */ + @Test + void originTest() { + // TODO: test origin + } + + /** + * Test the property 'lengthCm' + */ + @Test + void lengthCmTest() { + // TODO: test lengthCm + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/GmFruitTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/GmFruitTest.java new file mode 100644 index 000000000000..061d8f36caab --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/GmFruitTest.java @@ -0,0 +1,67 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.math.BigDecimal; +import java.util.Arrays; +import org.openapitools.client.model.Apple; +import org.openapitools.client.model.Banana; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GmFruit + */ +class GmFruitTest { + private final GmFruit model = new GmFruit(); + + /** + * Model tests for GmFruit + */ + @Test + void testGmFruit() { + // TODO: test GmFruit + } + + /** + * Test the property 'cultivar' + */ + @Test + void cultivarTest() { + // TODO: test cultivar + } + + /** + * Test the property 'origin' + */ + @Test + void originTest() { + // TODO: test origin + } + + /** + * Test the property 'lengthCm' + */ + @Test + void lengthCmTest() { + // TODO: test lengthCm + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/GrandparentAnimalTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/GrandparentAnimalTest.java new file mode 100644 index 000000000000..c5f2a4507f8a --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/GrandparentAnimalTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonIgnoreProperties; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonSubTypes; +import tools.jackson.annotation.JsonTypeInfo; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for GrandparentAnimal + */ +class GrandparentAnimalTest { + private final GrandparentAnimal model = new GrandparentAnimal(); + + /** + * Model tests for GrandparentAnimal + */ + @Test + void testGrandparentAnimal() { + // TODO: test GrandparentAnimal + } + + /** + * Test the property 'petType' + */ + @Test + void petTypeTest() { + // TODO: test petType + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java new file mode 100644 index 000000000000..fec29c9f8505 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -0,0 +1,56 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for HasOnlyReadOnly + */ +class HasOnlyReadOnlyTest { + private final HasOnlyReadOnly model = new HasOnlyReadOnly(); + + /** + * Model tests for HasOnlyReadOnly + */ + @Test + void testHasOnlyReadOnly() { + // TODO: test HasOnlyReadOnly + } + + /** + * Test the property 'bar' + */ + @Test + void barTest() { + // TODO: test bar + } + + /** + * Test the property 'foo' + */ + @Test + void fooTest() { + // TODO: test foo + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java new file mode 100644 index 000000000000..54495c921eea --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for HealthCheckResult + */ +class HealthCheckResultTest { + private final HealthCheckResult model = new HealthCheckResult(); + + /** + * Model tests for HealthCheckResult + */ + @Test + void testHealthCheckResult() { + // TODO: test HealthCheckResult + } + + /** + * Test the property 'nullableMessage' + */ + @Test + void nullableMessageTest() { + // TODO: test nullableMessage + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/IsoscelesTriangleTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/IsoscelesTriangleTest.java new file mode 100644 index 000000000000..d75dbb364e16 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/IsoscelesTriangleTest.java @@ -0,0 +1,56 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for IsoscelesTriangle + */ +class IsoscelesTriangleTest { + private final IsoscelesTriangle model = new IsoscelesTriangle(); + + /** + * Model tests for IsoscelesTriangle + */ + @Test + void testIsoscelesTriangle() { + // TODO: test IsoscelesTriangle + } + + /** + * Test the property 'shapeType' + */ + @Test + void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'triangleType' + */ + @Test + void triangleTypeTest() { + // TODO: test triangleType + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/MammalTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/MammalTest.java new file mode 100644 index 000000000000..b9f9276e394b --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/MammalTest.java @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import org.openapitools.client.model.Pig; +import org.openapitools.client.model.Whale; +import org.openapitools.client.model.Zebra; +import tools.jackson.annotation.JsonIgnoreProperties; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonSubTypes; +import tools.jackson.annotation.JsonTypeInfo; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Mammal + */ +class MammalTest { + private final Mammal model = new Mammal(); + + /** + * Model tests for Mammal + */ + @Test + void testMammal() { + // TODO: test Mammal + } + + /** + * Test the property 'hasBaleen' + */ + @Test + void hasBaleenTest() { + // TODO: test hasBaleen + } + + /** + * Test the property 'hasTeeth' + */ + @Test + void hasTeethTest() { + // TODO: test hasTeeth + } + + /** + * Test the property 'className' + */ + @Test + void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'type' + */ + @Test + void typeTest() { + // TODO: test type + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/MapTestTest.java new file mode 100644 index 000000000000..01e32fab5956 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -0,0 +1,74 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import java.util.HashMap; +import java.util.Map; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MapTest + */ +class MapTestTest { + private final MapTest model = new MapTest(); + + /** + * Model tests for MapTest + */ + @Test + void testMapTest() { + // TODO: test MapTest + } + + /** + * Test the property 'mapMapOfString' + */ + @Test + void mapMapOfStringTest() { + // TODO: test mapMapOfString + } + + /** + * Test the property 'mapOfEnumString' + */ + @Test + void mapOfEnumStringTest() { + // TODO: test mapOfEnumString + } + + /** + * Test the property 'directMap' + */ + @Test + void directMapTest() { + // TODO: test directMap + } + + /** + * Test the property 'indirectMap' + */ + @Test + void indirectMapTest() { + // TODO: test indirectMap + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java new file mode 100644 index 000000000000..1e134a99235e --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -0,0 +1,69 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.openapitools.client.model.Animal; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ +class MixedPropertiesAndAdditionalPropertiesClassTest { + private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); + + /** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ + @Test + void testMixedPropertiesAndAdditionalPropertiesClass() { + // TODO: test MixedPropertiesAndAdditionalPropertiesClass + } + + /** + * Test the property 'uuid' + */ + @Test + void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'dateTime' + */ + @Test + void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'map' + */ + @Test + void mapTest() { + // TODO: test map + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/Model200ResponseTest.java new file mode 100644 index 000000000000..e2246f62cc8f --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -0,0 +1,56 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Model200Response + */ +class Model200ResponseTest { + private final Model200Response model = new Model200Response(); + + /** + * Model tests for Model200Response + */ + @Test + void testModel200Response() { + // TODO: test Model200Response + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + + /** + * Test the property 'propertyClass' + */ + @Test + void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java new file mode 100644 index 000000000000..6c7f4861244b --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -0,0 +1,64 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +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/native-jackson3/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..27e7831b8e60 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelFile + */ +class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..8452eecb8064 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelList + */ +class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ModelReturnTest.java new file mode 100644 index 000000000000..ac030b2c803c --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ModelReturn + */ +class ModelReturnTest { + private final ModelReturn model = new ModelReturn(); + + /** + * Model tests for ModelReturn + */ + @Test + void testModelReturn() { + // TODO: test ModelReturn + } + + /** + * Test the property '_return' + */ + @Test + void _returnTest() { + // TODO: test _return + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/NameTest.java new file mode 100644 index 000000000000..f75bbc2abe99 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/NameTest.java @@ -0,0 +1,72 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Name + */ +class NameTest { + private final Name model = new Name(); + + /** + * Model tests for Name + */ + @Test + void testName() { + // TODO: test Name + } + + /** + * Test the property 'name' + */ + @Test + void nameTest() { + // TODO: test name + } + + /** + * Test the property 'snakeCase' + */ + @Test + void snakeCaseTest() { + // TODO: test snakeCase + } + + /** + * Test the property 'property' + */ + @Test + void propertyTest() { + // TODO: test property + } + + /** + * Test the property '_123number' + */ + @Test + void _123numberTest() { + // TODO: test _123number + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/NullableClassTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/NullableClassTest.java new file mode 100644 index 000000000000..1714b98ff882 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/NullableClassTest.java @@ -0,0 +1,147 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NullableClass + */ +class NullableClassTest { + private final NullableClass model = new NullableClass(); + + /** + * Model tests for NullableClass + */ + @Test + void testNullableClass() { + // TODO: test NullableClass + } + + /** + * Test the property 'integerProp' + */ + @Test + void integerPropTest() { + // TODO: test integerProp + } + + /** + * Test the property 'numberProp' + */ + @Test + void numberPropTest() { + // TODO: test numberProp + } + + /** + * Test the property 'booleanProp' + */ + @Test + void booleanPropTest() { + // TODO: test booleanProp + } + + /** + * Test the property 'stringProp' + */ + @Test + void stringPropTest() { + // TODO: test stringProp + } + + /** + * Test the property 'dateProp' + */ + @Test + void datePropTest() { + // TODO: test dateProp + } + + /** + * Test the property 'datetimeProp' + */ + @Test + void datetimePropTest() { + // TODO: test datetimeProp + } + + /** + * Test the property 'arrayNullableProp' + */ + @Test + void arrayNullablePropTest() { + // TODO: test arrayNullableProp + } + + /** + * Test the property 'arrayAndItemsNullableProp' + */ + @Test + void arrayAndItemsNullablePropTest() { + // TODO: test arrayAndItemsNullableProp + } + + /** + * Test the property 'arrayItemsNullable' + */ + @Test + void arrayItemsNullableTest() { + // TODO: test arrayItemsNullable + } + + /** + * Test the property 'objectNullableProp' + */ + @Test + void objectNullablePropTest() { + // TODO: test objectNullableProp + } + + /** + * Test the property 'objectAndItemsNullableProp' + */ + @Test + void objectAndItemsNullablePropTest() { + // TODO: test objectAndItemsNullableProp + } + + /** + * Test the property 'objectItemsNullable' + */ + @Test + void objectItemsNullableTest() { + // TODO: test objectItemsNullable + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/NullableShapeTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/NullableShapeTest.java new file mode 100644 index 000000000000..e675024ab4e0 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/NullableShapeTest.java @@ -0,0 +1,69 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import org.openapitools.client.model.Quadrilateral; +import org.openapitools.client.model.Triangle; +import tools.jackson.annotation.JsonIgnoreProperties; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonSubTypes; +import tools.jackson.annotation.JsonTypeInfo; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NullableShape + */ +class NullableShapeTest { + private final NullableShape model = new NullableShape(); + + /** + * Model tests for NullableShape + */ + @Test + void testNullableShape() { + // TODO: test NullableShape + } + + /** + * Test the property 'shapeType' + */ + @Test + void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'triangleType' + */ + @Test + void triangleTypeTest() { + // TODO: test triangleType + } + + /** + * Test the property 'quadrilateralType' + */ + @Test + void quadrilateralTypeTest() { + // TODO: test quadrilateralType + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/NumberOnlyTest.java new file mode 100644 index 000000000000..11b8bd0d52ac --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.math.BigDecimal; +import java.util.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for NumberOnly + */ +class NumberOnlyTest { + private final NumberOnly model = new NumberOnly(); + + /** + * Model tests for NumberOnly + */ + @Test + void testNumberOnly() { + // TODO: test NumberOnly + } + + /** + * Test the property 'justNumber' + */ + @Test + void justNumberTest() { + // TODO: test justNumber + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java new file mode 100644 index 000000000000..d4e98307ccc7 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java @@ -0,0 +1,76 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.client.model.DeprecatedObject; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ObjectWithDeprecatedFields + */ +class ObjectWithDeprecatedFieldsTest { + private final ObjectWithDeprecatedFields model = new ObjectWithDeprecatedFields(); + + /** + * Model tests for ObjectWithDeprecatedFields + */ + @Test + void testObjectWithDeprecatedFields() { + // TODO: test ObjectWithDeprecatedFields + } + + /** + * Test the property 'uuid' + */ + @Test + void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'id' + */ + @Test + void idTest() { + // TODO: test id + } + + /** + * Test the property 'deprecatedRef' + */ + @Test + void deprecatedRefTest() { + // TODO: test deprecatedRef + } + + /** + * Test the property 'bars' + */ + @Test + void barsTest() { + // TODO: test bars + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/OrderTest.java new file mode 100644 index 000000000000..0985b6a108a3 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/OrderTest.java @@ -0,0 +1,89 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.time.OffsetDateTime; +import java.util.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +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/native-jackson3/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/OuterCompositeTest.java new file mode 100644 index 000000000000..2f3470e9b43c --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.math.BigDecimal; +import java.util.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for OuterComposite + */ +class OuterCompositeTest { + private final OuterComposite model = new OuterComposite(); + + /** + * Model tests for OuterComposite + */ + @Test + void testOuterComposite() { + // TODO: test OuterComposite + } + + /** + * Test the property 'myNumber' + */ + @Test + void myNumberTest() { + // TODO: test myNumber + } + + /** + * Test the property 'myString' + */ + @Test + void myStringTest() { + // TODO: test myString + } + + /** + * Test the property 'myBoolean' + */ + @Test + void myBooleanTest() { + // TODO: test myBoolean + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java new file mode 100644 index 000000000000..d818b23c7d53 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java @@ -0,0 +1,32 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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 OuterEnumDefaultValue + */ +class OuterEnumDefaultValueTest { + /** + * Model tests for OuterEnumDefaultValue + */ + @Test + void testOuterEnumDefaultValue() { + // TODO: test OuterEnumDefaultValue + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java new file mode 100644 index 000000000000..1d7b3338bca2 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java @@ -0,0 +1,32 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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 OuterEnumIntegerDefaultValue + */ +class OuterEnumIntegerDefaultValueTest { + /** + * Model tests for OuterEnumIntegerDefaultValue + */ + @Test + void testOuterEnumIntegerDefaultValue() { + // TODO: test OuterEnumIntegerDefaultValue + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java new file mode 100644 index 000000000000..cacda46a76f4 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java @@ -0,0 +1,32 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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 OuterEnumInteger + */ +class OuterEnumIntegerTest { + /** + * Model tests for OuterEnumInteger + */ + @Test + void testOuterEnumInteger() { + // TODO: test OuterEnumInteger + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/OuterEnumTest.java new file mode 100644 index 000000000000..0333ee657a0f --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -0,0 +1,32 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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 OuterEnum + */ +class OuterEnumTest { + /** + * Model tests for OuterEnum + */ + @Test + void testOuterEnum() { + // TODO: test OuterEnum + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ParentPetTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ParentPetTest.java new file mode 100644 index 000000000000..cc7fd1195989 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ParentPetTest.java @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import org.openapitools.client.model.GrandparentAnimal; +import tools.jackson.annotation.JsonIgnoreProperties; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonSubTypes; +import tools.jackson.annotation.JsonTypeInfo; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ParentPet + */ +class ParentPetTest { + private final ParentPet model = new ParentPet(); + + /** + * Model tests for ParentPet + */ + @Test + void testParentPet() { + // TODO: test ParentPet + } + + /** + * Test the property 'petType' + */ + @Test + void petTypeTest() { + // TODO: test petType + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/PetTest.java new file mode 100644 index 000000000000..05251fd89b57 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/PetTest.java @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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 tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +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/native-jackson3/src/test/java/org/openapitools/client/model/PigTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/PigTest.java new file mode 100644 index 000000000000..b5dda7bb3d87 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/PigTest.java @@ -0,0 +1,53 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import org.openapitools.client.model.BasquePig; +import org.openapitools.client.model.DanishPig; +import tools.jackson.annotation.JsonIgnoreProperties; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonSubTypes; +import tools.jackson.annotation.JsonTypeInfo; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Pig + */ +class PigTest { + private final Pig model = new Pig(); + + /** + * Model tests for Pig + */ + @Test + void testPig() { + // TODO: test Pig + } + + /** + * Test the property 'className' + */ + @Test + void classNameTest() { + // TODO: test className + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/QuadrilateralInterfaceTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/QuadrilateralInterfaceTest.java new file mode 100644 index 000000000000..2d7330661075 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/QuadrilateralInterfaceTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for QuadrilateralInterface + */ +class QuadrilateralInterfaceTest { + private final QuadrilateralInterface model = new QuadrilateralInterface(); + + /** + * Model tests for QuadrilateralInterface + */ + @Test + void testQuadrilateralInterface() { + // TODO: test QuadrilateralInterface + } + + /** + * Test the property 'quadrilateralType' + */ + @Test + void quadrilateralTypeTest() { + // TODO: test quadrilateralType + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/QuadrilateralTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/QuadrilateralTest.java new file mode 100644 index 000000000000..5bf01a6b23d7 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/QuadrilateralTest.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import org.openapitools.client.model.ComplexQuadrilateral; +import org.openapitools.client.model.SimpleQuadrilateral; +import tools.jackson.annotation.JsonIgnoreProperties; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonSubTypes; +import tools.jackson.annotation.JsonTypeInfo; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Quadrilateral + */ +class QuadrilateralTest { + private final Quadrilateral model = new Quadrilateral(); + + /** + * Model tests for Quadrilateral + */ + @Test + void testQuadrilateral() { + // TODO: test Quadrilateral + } + + /** + * Test the property 'shapeType' + */ + @Test + void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'quadrilateralType' + */ + @Test + void quadrilateralTypeTest() { + // TODO: test quadrilateralType + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java new file mode 100644 index 000000000000..0944215eb369 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -0,0 +1,56 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ReadOnlyFirst + */ +class ReadOnlyFirstTest { + private final ReadOnlyFirst model = new ReadOnlyFirst(); + + /** + * Model tests for ReadOnlyFirst + */ + @Test + void testReadOnlyFirst() { + // TODO: test ReadOnlyFirst + } + + /** + * Test the property 'bar' + */ + @Test + void barTest() { + // TODO: test bar + } + + /** + * Test the property 'baz' + */ + @Test + void bazTest() { + // TODO: test baz + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ScaleneTriangleTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ScaleneTriangleTest.java new file mode 100644 index 000000000000..0f1e0a70e3be --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ScaleneTriangleTest.java @@ -0,0 +1,56 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ScaleneTriangle + */ +class ScaleneTriangleTest { + private final ScaleneTriangle model = new ScaleneTriangle(); + + /** + * Model tests for ScaleneTriangle + */ + @Test + void testScaleneTriangle() { + // TODO: test ScaleneTriangle + } + + /** + * Test the property 'shapeType' + */ + @Test + void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'triangleType' + */ + @Test + void triangleTypeTest() { + // TODO: test triangleType + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ShapeInterfaceTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ShapeInterfaceTest.java new file mode 100644 index 000000000000..120f47966dfa --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ShapeInterfaceTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ShapeInterface + */ +class ShapeInterfaceTest { + private final ShapeInterface model = new ShapeInterface(); + + /** + * Model tests for ShapeInterface + */ + @Test + void testShapeInterface() { + // TODO: test ShapeInterface + } + + /** + * Test the property 'shapeType' + */ + @Test + void shapeTypeTest() { + // TODO: test shapeType + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ShapeOrNullTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ShapeOrNullTest.java new file mode 100644 index 000000000000..196a9814f89a --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ShapeOrNullTest.java @@ -0,0 +1,69 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import org.openapitools.client.model.Quadrilateral; +import org.openapitools.client.model.Triangle; +import tools.jackson.annotation.JsonIgnoreProperties; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonSubTypes; +import tools.jackson.annotation.JsonTypeInfo; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ShapeOrNull + */ +class ShapeOrNullTest { + private final ShapeOrNull model = new ShapeOrNull(); + + /** + * Model tests for ShapeOrNull + */ + @Test + void testShapeOrNull() { + // TODO: test ShapeOrNull + } + + /** + * Test the property 'shapeType' + */ + @Test + void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'triangleType' + */ + @Test + void triangleTypeTest() { + // TODO: test triangleType + } + + /** + * Test the property 'quadrilateralType' + */ + @Test + void quadrilateralTypeTest() { + // TODO: test quadrilateralType + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ShapeTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ShapeTest.java new file mode 100644 index 000000000000..25ee49074148 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ShapeTest.java @@ -0,0 +1,69 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import org.openapitools.client.model.Quadrilateral; +import org.openapitools.client.model.Triangle; +import tools.jackson.annotation.JsonIgnoreProperties; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonSubTypes; +import tools.jackson.annotation.JsonTypeInfo; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Shape + */ +class ShapeTest { + private final Shape model = new Shape(); + + /** + * Model tests for Shape + */ + @Test + void testShape() { + // TODO: test Shape + } + + /** + * Test the property 'shapeType' + */ + @Test + void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'triangleType' + */ + @Test + void triangleTypeTest() { + // TODO: test triangleType + } + + /** + * Test the property 'quadrilateralType' + */ + @Test + void quadrilateralTypeTest() { + // TODO: test quadrilateralType + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/SimpleQuadrilateralTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/SimpleQuadrilateralTest.java new file mode 100644 index 000000000000..d7a8cbbeb4cc --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/SimpleQuadrilateralTest.java @@ -0,0 +1,56 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SimpleQuadrilateral + */ +class SimpleQuadrilateralTest { + private final SimpleQuadrilateral model = new SimpleQuadrilateral(); + + /** + * Model tests for SimpleQuadrilateral + */ + @Test + void testSimpleQuadrilateral() { + // TODO: test SimpleQuadrilateral + } + + /** + * Test the property 'shapeType' + */ + @Test + void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'quadrilateralType' + */ + @Test + void quadrilateralTypeTest() { + // TODO: test quadrilateralType + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java new file mode 100644 index 000000000000..ffbe89fcd93d --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -0,0 +1,56 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for SpecialModelName + */ +class SpecialModelNameTest { + private final SpecialModelName model = new SpecialModelName(); + + /** + * Model tests for SpecialModelName + */ + @Test + void testSpecialModelName() { + // TODO: test SpecialModelName + } + + /** + * Test the property '$specialPropertyName' + */ + @Test + void $specialPropertyNameTest() { + // TODO: test $specialPropertyName + } + + /** + * Test the property 'specialModelName' + */ + @Test + void specialModelNameTest() { + // TODO: test specialModelName + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/TagTest.java new file mode 100644 index 000000000000..06add63bf9e2 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/TagTest.java @@ -0,0 +1,56 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +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/native-jackson3/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 000000000000..dc58e4e8c12e --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + void somePropertyTest() { + // TODO: test someProperty + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/TriangleInterfaceTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/TriangleInterfaceTest.java new file mode 100644 index 000000000000..6e85f4a401b3 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/TriangleInterfaceTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TriangleInterface + */ +class TriangleInterfaceTest { + private final TriangleInterface model = new TriangleInterface(); + + /** + * Model tests for TriangleInterface + */ + @Test + void testTriangleInterface() { + // TODO: test TriangleInterface + } + + /** + * Test the property 'triangleType' + */ + @Test + void triangleTypeTest() { + // TODO: test triangleType + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/TriangleTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/TriangleTest.java new file mode 100644 index 000000000000..db400feda455 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/TriangleTest.java @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import org.openapitools.client.model.EquilateralTriangle; +import org.openapitools.client.model.IsoscelesTriangle; +import org.openapitools.client.model.ScaleneTriangle; +import tools.jackson.annotation.JsonIgnoreProperties; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonSubTypes; +import tools.jackson.annotation.JsonTypeInfo; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Triangle + */ +class TriangleTest { + private final Triangle model = new Triangle(); + + /** + * Model tests for Triangle + */ + @Test + void testTriangle() { + // TODO: test Triangle + } + + /** + * Test the property 'shapeType' + */ + @Test + void shapeTypeTest() { + // TODO: test shapeType + } + + /** + * Test the property 'triangleType' + */ + @Test + void triangleTypeTest() { + // TODO: test triangleType + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/UserTest.java new file mode 100644 index 000000000000..6b87ebd3bef9 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/UserTest.java @@ -0,0 +1,140 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +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 + } + + /** + * Test the property 'objectWithNoDeclaredProps' + */ + @Test + void objectWithNoDeclaredPropsTest() { + // TODO: test objectWithNoDeclaredProps + } + + /** + * Test the property 'objectWithNoDeclaredPropsNullable' + */ + @Test + void objectWithNoDeclaredPropsNullableTest() { + // TODO: test objectWithNoDeclaredPropsNullable + } + + /** + * Test the property 'anyTypeProp' + */ + @Test + void anyTypePropTest() { + // TODO: test anyTypeProp + } + + /** + * Test the property 'anyTypePropNullable' + */ + @Test + void anyTypePropNullableTest() { + // TODO: test anyTypePropNullable + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/WhaleTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/WhaleTest.java new file mode 100644 index 000000000000..ec5353dcb69f --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/WhaleTest.java @@ -0,0 +1,64 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Whale + */ +class WhaleTest { + private final Whale model = new Whale(); + + /** + * Model tests for Whale + */ + @Test + void testWhale() { + // TODO: test Whale + } + + /** + * Test the property 'hasBaleen' + */ + @Test + void hasBaleenTest() { + // TODO: test hasBaleen + } + + /** + * Test the property 'hasTeeth' + */ + @Test + void hasTeethTest() { + // TODO: test hasTeeth + } + + /** + * Test the property 'className' + */ + @Test + void classNameTest() { + // TODO: test className + } + +} diff --git a/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ZebraTest.java b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ZebraTest.java new file mode 100644 index 000000000000..2ebdc2fbab92 --- /dev/null +++ b/samples/client/petstore/java/native-jackson3/src/test/java/org/openapitools/client/model/ZebraTest.java @@ -0,0 +1,56 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * 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.Arrays; +import tools.jackson.annotation.JsonInclude; +import tools.jackson.annotation.JsonProperty; +import tools.jackson.annotation.JsonCreator; +import tools.jackson.annotation.JsonTypeName; +import tools.jackson.annotation.JsonValue; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Model tests for Zebra + */ +class ZebraTest { + private final Zebra model = new Zebra(); + + /** + * Model tests for Zebra + */ + @Test + void testZebra() { + // TODO: test Zebra + } + + /** + * Test the property 'type' + */ + @Test + void typeTest() { + // TODO: test type + } + + /** + * Test the property 'className' + */ + @Test + void classNameTest() { + // TODO: test className + } + +} diff --git a/samples/client/petstore/java/native-jakarta/build.gradle b/samples/client/petstore/java/native-jakarta/build.gradle index f351487b7859..3babd9a7d267 100644 --- a/samples/client/petstore/java/native-jakarta/build.gradle +++ b/samples/client/petstore/java/native-jakarta/build.gradle @@ -83,6 +83,11 @@ dependencies { implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" implementation "org.apache.httpcomponents:httpmime:$httpmime_version" testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" +} + +test { + useJUnitPlatform() } // Use spotless plugin to automatically format code, remove unused import, etc diff --git a/samples/client/petstore/java/native-jakarta/docs/PetApi.md b/samples/client/petstore/java/native-jakarta/docs/PetApi.md index 51f089e85389..3c16a70f64bc 100644 --- a/samples/client/petstore/java/native-jakarta/docs/PetApi.md +++ b/samples/client/petstore/java/native-jakarta/docs/PetApi.md @@ -96,7 +96,7 @@ public class Example { ## addPetWithHttpInfo -> ApiResponse addPet addPetWithHttpInfo(pet) +> ApiResponse addPetWithHttpInfo(pet) Add a new pet to the store @@ -242,7 +242,7 @@ null (empty response body) ## deletePetWithHttpInfo -> ApiResponse deletePet deletePetWithHttpInfo(petId, apiKey) +> ApiResponse deletePetWithHttpInfo(petId, apiKey) Deletes a pet @@ -388,7 +388,7 @@ public class Example { ## findPetsByStatusWithHttpInfo -> ApiResponse> findPetsByStatus findPetsByStatusWithHttpInfo(status) +> ApiResponse> findPetsByStatusWithHttpInfo(status) Finds Pets by status @@ -534,7 +534,7 @@ public class Example { ## findPetsByTagsWithHttpInfo -> ApiResponse> findPetsByTags findPetsByTagsWithHttpInfo(tags) +> ApiResponse> findPetsByTagsWithHttpInfo(tags) Finds Pets by tags @@ -683,7 +683,7 @@ public class Example { ## getPetByIdWithHttpInfo -> ApiResponse getPetById getPetByIdWithHttpInfo(petId) +> ApiResponse getPetByIdWithHttpInfo(petId) Find pet by ID @@ -834,7 +834,7 @@ public class Example { ## updatePetWithHttpInfo -> ApiResponse updatePet updatePetWithHttpInfo(pet) +> ApiResponse updatePetWithHttpInfo(pet) Update an existing pet @@ -984,7 +984,7 @@ null (empty response body) ## updatePetWithFormWithHttpInfo -> ApiResponse updatePetWithForm updatePetWithFormWithHttpInfo(petId, name, status) +> ApiResponse updatePetWithFormWithHttpInfo(petId, name, status) Updates a pet in the store with form data @@ -1135,7 +1135,7 @@ public class Example { ## uploadFileWithHttpInfo -> ApiResponse uploadFile uploadFileWithHttpInfo(petId, additionalMetadata, _file) +> ApiResponse uploadFileWithHttpInfo(petId, additionalMetadata, _file) uploads an image diff --git a/samples/client/petstore/java/native-jakarta/docs/StoreApi.md b/samples/client/petstore/java/native-jakarta/docs/StoreApi.md index 7dfbbe315c11..7de17287615b 100644 --- a/samples/client/petstore/java/native-jakarta/docs/StoreApi.md +++ b/samples/client/petstore/java/native-jakarta/docs/StoreApi.md @@ -82,7 +82,7 @@ No authorization required ## deleteOrderWithHttpInfo -> ApiResponse deleteOrder deleteOrderWithHttpInfo(orderId) +> ApiResponse deleteOrderWithHttpInfo(orderId) Delete purchase order by ID @@ -219,7 +219,7 @@ This endpoint does not need any parameter. ## getInventoryWithHttpInfo -> ApiResponse> getInventory getInventoryWithHttpInfo() +> ApiResponse> getInventoryWithHttpInfo() Returns pet inventories by status @@ -358,7 +358,7 @@ No authorization required ## getOrderByIdWithHttpInfo -> ApiResponse getOrderById getOrderByIdWithHttpInfo(orderId) +> ApiResponse getOrderByIdWithHttpInfo(orderId) Find purchase order by ID @@ -495,7 +495,7 @@ No authorization required ## placeOrderWithHttpInfo -> ApiResponse placeOrder placeOrderWithHttpInfo(order) +> ApiResponse placeOrderWithHttpInfo(order) Place an order for a pet diff --git a/samples/client/petstore/java/native-jakarta/docs/UserApi.md b/samples/client/petstore/java/native-jakarta/docs/UserApi.md index da72405c908b..498438f5e9c2 100644 --- a/samples/client/petstore/java/native-jakarta/docs/UserApi.md +++ b/samples/client/petstore/java/native-jakarta/docs/UserApi.md @@ -96,7 +96,7 @@ null (empty response body) ## createUserWithHttpInfo -> ApiResponse createUser createUserWithHttpInfo(user) +> ApiResponse createUserWithHttpInfo(user) Create user @@ -242,7 +242,7 @@ null (empty response body) ## createUsersWithArrayInputWithHttpInfo -> ApiResponse createUsersWithArrayInput createUsersWithArrayInputWithHttpInfo(user) +> ApiResponse createUsersWithArrayInputWithHttpInfo(user) Creates list of users with given input array @@ -388,7 +388,7 @@ null (empty response body) ## createUsersWithListInputWithHttpInfo -> ApiResponse createUsersWithListInput createUsersWithListInputWithHttpInfo(user) +> ApiResponse createUsersWithListInputWithHttpInfo(user) Creates list of users with given input array @@ -535,7 +535,7 @@ null (empty response body) ## deleteUserWithHttpInfo -> ApiResponse deleteUser deleteUserWithHttpInfo(username) +> ApiResponse deleteUserWithHttpInfo(username) Delete user @@ -678,7 +678,7 @@ No authorization required ## getUserByNameWithHttpInfo -> ApiResponse getUserByName getUserByNameWithHttpInfo(username) +> ApiResponse getUserByNameWithHttpInfo(username) Get user by user name @@ -817,7 +817,7 @@ No authorization required ## loginUserWithHttpInfo -> ApiResponse loginUser loginUserWithHttpInfo(username, password) +> ApiResponse loginUserWithHttpInfo(username, password) Logs user into the system @@ -956,7 +956,7 @@ null (empty response body) ## logoutUserWithHttpInfo -> ApiResponse logoutUser logoutUserWithHttpInfo() +> ApiResponse logoutUserWithHttpInfo() Logs out current logged in user session @@ -1101,7 +1101,7 @@ null (empty response body) ## updateUserWithHttpInfo -> ApiResponse updateUser updateUserWithHttpInfo(username, user) +> ApiResponse updateUserWithHttpInfo(username, user) Updated user diff --git a/samples/client/petstore/java/native-useGzipFeature/build.gradle b/samples/client/petstore/java/native-useGzipFeature/build.gradle index f04358d21139..5db1cd956c11 100644 --- a/samples/client/petstore/java/native-useGzipFeature/build.gradle +++ b/samples/client/petstore/java/native-useGzipFeature/build.gradle @@ -81,6 +81,11 @@ dependencies { implementation "org.openapitools:jackson-databind-nullable:0.2.9" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" +} + +test { + useJUnitPlatform() } // Use spotless plugin to automatically format code, remove unused import, etc diff --git a/samples/client/petstore/java/native-useGzipFeature/docs/PetApi.md b/samples/client/petstore/java/native-useGzipFeature/docs/PetApi.md index 8c9f9212dd3c..7f3ff72e7f61 100644 --- a/samples/client/petstore/java/native-useGzipFeature/docs/PetApi.md +++ b/samples/client/petstore/java/native-useGzipFeature/docs/PetApi.md @@ -82,7 +82,7 @@ public class Example { ## addPetWithHttpInfo -> ApiResponse addPet addPetWithHttpInfo(pet) +> ApiResponse addPetWithHttpInfo(pet) Add a new pet to the store diff --git a/samples/client/petstore/java/native/build.gradle b/samples/client/petstore/java/native/build.gradle index b81cb8f4be1e..d16371df5380 100644 --- a/samples/client/petstore/java/native/build.gradle +++ b/samples/client/petstore/java/native/build.gradle @@ -85,6 +85,11 @@ dependencies { 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" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" +} + +test { + useJUnitPlatform() } // Use spotless plugin to automatically format code, remove unused import, etc diff --git a/samples/client/petstore/java/native/docs/AnotherFakeApi.md b/samples/client/petstore/java/native/docs/AnotherFakeApi.md index 444df75a332a..4b3378322368 100644 --- a/samples/client/petstore/java/native/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/native/docs/AnotherFakeApi.md @@ -76,7 +76,7 @@ No authorization required ## call123testSpecialTagsWithHttpInfo -> ApiResponse call123testSpecialTags call123testSpecialTagsWithHttpInfo(client) +> ApiResponse call123testSpecialTagsWithHttpInfo(client) To test special tags diff --git a/samples/client/petstore/java/native/docs/DefaultApi.md b/samples/client/petstore/java/native/docs/DefaultApi.md index 6dbf94105544..7955d54b62ea 100644 --- a/samples/client/petstore/java/native/docs/DefaultApi.md +++ b/samples/client/petstore/java/native/docs/DefaultApi.md @@ -70,7 +70,7 @@ No authorization required ## fooGetWithHttpInfo -> ApiResponse fooGet fooGetWithHttpInfo() +> ApiResponse fooGetWithHttpInfo() diff --git a/samples/client/petstore/java/native/docs/FakeApi.md b/samples/client/petstore/java/native/docs/FakeApi.md index f9dd65ba4ec9..1e572ffa370b 100644 --- a/samples/client/petstore/java/native/docs/FakeApi.md +++ b/samples/client/petstore/java/native/docs/FakeApi.md @@ -110,7 +110,7 @@ No authorization required ## fakeBigDecimalMapWithHttpInfo -> ApiResponse fakeBigDecimalMap fakeBigDecimalMapWithHttpInfo() +> ApiResponse fakeBigDecimalMapWithHttpInfo() @@ -234,7 +234,7 @@ No authorization required ## fakeHealthGetWithHttpInfo -> ApiResponse fakeHealthGet fakeHealthGetWithHttpInfo() +> ApiResponse fakeHealthGetWithHttpInfo() Health check endpoint @@ -362,7 +362,7 @@ No authorization required ## fakeOuterBooleanSerializeWithHttpInfo -> ApiResponse fakeOuterBooleanSerialize fakeOuterBooleanSerializeWithHttpInfo(body) +> ApiResponse fakeOuterBooleanSerializeWithHttpInfo(body) @@ -496,7 +496,7 @@ No authorization required ## fakeOuterCompositeSerializeWithHttpInfo -> ApiResponse fakeOuterCompositeSerialize fakeOuterCompositeSerializeWithHttpInfo(outerComposite) +> ApiResponse fakeOuterCompositeSerializeWithHttpInfo(outerComposite) @@ -630,7 +630,7 @@ No authorization required ## fakeOuterNumberSerializeWithHttpInfo -> ApiResponse fakeOuterNumberSerialize fakeOuterNumberSerializeWithHttpInfo(body) +> ApiResponse fakeOuterNumberSerializeWithHttpInfo(body) @@ -764,7 +764,7 @@ No authorization required ## fakeOuterStringSerializeWithHttpInfo -> ApiResponse fakeOuterStringSerialize fakeOuterStringSerializeWithHttpInfo(body) +> ApiResponse fakeOuterStringSerializeWithHttpInfo(body) @@ -892,7 +892,7 @@ No authorization required ## getApplicationJsonUtf8WithHttpInfo -> ApiResponse> getApplicationJsonUtf8 getApplicationJsonUtf8WithHttpInfo() +> ApiResponse> getApplicationJsonUtf8WithHttpInfo() application/json UTF8 @@ -1014,7 +1014,7 @@ No authorization required ## getArrayOfEnumsWithHttpInfo -> ApiResponse> getArrayOfEnums getArrayOfEnumsWithHttpInfo() +> ApiResponse> getArrayOfEnumsWithHttpInfo() Array of Enums @@ -1141,7 +1141,7 @@ No authorization required ## testAdditionalPropertiesReferenceWithHttpInfo -> ApiResponse testAdditionalPropertiesReference testAdditionalPropertiesReferenceWithHttpInfo(requestBody) +> ApiResponse testAdditionalPropertiesReferenceWithHttpInfo(requestBody) test referenced additionalProperties @@ -1273,7 +1273,7 @@ No authorization required ## testBodyWithFileSchemaWithHttpInfo -> ApiResponse testBodyWithFileSchema testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass) +> ApiResponse testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass) @@ -1405,7 +1405,7 @@ No authorization required ## testBodyWithQueryParamsWithHttpInfo -> ApiResponse testBodyWithQueryParams testBodyWithQueryParamsWithHttpInfo(query, user) +> ApiResponse testBodyWithQueryParamsWithHttpInfo(query, user) @@ -1538,7 +1538,7 @@ No authorization required ## testClientModelWithHttpInfo -> ApiResponse testClientModel testClientModelWithHttpInfo(client) +> ApiResponse testClientModelWithHttpInfo(client) To test \"client\" model @@ -1704,7 +1704,7 @@ null (empty response body) ## testEndpointParametersWithHttpInfo -> ApiResponse testEndpointParameters testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) +> ApiResponse testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -1884,7 +1884,7 @@ No authorization required ## testEnumParametersWithHttpInfo -> ApiResponse testEnumParameters testEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) +> ApiResponse testEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) To test enum parameters @@ -2049,7 +2049,7 @@ null (empty response body) ## testGroupParametersWithHttpInfo -> ApiResponse testGroupParameters testGroupParametersWithHttpInfo(testGroupParametersRequest) +> ApiResponse testGroupParametersWithHttpInfo(testGroupParametersRequest) Fake endpoint to test group parameters (optional) @@ -2214,7 +2214,7 @@ No authorization required ## testInlineAdditionalPropertiesWithHttpInfo -> ApiResponse testInlineAdditionalProperties testInlineAdditionalPropertiesWithHttpInfo(requestBody) +> ApiResponse testInlineAdditionalPropertiesWithHttpInfo(requestBody) test inline additionalProperties @@ -2346,7 +2346,7 @@ No authorization required ## testInlineFreeformAdditionalPropertiesWithHttpInfo -> ApiResponse testInlineFreeformAdditionalProperties testInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest) +> ApiResponse testInlineFreeformAdditionalPropertiesWithHttpInfo(testInlineFreeformAdditionalPropertiesRequest) test inline free-form additionalProperties @@ -2480,7 +2480,7 @@ No authorization required ## testJsonFormDataWithHttpInfo -> ApiResponse testJsonFormData testJsonFormDataWithHttpInfo(param, param2) +> ApiResponse testJsonFormDataWithHttpInfo(param, param2) test json serialization of form data @@ -2622,7 +2622,7 @@ No authorization required ## testQueryParameterCollectionFormatWithHttpInfo -> ApiResponse testQueryParameterCollectionFormat testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context) +> ApiResponse testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context) @@ -2762,7 +2762,7 @@ No authorization required ## testStringMapReferenceWithHttpInfo -> ApiResponse testStringMapReference testStringMapReferenceWithHttpInfo(requestBody) +> ApiResponse testStringMapReferenceWithHttpInfo(requestBody) test referenced string map diff --git a/samples/client/petstore/java/native/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/native/docs/FakeClassnameTags123Api.md index f139bfdd27c4..a5611e635a15 100644 --- a/samples/client/petstore/java/native/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/native/docs/FakeClassnameTags123Api.md @@ -83,7 +83,7 @@ public class Example { ## testClassnameWithHttpInfo -> ApiResponse testClassname testClassnameWithHttpInfo(client) +> ApiResponse testClassnameWithHttpInfo(client) To test class name in snake case diff --git a/samples/client/petstore/java/native/docs/PetApi.md b/samples/client/petstore/java/native/docs/PetApi.md index f818ead041c7..a6b14f0ddf79 100644 --- a/samples/client/petstore/java/native/docs/PetApi.md +++ b/samples/client/petstore/java/native/docs/PetApi.md @@ -97,7 +97,7 @@ null (empty response body) ## addPetWithHttpInfo -> ApiResponse addPet addPetWithHttpInfo(pet) +> ApiResponse addPetWithHttpInfo(pet) Add a new pet to the store @@ -242,7 +242,7 @@ null (empty response body) ## deletePetWithHttpInfo -> ApiResponse deletePet deletePetWithHttpInfo(petId, apiKey) +> ApiResponse deletePetWithHttpInfo(petId, apiKey) Deletes a pet @@ -389,7 +389,7 @@ public class Example { ## findPetsByStatusWithHttpInfo -> ApiResponse> findPetsByStatus findPetsByStatusWithHttpInfo(status) +> ApiResponse> findPetsByStatusWithHttpInfo(status) Finds Pets by status @@ -537,7 +537,7 @@ public class Example { ## findPetsByTagsWithHttpInfo -> ApiResponse> findPetsByTags findPetsByTagsWithHttpInfo(tags) +> ApiResponse> findPetsByTagsWithHttpInfo(tags) Finds Pets by tags @@ -687,7 +687,7 @@ public class Example { ## getPetByIdWithHttpInfo -> ApiResponse getPetById getPetByIdWithHttpInfo(petId) +> ApiResponse getPetByIdWithHttpInfo(petId) Find pet by ID @@ -837,7 +837,7 @@ null (empty response body) ## updatePetWithHttpInfo -> ApiResponse updatePet updatePetWithHttpInfo(pet) +> ApiResponse updatePetWithHttpInfo(pet) Update an existing pet @@ -986,7 +986,7 @@ null (empty response body) ## updatePetWithFormWithHttpInfo -> ApiResponse updatePetWithForm updatePetWithFormWithHttpInfo(petId, name, status) +> ApiResponse updatePetWithFormWithHttpInfo(petId, name, status) Updates a pet in the store with form data @@ -1137,7 +1137,7 @@ public class Example { ## uploadFileWithHttpInfo -> ApiResponse uploadFile uploadFileWithHttpInfo(petId, additionalMetadata, _file) +> ApiResponse uploadFileWithHttpInfo(petId, additionalMetadata, _file) uploads an image @@ -1289,7 +1289,7 @@ public class Example { ## uploadFileWithRequiredFileWithHttpInfo -> ApiResponse uploadFileWithRequiredFile uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata) +> ApiResponse uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata) uploads an image (required) diff --git a/samples/client/petstore/java/native/docs/StoreApi.md b/samples/client/petstore/java/native/docs/StoreApi.md index b10b04f4c412..9cb90ed4b1a9 100644 --- a/samples/client/petstore/java/native/docs/StoreApi.md +++ b/samples/client/petstore/java/native/docs/StoreApi.md @@ -82,7 +82,7 @@ No authorization required ## deleteOrderWithHttpInfo -> ApiResponse deleteOrder deleteOrderWithHttpInfo(orderId) +> ApiResponse deleteOrderWithHttpInfo(orderId) Delete purchase order by ID @@ -219,7 +219,7 @@ This endpoint does not need any parameter. ## getInventoryWithHttpInfo -> ApiResponse> getInventory getInventoryWithHttpInfo() +> ApiResponse> getInventoryWithHttpInfo() Returns pet inventories by status @@ -358,7 +358,7 @@ No authorization required ## getOrderByIdWithHttpInfo -> ApiResponse getOrderById getOrderByIdWithHttpInfo(orderId) +> ApiResponse getOrderByIdWithHttpInfo(orderId) Find purchase order by ID @@ -495,7 +495,7 @@ No authorization required ## placeOrderWithHttpInfo -> ApiResponse placeOrder placeOrderWithHttpInfo(order) +> ApiResponse placeOrderWithHttpInfo(order) Place an order for a pet diff --git a/samples/client/petstore/java/native/docs/UserApi.md b/samples/client/petstore/java/native/docs/UserApi.md index 6a427b4ef9a8..5529a388da69 100644 --- a/samples/client/petstore/java/native/docs/UserApi.md +++ b/samples/client/petstore/java/native/docs/UserApi.md @@ -89,7 +89,7 @@ No authorization required ## createUserWithHttpInfo -> ApiResponse createUser createUserWithHttpInfo(user) +> ApiResponse createUserWithHttpInfo(user) Create user @@ -221,7 +221,7 @@ No authorization required ## createUsersWithArrayInputWithHttpInfo -> ApiResponse createUsersWithArrayInput createUsersWithArrayInputWithHttpInfo(user) +> ApiResponse createUsersWithArrayInputWithHttpInfo(user) Creates list of users with given input array @@ -353,7 +353,7 @@ No authorization required ## createUsersWithListInputWithHttpInfo -> ApiResponse createUsersWithListInput createUsersWithListInputWithHttpInfo(user) +> ApiResponse createUsersWithListInputWithHttpInfo(user) Creates list of users with given input array @@ -486,7 +486,7 @@ No authorization required ## deleteUserWithHttpInfo -> ApiResponse deleteUser deleteUserWithHttpInfo(username) +> ApiResponse deleteUserWithHttpInfo(username) Delete user @@ -622,7 +622,7 @@ No authorization required ## getUserByNameWithHttpInfo -> ApiResponse getUserByName getUserByNameWithHttpInfo(username) +> ApiResponse getUserByNameWithHttpInfo(username) Get user by user name @@ -761,7 +761,7 @@ No authorization required ## loginUserWithHttpInfo -> ApiResponse loginUser loginUserWithHttpInfo(username, password) +> ApiResponse loginUserWithHttpInfo(username, password) Logs user into the system @@ -893,7 +893,7 @@ No authorization required ## logoutUserWithHttpInfo -> ApiResponse logoutUser logoutUserWithHttpInfo() +> ApiResponse logoutUserWithHttpInfo() Logs out current logged in user session @@ -1024,7 +1024,7 @@ No authorization required ## updateUserWithHttpInfo -> ApiResponse updateUser updateUserWithHttpInfo(username, user) +> ApiResponse updateUserWithHttpInfo(username, user) Updated user diff --git a/tools/jackson/databind/cfg/DateTimeFeature.class b/tools/jackson/databind/cfg/DateTimeFeature.class new file mode 100644 index 000000000000..068a9d8e13a7 Binary files /dev/null and b/tools/jackson/databind/cfg/DateTimeFeature.class differ