From 9385b481babd48026038cc62bac76e6d39912f2e Mon Sep 17 00:00:00 2001 From: wakata_sansan Date: Thu, 19 Feb 2026 11:04:14 +0900 Subject: [PATCH 1/7] fix(kotlin): use sealed interface for non-discriminator oneOf/anyOf in kotlinx_serialization --- .../languages/KotlinClientCodegen.java | 23 +++ .../kotlin-client/anyof_class.mustache | 150 +++++++++++++++++- .../kotlin-client/oneof_class.mustache | 135 +++++++++++++++- .../kotlin/KotlinClientCodegenModelTest.java | 70 ++++++++ .../client/models/ApiAnyOfUserOrPet.kt | 2 +- .../models/ApiAnyOfUserOrPetOrArrayString.kt | 2 +- 6 files changed, 376 insertions(+), 6 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java index 96e402a21be0..ad0e40501b5b 100755 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java @@ -567,6 +567,7 @@ public void processOpts() { // We replace paths like `/v1/foo/*` with `/v1/foo/<*>` to avoid this additionalProperties.put("sanitizePathComment", new ReplaceAllLambda("\\/\\*", "/<*>")); additionalProperties.put("fnToOneOfWrapperName", new ToOneOfWrapperName()); + additionalProperties.put("fnToValueClassName", new ToValueClassName()); } private void processDateLibrary() { @@ -1155,6 +1156,28 @@ public String formatFragment(String fragment) { } } + private static class ToValueClassName extends CustomLambda { + @Override + public String formatFragment(String fragment) { + // Strip generic type parameters and extract simple class names + // e.g. "kotlin.collections.List" -> "ListStringValue" + // e.g. "kotlin.String" -> "StringValue" + // e.g. "User" -> "UserValue" + StringBuilder sb = new StringBuilder(); + for (String part : fragment.split("[<>,]")) { + String trimmed = part.trim(); + if (trimmed.isEmpty()) continue; + String simpleName = trimmed.contains(".") + ? trimmed.substring(trimmed.lastIndexOf('.') + 1) + : trimmed; + sb.append(Character.toUpperCase(simpleName.charAt(0))); + sb.append(simpleName.substring(1)); + } + sb.append("Value"); + return sb.toString(); + } + } + @Override public void postProcess() { System.out.println("################################################################################"); diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/anyof_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/anyof_class.mustache index 213b2fc15645..b326e9f14649 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/anyof_class.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/anyof_class.mustache @@ -37,6 +37,25 @@ import kotlinx.serialization.builtins.serializer import kotlinx.serialization.encoding.Decoder import kotlinx.serialization.encoding.Encoder {{/enumUnknownDefaultCase}} +{{^enumUnknownDefaultCase}} +{{#generateOneOfAnyOfWrappers}} +import kotlinx.serialization.KSerializer +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder +{{/generateOneOfAnyOfWrappers}} +{{/enumUnknownDefaultCase}} +{{#generateOneOfAnyOfWrappers}} +import kotlinx.serialization.SerializationException +import kotlinx.serialization.descriptors.SerialDescriptor +import kotlinx.serialization.descriptors.buildClassSerialDescriptor +import kotlinx.serialization.json.JsonDecoder +import kotlinx.serialization.json.JsonEncoder +import kotlinx.serialization.json.JsonArray +import kotlinx.serialization.json.JsonElement +import kotlinx.serialization.json.JsonPrimitive +import kotlinx.serialization.json.decodeFromJsonElement +import kotlinx.serialization.json.encodeToJsonElement +{{/generateOneOfAnyOfWrappers}} {{#hasEnums}} {{/hasEnums}} {{/kotlinx_serialization}} @@ -57,7 +76,9 @@ import java.io.Serializable import {{roomModelPackage}}.{{classname}}RoomModel import {{packageName}}.infrastructure.ITransformForStorage {{/generateRoomModels}} +{{^kotlinx_serialization}} import java.io.IOException +{{/kotlinx_serialization}} /** * {{{description}}} @@ -66,12 +87,138 @@ import java.io.IOException {{#parcelizeModels}} @Parcelize {{/parcelizeModels}} +{{^generateOneOfAnyOfWrappers}} {{#multiplatform}}{{^discriminator}}@Serializable{{/discriminator}}{{/multiplatform}}{{#kotlinx_serialization}}{{#serializableModel}}@KSerializable{{/serializableModel}}{{^serializableModel}}@Serializable{{/serializableModel}}{{/kotlinx_serialization}}{{#moshi}}{{#moshiCodeGen}}@JsonClass(generateAdapter = true){{/moshiCodeGen}}{{/moshi}}{{#jackson}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{/jackson}} +{{/generateOneOfAnyOfWrappers}} +{{#kotlinx_serialization}} +{{#generateOneOfAnyOfWrappers}} +{{#serializableModel}}@KSerializable(with = {{classname}}Serializer::class){{/serializableModel}}{{^serializableModel}}@Serializable(with = {{classname}}Serializer::class){{/serializableModel}} +{{/generateOneOfAnyOfWrappers}} +{{/kotlinx_serialization}} {{#isDeprecated}} @Deprecated(message = "This schema is deprecated.") {{/isDeprecated}} {{>additionalModelTypeAnnotations}} +{{#kotlinx_serialization}} +{{#generateOneOfAnyOfWrappers}} +{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}sealed interface {{classname}} { +{{#composedSchemas}} +{{#anyOf}} + @JvmInline + {{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}value class {{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}}(val value: {{{dataType}}}) : {{classname}} + +{{/anyOf}} +{{/composedSchemas}} +} + +{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}object {{classname}}Serializer : KSerializer<{{classname}}> { + override val descriptor: SerialDescriptor = buildClassSerialDescriptor("{{classname}}") + + override fun serialize(encoder: Encoder, value: {{classname}}) { + val jsonEncoder = encoder as? JsonEncoder ?: throw SerializationException("{{classname}} can only be serialized with Json") + + when (value) { + {{#composedSchemas}} + {{#anyOf}} + {{#isArray}} + is {{classname}}.{{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}} -> jsonEncoder.encodeJsonElement(jsonEncoder.json.encodeToJsonElement(value.value)) + {{/isArray}} + {{^isArray}} + {{#isPrimitiveType}} + {{#isString}} + is {{classname}}.{{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}} -> jsonEncoder.encodeString(value.value) + {{/isString}} + {{#isBoolean}} + is {{classname}}.{{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}} -> jsonEncoder.encodeBoolean(value.value) + {{/isBoolean}} + {{#isInteger}} + {{^isLong}} + is {{classname}}.{{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}} -> jsonEncoder.encodeInt(value.value) + {{/isLong}} + {{/isInteger}} + {{#isLong}} + is {{classname}}.{{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}} -> jsonEncoder.encodeLong(value.value) + {{/isLong}} + {{#isNumber}} + {{#isDouble}} + is {{classname}}.{{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}} -> jsonEncoder.encodeDouble(value.value) + {{/isDouble}} + {{#isFloat}} + is {{classname}}.{{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}} -> jsonEncoder.encodeFloat(value.value) + {{/isFloat}} + {{/isNumber}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + is {{classname}}.{{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}} -> jsonEncoder.encodeSerializableValue({{{dataType}}}.serializer(), value.value) + {{/isPrimitiveType}} + {{/isArray}} + {{/anyOf}} + {{/composedSchemas}} + } + } + + override fun deserialize(decoder: Decoder): {{classname}} { + val jsonDecoder = decoder as? JsonDecoder ?: throw SerializationException("{{classname}} can only be deserialized with Json") + val jsonElement = jsonDecoder.decodeJsonElement() + + val errorMessages = mutableListOf() + + {{#composedSchemas}} + {{#anyOf}} + {{#isArray}} + if (jsonElement is JsonArray) { + try { + val instance = jsonDecoder.json.decodeFromJsonElement<{{{dataType}}}>(jsonElement) + return {{classname}}.{{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}}(instance) + } catch (e: Exception) { + errorMessages.add("Failed to deserialize as {{{dataType}}}: ${e.message}") + } + } + {{/isArray}} + {{^isArray}} + {{#isPrimitiveType}} + {{#isString}} + if (jsonElement is JsonPrimitive && jsonElement.isString) { + try { + val instance = jsonDecoder.json.decodeFromJsonElement<{{{dataType}}}>(jsonElement) + return {{classname}}.{{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}}(instance) + } catch (e: Exception) { + errorMessages.add("Failed to deserialize as {{{dataType}}}: ${e.message}") + } + } + {{/isString}} + {{^isString}} + if (jsonElement is JsonPrimitive && !jsonElement.isString) { + try { + val instance = jsonDecoder.json.decodeFromJsonElement<{{{dataType}}}>(jsonElement) + return {{classname}}.{{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}}(instance) + } catch (e: Exception) { + errorMessages.add("Failed to deserialize as {{{dataType}}}: ${e.message}") + } + } + {{/isString}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + if (jsonElement !is JsonPrimitive) { + try { + val instance = jsonDecoder.json.decodeFromJsonElement<{{{dataType}}}>(jsonElement) + return {{classname}}.{{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}}(instance) + } catch (e: Exception) { + errorMessages.add("Failed to deserialize as {{{dataType}}}: ${e.message}") + } + } + {{/isPrimitiveType}} + {{/isArray}} + {{/anyOf}} + {{/composedSchemas}} + + throw SerializationException("Cannot deserialize {{classname}}. Tried: ${errorMessages.joinToString(", ")}") + } +} +{{/generateOneOfAnyOfWrappers}} +{{/kotlinx_serialization}} +{{^kotlinx_serialization}} {{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}data class {{classname}}(var actualInstance: Any? = null) { class CustomTypeAdapterFactory : TypeAdapterFactory { @@ -334,4 +481,5 @@ import java.io.IOException } } } -} \ No newline at end of file +} +{{/kotlinx_serialization}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/oneof_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/oneof_class.mustache index 6986ff31e043..0d02bb2439ca 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/oneof_class.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/oneof_class.mustache @@ -39,22 +39,30 @@ import kotlinx.serialization.encoding.Encoder {{/enumUnknownDefaultCase}} {{^enumUnknownDefaultCase}} {{#generateOneOfAnyOfWrappers}} -{{#discriminator}} import kotlinx.serialization.KSerializer import kotlinx.serialization.encoding.Decoder import kotlinx.serialization.encoding.Encoder -{{/discriminator}} {{/generateOneOfAnyOfWrappers}} {{/enumUnknownDefaultCase}} {{#generateOneOfAnyOfWrappers}} -{{#discriminator}} import kotlinx.serialization.SerializationException import kotlinx.serialization.descriptors.SerialDescriptor import kotlinx.serialization.descriptors.buildClassSerialDescriptor import kotlinx.serialization.json.JsonDecoder +{{^discriminator}} +import kotlinx.serialization.json.JsonElement +{{/discriminator}} import kotlinx.serialization.json.JsonEncoder +{{#discriminator}} import kotlinx.serialization.json.JsonObject +{{/discriminator}} import kotlinx.serialization.json.JsonPrimitive +{{^discriminator}} +import kotlinx.serialization.json.JsonArray +import kotlinx.serialization.json.decodeFromJsonElement +import kotlinx.serialization.json.encodeToJsonElement +{{/discriminator}} +{{#discriminator}} import kotlinx.serialization.json.jsonObject import kotlinx.serialization.json.jsonPrimitive {{/discriminator}} @@ -100,6 +108,9 @@ import java.io.IOException {{#discriminator}} @Serializable(with = {{classname}}Serializer::class) {{/discriminator}} +{{^discriminator}} +{{#serializableModel}}@KSerializable(with = {{classname}}Serializer::class){{/serializableModel}}{{^serializableModel}}@Serializable(with = {{classname}}Serializer::class){{/serializableModel}} +{{/discriminator}} {{/generateOneOfAnyOfWrappers}} {{/kotlinx_serialization}} {{#isDeprecated}} @@ -107,6 +118,7 @@ import java.io.IOException {{/isDeprecated}} {{>additionalModelTypeAnnotations}} {{#kotlinx_serialization}} +{{#discriminator}} {{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}sealed interface {{classname}} { {{#discriminator.mappedModels}} @JvmInline @@ -150,6 +162,123 @@ import java.io.IOException } } } +{{/discriminator}} +{{^discriminator}} +{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}sealed interface {{classname}} { +{{#composedSchemas}} +{{#oneOf}} + @JvmInline + {{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}value class {{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}}(val value: {{{dataType}}}) : {{classname}} + +{{/oneOf}} +{{/composedSchemas}} +} + +{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}object {{classname}}Serializer : KSerializer<{{classname}}> { + override val descriptor: SerialDescriptor = buildClassSerialDescriptor("{{classname}}") + + override fun serialize(encoder: Encoder, value: {{classname}}) { + val jsonEncoder = encoder as? JsonEncoder ?: throw SerializationException("{{classname}} can only be serialized with Json") + + when (value) { + {{#composedSchemas}} + {{#oneOf}} + {{#isArray}} + is {{classname}}.{{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}} -> jsonEncoder.encodeJsonElement(jsonEncoder.json.encodeToJsonElement(value.value)) + {{/isArray}} + {{^isArray}} + {{#isPrimitiveType}} + {{#isString}} + is {{classname}}.{{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}} -> jsonEncoder.encodeString(value.value) + {{/isString}} + {{#isBoolean}} + is {{classname}}.{{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}} -> jsonEncoder.encodeBoolean(value.value) + {{/isBoolean}} + {{#isInteger}} + {{^isLong}} + is {{classname}}.{{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}} -> jsonEncoder.encodeInt(value.value) + {{/isLong}} + {{/isInteger}} + {{#isLong}} + is {{classname}}.{{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}} -> jsonEncoder.encodeLong(value.value) + {{/isLong}} + {{#isNumber}} + {{#isDouble}} + is {{classname}}.{{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}} -> jsonEncoder.encodeDouble(value.value) + {{/isDouble}} + {{#isFloat}} + is {{classname}}.{{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}} -> jsonEncoder.encodeFloat(value.value) + {{/isFloat}} + {{/isNumber}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + is {{classname}}.{{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}} -> jsonEncoder.encodeSerializableValue({{{dataType}}}.serializer(), value.value) + {{/isPrimitiveType}} + {{/isArray}} + {{/oneOf}} + {{/composedSchemas}} + } + } + + override fun deserialize(decoder: Decoder): {{classname}} { + val jsonDecoder = decoder as? JsonDecoder ?: throw SerializationException("{{classname}} can only be deserialized with Json") + val jsonElement = jsonDecoder.decodeJsonElement() + + val errorMessages = mutableListOf() + + {{#composedSchemas}} + {{#oneOf}} + {{#isArray}} + if (jsonElement is JsonArray) { + try { + val instance = jsonDecoder.json.decodeFromJsonElement<{{{dataType}}}>(jsonElement) + return {{classname}}.{{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}}(instance) + } catch (e: Exception) { + errorMessages.add("Failed to deserialize as {{{dataType}}}: ${e.message}") + } + } + {{/isArray}} + {{^isArray}} + {{#isPrimitiveType}} + {{#isString}} + if (jsonElement is JsonPrimitive && jsonElement.isString) { + try { + val instance = jsonDecoder.json.decodeFromJsonElement<{{{dataType}}}>(jsonElement) + return {{classname}}.{{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}}(instance) + } catch (e: Exception) { + errorMessages.add("Failed to deserialize as {{{dataType}}}: ${e.message}") + } + } + {{/isString}} + {{^isString}} + if (jsonElement is JsonPrimitive && !jsonElement.isString) { + try { + val instance = jsonDecoder.json.decodeFromJsonElement<{{{dataType}}}>(jsonElement) + return {{classname}}.{{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}}(instance) + } catch (e: Exception) { + errorMessages.add("Failed to deserialize as {{{dataType}}}: ${e.message}") + } + } + {{/isString}} + {{/isPrimitiveType}} + {{^isPrimitiveType}} + if (jsonElement !is JsonPrimitive) { + try { + val instance = jsonDecoder.json.decodeFromJsonElement<{{{dataType}}}>(jsonElement) + return {{classname}}.{{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}}(instance) + } catch (e: Exception) { + errorMessages.add("Failed to deserialize as {{{dataType}}}: ${e.message}") + } + } + {{/isPrimitiveType}} + {{/isArray}} + {{/oneOf}} + {{/composedSchemas}} + + throw SerializationException("Cannot deserialize {{classname}}. Tried: ${errorMessages.joinToString(", ")}") + } +} +{{/discriminator}} {{/kotlinx_serialization}} {{^kotlinx_serialization}} {{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}data class {{classname}}(var actualInstance: Any? = null) { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinClientCodegenModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinClientCodegenModelTest.java index 4b844bc3b57f..023374b9e248 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinClientCodegenModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinClientCodegenModelTest.java @@ -614,6 +614,76 @@ public void polymorphicKotlinxSerialization() throws IOException { TestUtils.assertFileContains(birdKt, "@SerialName(value = \"BIRD\")"); } + @Test(description = "generate oneOf wrapper with primitive types using kotlinx_serialization") + public void oneOfPrimitiveKotlinxSerialization() throws IOException { + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("kotlin") + .setLibrary("jvm-retrofit2") + .setAdditionalProperties(new HashMap<>() {{ + put(CodegenConstants.SERIALIZATION_LIBRARY, "kotlinx_serialization"); + put("generateOneOfAnyOfWrappers", true); + }}) + .setInputSpec("src/test/resources/3_0/issue_19942.json") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + DefaultGenerator generator = new DefaultGenerator(); + generator.opts(clientOptInput).generate(); + + final Path oneOfModelKt = Paths.get(output + "/src/main/kotlin/org/openapitools/client/models/ObjectWithComplexOneOfId.kt"); + // generates sealed interface (not data class) + TestUtils.assertFileContains(oneOfModelKt, "sealed interface ObjectWithComplexOneOfId"); + // has value class variants + TestUtils.assertFileContains(oneOfModelKt, "value class StringValue(val value: kotlin.String) : ObjectWithComplexOneOfId"); + // has a custom KSerializer + TestUtils.assertFileContains(oneOfModelKt, "object ObjectWithComplexOneOfIdSerializer : KSerializer"); + // serializer handles primitive types via value class pattern + TestUtils.assertFileContains(oneOfModelKt, "is ObjectWithComplexOneOfId.StringValue -> jsonEncoder.encodeString(value.value)"); + // deserializer uses type guards + TestUtils.assertFileContains(oneOfModelKt, "jsonElement is JsonPrimitive && jsonElement.isString"); + // parent model references the oneOf wrapper type + final Path parentModelKt = Paths.get(output + "/src/main/kotlin/org/openapitools/client/models/ObjectWithComplexOneOf.kt"); + TestUtils.assertFileContains(parentModelKt, "val id: ObjectWithComplexOneOfId?"); + } + + @Test(description = "generate anyOf wrapper with primitive types using kotlinx_serialization") + public void anyOfPrimitiveKotlinxSerialization() throws IOException { + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("kotlin") + .setLibrary("jvm-retrofit2") + .setAdditionalProperties(new HashMap<>() {{ + put(CodegenConstants.SERIALIZATION_LIBRARY, "kotlinx_serialization"); + put("generateOneOfAnyOfWrappers", true); + }}) + .setInputSpec("src/test/resources/3_0/issue_19942.json") + .setOutputDir(output.getAbsolutePath().replace("\\", "/")); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + DefaultGenerator generator = new DefaultGenerator(); + generator.opts(clientOptInput).generate(); + + final Path anyOfModelKt = Paths.get(output + "/src/main/kotlin/org/openapitools/client/models/ObjectWithComplexAnyOfId.kt"); + // generates sealed interface (not data class) + TestUtils.assertFileContains(anyOfModelKt, "sealed interface ObjectWithComplexAnyOfId"); + // has value class variants + TestUtils.assertFileContains(anyOfModelKt, "value class StringValue(val value: kotlin.String) : ObjectWithComplexAnyOfId"); + // has a custom KSerializer + TestUtils.assertFileContains(anyOfModelKt, "object ObjectWithComplexAnyOfIdSerializer : KSerializer"); + // serializer handles primitive types via value class pattern + TestUtils.assertFileContains(anyOfModelKt, "is ObjectWithComplexAnyOfId.StringValue -> jsonEncoder.encodeString(value.value)"); + // deserializer uses type guards + TestUtils.assertFileContains(anyOfModelKt, "jsonElement is JsonPrimitive && jsonElement.isString"); + // parent model references the anyOf wrapper type + final Path parentModelKt = Paths.get(output + "/src/main/kotlin/org/openapitools/client/models/ObjectWithComplexAnyOf.kt"); + TestUtils.assertFileContains(parentModelKt, "val id: ObjectWithComplexAnyOfId?"); + } + @Test(description = "generate polymorphic jackson model") public void polymorphicJacksonSerialization() throws IOException { File output = Files.createTempDirectory("test").toFile(); diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiAnyOfUserOrPet.kt b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiAnyOfUserOrPet.kt index e7c337f2ebd7..bc94ecdcc81d 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiAnyOfUserOrPet.kt +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiAnyOfUserOrPet.kt @@ -36,7 +36,6 @@ import java.io.IOException * */ - data class ApiAnyOfUserOrPet(var actualInstance: Any? = null) { class CustomTypeAdapterFactory : TypeAdapterFactory { @@ -151,3 +150,4 @@ data class ApiAnyOfUserOrPet(var actualInstance: Any? = null) { } } } + diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiAnyOfUserOrPetOrArrayString.kt b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiAnyOfUserOrPetOrArrayString.kt index 6f349a94b4b8..e935dee1958f 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiAnyOfUserOrPetOrArrayString.kt +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiAnyOfUserOrPetOrArrayString.kt @@ -36,7 +36,6 @@ import java.io.IOException * */ - data class ApiAnyOfUserOrPetOrArrayString(var actualInstance: Any? = null) { class CustomTypeAdapterFactory : TypeAdapterFactory { @@ -202,3 +201,4 @@ data class ApiAnyOfUserOrPetOrArrayString(var actualInstance: Any? = null) { } } } + From 4893c3577bc765095169a4b18bc5f61037b0bc2f Mon Sep 17 00:00:00 2001 From: wakata_sansan Date: Thu, 19 Feb 2026 12:32:51 +0900 Subject: [PATCH 2/7] add sample and CI config for non-discriminator oneOf/anyOf with kotlinx_serialization --- .github/workflows/samples-kotlin-client.yaml | 1 + ...lin-oneOf-anyOf-kotlinx-serialization.yaml | 12 + .../.openapi-generator-ignore | 23 ++ .../.openapi-generator/FILES | 74 ++++ .../.openapi-generator/VERSION | 1 + .../README.md | 109 ++++++ .../build.gradle | 88 +++++ .../docs/Annotation.md | 10 + .../docs/AnyOfUserOrPet.md | 29 ++ .../docs/AnyOfUserOrPetOrArrayString.md | 29 ++ .../docs/ApiResponse.md | 12 + .../docs/Category.md | 11 + .../docs/FakeApi.md | 88 +++++ .../docs/Order.md | 22 ++ .../docs/Pet.md | 22 ++ .../docs/PetApi.md | 322 ++++++++++++++++++ .../docs/StoreApi.md | 157 +++++++++ .../docs/Tag.md | 11 + .../docs/User.md | 17 + .../docs/UserApi.md | 313 +++++++++++++++++ .../docs/UserOrPet.md | 29 ++ .../docs/UserOrPetOrArrayString.md | 29 ++ .../gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 43504 bytes .../gradle/wrapper/gradle-wrapper.properties | 7 + .../gradlew | 252 ++++++++++++++ .../gradlew.bat | 94 +++++ .../proguard-rules.pro | 11 + .../settings.gradle | 1 + .../org/openapitools/client/apis/FakeApi.kt | 43 +++ .../org/openapitools/client/apis/PetApi.kt | 147 ++++++++ .../org/openapitools/client/apis/StoreApi.kt | 68 ++++ .../org/openapitools/client/apis/UserApi.kt | 123 +++++++ .../openapitools/client/auth/ApiKeyAuth.kt | 50 +++ .../org/openapitools/client/auth/OAuth.kt | 151 ++++++++ .../org/openapitools/client/auth/OAuthFlow.kt | 5 + .../client/auth/OAuthOkHttpClient.kt | 61 ++++ .../client/infrastructure/ApiClient.kt | 222 ++++++++++++ .../infrastructure/AtomicBooleanAdapter.kt | 19 ++ .../infrastructure/AtomicIntegerAdapter.kt | 19 ++ .../infrastructure/AtomicLongAdapter.kt | 19 ++ .../infrastructure/BigDecimalAdapter.kt | 15 + .../infrastructure/BigIntegerAdapter.kt | 20 ++ .../infrastructure/CollectionFormats.kt | 56 +++ .../client/infrastructure/LocalDateAdapter.kt | 22 ++ .../infrastructure/LocalDateTimeAdapter.kt | 22 ++ .../infrastructure/OffsetDateTimeAdapter.kt | 22 ++ .../client/infrastructure/ResponseExt.kt | 4 + .../client/infrastructure/Serializer.kt | 73 ++++ .../infrastructure/StringBuilderAdapter.kt | 18 + .../client/infrastructure/URIAdapter.kt | 19 ++ .../client/infrastructure/URLAdapter.kt | 19 ++ .../client/infrastructure/UUIDAdapter.kt | 21 ++ .../openapitools/client/models/Annotation.kt | 44 +++ .../client/models/AnyOfUserOrPet.kt | 95 ++++++ .../models/AnyOfUserOrPetOrArrayString.kt | 107 ++++++ .../openapitools/client/models/Category.kt | 48 +++ .../client/models/ModelApiResponse.kt | 52 +++ .../org/openapitools/client/models/Order.kt | 91 +++++ .../org/openapitools/client/models/Pet.kt | 94 +++++ .../org/openapitools/client/models/Tag.kt | 48 +++ .../org/openapitools/client/models/User.kt | 73 ++++ .../openapitools/client/models/UserOrPet.kt | 94 +++++ .../client/models/UserOrPetOrArrayString.kt | 106 ++++++ .../openapitools/client/apis/FakeApiTest.kt | 47 +++ .../openapitools/client/apis/PetApiTest.kt | 98 ++++++ .../openapitools/client/apis/StoreApiTest.kt | 60 ++++ .../openapitools/client/apis/UserApiTest.kt | 89 +++++ .../client/models/AnnotationTest.kt | 35 ++ .../models/AnyOfUserOrPetOrArrayStringTest.kt | 111 ++++++ .../client/models/AnyOfUserOrPetTest.kt | 111 ++++++ .../client/models/ApiResponseTest.kt | 47 +++ .../client/models/CategoryTest.kt | 41 +++ .../openapitools/client/models/OrderTest.kt | 65 ++++ .../org/openapitools/client/models/PetTest.kt | 67 ++++ .../org/openapitools/client/models/TagTest.kt | 41 +++ .../models/UserOrPetOrArrayStringTest.kt | 111 ++++++ .../client/models/UserOrPetTest.kt | 111 ++++++ .../openapitools/client/models/UserTest.kt | 77 +++++ 78 files changed, 4975 insertions(+) create mode 100644 bin/configs/kotlin-oneOf-anyOf-kotlinx-serialization.yaml create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/.openapi-generator-ignore create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/.openapi-generator/FILES create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/.openapi-generator/VERSION create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/README.md create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/build.gradle create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Annotation.md create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/AnyOfUserOrPet.md create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/AnyOfUserOrPetOrArrayString.md create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/ApiResponse.md create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Category.md create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/FakeApi.md create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Order.md create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Pet.md create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/PetApi.md create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/StoreApi.md create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Tag.md create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/User.md create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/UserApi.md create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/UserOrPet.md create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/UserOrPetOrArrayString.md create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/gradle/wrapper/gradle-wrapper.jar create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/gradle/wrapper/gradle-wrapper.properties create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/gradlew create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/gradlew.bat create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/proguard-rules.pro create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/settings.gradle create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/PetApi.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/UserApi.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/OAuth.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/OAuthFlow.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/OAuthOkHttpClient.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/AtomicBooleanAdapter.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/AtomicIntegerAdapter.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/AtomicLongAdapter.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExt.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/StringBuilderAdapter.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/URLAdapter.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Annotation.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/AnyOfUserOrPet.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/AnyOfUserOrPetOrArrayString.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Category.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Order.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Pet.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Tag.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/User.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/UserOrPet.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/UserOrPetOrArrayString.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/FakeApiTest.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/PetApiTest.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/StoreApiTest.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/UserApiTest.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/AnnotationTest.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/AnyOfUserOrPetOrArrayStringTest.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/AnyOfUserOrPetTest.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/ApiResponseTest.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/CategoryTest.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/OrderTest.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/PetTest.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/TagTest.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/UserOrPetOrArrayStringTest.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/UserOrPetTest.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/UserTest.kt diff --git a/.github/workflows/samples-kotlin-client.yaml b/.github/workflows/samples-kotlin-client.yaml index 506e8d3fecd3..0a5dafbbed1a 100644 --- a/.github/workflows/samples-kotlin-client.yaml +++ b/.github/workflows/samples-kotlin-client.yaml @@ -70,6 +70,7 @@ jobs: - samples/client/others/kotlin-integer-enum - samples/client/petstore/kotlin-allOf-discriminator-kotlinx-serialization - samples/client/others/kotlin-oneOf-discriminator-kotlinx-serialization + - samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 diff --git a/bin/configs/kotlin-oneOf-anyOf-kotlinx-serialization.yaml b/bin/configs/kotlin-oneOf-anyOf-kotlinx-serialization.yaml new file mode 100644 index 000000000000..a9a18f549736 --- /dev/null +++ b/bin/configs/kotlin-oneOf-anyOf-kotlinx-serialization.yaml @@ -0,0 +1,12 @@ +generatorName: kotlin +outputDir: samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization +inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-client +additionalProperties: + artifactId: kotlin-oneOf-anyOf-kotlinx-serialization + serializableModel: "false" + dateLibrary: java8 + library: jvm-retrofit2 + enumUnknownDefaultCase: true + serializationLibrary: kotlinx_serialization + generateOneOfAnyOfWrappers: true diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/.openapi-generator-ignore b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/.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/others/kotlin-oneOf-anyOf-kotlinx-serialization/.openapi-generator/FILES b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/.openapi-generator/FILES new file mode 100644 index 000000000000..2a73d7bb8014 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/.openapi-generator/FILES @@ -0,0 +1,74 @@ +.openapi-generator-ignore +README.md +build.gradle +docs/Annotation.md +docs/AnyOfUserOrPet.md +docs/AnyOfUserOrPetOrArrayString.md +docs/ApiResponse.md +docs/Category.md +docs/FakeApi.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md +docs/UserOrPet.md +docs/UserOrPetOrArrayString.md +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +proguard-rules.pro +settings.gradle +src/main/kotlin/org/openapitools/client/apis/FakeApi.kt +src/main/kotlin/org/openapitools/client/apis/PetApi.kt +src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +src/main/kotlin/org/openapitools/client/apis/UserApi.kt +src/main/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt +src/main/kotlin/org/openapitools/client/auth/OAuth.kt +src/main/kotlin/org/openapitools/client/auth/OAuthFlow.kt +src/main/kotlin/org/openapitools/client/auth/OAuthOkHttpClient.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +src/main/kotlin/org/openapitools/client/infrastructure/AtomicBooleanAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/AtomicIntegerAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/AtomicLongAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt +src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/ResponseExt.kt +src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +src/main/kotlin/org/openapitools/client/infrastructure/StringBuilderAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/URLAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt +src/main/kotlin/org/openapitools/client/models/Annotation.kt +src/main/kotlin/org/openapitools/client/models/AnyOfUserOrPet.kt +src/main/kotlin/org/openapitools/client/models/AnyOfUserOrPetOrArrayString.kt +src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +src/main/kotlin/org/openapitools/client/models/Order.kt +src/main/kotlin/org/openapitools/client/models/Pet.kt +src/main/kotlin/org/openapitools/client/models/Tag.kt +src/main/kotlin/org/openapitools/client/models/User.kt +src/main/kotlin/org/openapitools/client/models/UserOrPet.kt +src/main/kotlin/org/openapitools/client/models/UserOrPetOrArrayString.kt +src/test/kotlin/org/openapitools/client/apis/FakeApiTest.kt +src/test/kotlin/org/openapitools/client/apis/PetApiTest.kt +src/test/kotlin/org/openapitools/client/apis/StoreApiTest.kt +src/test/kotlin/org/openapitools/client/apis/UserApiTest.kt +src/test/kotlin/org/openapitools/client/models/AnnotationTest.kt +src/test/kotlin/org/openapitools/client/models/AnyOfUserOrPetOrArrayStringTest.kt +src/test/kotlin/org/openapitools/client/models/AnyOfUserOrPetTest.kt +src/test/kotlin/org/openapitools/client/models/ApiResponseTest.kt +src/test/kotlin/org/openapitools/client/models/CategoryTest.kt +src/test/kotlin/org/openapitools/client/models/OrderTest.kt +src/test/kotlin/org/openapitools/client/models/PetTest.kt +src/test/kotlin/org/openapitools/client/models/TagTest.kt +src/test/kotlin/org/openapitools/client/models/UserOrPetOrArrayStringTest.kt +src/test/kotlin/org/openapitools/client/models/UserOrPetTest.kt +src/test/kotlin/org/openapitools/client/models/UserTest.kt diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/.openapi-generator/VERSION b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/.openapi-generator/VERSION new file mode 100644 index 000000000000..0610c66bc14f --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.21.0-SNAPSHOT diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/README.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/README.md new file mode 100644 index 000000000000..e6fe9407abe5 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/README.md @@ -0,0 +1,109 @@ +# org.openapitools.client - Kotlin client library for OpenAPI Petstore + +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Generator version: 7.21.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.KotlinClientCodegen + +## Requires + +* Kotlin 2.2.20 +* Gradle 8.14 + +## Build + +First, create the gradle wrapper script: + +``` +gradle wrapper +``` + +Then, run: + +``` +./gradlew check assemble +``` + +This runs all tests and packages the library. + +## Features/Implementation Notes + +* Supports JSON inputs/outputs, File inputs, and Form inputs. +* Supports collection formats for query parameters: csv, tsv, ssv, pipes. +* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions. +* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets. + + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Class | Method | HTTP request | Description | +| ------------ | ------------- | ------------- | ------------- | +| *FakeApi* | [**annotations**](docs/FakeApi.md#annotations) | **POST** fake/annotations | annotate | +| *FakeApi* | [**updatePetWithFormNumber**](docs/FakeApi.md#updatepetwithformnumber) | **PUT** fake/annotations | Updates a pet in the store with form data (number) | +| *PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** pet | Add a new pet to the store | +| *PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** pet/{petId} | Deletes a pet | +| *PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** pet/findByStatus | Finds Pets by status | +| *PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** pet/findByTags | Finds Pets by tags | +| *PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** pet/{petId} | Find pet by ID | +| *PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** pet | Update an existing pet | +| *PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** pet/{petId} | Updates a pet in the store with form data | +| *PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** pet/{petId}/uploadImage | uploads an image | +| *StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** store/order/{orderId} | Delete purchase order by ID | +| *StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** store/inventory | Returns pet inventories by status | +| *StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** store/order/{orderId} | Find purchase order by ID | +| *StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** store/order | Place an order for a pet | +| *UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** user | Create user | +| *UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** user/createWithArray | Creates list of users with given input array | +| *UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** user/createWithList | Creates list of users with given input array | +| *UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** user/{username} | Delete user | +| *UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** user/{username} | Get user by user name | +| *UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **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* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** user/{username} | Updated user | + + + +## Documentation for Models + + - [org.openapitools.client.models.Annotation](docs/Annotation.md) + - [org.openapitools.client.models.AnyOfUserOrPet](docs/AnyOfUserOrPet.md) + - [org.openapitools.client.models.AnyOfUserOrPetOrArrayString](docs/AnyOfUserOrPetOrArrayString.md) + - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) + - [org.openapitools.client.models.Order](docs/Order.md) + - [org.openapitools.client.models.Pet](docs/Pet.md) + - [org.openapitools.client.models.Tag](docs/Tag.md) + - [org.openapitools.client.models.User](docs/User.md) + - [org.openapitools.client.models.UserOrPet](docs/UserOrPet.md) + - [org.openapitools.client.models.UserOrPetOrArrayString](docs/UserOrPetOrArrayString.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 + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/build.gradle b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/build.gradle new file mode 100644 index 000000000000..b5dcfbd3f24a --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/build.gradle @@ -0,0 +1,88 @@ +group 'org.openapitools' +version '1.0.0' + +wrapper { + gradleVersion = '8.14.3' + distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" +} + +buildscript { + ext.kotlin_version = '2.2.20' + ext.retrofitVersion = '3.0.0' + ext.spotless_version = "7.2.1" + + repositories { + maven { url "https://repo1.maven.org/maven2" } + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" + classpath "com.diffplug.spotless:spotless-plugin-gradle:$spotless_version" + } +} + +apply plugin: 'kotlin' +apply plugin: 'kotlinx-serialization' +apply plugin: 'maven-publish' +apply plugin: 'com.diffplug.spotless' + +repositories { + maven { url "https://repo1.maven.org/maven2" } +} + +// 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() + } + kotlin { + ktfmt() + } +} + +test { + useJUnitPlatform() +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0" + implementation "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.2" + implementation "com.squareup.okhttp3:logging-interceptor:5.1.0" + implementation "com.squareup.retrofit2:retrofit:$retrofitVersion" + implementation "com.squareup.retrofit2:converter-kotlinx-serialization:$retrofitVersion" + implementation "com.squareup.retrofit2:converter-scalars:$retrofitVersion" + testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2" +} + +tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { + kotlinOptions { + freeCompilerArgs += "-Xopt-in=kotlinx.serialization.ExperimentalSerializationApi" + } +} + +java { + withSourcesJar() +} + +publishing { + publications { + maven(MavenPublication) { + groupId = 'org.openapitools' + artifactId = 'kotlin-oneOf-anyOf-kotlinx-serialization' + version = '1.0.0' + from components.java + } + } +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Annotation.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Annotation.md new file mode 100644 index 000000000000..5836f295e4c3 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Annotation.md @@ -0,0 +1,10 @@ + +# Annotation + +## Properties +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | [**java.util.UUID**](java.util.UUID.md) | | [optional] | + + + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/AnyOfUserOrPet.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/AnyOfUserOrPet.md new file mode 100644 index 000000000000..dccdda0a1f39 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/AnyOfUserOrPet.md @@ -0,0 +1,29 @@ + +# AnyOfUserOrPet + +## Properties +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **username** | **kotlin.String** | | | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | + + + +## Enum: status +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | + + + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/AnyOfUserOrPetOrArrayString.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/AnyOfUserOrPetOrArrayString.md new file mode 100644 index 000000000000..7f2bee6c6212 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/AnyOfUserOrPetOrArrayString.md @@ -0,0 +1,29 @@ + +# AnyOfUserOrPetOrArrayString + +## Properties +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **username** | **kotlin.String** | | | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | + + + +## Enum: status +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | + + + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/ApiResponse.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/ApiResponse.md new file mode 100644 index 000000000000..059525a99512 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/ApiResponse.md @@ -0,0 +1,12 @@ + +# ModelApiResponse + +## Properties +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **code** | **kotlin.Int** | | [optional] | +| **type** | **kotlin.String** | | [optional] | +| **message** | **kotlin.String** | | [optional] | + + + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Category.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Category.md new file mode 100644 index 000000000000..baba5657eb21 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Category.md @@ -0,0 +1,11 @@ + +# Category + +## Properties +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | + + + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/FakeApi.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/FakeApi.md new file mode 100644 index 000000000000..aded3ef43900 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/FakeApi.md @@ -0,0 +1,88 @@ +# FakeApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**annotations**](FakeApi.md#annotations) | **POST** fake/annotations | annotate | +| [**updatePetWithFormNumber**](FakeApi.md#updatePetWithFormNumber) | **PUT** fake/annotations | Updates a pet in the store with form data (number) | + + + +annotate + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(FakeApi::class.java) +val `annotation` : Annotation = // Annotation | + +webService.annotations(`annotation`) +``` + +### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **`annotation`** | [**Annotation**](Annotation.md)| | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +Updates a pet in the store with form data (number) + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(FakeApi::class.java) +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated +val name : kotlin.String = name_example // kotlin.String | Updated name of the pet +val status : kotlin.Int = 56 // kotlin.Int | integer type +val status2 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | number type + +webService.updatePetWithFormNumber(petId, name, status, status2) +``` + +### Parameters +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| **status** | **kotlin.Int**| integer type | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status2** | **java.math.BigDecimal**| number type | [optional] | + +### Return type + +null (empty response body) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Order.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Order.md new file mode 100644 index 000000000000..7b7a399f7f75 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Order.md @@ -0,0 +1,22 @@ + +# Order + +## Properties +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **petId** | **kotlin.Long** | | [optional] | +| **quantity** | **kotlin.Int** | | [optional] | +| **shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] | +| **status** | [**inline**](#Status) | Order Status | [optional] | +| **complete** | **kotlin.Boolean** | | [optional] | + + + +## Enum: status +| Name | Value | +| ---- | ----- | +| status | placed, approved, delivered | + + + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Pet.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Pet.md new file mode 100644 index 000000000000..287312efaf94 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Pet.md @@ -0,0 +1,22 @@ + +# Pet + +## Properties +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | + + + +## Enum: status +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | + + + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/PetApi.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/PetApi.md new file mode 100644 index 000000000000..01ad4cac6196 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/PetApi.md @@ -0,0 +1,322 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**addPet**](PetApi.md#addPet) | **POST** pet | Add a new pet to the store | +| [**deletePet**](PetApi.md#deletePet) | **DELETE** pet/{petId} | Deletes a pet | +| [**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** pet/findByStatus | Finds Pets by status | +| [**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** pet/findByTags | Finds Pets by tags | +| [**getPetById**](PetApi.md#getPetById) | **GET** pet/{petId} | Find pet by ID | +| [**updatePet**](PetApi.md#updatePet) | **PUT** pet | Update an existing pet | +| [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** pet/{petId} | Updates a pet in the store with form data | +| [**uploadFile**](PetApi.md#uploadFile) | **POST** pet/{petId}/uploadImage | uploads an image | + + + +Add a new pet to the store + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(PetApi::class.java) +val pet : Pet = // Pet | Pet object that needs to be added to the store + +val result : Pet = webService.addPet(pet) +``` + +### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + + +Deletes a pet + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(PetApi::class.java) +val petId : kotlin.Long = 789 // kotlin.Long | Pet id to delete +val apiKey : kotlin.String = apiKey_example // kotlin.String | + +webService.deletePet(petId, apiKey) +``` + +### Parameters +| **petId** | **kotlin.Long**| Pet id to delete | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | + +### Return type + +null (empty response body) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(PetApi::class.java) +val status : kotlin.collections.List = // kotlin.collections.List | Status values that need to be considered for filter + +val result : kotlin.collections.List = webService.findPetsByStatus(status) +``` + +### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | + +### Return type + +[**kotlin.collections.List<Pet>**](Pet.md) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(PetApi::class.java) +val tags : kotlin.collections.List = // kotlin.collections.List | Tags to filter by + +val result : kotlin.collections.List = webService.findPetsByTags(tags) +``` + +### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | + +### Return type + +[**kotlin.collections.List<Pet>**](Pet.md) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +Find pet by ID + +Returns a single pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(PetApi::class.java) +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to return + +val result : Pet = webService.getPetById(petId) +``` + +### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to return | | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +Update an existing pet + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(PetApi::class.java) +val pet : Pet = // Pet | Pet object that needs to be added to the store + +val result : Pet = webService.updatePet(pet) +``` + +### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/xml, application/json + + +Updates a pet in the store with form data + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(PetApi::class.java) +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated +val name : kotlin.String = name_example // kotlin.String | Updated name of the pet +val status : kotlin.String = status_example // kotlin.String | Updated status of the pet + +webService.updatePetWithForm(petId, name, status) +``` + +### Parameters +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **status** | **kotlin.String**| Updated status of the pet | [optional] | + +### Return type + +null (empty response body) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +uploads an image + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(PetApi::class.java) +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update +val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server +val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload + +val result : ModelApiResponse = webService.uploadFile(petId, additionalMetadata, file) +``` + +### Parameters +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **file** | **java.io.File**| file to upload | [optional] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/StoreApi.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/StoreApi.md new file mode 100644 index 000000000000..34b0e0700a72 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/StoreApi.md @@ -0,0 +1,157 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{orderId} | Delete purchase order by ID | +| [**getInventory**](StoreApi.md#getInventory) | **GET** store/inventory | Returns pet inventories by status | +| [**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{orderId} | Find purchase order by ID | +| [**placeOrder**](StoreApi.md#placeOrder) | **POST** store/order | Place an order for a pet | + + + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(StoreApi::class.java) +val orderId : kotlin.String = orderId_example // kotlin.String | ID of the order that needs to be deleted + +webService.deleteOrder(orderId) +``` + +### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.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 + + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(StoreApi::class.java) + +val result : kotlin.collections.Map = webService.getInventory() +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**kotlin.collections.Map<kotlin.String, kotlin.Int>** + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(StoreApi::class.java) +val orderId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be fetched + +val result : Order = webService.getOrderById(orderId) +``` + +### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **orderId** | **kotlin.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 + + +Place an order for a pet + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(StoreApi::class.java) +val order : Order = // Order | order placed for purchasing the pet + +val result : Order = webService.placeOrder(order) +``` + +### 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 + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Tag.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Tag.md new file mode 100644 index 000000000000..dc8fa3cb555d --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Tag.md @@ -0,0 +1,11 @@ + +# Tag + +## Properties +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | [optional] | +| **name** | **kotlin.String** | | [optional] | + + + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/User.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/User.md new file mode 100644 index 000000000000..29af9690cc49 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/User.md @@ -0,0 +1,17 @@ + +# User + +## Properties +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **username** | **kotlin.String** | | | +| **id** | **kotlin.Long** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | + + + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/UserApi.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/UserApi.md new file mode 100644 index 000000000000..20a1ac7703b4 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/UserApi.md @@ -0,0 +1,313 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**createUser**](UserApi.md#createUser) | **POST** user | Create user | +| [**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** user/createWithArray | Creates list of users with given input array | +| [**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** user/createWithList | Creates list of users with given input array | +| [**deleteUser**](UserApi.md#deleteUser) | **DELETE** user/{username} | Delete user | +| [**getUserByName**](UserApi.md#getUserByName) | **GET** user/{username} | Get user by user name | +| [**loginUser**](UserApi.md#loginUser) | **GET** user/login | Logs user into the system | +| [**logoutUser**](UserApi.md#logoutUser) | **GET** user/logout | Logs out current logged in user session | +| [**updateUser**](UserApi.md#updateUser) | **PUT** user/{username} | Updated user | + + + +Create user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(UserApi::class.java) +val user : User = // User | Created user object + +webService.createUser(user) +``` + +### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**User**](User.md)| Created user object | | + +### Return type + +null (empty response body) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +Creates list of users with given input array + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(UserApi::class.java) +val user : kotlin.collections.List = // kotlin.collections.List | List of user object + +webService.createUsersWithArrayInput(user) +``` + +### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | | + +### Return type + +null (empty response body) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +Creates list of users with given input array + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(UserApi::class.java) +val user : kotlin.collections.List = // kotlin.collections.List | List of user object + +webService.createUsersWithListInput(user) +``` + +### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | | + +### Return type + +null (empty response body) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +Delete user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(UserApi::class.java) +val username : kotlin.String = username_example // kotlin.String | The name that needs to be deleted + +webService.deleteUser(username) +``` + +### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The name that needs to be deleted | | + +### Return type + +null (empty response body) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +Get user by user name + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(UserApi::class.java) +val username : kotlin.String = username_example // kotlin.String | The name that needs to be fetched. Use user1 for testing. + +val result : User = webService.getUserByName(username) +``` + +### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.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 + + +Logs user into the system + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(UserApi::class.java) +val username : kotlin.String = username_example // kotlin.String | The user name for login +val password : kotlin.String = password_example // kotlin.String | The password for login in clear text + +val result : kotlin.String = webService.loginUser(username, password) +``` + +### Parameters +| **username** | **kotlin.String**| The user name for login | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **password** | **kotlin.String**| The password for login in clear text | | + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +Logs out current logged in user session + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(UserApi::class.java) + +webService.logoutUser() +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +Updated user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(UserApi::class.java) +val username : kotlin.String = username_example // kotlin.String | name that need to be deleted +val user : User = // User | Updated user object + +webService.updateUser(username, user) +``` + +### Parameters +| **username** | **kotlin.String**| name that need to be deleted | | +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **user** | [**User**](User.md)| Updated user object | | + +### Return type + +null (empty response body) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/UserOrPet.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/UserOrPet.md new file mode 100644 index 000000000000..5412def1feab --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/UserOrPet.md @@ -0,0 +1,29 @@ + +# UserOrPet + +## Properties +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **username** | **kotlin.String** | | | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | + + + +## Enum: status +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | + + + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/UserOrPetOrArrayString.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/UserOrPetOrArrayString.md new file mode 100644 index 000000000000..97281e826daf --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/UserOrPetOrArrayString.md @@ -0,0 +1,29 @@ + +# UserOrPetOrArrayString + +## Properties +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **username** | **kotlin.String** | | | +| **name** | **kotlin.String** | | | +| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | +| **id** | **kotlin.Long** | | [optional] | +| **firstName** | **kotlin.String** | | [optional] | +| **lastName** | **kotlin.String** | | [optional] | +| **email** | **kotlin.String** | | [optional] | +| **password** | **kotlin.String** | | [optional] | +| **phone** | **kotlin.String** | | [optional] | +| **userStatus** | **kotlin.Int** | User Status | [optional] | +| **category** | [**Category**](Category.md) | | [optional] | +| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | +| **status** | [**inline**](#Status) | pet status in the store | [optional] | + + + +## Enum: status +| Name | Value | +| ---- | ----- | +| status | available, pending, sold | + + + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/gradle/wrapper/gradle-wrapper.jar b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..2c3521197d7c4586c843d1d3e9090525f1898cde GIT binary patch literal 43504 zcma&N1CXTcmMvW9vTb(Rwr$&4wr$(C?dmSu>@vG-+vuvg^_??!{yS%8zW-#zn-LkA z5&1^$^{lnmUON?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hE;nDAbH#%f1ZwuOkvWLj{qV$m3LF423&l!^iV zhym*>R>Yyens++~6F5+uZQTCz9t~PEW+e?w)XF2g!^^%6k?@Jcu;MG0FG9!T+Gx{Z zK;31y@(J{!-$k4E{5#Sv(2DGy3EZQY}G_*z*G&CZ_J?m&Fg4IBrvPx1w z1zAb3k}6nT?E)HNCi%}aR^?)%w-DcpBR*tD(r_c{QU6V&2vU-j0;{TVDN6los%YJZ z5C(*ZE#kv-BvlGLDf9>EO#RH_jtolA)iRJ>tSfJpF!#DO+tk% zBAKCwVZwO^p)(Rhk2en$XLfWjQQ`ix>K}Ru6-sn8Ih6k&$$y`zQ}}4dj~o@9gX9_= z#~EkchJqd5$**l}~~6mOl(q#GMIcFg&XCKO;$w>!K14 zko1egAORiG{r|8qj*FsN>?7d`han?*MD#xe^)sOqj;o;hgdaVnBH$BM{_73?znS+R z*G2VHM!Jw6#<FfJ-J%-9AuDW$@mc-Eyk~F{Jbvt` zn;(%DbBDnKIYr~|I>ZTvbH@cxUyw%bp*)OSs}lwO^HTJ2M#u5QsPF0?Jv*OVPfdKv z+t$Z5P!~jzZ~Y!d#iP?S{?M_g%Ua0Q)WawbIx+2uYpcf(7Im%W=rAu4dSceo7RZh# zN38=RmwOJQE$qbPXIuO^E`wSeJKCx3Q76irp~QS#19dusEVCWPrKhK9{7cbIMg9U} TZiJi*F`$tkWLn) literal 0 HcmV?d00001 diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/gradle/wrapper/gradle-wrapper.properties b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000000..7705927e949f --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-all.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/gradlew b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/gradlew new file mode 100644 index 000000000000..51eb8bb47109 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/gradlew @@ -0,0 +1,252 @@ +#!/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. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# 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/platforms/jvm/plugins-application/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 -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || 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/others/kotlin-oneOf-anyOf-kotlinx-serialization/gradlew.bat b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/gradlew.bat new file mode 100644 index 000000000000..9d21a21834d5 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/gradlew.bat @@ -0,0 +1,94 @@ +@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 +@rem SPDX-License-Identifier: Apache-2.0 +@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/others/kotlin-oneOf-anyOf-kotlinx-serialization/proguard-rules.pro b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/proguard-rules.pro new file mode 100644 index 000000000000..7c7b08bf3810 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/proguard-rules.pro @@ -0,0 +1,11 @@ +-keepattributes *Annotation*, InnerClasses +-dontnote kotlinx.serialization.AnnotationsKt # core serialization annotations + +# kotlinx-serialization-json specific. Add this if you have java.lang.NoClassDefFoundError kotlinx.serialization.json.JsonObjectSerializer +-keepclassmembers class kotlinx.serialization.json.** { *** Companion; } +-keepclasseswithmembers class kotlinx.serialization.json.** { kotlinx.serialization.KSerializer serializer(...); } + +# project specific. +-keep,includedescriptorclasses class org.openapitools.client.models.**$$serializer { *; } +-keepclassmembers class org.openapitools.client.models.** { *** Companion; } +-keepclasseswithmembers class org.openapitools.client.models.** { kotlinx.serialization.KSerializer serializer(...); } diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/settings.gradle b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/settings.gradle new file mode 100644 index 000000000000..a1178cffa7c1 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'kotlin-oneOf-anyOf-kotlinx-serialization' diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt new file mode 100644 index 000000000000..fe41364346eb --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import retrofit2.Call +import okhttp3.RequestBody +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +import org.openapitools.client.models.Annotation + +interface FakeApi { + /** + * POST fake/annotations + * annotate + * + * Responses: + * - 200: OK + * + * @param `annotation` + * @return [Call]<[Unit]> + */ + @POST("fake/annotations") + fun annotations(@Body `annotation`: Annotation): Call + + /** + * PUT fake/annotations + * Updates a pet in the store with form data (number) + * + * Responses: + * - 405: Invalid input + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status integer type (optional) + * @param status2 number type (optional) + * @return [Call]<[Unit]> + */ + @FormUrlEncoded + @PUT("fake/annotations") + fun updatePetWithFormNumber(@Path("petId") petId: kotlin.Long, @Field("name") name: kotlin.String? = null, @Field("status") status: kotlin.Int? = null, @Field("status2") status2: java.math.BigDecimal? = null): Call + +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/PetApi.kt new file mode 100644 index 000000000000..b78eb25527f0 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -0,0 +1,147 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import retrofit2.Call +import okhttp3.RequestBody +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +import org.openapitools.client.models.ModelApiResponse +import org.openapitools.client.models.Pet + +import okhttp3.MultipartBody + +interface PetApi { + /** + * POST pet + * Add a new pet to the store + * + * Responses: + * - 200: successful operation + * - 405: Invalid input + * + * @param pet Pet object that needs to be added to the store + * @return [Call]<[Pet]> + */ + @POST("pet") + fun addPet(@Body pet: Pet): Call + + /** + * DELETE pet/{petId} + * Deletes a pet + * + * Responses: + * - 400: Invalid pet value + * + * @param petId Pet id to delete + * @param apiKey (optional) + * @return [Call]<[Unit]> + */ + @DELETE("pet/{petId}") + fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String? = null): Call + + + /** + * enum for parameter status + */ + @Serializable + enum class StatusFindPetsByStatus(val value: kotlin.String) { + @SerialName(value = "available") available("available"), + @SerialName(value = "pending") pending("pending"), + @SerialName(value = "sold") sold("sold"), + } + + /** + * GET pet/findByStatus + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Responses: + * - 200: successful operation + * - 400: Invalid status value + * + * @param status Status values that need to be considered for filter + * @return [Call]<[kotlin.collections.List]> + */ + @GET("pet/findByStatus") + fun findPetsByStatus(@Query("status") status: CSVParams): Call> + + /** + * GET pet/findByTags + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Responses: + * - 200: successful operation + * - 400: Invalid tag value + * + * @param tags Tags to filter by + * @return [Call]<[kotlin.collections.List]> + */ + @Deprecated("This api was deprecated") + @GET("pet/findByTags") + fun findPetsByTags(@Query("tags") tags: CSVParams): Call> + + /** + * GET pet/{petId} + * Find pet by ID + * Returns a single pet + * Responses: + * - 200: successful operation + * - 400: Invalid ID supplied + * - 404: Pet not found + * + * @param petId ID of pet to return + * @return [Call]<[Pet]> + */ + @GET("pet/{petId}") + fun getPetById(@Path("petId") petId: kotlin.Long): Call + + /** + * PUT pet + * Update an existing pet + * + * Responses: + * - 200: successful operation + * - 400: Invalid ID supplied + * - 404: Pet not found + * - 405: Validation exception + * + * @param pet Pet object that needs to be added to the store + * @return [Call]<[Pet]> + */ + @PUT("pet") + fun updatePet(@Body pet: Pet): Call + + /** + * POST pet/{petId} + * Updates a pet in the store with form data + * + * Responses: + * - 405: Invalid input + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return [Call]<[Unit]> + */ + @FormUrlEncoded + @POST("pet/{petId}") + fun updatePetWithForm(@Path("petId") petId: kotlin.Long, @Field("name") name: kotlin.String? = null, @Field("status") status: kotlin.String? = null): Call + + /** + * POST pet/{petId}/uploadImage + * uploads an image + * + * Responses: + * - 200: successful operation + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return [Call]<[ModelApiResponse]> + */ + @Multipart + @POST("pet/{petId}/uploadImage") + fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String? = null, @Part file: MultipartBody.Part? = null): Call + +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt new file mode 100644 index 000000000000..3fba219b7904 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -0,0 +1,68 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import retrofit2.Call +import okhttp3.RequestBody +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +import org.openapitools.client.models.Order + +interface StoreApi { + /** + * DELETE store/order/{orderId} + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Responses: + * - 400: Invalid ID supplied + * - 404: Order not found + * + * @param orderId ID of the order that needs to be deleted + * @return [Call]<[Unit]> + */ + @DELETE("store/order/{orderId}") + fun deleteOrder(@Path("orderId") orderId: kotlin.String): Call + + /** + * GET store/inventory + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Responses: + * - 200: successful operation + * + * @return [Call]<[kotlin.collections.Map]> + */ + @GET("store/inventory") + fun getInventory(): Call> + + /** + * GET store/order/{orderId} + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + * Responses: + * - 200: successful operation + * - 400: Invalid ID supplied + * - 404: Order not found + * + * @param orderId ID of pet that needs to be fetched + * @return [Call]<[Order]> + */ + @GET("store/order/{orderId}") + fun getOrderById(@Path("orderId") orderId: kotlin.Long): Call + + /** + * POST store/order + * Place an order for a pet + * + * Responses: + * - 200: successful operation + * - 400: Invalid Order + * + * @param order order placed for purchasing the pet + * @return [Call]<[Order]> + */ + @POST("store/order") + fun placeOrder(@Body order: Order): Call + +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/UserApi.kt new file mode 100644 index 000000000000..9b267e9b2eb4 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -0,0 +1,123 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import retrofit2.Call +import okhttp3.RequestBody +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +import org.openapitools.client.models.User + +interface UserApi { + /** + * POST user + * Create user + * This can only be done by the logged in user. + * Responses: + * - 0: successful operation + * + * @param user Created user object + * @return [Call]<[Unit]> + */ + @POST("user") + fun createUser(@Body user: User): Call + + /** + * POST user/createWithArray + * Creates list of users with given input array + * + * Responses: + * - 0: successful operation + * + * @param user List of user object + * @return [Call]<[Unit]> + */ + @POST("user/createWithArray") + fun createUsersWithArrayInput(@Body user: kotlin.collections.List): Call + + /** + * POST user/createWithList + * Creates list of users with given input array + * + * Responses: + * - 0: successful operation + * + * @param user List of user object + * @return [Call]<[Unit]> + */ + @POST("user/createWithList") + fun createUsersWithListInput(@Body user: kotlin.collections.List): Call + + /** + * DELETE user/{username} + * Delete user + * This can only be done by the logged in user. + * Responses: + * - 400: Invalid username supplied + * - 404: User not found + * + * @param username The name that needs to be deleted + * @return [Call]<[Unit]> + */ + @DELETE("user/{username}") + fun deleteUser(@Path("username") username: kotlin.String): Call + + /** + * GET user/{username} + * Get user by user name + * + * Responses: + * - 200: successful operation + * - 400: Invalid username supplied + * - 404: User not found + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return [Call]<[User]> + */ + @GET("user/{username}") + fun getUserByName(@Path("username") username: kotlin.String): Call + + /** + * GET user/login + * Logs user into the system + * + * Responses: + * - 200: successful operation + * - 400: Invalid username/password supplied + * + * @param username The user name for login + * @param password The password for login in clear text + * @return [Call]<[kotlin.String]> + */ + @GET("user/login") + fun loginUser(@Query("username") username: kotlin.String, @Query("password") password: kotlin.String): Call + + /** + * GET user/logout + * Logs out current logged in user session + * + * Responses: + * - 0: successful operation + * + * @return [Call]<[Unit]> + */ + @GET("user/logout") + fun logoutUser(): Call + + /** + * PUT user/{username} + * Updated user + * This can only be done by the logged in user. + * Responses: + * - 400: Invalid user supplied + * - 404: User not found + * + * @param username name that need to be deleted + * @param user Updated user object + * @return [Call]<[Unit]> + */ + @PUT("user/{username}") + fun updateUser(@Path("username") username: kotlin.String, @Body user: User): Call + +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt new file mode 100644 index 000000000000..ddb369be5f8f --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt @@ -0,0 +1,50 @@ +package org.openapitools.client.auth + +import java.io.IOException +import java.net.URI +import java.net.URISyntaxException + +import okhttp3.Interceptor +import okhttp3.Response + +class ApiKeyAuth( + private val location: String = "", + private val paramName: String = "", + private var apiKey: String = "" +) : Interceptor { + + @Throws(IOException::class) + override fun intercept(chain: Interceptor.Chain): Response { + var request = chain.request() + + if ("query" == location) { + var newQuery = request.url.toUri().query + val paramValue = "$paramName=$apiKey" + if (newQuery == null) { + newQuery = paramValue + } else { + newQuery += "&$paramValue" + } + + val newUri: URI + try { + val oldUri = request.url.toUri() + newUri = URI(oldUri.scheme, oldUri.authority, + oldUri.path, newQuery, oldUri.fragment) + } catch (e: URISyntaxException) { + throw IOException(e) + } + + request = request.newBuilder().url(newUri.toURL()).build() + } else if ("header" == location) { + request = request.newBuilder() + .addHeader(paramName, apiKey) + .build() + } else if ("cookie" == location) { + request = request.newBuilder() + .addHeader("Cookie", "$paramName=$apiKey") + .build() + } + return chain.proceed(request) + } +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/OAuth.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/OAuth.kt new file mode 100644 index 000000000000..69582551f376 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/OAuth.kt @@ -0,0 +1,151 @@ +package org.openapitools.client.auth + +import java.net.HttpURLConnection.HTTP_UNAUTHORIZED +import java.net.HttpURLConnection.HTTP_FORBIDDEN + +import java.io.IOException + +import org.apache.oltu.oauth2.client.OAuthClient +import org.apache.oltu.oauth2.client.request.OAuthBearerClientRequest +import org.apache.oltu.oauth2.client.request.OAuthClientRequest +import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder +import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder +import org.apache.oltu.oauth2.common.exception.OAuthProblemException +import org.apache.oltu.oauth2.common.exception.OAuthSystemException +import org.apache.oltu.oauth2.common.message.types.GrantType +import org.apache.oltu.oauth2.common.token.BasicOAuthToken + +import okhttp3.Interceptor +import okhttp3.OkHttpClient +import okhttp3.Response + +class OAuth( + client: OkHttpClient, + var tokenRequestBuilder: TokenRequestBuilder +) : Interceptor { + + interface AccessTokenListener { + fun notify(token: BasicOAuthToken) + } + + private var oauthClient: OAuthClient = OAuthClient(OAuthOkHttpClient(client)) + + @Volatile + private var accessToken: String? = null + var authenticationRequestBuilder: AuthenticationRequestBuilder? = null + private var accessTokenListener: AccessTokenListener? = null + + constructor( + requestBuilder: TokenRequestBuilder + ) : this( + OkHttpClient(), + requestBuilder + ) + + constructor( + flow: OAuthFlow, + authorizationUrl: String, + tokenUrl: String, + scopes: String + ) : this( + OAuthClientRequest.tokenLocation(tokenUrl).setScope(scopes) + ) { + setFlow(flow) + authenticationRequestBuilder = OAuthClientRequest.authorizationLocation(authorizationUrl) + } + + fun setFlow(flow: OAuthFlow) { + when (flow) { + OAuthFlow.accessCode, OAuthFlow.implicit -> + tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE) + OAuthFlow.password -> + tokenRequestBuilder.setGrantType(GrantType.PASSWORD) + OAuthFlow.application -> + tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS) + } + } + + @Throws(IOException::class) + override fun intercept(chain: Interceptor.Chain): Response { + return retryingIntercept(chain, true) + } + + @Throws(IOException::class) + private fun retryingIntercept(chain: Interceptor.Chain, updateTokenAndRetryOnAuthorizationFailure: Boolean): Response { + var request = chain.request() + + // If the request already have an authorization (eg. Basic auth), do nothing + if (request.header("Authorization") != null) { + return chain.proceed(request) + } + + // If first time, get the token + val oAuthRequest: OAuthClientRequest + if (accessToken == null) { + updateAccessToken(null) + } + + if (accessToken != null) { + // Build the request + val rb = request.newBuilder() + + val requestAccessToken = accessToken + try { + oAuthRequest = OAuthBearerClientRequest(request.url.toString()) + .setAccessToken(requestAccessToken) + .buildHeaderMessage() + } catch (e: OAuthSystemException) { + throw IOException(e) + } + + oAuthRequest.headers.entries.forEach { header -> + rb.addHeader(header.key, header.value) + } + rb.url(oAuthRequest.locationUri) + + //Execute the request + val response = chain.proceed(rb.build()) + + // 401/403 most likely indicates that access token has expired. Unless it happens two times in a row. + if ((response.code == HTTP_UNAUTHORIZED || response.code == HTTP_FORBIDDEN) && updateTokenAndRetryOnAuthorizationFailure) { + try { + if (updateAccessToken(requestAccessToken)) { + response.body?.close() + return retryingIntercept(chain, false) + } + } catch (e: Exception) { + response.body?.close() + throw e + } + } + return response + } else { + return chain.proceed(chain.request()) + } + } + + /** + * Returns true if the access token has been updated + */ + @Throws(IOException::class) + @Synchronized + fun updateAccessToken(requestAccessToken: String?): Boolean { + if (accessToken == null || accessToken.equals(requestAccessToken)) { + return try { + val accessTokenResponse = oauthClient.accessToken(this.tokenRequestBuilder.buildBodyMessage()) + if (accessTokenResponse != null && accessTokenResponse.accessToken != null) { + accessToken = accessTokenResponse.accessToken + accessTokenListener?.notify(accessTokenResponse.oAuthToken as BasicOAuthToken) + !accessToken.equals(requestAccessToken) + } else { + false + } + } catch (e: OAuthSystemException) { + throw IOException(e) + } catch (e: OAuthProblemException) { + throw IOException(e) + } + } + return true + } +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/OAuthFlow.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/OAuthFlow.kt new file mode 100644 index 000000000000..bcada9b7a6a2 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/OAuthFlow.kt @@ -0,0 +1,5 @@ +package org.openapitools.client.auth + +enum class OAuthFlow { + accessCode, implicit, password, application +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/OAuthOkHttpClient.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/OAuthOkHttpClient.kt new file mode 100644 index 000000000000..6680059d0536 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/OAuthOkHttpClient.kt @@ -0,0 +1,61 @@ +package org.openapitools.client.auth + +import java.io.IOException + +import org.apache.oltu.oauth2.client.HttpClient +import org.apache.oltu.oauth2.client.request.OAuthClientRequest +import org.apache.oltu.oauth2.client.response.OAuthClientResponse +import org.apache.oltu.oauth2.client.response.OAuthClientResponseFactory +import org.apache.oltu.oauth2.common.exception.OAuthProblemException +import org.apache.oltu.oauth2.common.exception.OAuthSystemException + +import okhttp3.OkHttpClient +import okhttp3.Request +import okhttp3.MediaType.Companion.toMediaTypeOrNull +import okhttp3.RequestBody +import okhttp3.RequestBody.Companion.toRequestBody + + +class OAuthOkHttpClient( + private var client: OkHttpClient = OkHttpClient() +) : HttpClient { + + @Throws(OAuthSystemException::class, OAuthProblemException::class) + override fun execute( + request: OAuthClientRequest, + headers: Map?, + requestMethod: String, + responseClass: Class?): T { + + var mediaType = "application/json".toMediaTypeOrNull() + val requestBuilder = Request.Builder().url(request.locationUri) + + headers?.forEach { entry -> + if (entry.key.equals("Content-Type", true)) { + mediaType = entry.value.toMediaTypeOrNull() + } else { + requestBuilder.addHeader(entry.key, entry.value) + } + } + + val body: RequestBody? = if (request.body != null) request.body.toRequestBody(mediaType) else null + requestBuilder.method(requestMethod, body) + + try { + val response = client.newCall(requestBuilder.build()).execute() + return OAuthClientResponseFactory.createCustomResponse( + response.body?.string(), + response.body?.contentType()?.toString(), + response.code, + response.headers.toMultimap(), + responseClass) + } catch (e: IOException) { + throw OAuthSystemException(e) + } + } + + override fun shutdown() { + // Nothing to do here + } + +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt new file mode 100644 index 000000000000..9a4b719801ca --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -0,0 +1,222 @@ +package org.openapitools.client.infrastructure + +import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder +import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder +import org.openapitools.client.auth.OAuth +import org.openapitools.client.auth.OAuth.AccessTokenListener +import org.openapitools.client.auth.OAuthFlow +import org.openapitools.client.auth.ApiKeyAuth + +import okhttp3.Call +import okhttp3.Interceptor +import okhttp3.OkHttpClient +import retrofit2.Retrofit +import okhttp3.logging.HttpLoggingInterceptor +import retrofit2.Converter +import retrofit2.CallAdapter +import retrofit2.converter.scalars.ScalarsConverterFactory + +import retrofit2.converter.kotlinx.serialization.asConverterFactory +import org.openapitools.client.infrastructure.Serializer.kotlinxSerializationJson +import okhttp3.MediaType.Companion.toMediaType + +class ApiClient( + private var baseUrl: String = defaultBasePath, + private val okHttpClientBuilder: OkHttpClient.Builder? = null, + private val callFactory: Call.Factory? = null, + private val callAdapterFactories: List = listOf( + ), + private val converterFactories: List = listOf( + ScalarsConverterFactory.create(), + kotlinxSerializationJson.asConverterFactory("application/json".toMediaType()), + ) +) { + private val apiAuthorizations = mutableMapOf() + var logger: ((String) -> Unit)? = null + + private val retrofitBuilder: Retrofit.Builder by lazy { + Retrofit.Builder() + .baseUrl(baseUrl) + .apply { + callAdapterFactories.forEach { + addCallAdapterFactory(it) + } + } + .apply { + converterFactories.forEach { + addConverterFactory(it) + } + } + } + + private val clientBuilder: OkHttpClient.Builder by lazy { + okHttpClientBuilder ?: defaultClientBuilder + } + + private val defaultClientBuilder: OkHttpClient.Builder by lazy { + OkHttpClient() + .newBuilder() + .addInterceptor(HttpLoggingInterceptor { message -> logger?.invoke(message) } + .apply { level = HttpLoggingInterceptor.Level.BODY } + ) + } + + init { + normalizeBaseUrl() + } + + constructor( + baseUrl: String = defaultBasePath, + okHttpClientBuilder: OkHttpClient.Builder? = null, + + authNames: Array + ) : this(baseUrl, okHttpClientBuilder) { + authNames.forEach { authName -> + val auth: Interceptor? = when (authName) { + "petstore_auth" -> OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets") + + "api_key" -> ApiKeyAuth("header", "api_key") + + else -> throw RuntimeException("auth name $authName not found in available auth names") + } + if (auth != null) { + addAuthorization(authName, auth) + } + } + } + + constructor( + baseUrl: String = defaultBasePath, + okHttpClientBuilder: OkHttpClient.Builder? = null, + + authName: String, + clientId: String, + secret: String, + username: String, + password: String + ) : this(baseUrl, okHttpClientBuilder, arrayOf(authName)) { + getTokenEndPoint() + ?.setClientId(clientId) + ?.setClientSecret(secret) + ?.setUsername(username) + ?.setPassword(password) + } + + /** + * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) + * @return Token request builder + */ + fun getTokenEndPoint(): TokenRequestBuilder? { + var result: TokenRequestBuilder? = null + apiAuthorizations.values.runOnFirst { + result = tokenRequestBuilder + } + return result + } + + /** + * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) + * @return Authentication request builder + */ + fun getAuthorizationEndPoint(): AuthenticationRequestBuilder? { + var result: AuthenticationRequestBuilder? = null + apiAuthorizations.values.runOnFirst { + result = authenticationRequestBuilder + } + return result + } + + /** + * Helper method to pre-set the oauth access token of the first oauth found in the apiAuthorizations (there should be only one) + * @param accessToken Access token + * @return ApiClient + */ + fun setAccessToken(accessToken: String): ApiClient { + apiAuthorizations.values.runOnFirst { + setAccessToken(accessToken) + } + return this + } + + /** + * Helper method to configure the oauth accessCode/implicit flow parameters + * @param clientId Client ID + * @param clientSecret Client secret + * @param redirectURI Redirect URI + * @return ApiClient + */ + fun configureAuthorizationFlow(clientId: String, clientSecret: String, redirectURI: String): ApiClient { + apiAuthorizations.values.runOnFirst { + tokenRequestBuilder + .setClientId(clientId) + .setClientSecret(clientSecret) + .setRedirectURI(redirectURI) + authenticationRequestBuilder + ?.setClientId(clientId) + ?.setRedirectURI(redirectURI) + } + return this + } + + /** + * Configures a listener which is notified when a new access token is received. + * @param accessTokenListener Access token listener + * @return ApiClient + */ + fun registerAccessTokenListener(accessTokenListener: AccessTokenListener): ApiClient { + apiAuthorizations.values.runOnFirst { + registerAccessTokenListener(accessTokenListener) + } + return this + } + + /** + * Adds an authorization to be used by the client + * @param authName Authentication name + * @param authorization Authorization interceptor + * @return ApiClient + */ + fun addAuthorization(authName: String, authorization: Interceptor): ApiClient { + if (apiAuthorizations.containsKey(authName)) { + throw RuntimeException("auth name $authName already in api authorizations") + } + apiAuthorizations[authName] = authorization + clientBuilder.addInterceptor(authorization) + return this + } + + fun setLogger(logger: (String) -> Unit): ApiClient { + this.logger = logger + return this + } + + fun createService(serviceClass: Class): S { + val usedCallFactory = this.callFactory ?: clientBuilder.build() + return retrofitBuilder.callFactory(usedCallFactory).build().create(serviceClass) + } + + private fun normalizeBaseUrl() { + if (!baseUrl.endsWith("/")) { + baseUrl += "/" + } + } + + private inline fun Iterable.runOnFirst(callback: U.() -> Unit) { + for (element in this) { + if (element is U) { + callback.invoke(element) + break + } + } + } + + companion object { + @JvmStatic + protected val baseUrlKey: String = "org.openapitools.client.baseUrl" + + @JvmStatic + val defaultBasePath: String by lazy { + System.getProperties().getProperty(baseUrlKey, "http://petstore.swagger.io/v2") + } + } +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/AtomicBooleanAdapter.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/AtomicBooleanAdapter.kt new file mode 100644 index 000000000000..0c0d0d00fcfa --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/AtomicBooleanAdapter.kt @@ -0,0 +1,19 @@ +package org.openapitools.client.infrastructure + +import kotlinx.serialization.KSerializer +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder +import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor +import kotlinx.serialization.descriptors.PrimitiveKind +import kotlinx.serialization.descriptors.SerialDescriptor +import java.util.concurrent.atomic.AtomicBoolean + +object AtomicBooleanAdapter : KSerializer { + override fun serialize(encoder: Encoder, value: AtomicBoolean) { + encoder.encodeBoolean(value.get()) + } + + override fun deserialize(decoder: Decoder): AtomicBoolean = AtomicBoolean(decoder.decodeBoolean()) + + override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("AtomicBoolean", PrimitiveKind.BOOLEAN) +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/AtomicIntegerAdapter.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/AtomicIntegerAdapter.kt new file mode 100644 index 000000000000..0060b2a0f1c3 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/AtomicIntegerAdapter.kt @@ -0,0 +1,19 @@ +package org.openapitools.client.infrastructure + +import kotlinx.serialization.KSerializer +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder +import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor +import kotlinx.serialization.descriptors.PrimitiveKind +import kotlinx.serialization.descriptors.SerialDescriptor +import java.util.concurrent.atomic.AtomicInteger + +object AtomicIntegerAdapter : KSerializer { + override fun serialize(encoder: Encoder, value: AtomicInteger) { + encoder.encodeInt(value.get()) + } + + override fun deserialize(decoder: Decoder): AtomicInteger = AtomicInteger(decoder.decodeInt()) + + override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("AtomicInteger", PrimitiveKind.INT) +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/AtomicLongAdapter.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/AtomicLongAdapter.kt new file mode 100644 index 000000000000..6de80cc56bd5 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/AtomicLongAdapter.kt @@ -0,0 +1,19 @@ +package org.openapitools.client.infrastructure + +import kotlinx.serialization.KSerializer +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder +import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor +import kotlinx.serialization.descriptors.PrimitiveKind +import kotlinx.serialization.descriptors.SerialDescriptor +import java.util.concurrent.atomic.AtomicLong + +object AtomicLongAdapter : KSerializer { + override fun serialize(encoder: Encoder, value: AtomicLong) { + encoder.encodeLong(value.get()) + } + + override fun deserialize(decoder: Decoder): AtomicLong = AtomicLong(decoder.decodeLong()) + + override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("AtomicLong", PrimitiveKind.LONG) +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt new file mode 100644 index 000000000000..86cb9efdd727 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt @@ -0,0 +1,15 @@ +package org.openapitools.client.infrastructure + +import kotlinx.serialization.KSerializer +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder +import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor +import kotlinx.serialization.descriptors.PrimitiveKind +import kotlinx.serialization.descriptors.SerialDescriptor +import java.math.BigDecimal + +object BigDecimalAdapter : KSerializer { + override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("BigDecimal", PrimitiveKind.STRING) + override fun deserialize(decoder: Decoder): BigDecimal = BigDecimal(decoder.decodeString()) + override fun serialize(encoder: Encoder, value: BigDecimal) = encoder.encodeString(value.toPlainString()) +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt new file mode 100644 index 000000000000..136017cb21bc --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt @@ -0,0 +1,20 @@ +package org.openapitools.client.infrastructure + +import kotlinx.serialization.KSerializer +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder +import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor +import kotlinx.serialization.descriptors.PrimitiveKind +import kotlinx.serialization.descriptors.SerialDescriptor +import java.math.BigInteger + +object BigIntegerAdapter : KSerializer { + override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("BigInteger", PrimitiveKind.STRING) + override fun deserialize(decoder: Decoder): BigInteger { + return BigInteger(decoder.decodeString()) + } + + override fun serialize(encoder: Encoder, value: BigInteger) { + encoder.encodeString(value.toString()) + } +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt new file mode 100644 index 000000000000..7f404da69ea0 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt @@ -0,0 +1,56 @@ +package org.openapitools.client.infrastructure + +class CollectionFormats { + + open class CSVParams { + + var params: List + + constructor(params: List) { + this.params = params + } + + constructor(vararg params: String) { + this.params = listOf(*params) + } + + override fun toString(): String { + return params.joinToString(",") + } + } + + open class SSVParams : CSVParams { + + constructor(params: List) : super(params) + + constructor(vararg params: String) : super(*params) + + override fun toString(): String { + return params.joinToString(" ") + } + } + + class TSVParams : CSVParams { + + constructor(params: List) : super(params) + + constructor(vararg params: String) : super(*params) + + override fun toString(): String { + return params.joinToString("\t") + } + } + + class PIPESParams : CSVParams { + + constructor(params: List) : super(params) + + constructor(vararg params: String) : super(*params) + + override fun toString(): String { + return params.joinToString("|") + } + } + + class SPACEParams : SSVParams() +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt new file mode 100644 index 000000000000..923828ff017b --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt @@ -0,0 +1,22 @@ +package org.openapitools.client.infrastructure + +import kotlinx.serialization.KSerializer +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder +import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor +import kotlinx.serialization.descriptors.PrimitiveKind +import kotlinx.serialization.descriptors.SerialDescriptor +import java.time.LocalDate +import java.time.format.DateTimeFormatter + +object LocalDateAdapter : KSerializer { + override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("LocalDate", PrimitiveKind.STRING) + + override fun serialize(encoder: Encoder, value: LocalDate) { + encoder.encodeString(DateTimeFormatter.ISO_LOCAL_DATE.format(value)) + } + + override fun deserialize(decoder: Decoder): LocalDate { + return LocalDate.parse(decoder.decodeString(), DateTimeFormatter.ISO_LOCAL_DATE) + } +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt new file mode 100644 index 000000000000..52d73dc0ad03 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt @@ -0,0 +1,22 @@ +package org.openapitools.client.infrastructure + +import kotlinx.serialization.KSerializer +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder +import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor +import kotlinx.serialization.descriptors.PrimitiveKind +import kotlinx.serialization.descriptors.SerialDescriptor +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter + +object LocalDateTimeAdapter : KSerializer { + override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("LocalDateTime", PrimitiveKind.STRING) + + override fun serialize(encoder: Encoder, value: LocalDateTime) { + encoder.encodeString(DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value)) + } + + override fun deserialize(decoder: Decoder): LocalDateTime { + return LocalDateTime.parse(decoder.decodeString(), DateTimeFormatter.ISO_LOCAL_DATE_TIME) + } +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt new file mode 100644 index 000000000000..f098b5ed1e15 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt @@ -0,0 +1,22 @@ +package org.openapitools.client.infrastructure + +import kotlinx.serialization.KSerializer +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder +import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor +import kotlinx.serialization.descriptors.PrimitiveKind +import kotlinx.serialization.descriptors.SerialDescriptor +import java.time.OffsetDateTime +import java.time.format.DateTimeFormatter + +object OffsetDateTimeAdapter : KSerializer { + override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("OffsetDateTime", PrimitiveKind.STRING) + + override fun serialize(encoder: Encoder, value: OffsetDateTime) { + encoder.encodeString(DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value)) + } + + override fun deserialize(decoder: Decoder): OffsetDateTime { + return OffsetDateTime.parse(decoder.decodeString(), DateTimeFormatter.ISO_OFFSET_DATE_TIME) + } +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExt.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExt.kt new file mode 100644 index 000000000000..0f121a95f5be --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExt.kt @@ -0,0 +1,4 @@ +package org.openapitools.client.infrastructure + +import retrofit2.Response + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt new file mode 100644 index 000000000000..1bed97472b3a --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -0,0 +1,73 @@ +package org.openapitools.client.infrastructure + +import java.math.BigDecimal +import java.math.BigInteger +import java.time.LocalDate +import java.time.LocalDateTime +import java.time.OffsetDateTime +import java.util.UUID +import kotlinx.serialization.json.Json +import kotlinx.serialization.json.JsonBuilder +import kotlinx.serialization.modules.SerializersModule +import kotlinx.serialization.modules.SerializersModuleBuilder +import java.net.URI +import java.net.URL +import java.util.concurrent.atomic.AtomicBoolean +import java.util.concurrent.atomic.AtomicInteger +import java.util.concurrent.atomic.AtomicLong + +object Serializer { + private var isAdaptersInitialized = false + + @JvmStatic + val kotlinxSerializationAdapters: SerializersModule by lazy { + isAdaptersInitialized = true + SerializersModule { + contextual(BigDecimal::class, BigDecimalAdapter) + contextual(BigInteger::class, BigIntegerAdapter) + contextual(LocalDate::class, LocalDateAdapter) + contextual(LocalDateTime::class, LocalDateTimeAdapter) + contextual(OffsetDateTime::class, OffsetDateTimeAdapter) + contextual(UUID::class, UUIDAdapter) + contextual(AtomicInteger::class, AtomicIntegerAdapter) + contextual(AtomicLong::class, AtomicLongAdapter) + contextual(AtomicBoolean::class, AtomicBooleanAdapter) + contextual(URI::class, URIAdapter) + contextual(URL::class, URLAdapter) + contextual(StringBuilder::class, StringBuilderAdapter) + + apply(kotlinxSerializationAdaptersConfiguration) + } + } + + var kotlinxSerializationAdaptersConfiguration: SerializersModuleBuilder.() -> Unit = {} + set(value) { + check(!isAdaptersInitialized) { + "Cannot configure kotlinxSerializationAdaptersConfiguration after kotlinxSerializationAdapters has been initialized." + } + field = value + } + + private var isJsonInitialized = false + + @JvmStatic + val kotlinxSerializationJson: Json by lazy { + isJsonInitialized = true + Json { + serializersModule = kotlinxSerializationAdapters + encodeDefaults = true + ignoreUnknownKeys = true + isLenient = true + + apply(kotlinxSerializationJsonConfiguration) + } + } + + var kotlinxSerializationJsonConfiguration: JsonBuilder.() -> Unit = {} + set(value) { + check(!isJsonInitialized) { + "Cannot configure kotlinxSerializationJsonConfiguration after kotlinxSerializationJson has been initialized." + } + field = value + } +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/StringBuilderAdapter.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/StringBuilderAdapter.kt new file mode 100644 index 000000000000..b510e73808a5 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/StringBuilderAdapter.kt @@ -0,0 +1,18 @@ +package org.openapitools.client.infrastructure + +import kotlinx.serialization.KSerializer +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder +import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor +import kotlinx.serialization.descriptors.PrimitiveKind +import kotlinx.serialization.descriptors.SerialDescriptor + +object StringBuilderAdapter : KSerializer { + override fun serialize(encoder: Encoder, value: StringBuilder) { + encoder.encodeString(value.toString()) + } + + override fun deserialize(decoder: Decoder): StringBuilder = StringBuilder(decoder.decodeString()) + + override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("StringBuilder", PrimitiveKind.STRING) +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt new file mode 100644 index 000000000000..8b4015feddc6 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt @@ -0,0 +1,19 @@ +package org.openapitools.client.infrastructure + +import kotlinx.serialization.KSerializer +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder +import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor +import kotlinx.serialization.descriptors.PrimitiveKind +import kotlinx.serialization.descriptors.SerialDescriptor +import java.net.URI + +object URIAdapter : KSerializer { + override fun serialize(encoder: Encoder, value: URI) { + encoder.encodeString(value.toASCIIString()) + } + + override fun deserialize(decoder: Decoder): URI = URI(decoder.decodeString()) + + override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("URI", PrimitiveKind.STRING) +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/URLAdapter.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/URLAdapter.kt new file mode 100644 index 000000000000..9aa0326662e7 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/URLAdapter.kt @@ -0,0 +1,19 @@ +package org.openapitools.client.infrastructure + +import kotlinx.serialization.KSerializer +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder +import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor +import kotlinx.serialization.descriptors.PrimitiveKind +import kotlinx.serialization.descriptors.SerialDescriptor +import java.net.URL + +object URLAdapter : KSerializer { + override fun serialize(encoder: Encoder, value: URL) { + encoder.encodeString(value.toExternalForm()) + } + + override fun deserialize(decoder: Decoder): URL = URL(decoder.decodeString()) + + override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("URL", PrimitiveKind.STRING) +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt new file mode 100644 index 000000000000..64ff2f9139fe --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt @@ -0,0 +1,21 @@ +package org.openapitools.client.infrastructure + +import kotlinx.serialization.KSerializer +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder +import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor +import kotlinx.serialization.descriptors.PrimitiveKind +import kotlinx.serialization.descriptors.SerialDescriptor +import java.util.UUID + +object UUIDAdapter : KSerializer { + override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("UUID", PrimitiveKind.STRING) + + override fun serialize(encoder: Encoder, value: UUID) { + encoder.encodeString(value.toString()) + } + + override fun deserialize(decoder: Decoder): UUID { + return UUID.fromString(decoder.decodeString()) + } +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Annotation.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Annotation.kt new file mode 100644 index 000000000000..d05428c31fc0 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Annotation.kt @@ -0,0 +1,44 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import kotlinx.serialization.Serializable +import kotlinx.serialization.SerialName +import kotlinx.serialization.Contextual +import kotlinx.serialization.KSerializer +import kotlinx.serialization.Serializer +import kotlinx.serialization.builtins.serializer +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder + +/** + * + * + * @param id + */ +@Serializable + +data class Annotation ( + + @Contextual @SerialName(value = "id") + val id: java.util.UUID? = null + +) { + + +} + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/AnyOfUserOrPet.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/AnyOfUserOrPet.kt new file mode 100644 index 000000000000..f3d981ddf2e7 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/AnyOfUserOrPet.kt @@ -0,0 +1,95 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import org.openapitools.client.models.Category +import org.openapitools.client.models.Pet +import org.openapitools.client.models.Tag +import org.openapitools.client.models.User + +import kotlinx.serialization.Serializable +import kotlinx.serialization.SerialName +import kotlinx.serialization.Contextual +import kotlinx.serialization.KSerializer +import kotlinx.serialization.Serializer +import kotlinx.serialization.builtins.serializer +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder +import kotlinx.serialization.SerializationException +import kotlinx.serialization.descriptors.SerialDescriptor +import kotlinx.serialization.descriptors.buildClassSerialDescriptor +import kotlinx.serialization.json.JsonDecoder +import kotlinx.serialization.json.JsonEncoder +import kotlinx.serialization.json.JsonArray +import kotlinx.serialization.json.JsonElement +import kotlinx.serialization.json.JsonPrimitive +import kotlinx.serialization.json.decodeFromJsonElement +import kotlinx.serialization.json.encodeToJsonElement + +/** + * + * + */ +@Serializable(with = AnyOfUserOrPetSerializer::class) + +sealed interface AnyOfUserOrPet { + @JvmInline + value class UserValue(val value: User) : AnyOfUserOrPet + + @JvmInline + value class PetValue(val value: Pet) : AnyOfUserOrPet + +} + +object AnyOfUserOrPetSerializer : KSerializer { + override val descriptor: SerialDescriptor = buildClassSerialDescriptor("AnyOfUserOrPet") + + override fun serialize(encoder: Encoder, value: AnyOfUserOrPet) { + val jsonEncoder = encoder as? JsonEncoder ?: throw SerializationException("AnyOfUserOrPet can only be serialized with Json") + + when (value) { + is AnyOfUserOrPet.UserValue -> jsonEncoder.encodeSerializableValue(User.serializer(), value.value) + is AnyOfUserOrPet.PetValue -> jsonEncoder.encodeSerializableValue(Pet.serializer(), value.value) + } + } + + override fun deserialize(decoder: Decoder): AnyOfUserOrPet { + val jsonDecoder = decoder as? JsonDecoder ?: throw SerializationException("AnyOfUserOrPet can only be deserialized with Json") + val jsonElement = jsonDecoder.decodeJsonElement() + + val errorMessages = mutableListOf() + + if (jsonElement !is JsonPrimitive) { + try { + val instance = jsonDecoder.json.decodeFromJsonElement(jsonElement) + return AnyOfUserOrPet.UserValue(instance) + } catch (e: Exception) { + errorMessages.add("Failed to deserialize as User: ${e.message}") + } + } + if (jsonElement !is JsonPrimitive) { + try { + val instance = jsonDecoder.json.decodeFromJsonElement(jsonElement) + return AnyOfUserOrPet.PetValue(instance) + } catch (e: Exception) { + errorMessages.add("Failed to deserialize as Pet: ${e.message}") + } + } + + throw SerializationException("Cannot deserialize AnyOfUserOrPet. Tried: ${errorMessages.joinToString(", ")}") + } +} + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/AnyOfUserOrPetOrArrayString.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/AnyOfUserOrPetOrArrayString.kt new file mode 100644 index 000000000000..7a79b0aeb140 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/AnyOfUserOrPetOrArrayString.kt @@ -0,0 +1,107 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import org.openapitools.client.models.Category +import org.openapitools.client.models.Pet +import org.openapitools.client.models.Tag +import org.openapitools.client.models.User + +import kotlinx.serialization.Serializable +import kotlinx.serialization.SerialName +import kotlinx.serialization.Contextual +import kotlinx.serialization.KSerializer +import kotlinx.serialization.Serializer +import kotlinx.serialization.builtins.serializer +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder +import kotlinx.serialization.SerializationException +import kotlinx.serialization.descriptors.SerialDescriptor +import kotlinx.serialization.descriptors.buildClassSerialDescriptor +import kotlinx.serialization.json.JsonDecoder +import kotlinx.serialization.json.JsonEncoder +import kotlinx.serialization.json.JsonArray +import kotlinx.serialization.json.JsonElement +import kotlinx.serialization.json.JsonPrimitive +import kotlinx.serialization.json.decodeFromJsonElement +import kotlinx.serialization.json.encodeToJsonElement + +/** + * + * + */ +@Serializable(with = AnyOfUserOrPetOrArrayStringSerializer::class) + +sealed interface AnyOfUserOrPetOrArrayString { + @JvmInline + value class UserValue(val value: User) : AnyOfUserOrPetOrArrayString + + @JvmInline + value class PetValue(val value: Pet) : AnyOfUserOrPetOrArrayString + + @JvmInline + value class ListStringValue(val value: kotlin.collections.List) : AnyOfUserOrPetOrArrayString + +} + +object AnyOfUserOrPetOrArrayStringSerializer : KSerializer { + override val descriptor: SerialDescriptor = buildClassSerialDescriptor("AnyOfUserOrPetOrArrayString") + + override fun serialize(encoder: Encoder, value: AnyOfUserOrPetOrArrayString) { + val jsonEncoder = encoder as? JsonEncoder ?: throw SerializationException("AnyOfUserOrPetOrArrayString can only be serialized with Json") + + when (value) { + is AnyOfUserOrPetOrArrayString.UserValue -> jsonEncoder.encodeSerializableValue(User.serializer(), value.value) + is AnyOfUserOrPetOrArrayString.PetValue -> jsonEncoder.encodeSerializableValue(Pet.serializer(), value.value) + is AnyOfUserOrPetOrArrayString.ListStringValue -> jsonEncoder.encodeJsonElement(jsonEncoder.json.encodeToJsonElement(value.value)) + } + } + + override fun deserialize(decoder: Decoder): AnyOfUserOrPetOrArrayString { + val jsonDecoder = decoder as? JsonDecoder ?: throw SerializationException("AnyOfUserOrPetOrArrayString can only be deserialized with Json") + val jsonElement = jsonDecoder.decodeJsonElement() + + val errorMessages = mutableListOf() + + if (jsonElement !is JsonPrimitive) { + try { + val instance = jsonDecoder.json.decodeFromJsonElement(jsonElement) + return AnyOfUserOrPetOrArrayString.UserValue(instance) + } catch (e: Exception) { + errorMessages.add("Failed to deserialize as User: ${e.message}") + } + } + if (jsonElement !is JsonPrimitive) { + try { + val instance = jsonDecoder.json.decodeFromJsonElement(jsonElement) + return AnyOfUserOrPetOrArrayString.PetValue(instance) + } catch (e: Exception) { + errorMessages.add("Failed to deserialize as Pet: ${e.message}") + } + } + if (jsonElement is JsonArray) { + try { + val instance = jsonDecoder.json.decodeFromJsonElement>(jsonElement) + return AnyOfUserOrPetOrArrayString.ListStringValue(instance) + } catch (e: Exception) { + errorMessages.add("Failed to deserialize as kotlin.collections.List: ${e.message}") + } + } + + throw SerializationException("Cannot deserialize AnyOfUserOrPetOrArrayString. Tried: ${errorMessages.joinToString(", ")}") + } +} + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Category.kt new file mode 100644 index 000000000000..2460ffd5f605 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -0,0 +1,48 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import kotlinx.serialization.Serializable +import kotlinx.serialization.SerialName +import kotlinx.serialization.Contextual +import kotlinx.serialization.KSerializer +import kotlinx.serialization.Serializer +import kotlinx.serialization.builtins.serializer +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder + +/** + * A category for a pet + * + * @param id + * @param name + */ +@Serializable + +data class Category ( + + @SerialName(value = "id") + val id: kotlin.Long? = null, + + @SerialName(value = "name") + val name: kotlin.String? = null + +) { + + +} + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt new file mode 100644 index 000000000000..d41b0c8629e4 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -0,0 +1,52 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import kotlinx.serialization.Serializable +import kotlinx.serialization.SerialName +import kotlinx.serialization.Contextual +import kotlinx.serialization.KSerializer +import kotlinx.serialization.Serializer +import kotlinx.serialization.builtins.serializer +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder + +/** + * Describes the result of uploading an image resource + * + * @param code + * @param type + * @param message + */ +@Serializable + +data class ModelApiResponse ( + + @SerialName(value = "code") + val code: kotlin.Int? = null, + + @SerialName(value = "type") + val type: kotlin.String? = null, + + @SerialName(value = "message") + val message: kotlin.String? = null + +) { + + +} + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Order.kt new file mode 100644 index 000000000000..f741a6924db5 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -0,0 +1,91 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import kotlinx.serialization.Serializable +import kotlinx.serialization.SerialName +import kotlinx.serialization.Contextual +import kotlinx.serialization.KSerializer +import kotlinx.serialization.Serializer +import kotlinx.serialization.builtins.serializer +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder + +/** + * An order for a pets from the pet store + * + * @param id + * @param petId + * @param quantity + * @param shipDate + * @param status Order Status + * @param complete + */ +@Serializable + +data class Order ( + + @SerialName(value = "id") + val id: kotlin.Long? = null, + + @SerialName(value = "petId") + val petId: kotlin.Long? = null, + + @SerialName(value = "quantity") + val quantity: kotlin.Int? = null, + + @Contextual @SerialName(value = "shipDate") + val shipDate: java.time.OffsetDateTime? = null, + + /* Order Status */ + @SerialName(value = "status") + val status: Order.Status? = null, + + @SerialName(value = "complete") + val complete: kotlin.Boolean? = false + +) { + + /** + * Order Status + * + * Values: placed,approved,delivered,unknown_default_open_api + */ + @Serializable(with = StatusSerializer::class) + enum class Status(val value: kotlin.String) { + @SerialName(value = "placed") placed("placed"), + @SerialName(value = "approved") approved("approved"), + @SerialName(value = "delivered") delivered("delivered"), + @SerialName(value = "unknown_default_open_api") unknown_default_open_api("unknown_default_open_api"); + } + + internal object StatusSerializer : KSerializer { + override val descriptor = kotlin.String.serializer().descriptor + + override fun deserialize(decoder: Decoder): Status { + val value = decoder.decodeSerializableValue(kotlin.String.serializer()) + return Status.entries.firstOrNull { it.value == value } + ?: Status.unknown_default_open_api + } + + override fun serialize(encoder: Encoder, value: Status) { + encoder.encodeSerializableValue(kotlin.String.serializer(), value.value) + } + } + +} + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Pet.kt new file mode 100644 index 000000000000..16bfc63d6ef8 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -0,0 +1,94 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import org.openapitools.client.models.Category +import org.openapitools.client.models.Tag + +import kotlinx.serialization.Serializable +import kotlinx.serialization.SerialName +import kotlinx.serialization.Contextual +import kotlinx.serialization.KSerializer +import kotlinx.serialization.Serializer +import kotlinx.serialization.builtins.serializer +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder + +/** + * A pet for sale in the pet store + * + * @param name + * @param photoUrls + * @param id + * @param category + * @param tags + * @param status pet status in the store + */ +@Serializable + +data class Pet ( + + @SerialName(value = "name") + val name: kotlin.String, + + @SerialName(value = "photoUrls") + val photoUrls: kotlin.collections.List, + + @SerialName(value = "id") + val id: kotlin.Long? = null, + + @SerialName(value = "category") + val category: Category? = null, + + @SerialName(value = "tags") + val tags: kotlin.collections.List? = null, + + /* pet status in the store */ + @SerialName(value = "status") + @Deprecated(message = "This property is deprecated.") + val status: Pet.Status? = null + +) { + + /** + * pet status in the store + * + * Values: available,pending,sold,unknown_default_open_api + */ + @Serializable(with = StatusSerializer::class) + enum class Status(val value: kotlin.String) { + @SerialName(value = "available") available("available"), + @SerialName(value = "pending") pending("pending"), + @SerialName(value = "sold") sold("sold"), + @SerialName(value = "unknown_default_open_api") unknown_default_open_api("unknown_default_open_api"); + } + + internal object StatusSerializer : KSerializer { + override val descriptor = kotlin.String.serializer().descriptor + + override fun deserialize(decoder: Decoder): Status { + val value = decoder.decodeSerializableValue(kotlin.String.serializer()) + return Status.entries.firstOrNull { it.value == value } + ?: Status.unknown_default_open_api + } + + override fun serialize(encoder: Encoder, value: Status) { + encoder.encodeSerializableValue(kotlin.String.serializer(), value.value) + } + } + +} + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Tag.kt new file mode 100644 index 000000000000..4d365d3a3cd5 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -0,0 +1,48 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import kotlinx.serialization.Serializable +import kotlinx.serialization.SerialName +import kotlinx.serialization.Contextual +import kotlinx.serialization.KSerializer +import kotlinx.serialization.Serializer +import kotlinx.serialization.builtins.serializer +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder + +/** + * A tag for a pet + * + * @param id + * @param name + */ +@Serializable + +data class Tag ( + + @SerialName(value = "id") + val id: kotlin.Long? = null, + + @SerialName(value = "name") + val name: kotlin.String? = null + +) { + + +} + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/User.kt new file mode 100644 index 000000000000..98ff7ee53490 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/User.kt @@ -0,0 +1,73 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import kotlinx.serialization.Serializable +import kotlinx.serialization.SerialName +import kotlinx.serialization.Contextual +import kotlinx.serialization.KSerializer +import kotlinx.serialization.Serializer +import kotlinx.serialization.builtins.serializer +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder + +/** + * A User who is purchasing from the pet store + * + * @param username + * @param id + * @param firstName + * @param lastName + * @param email + * @param password + * @param phone + * @param userStatus User Status + */ +@Serializable + +data class User ( + + @SerialName(value = "username") + val username: kotlin.String, + + @SerialName(value = "id") + val id: kotlin.Long? = null, + + @SerialName(value = "firstName") + val firstName: kotlin.String? = null, + + @SerialName(value = "lastName") + val lastName: kotlin.String? = null, + + @SerialName(value = "email") + val email: kotlin.String? = null, + + @SerialName(value = "password") + val password: kotlin.String? = null, + + @SerialName(value = "phone") + val phone: kotlin.String? = null, + + /* User Status */ + @SerialName(value = "userStatus") + val userStatus: kotlin.Int? = null + +) { + + +} + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/UserOrPet.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/UserOrPet.kt new file mode 100644 index 000000000000..35d25939597b --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/UserOrPet.kt @@ -0,0 +1,94 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import org.openapitools.client.models.Category +import org.openapitools.client.models.Pet +import org.openapitools.client.models.Tag +import org.openapitools.client.models.User + +import kotlinx.serialization.Serializable +import kotlinx.serialization.SerialName +import kotlinx.serialization.Contextual +import kotlinx.serialization.KSerializer +import kotlinx.serialization.Serializer +import kotlinx.serialization.builtins.serializer +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder +import kotlinx.serialization.SerializationException +import kotlinx.serialization.descriptors.SerialDescriptor +import kotlinx.serialization.descriptors.buildClassSerialDescriptor +import kotlinx.serialization.json.JsonDecoder +import kotlinx.serialization.json.JsonElement +import kotlinx.serialization.json.JsonEncoder +import kotlinx.serialization.json.JsonPrimitive +import kotlinx.serialization.json.JsonArray +import kotlinx.serialization.json.decodeFromJsonElement +import kotlinx.serialization.json.encodeToJsonElement + +/** + * + * + */ +@Serializable(with = UserOrPetSerializer::class) +sealed interface UserOrPet { + @JvmInline + value class UserValue(val value: User) : UserOrPet + + @JvmInline + value class PetValue(val value: Pet) : UserOrPet + +} + +object UserOrPetSerializer : KSerializer { + override val descriptor: SerialDescriptor = buildClassSerialDescriptor("UserOrPet") + + override fun serialize(encoder: Encoder, value: UserOrPet) { + val jsonEncoder = encoder as? JsonEncoder ?: throw SerializationException("UserOrPet can only be serialized with Json") + + when (value) { + is UserOrPet.UserValue -> jsonEncoder.encodeSerializableValue(User.serializer(), value.value) + is UserOrPet.PetValue -> jsonEncoder.encodeSerializableValue(Pet.serializer(), value.value) + } + } + + override fun deserialize(decoder: Decoder): UserOrPet { + val jsonDecoder = decoder as? JsonDecoder ?: throw SerializationException("UserOrPet can only be deserialized with Json") + val jsonElement = jsonDecoder.decodeJsonElement() + + val errorMessages = mutableListOf() + + if (jsonElement !is JsonPrimitive) { + try { + val instance = jsonDecoder.json.decodeFromJsonElement(jsonElement) + return UserOrPet.UserValue(instance) + } catch (e: Exception) { + errorMessages.add("Failed to deserialize as User: ${e.message}") + } + } + if (jsonElement !is JsonPrimitive) { + try { + val instance = jsonDecoder.json.decodeFromJsonElement(jsonElement) + return UserOrPet.PetValue(instance) + } catch (e: Exception) { + errorMessages.add("Failed to deserialize as Pet: ${e.message}") + } + } + + throw SerializationException("Cannot deserialize UserOrPet. Tried: ${errorMessages.joinToString(", ")}") + } +} + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/UserOrPetOrArrayString.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/UserOrPetOrArrayString.kt new file mode 100644 index 000000000000..1a0ed5b32e76 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/UserOrPetOrArrayString.kt @@ -0,0 +1,106 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import org.openapitools.client.models.Category +import org.openapitools.client.models.Pet +import org.openapitools.client.models.Tag +import org.openapitools.client.models.User + +import kotlinx.serialization.Serializable +import kotlinx.serialization.SerialName +import kotlinx.serialization.Contextual +import kotlinx.serialization.KSerializer +import kotlinx.serialization.Serializer +import kotlinx.serialization.builtins.serializer +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder +import kotlinx.serialization.SerializationException +import kotlinx.serialization.descriptors.SerialDescriptor +import kotlinx.serialization.descriptors.buildClassSerialDescriptor +import kotlinx.serialization.json.JsonDecoder +import kotlinx.serialization.json.JsonElement +import kotlinx.serialization.json.JsonEncoder +import kotlinx.serialization.json.JsonPrimitive +import kotlinx.serialization.json.JsonArray +import kotlinx.serialization.json.decodeFromJsonElement +import kotlinx.serialization.json.encodeToJsonElement + +/** + * + * + */ +@Serializable(with = UserOrPetOrArrayStringSerializer::class) +sealed interface UserOrPetOrArrayString { + @JvmInline + value class UserValue(val value: User) : UserOrPetOrArrayString + + @JvmInline + value class PetValue(val value: Pet) : UserOrPetOrArrayString + + @JvmInline + value class ListStringValue(val value: kotlin.collections.List) : UserOrPetOrArrayString + +} + +object UserOrPetOrArrayStringSerializer : KSerializer { + override val descriptor: SerialDescriptor = buildClassSerialDescriptor("UserOrPetOrArrayString") + + override fun serialize(encoder: Encoder, value: UserOrPetOrArrayString) { + val jsonEncoder = encoder as? JsonEncoder ?: throw SerializationException("UserOrPetOrArrayString can only be serialized with Json") + + when (value) { + is UserOrPetOrArrayString.UserValue -> jsonEncoder.encodeSerializableValue(User.serializer(), value.value) + is UserOrPetOrArrayString.PetValue -> jsonEncoder.encodeSerializableValue(Pet.serializer(), value.value) + is UserOrPetOrArrayString.ListStringValue -> jsonEncoder.encodeJsonElement(jsonEncoder.json.encodeToJsonElement(value.value)) + } + } + + override fun deserialize(decoder: Decoder): UserOrPetOrArrayString { + val jsonDecoder = decoder as? JsonDecoder ?: throw SerializationException("UserOrPetOrArrayString can only be deserialized with Json") + val jsonElement = jsonDecoder.decodeJsonElement() + + val errorMessages = mutableListOf() + + if (jsonElement !is JsonPrimitive) { + try { + val instance = jsonDecoder.json.decodeFromJsonElement(jsonElement) + return UserOrPetOrArrayString.UserValue(instance) + } catch (e: Exception) { + errorMessages.add("Failed to deserialize as User: ${e.message}") + } + } + if (jsonElement !is JsonPrimitive) { + try { + val instance = jsonDecoder.json.decodeFromJsonElement(jsonElement) + return UserOrPetOrArrayString.PetValue(instance) + } catch (e: Exception) { + errorMessages.add("Failed to deserialize as Pet: ${e.message}") + } + } + if (jsonElement is JsonArray) { + try { + val instance = jsonDecoder.json.decodeFromJsonElement>(jsonElement) + return UserOrPetOrArrayString.ListStringValue(instance) + } catch (e: Exception) { + errorMessages.add("Failed to deserialize as kotlin.collections.List: ${e.message}") + } + } + + throw SerializationException("Cannot deserialize UserOrPetOrArrayString. Tried: ${errorMessages.joinToString(", ")}") + } +} + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/FakeApiTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/FakeApiTest.kt new file mode 100644 index 000000000000..05b5f3967390 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/FakeApiTest.kt @@ -0,0 +1,47 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.apis + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.apis.FakeApi +import org.openapitools.client.models.Annotation + +class FakeApiTest : ShouldSpec() { + init { + // uncomment below to create an instance of FakeApi + //val apiInstance = FakeApi() + + // to test annotations + should("test annotations") { + // uncomment below to test annotations + //val `annotation` : Annotation = // Annotation | + //apiInstance.annotations(`annotation`) + } + + // to test updatePetWithFormNumber + should("test updatePetWithFormNumber") { + // uncomment below to test updatePetWithFormNumber + //val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated + //val name : kotlin.String = name_example // kotlin.String | Updated name of the pet + //val status : kotlin.Int = 56 // kotlin.Int | integer type + //val status2 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | number type + //apiInstance.updatePetWithFormNumber(petId, name, status, status2) + } + + } +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/PetApiTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/PetApiTest.kt new file mode 100644 index 000000000000..9289330db4fd --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/PetApiTest.kt @@ -0,0 +1,98 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.apis + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.apis.PetApi +import org.openapitools.client.models.ModelApiResponse +import org.openapitools.client.models.Pet + +class PetApiTest : ShouldSpec() { + init { + // uncomment below to create an instance of PetApi + //val apiInstance = PetApi() + + // to test addPet + should("test addPet") { + // uncomment below to test addPet + //val pet : Pet = // Pet | Pet object that needs to be added to the store + //val result : Pet = apiInstance.addPet(pet) + //result shouldBe ("TODO") + } + + // to test deletePet + should("test deletePet") { + // uncomment below to test deletePet + //val petId : kotlin.Long = 789 // kotlin.Long | Pet id to delete + //val apiKey : kotlin.String = apiKey_example // kotlin.String | + //apiInstance.deletePet(petId, apiKey) + } + + // to test findPetsByStatus + should("test findPetsByStatus") { + // uncomment below to test findPetsByStatus + //val status : kotlin.collections.List = // kotlin.collections.List | Status values that need to be considered for filter + //val result : kotlin.collections.List = apiInstance.findPetsByStatus(status) + //result shouldBe ("TODO") + } + + // to test findPetsByTags + should("test findPetsByTags") { + // uncomment below to test findPetsByTags + //val tags : kotlin.collections.List = // kotlin.collections.List | Tags to filter by + //val result : kotlin.collections.List = apiInstance.findPetsByTags(tags) + //result shouldBe ("TODO") + } + + // to test getPetById + should("test getPetById") { + // uncomment below to test getPetById + //val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to return + //val result : Pet = apiInstance.getPetById(petId) + //result shouldBe ("TODO") + } + + // to test updatePet + should("test updatePet") { + // uncomment below to test updatePet + //val pet : Pet = // Pet | Pet object that needs to be added to the store + //val result : Pet = apiInstance.updatePet(pet) + //result shouldBe ("TODO") + } + + // to test updatePetWithForm + should("test updatePetWithForm") { + // uncomment below to test updatePetWithForm + //val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated + //val name : kotlin.String = name_example // kotlin.String | Updated name of the pet + //val status : kotlin.String = status_example // kotlin.String | Updated status of the pet + //apiInstance.updatePetWithForm(petId, name, status) + } + + // to test uploadFile + should("test uploadFile") { + // uncomment below to test uploadFile + //val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update + //val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server + //val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload + //val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + //result shouldBe ("TODO") + } + + } +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/StoreApiTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/StoreApiTest.kt new file mode 100644 index 000000000000..f37863047d30 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/StoreApiTest.kt @@ -0,0 +1,60 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.apis + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.apis.StoreApi +import org.openapitools.client.models.Order + +class StoreApiTest : ShouldSpec() { + init { + // uncomment below to create an instance of StoreApi + //val apiInstance = StoreApi() + + // to test deleteOrder + should("test deleteOrder") { + // uncomment below to test deleteOrder + //val orderId : kotlin.String = orderId_example // kotlin.String | ID of the order that needs to be deleted + //apiInstance.deleteOrder(orderId) + } + + // to test getInventory + should("test getInventory") { + // uncomment below to test getInventory + //val result : kotlin.collections.Map = apiInstance.getInventory() + //result shouldBe ("TODO") + } + + // to test getOrderById + should("test getOrderById") { + // uncomment below to test getOrderById + //val orderId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be fetched + //val result : Order = apiInstance.getOrderById(orderId) + //result shouldBe ("TODO") + } + + // to test placeOrder + should("test placeOrder") { + // uncomment below to test placeOrder + //val order : Order = // Order | order placed for purchasing the pet + //val result : Order = apiInstance.placeOrder(order) + //result shouldBe ("TODO") + } + + } +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/UserApiTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/UserApiTest.kt new file mode 100644 index 000000000000..b617fb9fd0e4 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/UserApiTest.kt @@ -0,0 +1,89 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.apis + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.apis.UserApi +import org.openapitools.client.models.User + +class UserApiTest : ShouldSpec() { + init { + // uncomment below to create an instance of UserApi + //val apiInstance = UserApi() + + // to test createUser + should("test createUser") { + // uncomment below to test createUser + //val user : User = // User | Created user object + //apiInstance.createUser(user) + } + + // to test createUsersWithArrayInput + should("test createUsersWithArrayInput") { + // uncomment below to test createUsersWithArrayInput + //val user : kotlin.collections.List = // kotlin.collections.List | List of user object + //apiInstance.createUsersWithArrayInput(user) + } + + // to test createUsersWithListInput + should("test createUsersWithListInput") { + // uncomment below to test createUsersWithListInput + //val user : kotlin.collections.List = // kotlin.collections.List | List of user object + //apiInstance.createUsersWithListInput(user) + } + + // to test deleteUser + should("test deleteUser") { + // uncomment below to test deleteUser + //val username : kotlin.String = username_example // kotlin.String | The name that needs to be deleted + //apiInstance.deleteUser(username) + } + + // to test getUserByName + should("test getUserByName") { + // uncomment below to test getUserByName + //val username : kotlin.String = username_example // kotlin.String | The name that needs to be fetched. Use user1 for testing. + //val result : User = apiInstance.getUserByName(username) + //result shouldBe ("TODO") + } + + // to test loginUser + should("test loginUser") { + // uncomment below to test loginUser + //val username : kotlin.String = username_example // kotlin.String | The user name for login + //val password : kotlin.String = password_example // kotlin.String | The password for login in clear text + //val result : kotlin.String = apiInstance.loginUser(username, password) + //result shouldBe ("TODO") + } + + // to test logoutUser + should("test logoutUser") { + // uncomment below to test logoutUser + //apiInstance.logoutUser() + } + + // to test updateUser + should("test updateUser") { + // uncomment below to test updateUser + //val username : kotlin.String = username_example // kotlin.String | name that need to be deleted + //val user : User = // User | Updated user object + //apiInstance.updateUser(username, user) + } + + } +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/AnnotationTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/AnnotationTest.kt new file mode 100644 index 000000000000..7110952e1508 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/AnnotationTest.kt @@ -0,0 +1,35 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.Annotation + +class AnnotationTest : ShouldSpec() { + init { + // uncomment below to create an instance of Annotation + //val modelInstance = Annotation() + + // to test the property `id` + should("test id") { + // uncomment below to test the property + //modelInstance.id shouldBe ("TODO") + } + + } +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/AnyOfUserOrPetOrArrayStringTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/AnyOfUserOrPetOrArrayStringTest.kt new file mode 100644 index 000000000000..76a2fc35450d --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/AnyOfUserOrPetOrArrayStringTest.kt @@ -0,0 +1,111 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.AnyOfUserOrPetOrArrayString +import org.openapitools.client.models.Category +import org.openapitools.client.models.Pet +import org.openapitools.client.models.Tag +import org.openapitools.client.models.User + +class AnyOfUserOrPetOrArrayStringTest : ShouldSpec() { + init { + // uncomment below to create an instance of AnyOfUserOrPetOrArrayString + //val modelInstance = AnyOfUserOrPetOrArrayString() + + // to test the property `username` + should("test username") { + // uncomment below to test the property + //modelInstance.username shouldBe ("TODO") + } + + // to test the property `name` + should("test name") { + // uncomment below to test the property + //modelInstance.name shouldBe ("TODO") + } + + // to test the property `photoUrls` + should("test photoUrls") { + // uncomment below to test the property + //modelInstance.photoUrls shouldBe ("TODO") + } + + // to test the property `id` + should("test id") { + // uncomment below to test the property + //modelInstance.id shouldBe ("TODO") + } + + // to test the property `firstName` + should("test firstName") { + // uncomment below to test the property + //modelInstance.firstName shouldBe ("TODO") + } + + // to test the property `lastName` + should("test lastName") { + // uncomment below to test the property + //modelInstance.lastName shouldBe ("TODO") + } + + // to test the property `email` + should("test email") { + // uncomment below to test the property + //modelInstance.email shouldBe ("TODO") + } + + // to test the property `password` + should("test password") { + // uncomment below to test the property + //modelInstance.password shouldBe ("TODO") + } + + // to test the property `phone` + should("test phone") { + // uncomment below to test the property + //modelInstance.phone shouldBe ("TODO") + } + + // to test the property `userStatus` - User Status + should("test userStatus") { + // uncomment below to test the property + //modelInstance.userStatus shouldBe ("TODO") + } + + // to test the property `category` + should("test category") { + // uncomment below to test the property + //modelInstance.category shouldBe ("TODO") + } + + // to test the property `tags` + should("test tags") { + // uncomment below to test the property + //modelInstance.tags shouldBe ("TODO") + } + + // to test the property `status` - pet status in the store + should("test status") { + // uncomment below to test the property + //modelInstance.status shouldBe ("TODO") + } + + } +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/AnyOfUserOrPetTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/AnyOfUserOrPetTest.kt new file mode 100644 index 000000000000..cf4d7db01792 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/AnyOfUserOrPetTest.kt @@ -0,0 +1,111 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.AnyOfUserOrPet +import org.openapitools.client.models.Category +import org.openapitools.client.models.Pet +import org.openapitools.client.models.Tag +import org.openapitools.client.models.User + +class AnyOfUserOrPetTest : ShouldSpec() { + init { + // uncomment below to create an instance of AnyOfUserOrPet + //val modelInstance = AnyOfUserOrPet() + + // to test the property `username` + should("test username") { + // uncomment below to test the property + //modelInstance.username shouldBe ("TODO") + } + + // to test the property `name` + should("test name") { + // uncomment below to test the property + //modelInstance.name shouldBe ("TODO") + } + + // to test the property `photoUrls` + should("test photoUrls") { + // uncomment below to test the property + //modelInstance.photoUrls shouldBe ("TODO") + } + + // to test the property `id` + should("test id") { + // uncomment below to test the property + //modelInstance.id shouldBe ("TODO") + } + + // to test the property `firstName` + should("test firstName") { + // uncomment below to test the property + //modelInstance.firstName shouldBe ("TODO") + } + + // to test the property `lastName` + should("test lastName") { + // uncomment below to test the property + //modelInstance.lastName shouldBe ("TODO") + } + + // to test the property `email` + should("test email") { + // uncomment below to test the property + //modelInstance.email shouldBe ("TODO") + } + + // to test the property `password` + should("test password") { + // uncomment below to test the property + //modelInstance.password shouldBe ("TODO") + } + + // to test the property `phone` + should("test phone") { + // uncomment below to test the property + //modelInstance.phone shouldBe ("TODO") + } + + // to test the property `userStatus` - User Status + should("test userStatus") { + // uncomment below to test the property + //modelInstance.userStatus shouldBe ("TODO") + } + + // to test the property `category` + should("test category") { + // uncomment below to test the property + //modelInstance.category shouldBe ("TODO") + } + + // to test the property `tags` + should("test tags") { + // uncomment below to test the property + //modelInstance.tags shouldBe ("TODO") + } + + // to test the property `status` - pet status in the store + should("test status") { + // uncomment below to test the property + //modelInstance.status shouldBe ("TODO") + } + + } +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/ApiResponseTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/ApiResponseTest.kt new file mode 100644 index 000000000000..61fe0207cf0a --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/ApiResponseTest.kt @@ -0,0 +1,47 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.ModelApiResponse + +class ModelApiResponseTest : ShouldSpec() { + init { + // uncomment below to create an instance of ModelApiResponse + //val modelInstance = ModelApiResponse() + + // to test the property `code` + should("test code") { + // uncomment below to test the property + //modelInstance.code shouldBe ("TODO") + } + + // to test the property `type` + should("test type") { + // uncomment below to test the property + //modelInstance.type shouldBe ("TODO") + } + + // to test the property `message` + should("test message") { + // uncomment below to test the property + //modelInstance.message shouldBe ("TODO") + } + + } +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/CategoryTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/CategoryTest.kt new file mode 100644 index 000000000000..4cfde8e19c63 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/CategoryTest.kt @@ -0,0 +1,41 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.Category + +class CategoryTest : ShouldSpec() { + init { + // uncomment below to create an instance of Category + //val modelInstance = Category() + + // to test the property `id` + should("test id") { + // uncomment below to test the property + //modelInstance.id shouldBe ("TODO") + } + + // to test the property `name` + should("test name") { + // uncomment below to test the property + //modelInstance.name shouldBe ("TODO") + } + + } +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/OrderTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/OrderTest.kt new file mode 100644 index 000000000000..1f2eb1dfa888 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/OrderTest.kt @@ -0,0 +1,65 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.Order + +class OrderTest : ShouldSpec() { + init { + // uncomment below to create an instance of Order + //val modelInstance = Order() + + // to test the property `id` + should("test id") { + // uncomment below to test the property + //modelInstance.id shouldBe ("TODO") + } + + // to test the property `petId` + should("test petId") { + // uncomment below to test the property + //modelInstance.petId shouldBe ("TODO") + } + + // to test the property `quantity` + should("test quantity") { + // uncomment below to test the property + //modelInstance.quantity shouldBe ("TODO") + } + + // to test the property `shipDate` + should("test shipDate") { + // uncomment below to test the property + //modelInstance.shipDate shouldBe ("TODO") + } + + // to test the property `status` - Order Status + should("test status") { + // uncomment below to test the property + //modelInstance.status shouldBe ("TODO") + } + + // to test the property `complete` + should("test complete") { + // uncomment below to test the property + //modelInstance.complete shouldBe ("TODO") + } + + } +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/PetTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/PetTest.kt new file mode 100644 index 000000000000..ef7128c4d0b9 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/PetTest.kt @@ -0,0 +1,67 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.Pet +import org.openapitools.client.models.Category +import org.openapitools.client.models.Tag + +class PetTest : ShouldSpec() { + init { + // uncomment below to create an instance of Pet + //val modelInstance = Pet() + + // to test the property `name` + should("test name") { + // uncomment below to test the property + //modelInstance.name shouldBe ("TODO") + } + + // to test the property `photoUrls` + should("test photoUrls") { + // uncomment below to test the property + //modelInstance.photoUrls shouldBe ("TODO") + } + + // to test the property `id` + should("test id") { + // uncomment below to test the property + //modelInstance.id shouldBe ("TODO") + } + + // to test the property `category` + should("test category") { + // uncomment below to test the property + //modelInstance.category shouldBe ("TODO") + } + + // to test the property `tags` + should("test tags") { + // uncomment below to test the property + //modelInstance.tags shouldBe ("TODO") + } + + // to test the property `status` - pet status in the store + should("test status") { + // uncomment below to test the property + //modelInstance.status shouldBe ("TODO") + } + + } +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/TagTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/TagTest.kt new file mode 100644 index 000000000000..65e729bb4985 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/TagTest.kt @@ -0,0 +1,41 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.Tag + +class TagTest : ShouldSpec() { + init { + // uncomment below to create an instance of Tag + //val modelInstance = Tag() + + // to test the property `id` + should("test id") { + // uncomment below to test the property + //modelInstance.id shouldBe ("TODO") + } + + // to test the property `name` + should("test name") { + // uncomment below to test the property + //modelInstance.name shouldBe ("TODO") + } + + } +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/UserOrPetOrArrayStringTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/UserOrPetOrArrayStringTest.kt new file mode 100644 index 000000000000..f996252e919f --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/UserOrPetOrArrayStringTest.kt @@ -0,0 +1,111 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.UserOrPetOrArrayString +import org.openapitools.client.models.Category +import org.openapitools.client.models.Pet +import org.openapitools.client.models.Tag +import org.openapitools.client.models.User + +class UserOrPetOrArrayStringTest : ShouldSpec() { + init { + // uncomment below to create an instance of UserOrPetOrArrayString + //val modelInstance = UserOrPetOrArrayString() + + // to test the property `username` + should("test username") { + // uncomment below to test the property + //modelInstance.username shouldBe ("TODO") + } + + // to test the property `name` + should("test name") { + // uncomment below to test the property + //modelInstance.name shouldBe ("TODO") + } + + // to test the property `photoUrls` + should("test photoUrls") { + // uncomment below to test the property + //modelInstance.photoUrls shouldBe ("TODO") + } + + // to test the property `id` + should("test id") { + // uncomment below to test the property + //modelInstance.id shouldBe ("TODO") + } + + // to test the property `firstName` + should("test firstName") { + // uncomment below to test the property + //modelInstance.firstName shouldBe ("TODO") + } + + // to test the property `lastName` + should("test lastName") { + // uncomment below to test the property + //modelInstance.lastName shouldBe ("TODO") + } + + // to test the property `email` + should("test email") { + // uncomment below to test the property + //modelInstance.email shouldBe ("TODO") + } + + // to test the property `password` + should("test password") { + // uncomment below to test the property + //modelInstance.password shouldBe ("TODO") + } + + // to test the property `phone` + should("test phone") { + // uncomment below to test the property + //modelInstance.phone shouldBe ("TODO") + } + + // to test the property `userStatus` - User Status + should("test userStatus") { + // uncomment below to test the property + //modelInstance.userStatus shouldBe ("TODO") + } + + // to test the property `category` + should("test category") { + // uncomment below to test the property + //modelInstance.category shouldBe ("TODO") + } + + // to test the property `tags` + should("test tags") { + // uncomment below to test the property + //modelInstance.tags shouldBe ("TODO") + } + + // to test the property `status` - pet status in the store + should("test status") { + // uncomment below to test the property + //modelInstance.status shouldBe ("TODO") + } + + } +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/UserOrPetTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/UserOrPetTest.kt new file mode 100644 index 000000000000..645e8e5de206 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/UserOrPetTest.kt @@ -0,0 +1,111 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.UserOrPet +import org.openapitools.client.models.Category +import org.openapitools.client.models.Pet +import org.openapitools.client.models.Tag +import org.openapitools.client.models.User + +class UserOrPetTest : ShouldSpec() { + init { + // uncomment below to create an instance of UserOrPet + //val modelInstance = UserOrPet() + + // to test the property `username` + should("test username") { + // uncomment below to test the property + //modelInstance.username shouldBe ("TODO") + } + + // to test the property `name` + should("test name") { + // uncomment below to test the property + //modelInstance.name shouldBe ("TODO") + } + + // to test the property `photoUrls` + should("test photoUrls") { + // uncomment below to test the property + //modelInstance.photoUrls shouldBe ("TODO") + } + + // to test the property `id` + should("test id") { + // uncomment below to test the property + //modelInstance.id shouldBe ("TODO") + } + + // to test the property `firstName` + should("test firstName") { + // uncomment below to test the property + //modelInstance.firstName shouldBe ("TODO") + } + + // to test the property `lastName` + should("test lastName") { + // uncomment below to test the property + //modelInstance.lastName shouldBe ("TODO") + } + + // to test the property `email` + should("test email") { + // uncomment below to test the property + //modelInstance.email shouldBe ("TODO") + } + + // to test the property `password` + should("test password") { + // uncomment below to test the property + //modelInstance.password shouldBe ("TODO") + } + + // to test the property `phone` + should("test phone") { + // uncomment below to test the property + //modelInstance.phone shouldBe ("TODO") + } + + // to test the property `userStatus` - User Status + should("test userStatus") { + // uncomment below to test the property + //modelInstance.userStatus shouldBe ("TODO") + } + + // to test the property `category` + should("test category") { + // uncomment below to test the property + //modelInstance.category shouldBe ("TODO") + } + + // to test the property `tags` + should("test tags") { + // uncomment below to test the property + //modelInstance.tags shouldBe ("TODO") + } + + // to test the property `status` - pet status in the store + should("test status") { + // uncomment below to test the property + //modelInstance.status shouldBe ("TODO") + } + + } +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/UserTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/UserTest.kt new file mode 100644 index 000000000000..a4d689ca231f --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/UserTest.kt @@ -0,0 +1,77 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.User + +class UserTest : ShouldSpec() { + init { + // uncomment below to create an instance of User + //val modelInstance = User() + + // to test the property `username` + should("test username") { + // uncomment below to test the property + //modelInstance.username shouldBe ("TODO") + } + + // to test the property `id` + should("test id") { + // uncomment below to test the property + //modelInstance.id shouldBe ("TODO") + } + + // to test the property `firstName` + should("test firstName") { + // uncomment below to test the property + //modelInstance.firstName shouldBe ("TODO") + } + + // to test the property `lastName` + should("test lastName") { + // uncomment below to test the property + //modelInstance.lastName shouldBe ("TODO") + } + + // to test the property `email` + should("test email") { + // uncomment below to test the property + //modelInstance.email shouldBe ("TODO") + } + + // to test the property `password` + should("test password") { + // uncomment below to test the property + //modelInstance.password shouldBe ("TODO") + } + + // to test the property `phone` + should("test phone") { + // uncomment below to test the property + //modelInstance.phone shouldBe ("TODO") + } + + // to test the property `userStatus` - User Status + should("test userStatus") { + // uncomment below to test the property + //modelInstance.userStatus shouldBe ("TODO") + } + + } +} From d83be96ed148a5a98a49df5ee94db2f18df0555b Mon Sep 17 00:00:00 2001 From: wakata_sansan Date: Thu, 19 Feb 2026 13:34:22 +0900 Subject: [PATCH 3/7] replace petstore with focused spec for non-discriminator oneOf/anyOf sample --- ...lin-oneOf-anyOf-kotlinx-serialization.yaml | 2 +- .../kotlin/oneof-anyof-non-discriminator.yaml | 138 ++++++++ .../.openapi-generator/FILES | 40 +-- .../README.md | 62 +--- .../build.gradle | 1 - .../docs/AnyOfUserOrPet.md | 19 +- .../docs/AnyOfUserOrPetOrArrayString.md | 19 +- .../docs/ApiResponse.md | 12 - .../docs/{Annotation.md => BooleanOrLong.md} | 3 +- .../docs/Category.md | 11 - .../docs/FakeApi.md | 88 ----- .../docs/Order.md | 22 -- .../docs/Pet.md | 13 +- .../docs/PetApi.md | 322 ------------------ .../docs/StoreApi.md | 157 --------- .../docs/{Tag.md => StringOrLong.md} | 4 +- .../docs/TestApi.md | 206 +++++++++++ .../docs/User.md | 8 +- .../docs/UserApi.md | 313 ----------------- .../docs/UserOrPet.md | 19 +- .../docs/UserOrPetOrArrayString.md | 19 +- .../gradlew | 0 .../org/openapitools/client/apis/FakeApi.kt | 43 --- .../org/openapitools/client/apis/PetApi.kt | 147 -------- .../org/openapitools/client/apis/StoreApi.kt | 68 ---- .../org/openapitools/client/apis/TestApi.kt | 90 +++++ .../org/openapitools/client/apis/UserApi.kt | 123 ------- .../openapitools/client/auth/ApiKeyAuth.kt | 50 --- .../org/openapitools/client/auth/OAuth.kt | 151 -------- .../org/openapitools/client/auth/OAuthFlow.kt | 5 - .../client/auth/OAuthOkHttpClient.kt | 61 ---- .../client/infrastructure/ApiClient.kt | 113 +----- .../openapitools/client/models/Annotation.kt | 44 --- .../client/models/AnyOfUserOrPet.kt | 2 - .../models/AnyOfUserOrPetOrArrayString.kt | 2 - .../client/models/BooleanOrLong.kt | 90 +++++ .../openapitools/client/models/Category.kt | 48 --- .../client/models/ModelApiResponse.kt | 52 --- .../org/openapitools/client/models/Order.kt | 91 ----- .../org/openapitools/client/models/Pet.kt | 56 +-- .../client/models/StringOrLong.kt | 90 +++++ .../org/openapitools/client/models/Tag.kt | 48 --- .../org/openapitools/client/models/User.kt | 35 +- .../openapitools/client/models/UserOrPet.kt | 2 - .../client/models/UserOrPetOrArrayString.kt | 2 - .../openapitools/client/apis/FakeApiTest.kt | 47 --- .../openapitools/client/apis/PetApiTest.kt | 98 ------ .../openapitools/client/apis/StoreApiTest.kt | 60 ---- .../openapitools/client/apis/TestApiTest.kt | 77 +++++ .../openapitools/client/apis/UserApiTest.kt | 89 ----- .../models/AnyOfUserOrPetOrArrayStringTest.kt | 74 +--- .../client/models/AnyOfUserOrPetTest.kt | 74 +--- .../client/models/ApiResponseTest.kt | 47 --- .../client/models/BooleanOrLongTest.kt | 29 ++ .../client/models/CategoryTest.kt | 41 --- .../openapitools/client/models/OrderTest.kt | 65 ---- .../org/openapitools/client/models/PetTest.kt | 32 +- ...{AnnotationTest.kt => StringOrLongTest.kt} | 14 +- .../org/openapitools/client/models/TagTest.kt | 41 --- .../models/UserOrPetOrArrayStringTest.kt | 74 +--- .../client/models/UserOrPetTest.kt | 74 +--- .../openapitools/client/models/UserTest.kt | 42 +-- 62 files changed, 796 insertions(+), 3073 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/3_0/kotlin/oneof-anyof-non-discriminator.yaml delete mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/ApiResponse.md rename samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/{Annotation.md => BooleanOrLong.md} (59%) delete mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Category.md delete mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/FakeApi.md delete mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Order.md delete mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/PetApi.md delete mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/StoreApi.md rename samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/{Tag.md => StringOrLong.md} (54%) create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/TestApi.md delete mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/UserApi.md mode change 100644 => 100755 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/gradlew delete mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt delete mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/PetApi.kt delete mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/TestApi.kt delete mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/UserApi.kt delete mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt delete mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/OAuth.kt delete mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/OAuthFlow.kt delete mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/OAuthOkHttpClient.kt delete mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Annotation.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/BooleanOrLong.kt delete mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Category.kt delete mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt delete mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Order.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/StringOrLong.kt delete mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Tag.kt delete mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/FakeApiTest.kt delete mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/PetApiTest.kt delete mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/StoreApiTest.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/TestApiTest.kt delete mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/UserApiTest.kt delete mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/ApiResponseTest.kt create mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/BooleanOrLongTest.kt delete mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/CategoryTest.kt delete mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/OrderTest.kt rename samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/{AnnotationTest.kt => StringOrLongTest.kt} (52%) delete mode 100644 samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/TagTest.kt diff --git a/bin/configs/kotlin-oneOf-anyOf-kotlinx-serialization.yaml b/bin/configs/kotlin-oneOf-anyOf-kotlinx-serialization.yaml index a9a18f549736..9b1d1c2d5614 100644 --- a/bin/configs/kotlin-oneOf-anyOf-kotlinx-serialization.yaml +++ b/bin/configs/kotlin-oneOf-anyOf-kotlinx-serialization.yaml @@ -1,6 +1,6 @@ generatorName: kotlin outputDir: samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization -inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/petstore.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/oneof-anyof-non-discriminator.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-oneOf-anyOf-kotlinx-serialization diff --git a/modules/openapi-generator/src/test/resources/3_0/kotlin/oneof-anyof-non-discriminator.yaml b/modules/openapi-generator/src/test/resources/3_0/kotlin/oneof-anyof-non-discriminator.yaml new file mode 100644 index 000000000000..c15a50e2c3c6 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/kotlin/oneof-anyof-non-discriminator.yaml @@ -0,0 +1,138 @@ +openapi: 3.0.1 +info: + title: oneOf/anyOf non-discriminator example + description: Test non-discriminator oneOf and anyOf with model, primitive, and array types + version: '0.1' +servers: + - url: http://example.org +tags: + - name: test +paths: + '/v1/test/oneOf': + get: + tags: + - test + operationId: get-oneOf + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UserOrPet' + '/v1/test/oneOfArray': + get: + tags: + - test + operationId: get-oneOf-array + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UserOrPetOrArrayString' + '/v1/test/oneOfPrimitive': + get: + tags: + - test + operationId: get-oneOf-primitive + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StringOrLong' + '/v1/test/oneOfBooleanPrimitive': + get: + tags: + - test + operationId: get-oneOf-boolean-primitive + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/BooleanOrLong' + '/v1/test/anyOf': + get: + tags: + - test + operationId: get-anyOf + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AnyOfUserOrPet' + '/v1/test/anyOfArray': + get: + tags: + - test + operationId: get-anyOf-array + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AnyOfUserOrPetOrArrayString' +components: + schemas: + User: + type: object + properties: + id: + type: integer + format: int64 + username: + type: string + required: + - id + - username + Pet: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + required: + - id + - name + UserOrPet: + oneOf: + - $ref: '#/components/schemas/User' + - $ref: '#/components/schemas/Pet' + UserOrPetOrArrayString: + oneOf: + - $ref: '#/components/schemas/User' + - $ref: '#/components/schemas/Pet' + - type: array + items: + type: string + StringOrLong: + oneOf: + - type: string + - type: integer + format: int64 + BooleanOrLong: + oneOf: + - type: boolean + - type: integer + format: int64 + AnyOfUserOrPet: + anyOf: + - $ref: '#/components/schemas/User' + - $ref: '#/components/schemas/Pet' + AnyOfUserOrPetOrArrayString: + anyOf: + - $ref: '#/components/schemas/User' + - $ref: '#/components/schemas/Pet' + - type: array + items: + type: string diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/.openapi-generator/FILES b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/.openapi-generator/FILES index 2a73d7bb8014..bbe6037c9289 100644 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/.openapi-generator/FILES +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/.openapi-generator/FILES @@ -1,19 +1,13 @@ .openapi-generator-ignore README.md build.gradle -docs/Annotation.md docs/AnyOfUserOrPet.md docs/AnyOfUserOrPetOrArrayString.md -docs/ApiResponse.md -docs/Category.md -docs/FakeApi.md -docs/Order.md +docs/BooleanOrLong.md docs/Pet.md -docs/PetApi.md -docs/StoreApi.md -docs/Tag.md +docs/StringOrLong.md +docs/TestApi.md docs/User.md -docs/UserApi.md docs/UserOrPet.md docs/UserOrPetOrArrayString.md gradle/wrapper/gradle-wrapper.jar @@ -22,14 +16,7 @@ gradlew gradlew.bat proguard-rules.pro settings.gradle -src/main/kotlin/org/openapitools/client/apis/FakeApi.kt -src/main/kotlin/org/openapitools/client/apis/PetApi.kt -src/main/kotlin/org/openapitools/client/apis/StoreApi.kt -src/main/kotlin/org/openapitools/client/apis/UserApi.kt -src/main/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt -src/main/kotlin/org/openapitools/client/auth/OAuth.kt -src/main/kotlin/org/openapitools/client/auth/OAuthFlow.kt -src/main/kotlin/org/openapitools/client/auth/OAuthOkHttpClient.kt +src/main/kotlin/org/openapitools/client/apis/TestApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt src/main/kotlin/org/openapitools/client/infrastructure/AtomicBooleanAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/AtomicIntegerAdapter.kt @@ -46,29 +33,20 @@ src/main/kotlin/org/openapitools/client/infrastructure/StringBuilderAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/URLAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt -src/main/kotlin/org/openapitools/client/models/Annotation.kt src/main/kotlin/org/openapitools/client/models/AnyOfUserOrPet.kt src/main/kotlin/org/openapitools/client/models/AnyOfUserOrPetOrArrayString.kt -src/main/kotlin/org/openapitools/client/models/Category.kt -src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt -src/main/kotlin/org/openapitools/client/models/Order.kt +src/main/kotlin/org/openapitools/client/models/BooleanOrLong.kt src/main/kotlin/org/openapitools/client/models/Pet.kt -src/main/kotlin/org/openapitools/client/models/Tag.kt +src/main/kotlin/org/openapitools/client/models/StringOrLong.kt src/main/kotlin/org/openapitools/client/models/User.kt src/main/kotlin/org/openapitools/client/models/UserOrPet.kt src/main/kotlin/org/openapitools/client/models/UserOrPetOrArrayString.kt -src/test/kotlin/org/openapitools/client/apis/FakeApiTest.kt -src/test/kotlin/org/openapitools/client/apis/PetApiTest.kt -src/test/kotlin/org/openapitools/client/apis/StoreApiTest.kt -src/test/kotlin/org/openapitools/client/apis/UserApiTest.kt -src/test/kotlin/org/openapitools/client/models/AnnotationTest.kt +src/test/kotlin/org/openapitools/client/apis/TestApiTest.kt src/test/kotlin/org/openapitools/client/models/AnyOfUserOrPetOrArrayStringTest.kt src/test/kotlin/org/openapitools/client/models/AnyOfUserOrPetTest.kt -src/test/kotlin/org/openapitools/client/models/ApiResponseTest.kt -src/test/kotlin/org/openapitools/client/models/CategoryTest.kt -src/test/kotlin/org/openapitools/client/models/OrderTest.kt +src/test/kotlin/org/openapitools/client/models/BooleanOrLongTest.kt src/test/kotlin/org/openapitools/client/models/PetTest.kt -src/test/kotlin/org/openapitools/client/models/TagTest.kt +src/test/kotlin/org/openapitools/client/models/StringOrLongTest.kt src/test/kotlin/org/openapitools/client/models/UserOrPetOrArrayStringTest.kt src/test/kotlin/org/openapitools/client/models/UserOrPetTest.kt src/test/kotlin/org/openapitools/client/models/UserTest.kt diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/README.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/README.md index e6fe9407abe5..a5734ec4140e 100644 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/README.md +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/README.md @@ -1,11 +1,11 @@ -# org.openapitools.client - Kotlin client library for OpenAPI Petstore +# org.openapitools.client - Kotlin client library for oneOf/anyOf non-discriminator example -This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +Test non-discriminator oneOf and anyOf with model, primitive, and array types ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client. -- API version: 1.0.0 +- API version: 0.1 - Package version: - Generator version: 7.21.0-SNAPSHOT - Build package: org.openapitools.codegen.languages.KotlinClientCodegen @@ -41,45 +41,26 @@ This runs all tests and packages the library. ## Documentation for API Endpoints -All URIs are relative to *http://petstore.swagger.io/v2* +All URIs are relative to *http://example.org* | Class | Method | HTTP request | Description | | ------------ | ------------- | ------------- | ------------- | -| *FakeApi* | [**annotations**](docs/FakeApi.md#annotations) | **POST** fake/annotations | annotate | -| *FakeApi* | [**updatePetWithFormNumber**](docs/FakeApi.md#updatepetwithformnumber) | **PUT** fake/annotations | Updates a pet in the store with form data (number) | -| *PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** pet | Add a new pet to the store | -| *PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** pet/{petId} | Deletes a pet | -| *PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** pet/findByStatus | Finds Pets by status | -| *PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** pet/findByTags | Finds Pets by tags | -| *PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** pet/{petId} | Find pet by ID | -| *PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** pet | Update an existing pet | -| *PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** pet/{petId} | Updates a pet in the store with form data | -| *PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** pet/{petId}/uploadImage | uploads an image | -| *StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** store/order/{orderId} | Delete purchase order by ID | -| *StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** store/inventory | Returns pet inventories by status | -| *StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** store/order/{orderId} | Find purchase order by ID | -| *StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** store/order | Place an order for a pet | -| *UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** user | Create user | -| *UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** user/createWithArray | Creates list of users with given input array | -| *UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** user/createWithList | Creates list of users with given input array | -| *UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** user/{username} | Delete user | -| *UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** user/{username} | Get user by user name | -| *UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **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* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** user/{username} | Updated user | +| *TestApi* | [**getAnyOf**](docs/TestApi.md#getanyof) | **GET** v1/test/anyOf | | +| *TestApi* | [**getAnyOfArray**](docs/TestApi.md#getanyofarray) | **GET** v1/test/anyOfArray | | +| *TestApi* | [**getOneOf**](docs/TestApi.md#getoneof) | **GET** v1/test/oneOf | | +| *TestApi* | [**getOneOfArray**](docs/TestApi.md#getoneofarray) | **GET** v1/test/oneOfArray | | +| *TestApi* | [**getOneOfBooleanPrimitive**](docs/TestApi.md#getoneofbooleanprimitive) | **GET** v1/test/oneOfBooleanPrimitive | | +| *TestApi* | [**getOneOfPrimitive**](docs/TestApi.md#getoneofprimitive) | **GET** v1/test/oneOfPrimitive | | ## Documentation for Models - - [org.openapitools.client.models.Annotation](docs/Annotation.md) - [org.openapitools.client.models.AnyOfUserOrPet](docs/AnyOfUserOrPet.md) - [org.openapitools.client.models.AnyOfUserOrPetOrArrayString](docs/AnyOfUserOrPetOrArrayString.md) - - [org.openapitools.client.models.Category](docs/Category.md) - - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - - [org.openapitools.client.models.Order](docs/Order.md) + - [org.openapitools.client.models.BooleanOrLong](docs/BooleanOrLong.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - - [org.openapitools.client.models.Tag](docs/Tag.md) + - [org.openapitools.client.models.StringOrLong](docs/StringOrLong.md) - [org.openapitools.client.models.User](docs/User.md) - [org.openapitools.client.models.UserOrPet](docs/UserOrPet.md) - [org.openapitools.client.models.UserOrPetOrArrayString](docs/UserOrPetOrArrayString.md) @@ -88,22 +69,5 @@ All URIs are relative to *http://petstore.swagger.io/v2* ## 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 +Endpoints do not require authorization. diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/build.gradle b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/build.gradle index b5dcfbd3f24a..0f176ff525b7 100644 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/build.gradle +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/build.gradle @@ -58,7 +58,6 @@ test { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0" - implementation "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.2" implementation "com.squareup.okhttp3:logging-interceptor:5.1.0" implementation "com.squareup.retrofit2:retrofit:$retrofitVersion" implementation "com.squareup.retrofit2:converter-kotlinx-serialization:$retrofitVersion" diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/AnyOfUserOrPet.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/AnyOfUserOrPet.md index dccdda0a1f39..bfa4bc532462 100644 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/AnyOfUserOrPet.md +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/AnyOfUserOrPet.md @@ -4,26 +4,9 @@ ## Properties | Name | Type | Description | Notes | | ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | | | **username** | **kotlin.String** | | | | **name** | **kotlin.String** | | | -| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | -| **id** | **kotlin.Long** | | [optional] | -| **firstName** | **kotlin.String** | | [optional] | -| **lastName** | **kotlin.String** | | [optional] | -| **email** | **kotlin.String** | | [optional] | -| **password** | **kotlin.String** | | [optional] | -| **phone** | **kotlin.String** | | [optional] | -| **userStatus** | **kotlin.Int** | User Status | [optional] | -| **category** | [**Category**](Category.md) | | [optional] | -| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | -| **status** | [**inline**](#Status) | pet status in the store | [optional] | - - - -## Enum: status -| Name | Value | -| ---- | ----- | -| status | available, pending, sold | diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/AnyOfUserOrPetOrArrayString.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/AnyOfUserOrPetOrArrayString.md index 7f2bee6c6212..fa7a5106fa49 100644 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/AnyOfUserOrPetOrArrayString.md +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/AnyOfUserOrPetOrArrayString.md @@ -4,26 +4,9 @@ ## Properties | Name | Type | Description | Notes | | ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | | | **username** | **kotlin.String** | | | | **name** | **kotlin.String** | | | -| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | -| **id** | **kotlin.Long** | | [optional] | -| **firstName** | **kotlin.String** | | [optional] | -| **lastName** | **kotlin.String** | | [optional] | -| **email** | **kotlin.String** | | [optional] | -| **password** | **kotlin.String** | | [optional] | -| **phone** | **kotlin.String** | | [optional] | -| **userStatus** | **kotlin.Int** | User Status | [optional] | -| **category** | [**Category**](Category.md) | | [optional] | -| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | -| **status** | [**inline**](#Status) | pet status in the store | [optional] | - - - -## Enum: status -| Name | Value | -| ---- | ----- | -| status | available, pending, sold | diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/ApiResponse.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/ApiResponse.md deleted file mode 100644 index 059525a99512..000000000000 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/ApiResponse.md +++ /dev/null @@ -1,12 +0,0 @@ - -# ModelApiResponse - -## Properties -| Name | Type | Description | Notes | -| ------------ | ------------- | ------------- | ------------- | -| **code** | **kotlin.Int** | | [optional] | -| **type** | **kotlin.String** | | [optional] | -| **message** | **kotlin.String** | | [optional] | - - - diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Annotation.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/BooleanOrLong.md similarity index 59% rename from samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Annotation.md rename to samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/BooleanOrLong.md index 5836f295e4c3..5bff5784707b 100644 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Annotation.md +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/BooleanOrLong.md @@ -1,10 +1,9 @@ -# Annotation +# BooleanOrLong ## Properties | Name | Type | Description | Notes | | ------------ | ------------- | ------------- | ------------- | -| **id** | [**java.util.UUID**](java.util.UUID.md) | | [optional] | diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Category.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Category.md deleted file mode 100644 index baba5657eb21..000000000000 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Category.md +++ /dev/null @@ -1,11 +0,0 @@ - -# Category - -## Properties -| Name | Type | Description | Notes | -| ------------ | ------------- | ------------- | ------------- | -| **id** | **kotlin.Long** | | [optional] | -| **name** | **kotlin.String** | | [optional] | - - - diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/FakeApi.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/FakeApi.md deleted file mode 100644 index aded3ef43900..000000000000 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/FakeApi.md +++ /dev/null @@ -1,88 +0,0 @@ -# FakeApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -| Method | HTTP request | Description | -| ------------- | ------------- | ------------- | -| [**annotations**](FakeApi.md#annotations) | **POST** fake/annotations | annotate | -| [**updatePetWithFormNumber**](FakeApi.md#updatePetWithFormNumber) | **PUT** fake/annotations | Updates a pet in the store with form data (number) | - - - -annotate - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(FakeApi::class.java) -val `annotation` : Annotation = // Annotation | - -webService.annotations(`annotation`) -``` - -### Parameters -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **`annotation`** | [**Annotation**](Annotation.md)| | | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -Updates a pet in the store with form data (number) - - - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(FakeApi::class.java) -val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated -val name : kotlin.String = name_example // kotlin.String | Updated name of the pet -val status : kotlin.Int = 56 // kotlin.Int | integer type -val status2 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | number type - -webService.updatePetWithFormNumber(petId, name, status, status2) -``` - -### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | -| **status** | **kotlin.Int**| integer type | [optional] | -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **status2** | **java.math.BigDecimal**| number type | [optional] | - -### Return type - -null (empty response body) - -### Authorization - - - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Order.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Order.md deleted file mode 100644 index 7b7a399f7f75..000000000000 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Order.md +++ /dev/null @@ -1,22 +0,0 @@ - -# Order - -## Properties -| Name | Type | Description | Notes | -| ------------ | ------------- | ------------- | ------------- | -| **id** | **kotlin.Long** | | [optional] | -| **petId** | **kotlin.Long** | | [optional] | -| **quantity** | **kotlin.Int** | | [optional] | -| **shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] | -| **status** | [**inline**](#Status) | Order Status | [optional] | -| **complete** | **kotlin.Boolean** | | [optional] | - - - -## Enum: status -| Name | Value | -| ---- | ----- | -| status | placed, approved, delivered | - - - diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Pet.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Pet.md index 287312efaf94..ca97066a6232 100644 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Pet.md +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Pet.md @@ -4,19 +4,8 @@ ## Properties | Name | Type | Description | Notes | | ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | | | **name** | **kotlin.String** | | | -| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | -| **id** | **kotlin.Long** | | [optional] | -| **category** | [**Category**](Category.md) | | [optional] | -| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | -| **status** | [**inline**](#Status) | pet status in the store | [optional] | - - - -## Enum: status -| Name | Value | -| ---- | ----- | -| status | available, pending, sold | diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/PetApi.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/PetApi.md deleted file mode 100644 index 01ad4cac6196..000000000000 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/PetApi.md +++ /dev/null @@ -1,322 +0,0 @@ -# PetApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -| Method | HTTP request | Description | -| ------------- | ------------- | ------------- | -| [**addPet**](PetApi.md#addPet) | **POST** pet | Add a new pet to the store | -| [**deletePet**](PetApi.md#deletePet) | **DELETE** pet/{petId} | Deletes a pet | -| [**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** pet/findByStatus | Finds Pets by status | -| [**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** pet/findByTags | Finds Pets by tags | -| [**getPetById**](PetApi.md#getPetById) | **GET** pet/{petId} | Find pet by ID | -| [**updatePet**](PetApi.md#updatePet) | **PUT** pet | Update an existing pet | -| [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** pet/{petId} | Updates a pet in the store with form data | -| [**uploadFile**](PetApi.md#uploadFile) | **POST** pet/{petId}/uploadImage | uploads an image | - - - -Add a new pet to the store - - - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(PetApi::class.java) -val pet : Pet = // Pet | Pet object that needs to be added to the store - -val result : Pet = webService.addPet(pet) -``` - -### Parameters -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - - - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json - - -Deletes a pet - - - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(PetApi::class.java) -val petId : kotlin.Long = 789 // kotlin.Long | Pet id to delete -val apiKey : kotlin.String = apiKey_example // kotlin.String | - -webService.deletePet(petId, apiKey) -``` - -### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **apiKey** | **kotlin.String**| | [optional] | - -### Return type - -null (empty response body) - -### Authorization - - - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(PetApi::class.java) -val status : kotlin.collections.List = // kotlin.collections.List | Status values that need to be considered for filter - -val result : kotlin.collections.List = webService.findPetsByStatus(status) -``` - -### Parameters -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | - -### Return type - -[**kotlin.collections.List<Pet>**](Pet.md) - -### Authorization - - - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(PetApi::class.java) -val tags : kotlin.collections.List = // kotlin.collections.List | Tags to filter by - -val result : kotlin.collections.List = webService.findPetsByTags(tags) -``` - -### Parameters -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | | - -### Return type - -[**kotlin.collections.List<Pet>**](Pet.md) - -### Authorization - - - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -Find pet by ID - -Returns a single pet - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(PetApi::class.java) -val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to return - -val result : Pet = webService.getPetById(petId) -``` - -### Parameters -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **petId** | **kotlin.Long**| ID of pet to return | | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - - - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -Update an existing pet - - - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(PetApi::class.java) -val pet : Pet = // Pet | Pet object that needs to be added to the store - -val result : Pet = webService.updatePet(pet) -``` - -### Parameters -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - - - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json - - -Updates a pet in the store with form data - - - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(PetApi::class.java) -val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated -val name : kotlin.String = name_example // kotlin.String | Updated name of the pet -val status : kotlin.String = status_example // kotlin.String | Updated status of the pet - -webService.updatePetWithForm(petId, name, status) -``` - -### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **status** | **kotlin.String**| Updated status of the pet | [optional] | - -### Return type - -null (empty response body) - -### Authorization - - - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - - -uploads an image - - - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(PetApi::class.java) -val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update -val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server -val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload - -val result : ModelApiResponse = webService.uploadFile(petId, additionalMetadata, file) -``` - -### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **file** | **java.io.File**| file to upload | [optional] | - -### Return type - -[**ModelApiResponse**](ModelApiResponse.md) - -### Authorization - - - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/StoreApi.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/StoreApi.md deleted file mode 100644 index 34b0e0700a72..000000000000 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/StoreApi.md +++ /dev/null @@ -1,157 +0,0 @@ -# StoreApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -| Method | HTTP request | Description | -| ------------- | ------------- | ------------- | -| [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** store/order/{orderId} | Delete purchase order by ID | -| [**getInventory**](StoreApi.md#getInventory) | **GET** store/inventory | Returns pet inventories by status | -| [**getOrderById**](StoreApi.md#getOrderById) | **GET** store/order/{orderId} | Find purchase order by ID | -| [**placeOrder**](StoreApi.md#placeOrder) | **POST** store/order | Place an order for a pet | - - - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(StoreApi::class.java) -val orderId : kotlin.String = orderId_example // kotlin.String | ID of the order that needs to be deleted - -webService.deleteOrder(orderId) -``` - -### Parameters -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **orderId** | **kotlin.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 - - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(StoreApi::class.java) - -val result : kotlin.collections.Map = webService.getInventory() -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**kotlin.collections.Map<kotlin.String, kotlin.Int>** - -### Authorization - - - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(StoreApi::class.java) -val orderId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be fetched - -val result : Order = webService.getOrderById(orderId) -``` - -### Parameters -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **orderId** | **kotlin.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 - - -Place an order for a pet - - - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(StoreApi::class.java) -val order : Order = // Order | order placed for purchasing the pet - -val result : Order = webService.placeOrder(order) -``` - -### 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 - diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Tag.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/StringOrLong.md similarity index 54% rename from samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Tag.md rename to samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/StringOrLong.md index dc8fa3cb555d..ca17013a8b34 100644 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/Tag.md +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/StringOrLong.md @@ -1,11 +1,9 @@ -# Tag +# StringOrLong ## Properties | Name | Type | Description | Notes | | ------------ | ------------- | ------------- | ------------- | -| **id** | **kotlin.Long** | | [optional] | -| **name** | **kotlin.String** | | [optional] | diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/TestApi.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/TestApi.md new file mode 100644 index 000000000000..310ca6a6acb7 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/TestApi.md @@ -0,0 +1,206 @@ +# TestApi + +All URIs are relative to *http://example.org* + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**getAnyOf**](TestApi.md#getAnyOf) | **GET** v1/test/anyOf | | +| [**getAnyOfArray**](TestApi.md#getAnyOfArray) | **GET** v1/test/anyOfArray | | +| [**getOneOf**](TestApi.md#getOneOf) | **GET** v1/test/oneOf | | +| [**getOneOfArray**](TestApi.md#getOneOfArray) | **GET** v1/test/oneOfArray | | +| [**getOneOfBooleanPrimitive**](TestApi.md#getOneOfBooleanPrimitive) | **GET** v1/test/oneOfBooleanPrimitive | | +| [**getOneOfPrimitive**](TestApi.md#getOneOfPrimitive) | **GET** v1/test/oneOfPrimitive | | + + + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(TestApi::class.java) + +val result : AnyOfUserOrPet = webService.getAnyOf() +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**AnyOfUserOrPet**](AnyOfUserOrPet.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(TestApi::class.java) + +val result : AnyOfUserOrPetOrArrayString = webService.getAnyOfArray() +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**AnyOfUserOrPetOrArrayString**](AnyOfUserOrPetOrArrayString.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(TestApi::class.java) + +val result : UserOrPet = webService.getOneOf() +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**UserOrPet**](UserOrPet.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(TestApi::class.java) + +val result : UserOrPetOrArrayString = webService.getOneOfArray() +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**UserOrPetOrArrayString**](UserOrPetOrArrayString.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(TestApi::class.java) + +val result : BooleanOrLong = webService.getOneOfBooleanPrimitive() +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**BooleanOrLong**](BooleanOrLong.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(TestApi::class.java) + +val result : StringOrLong = webService.getOneOfPrimitive() +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**StringOrLong**](StringOrLong.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/User.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/User.md index 29af9690cc49..ff40c0f8236e 100644 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/User.md +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/User.md @@ -4,14 +4,8 @@ ## Properties | Name | Type | Description | Notes | | ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | | | **username** | **kotlin.String** | | | -| **id** | **kotlin.Long** | | [optional] | -| **firstName** | **kotlin.String** | | [optional] | -| **lastName** | **kotlin.String** | | [optional] | -| **email** | **kotlin.String** | | [optional] | -| **password** | **kotlin.String** | | [optional] | -| **phone** | **kotlin.String** | | [optional] | -| **userStatus** | **kotlin.Int** | User Status | [optional] | diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/UserApi.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/UserApi.md deleted file mode 100644 index 20a1ac7703b4..000000000000 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/UserApi.md +++ /dev/null @@ -1,313 +0,0 @@ -# UserApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -| Method | HTTP request | Description | -| ------------- | ------------- | ------------- | -| [**createUser**](UserApi.md#createUser) | **POST** user | Create user | -| [**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** user/createWithArray | Creates list of users with given input array | -| [**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** user/createWithList | Creates list of users with given input array | -| [**deleteUser**](UserApi.md#deleteUser) | **DELETE** user/{username} | Delete user | -| [**getUserByName**](UserApi.md#getUserByName) | **GET** user/{username} | Get user by user name | -| [**loginUser**](UserApi.md#loginUser) | **GET** user/login | Logs user into the system | -| [**logoutUser**](UserApi.md#logoutUser) | **GET** user/logout | Logs out current logged in user session | -| [**updateUser**](UserApi.md#updateUser) | **PUT** user/{username} | Updated user | - - - -Create user - -This can only be done by the logged in user. - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(UserApi::class.java) -val user : User = // User | Created user object - -webService.createUser(user) -``` - -### Parameters -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **user** | [**User**](User.md)| Created user object | | - -### Return type - -null (empty response body) - -### Authorization - - - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -Creates list of users with given input array - - - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(UserApi::class.java) -val user : kotlin.collections.List = // kotlin.collections.List | List of user object - -webService.createUsersWithArrayInput(user) -``` - -### Parameters -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | | - -### Return type - -null (empty response body) - -### Authorization - - - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -Creates list of users with given input array - - - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(UserApi::class.java) -val user : kotlin.collections.List = // kotlin.collections.List | List of user object - -webService.createUsersWithListInput(user) -``` - -### Parameters -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | | - -### Return type - -null (empty response body) - -### Authorization - - - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -Delete user - -This can only be done by the logged in user. - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(UserApi::class.java) -val username : kotlin.String = username_example // kotlin.String | The name that needs to be deleted - -webService.deleteUser(username) -``` - -### Parameters -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **username** | **kotlin.String**| The name that needs to be deleted | | - -### Return type - -null (empty response body) - -### Authorization - - - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -Get user by user name - - - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(UserApi::class.java) -val username : kotlin.String = username_example // kotlin.String | The name that needs to be fetched. Use user1 for testing. - -val result : User = webService.getUserByName(username) -``` - -### Parameters -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **username** | **kotlin.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 - - -Logs user into the system - - - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(UserApi::class.java) -val username : kotlin.String = username_example // kotlin.String | The user name for login -val password : kotlin.String = password_example // kotlin.String | The password for login in clear text - -val result : kotlin.String = webService.loginUser(username, password) -``` - -### Parameters -| **username** | **kotlin.String**| The user name for login | | -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **password** | **kotlin.String**| The password for login in clear text | | - -### Return type - -**kotlin.String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -Logs out current logged in user session - - - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(UserApi::class.java) - -webService.logoutUser() -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -null (empty response body) - -### Authorization - - - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -Updated user - -This can only be done by the logged in user. - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.* -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiClient = ApiClient() -val webService = apiClient.createWebservice(UserApi::class.java) -val username : kotlin.String = username_example // kotlin.String | name that need to be deleted -val user : User = // User | Updated user object - -webService.updateUser(username, user) -``` - -### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | -| **user** | [**User**](User.md)| Updated user object | | - -### Return type - -null (empty response body) - -### Authorization - - - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/UserOrPet.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/UserOrPet.md index 5412def1feab..1cfb30b0d0a9 100644 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/UserOrPet.md +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/UserOrPet.md @@ -4,26 +4,9 @@ ## Properties | Name | Type | Description | Notes | | ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | | | **username** | **kotlin.String** | | | | **name** | **kotlin.String** | | | -| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | -| **id** | **kotlin.Long** | | [optional] | -| **firstName** | **kotlin.String** | | [optional] | -| **lastName** | **kotlin.String** | | [optional] | -| **email** | **kotlin.String** | | [optional] | -| **password** | **kotlin.String** | | [optional] | -| **phone** | **kotlin.String** | | [optional] | -| **userStatus** | **kotlin.Int** | User Status | [optional] | -| **category** | [**Category**](Category.md) | | [optional] | -| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | -| **status** | [**inline**](#Status) | pet status in the store | [optional] | - - - -## Enum: status -| Name | Value | -| ---- | ----- | -| status | available, pending, sold | diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/UserOrPetOrArrayString.md b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/UserOrPetOrArrayString.md index 97281e826daf..667f64035f8f 100644 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/UserOrPetOrArrayString.md +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/docs/UserOrPetOrArrayString.md @@ -4,26 +4,9 @@ ## Properties | Name | Type | Description | Notes | | ------------ | ------------- | ------------- | ------------- | +| **id** | **kotlin.Long** | | | | **username** | **kotlin.String** | | | | **name** | **kotlin.String** | | | -| **photoUrls** | **kotlin.collections.List<kotlin.String>** | | | -| **id** | **kotlin.Long** | | [optional] | -| **firstName** | **kotlin.String** | | [optional] | -| **lastName** | **kotlin.String** | | [optional] | -| **email** | **kotlin.String** | | [optional] | -| **password** | **kotlin.String** | | [optional] | -| **phone** | **kotlin.String** | | [optional] | -| **userStatus** | **kotlin.Int** | User Status | [optional] | -| **category** | [**Category**](Category.md) | | [optional] | -| **tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] | -| **status** | [**inline**](#Status) | pet status in the store | [optional] | - - - -## Enum: status -| Name | Value | -| ---- | ----- | -| status | available, pending, sold | diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/gradlew b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/gradlew old mode 100644 new mode 100755 diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt deleted file mode 100644 index fe41364346eb..000000000000 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.apis - -import org.openapitools.client.infrastructure.CollectionFormats.* -import retrofit2.http.* -import retrofit2.Call -import okhttp3.RequestBody -import kotlinx.serialization.SerialName -import kotlinx.serialization.Serializable - -import org.openapitools.client.models.Annotation - -interface FakeApi { - /** - * POST fake/annotations - * annotate - * - * Responses: - * - 200: OK - * - * @param `annotation` - * @return [Call]<[Unit]> - */ - @POST("fake/annotations") - fun annotations(@Body `annotation`: Annotation): Call - - /** - * PUT fake/annotations - * Updates a pet in the store with form data (number) - * - * Responses: - * - 405: Invalid input - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status integer type (optional) - * @param status2 number type (optional) - * @return [Call]<[Unit]> - */ - @FormUrlEncoded - @PUT("fake/annotations") - fun updatePetWithFormNumber(@Path("petId") petId: kotlin.Long, @Field("name") name: kotlin.String? = null, @Field("status") status: kotlin.Int? = null, @Field("status2") status2: java.math.BigDecimal? = null): Call - -} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index b78eb25527f0..000000000000 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,147 +0,0 @@ -package org.openapitools.client.apis - -import org.openapitools.client.infrastructure.CollectionFormats.* -import retrofit2.http.* -import retrofit2.Call -import okhttp3.RequestBody -import kotlinx.serialization.SerialName -import kotlinx.serialization.Serializable - -import org.openapitools.client.models.ModelApiResponse -import org.openapitools.client.models.Pet - -import okhttp3.MultipartBody - -interface PetApi { - /** - * POST pet - * Add a new pet to the store - * - * Responses: - * - 200: successful operation - * - 405: Invalid input - * - * @param pet Pet object that needs to be added to the store - * @return [Call]<[Pet]> - */ - @POST("pet") - fun addPet(@Body pet: Pet): Call - - /** - * DELETE pet/{petId} - * Deletes a pet - * - * Responses: - * - 400: Invalid pet value - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return [Call]<[Unit]> - */ - @DELETE("pet/{petId}") - fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String? = null): Call - - - /** - * enum for parameter status - */ - @Serializable - enum class StatusFindPetsByStatus(val value: kotlin.String) { - @SerialName(value = "available") available("available"), - @SerialName(value = "pending") pending("pending"), - @SerialName(value = "sold") sold("sold"), - } - - /** - * GET pet/findByStatus - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Responses: - * - 200: successful operation - * - 400: Invalid status value - * - * @param status Status values that need to be considered for filter - * @return [Call]<[kotlin.collections.List]> - */ - @GET("pet/findByStatus") - fun findPetsByStatus(@Query("status") status: CSVParams): Call> - - /** - * GET pet/findByTags - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Responses: - * - 200: successful operation - * - 400: Invalid tag value - * - * @param tags Tags to filter by - * @return [Call]<[kotlin.collections.List]> - */ - @Deprecated("This api was deprecated") - @GET("pet/findByTags") - fun findPetsByTags(@Query("tags") tags: CSVParams): Call> - - /** - * GET pet/{petId} - * Find pet by ID - * Returns a single pet - * Responses: - * - 200: successful operation - * - 400: Invalid ID supplied - * - 404: Pet not found - * - * @param petId ID of pet to return - * @return [Call]<[Pet]> - */ - @GET("pet/{petId}") - fun getPetById(@Path("petId") petId: kotlin.Long): Call - - /** - * PUT pet - * Update an existing pet - * - * Responses: - * - 200: successful operation - * - 400: Invalid ID supplied - * - 404: Pet not found - * - 405: Validation exception - * - * @param pet Pet object that needs to be added to the store - * @return [Call]<[Pet]> - */ - @PUT("pet") - fun updatePet(@Body pet: Pet): Call - - /** - * POST pet/{petId} - * Updates a pet in the store with form data - * - * Responses: - * - 405: Invalid input - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return [Call]<[Unit]> - */ - @FormUrlEncoded - @POST("pet/{petId}") - fun updatePetWithForm(@Path("petId") petId: kotlin.Long, @Field("name") name: kotlin.String? = null, @Field("status") status: kotlin.String? = null): Call - - /** - * POST pet/{petId}/uploadImage - * uploads an image - * - * Responses: - * - 200: successful operation - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return [Call]<[ModelApiResponse]> - */ - @Multipart - @POST("pet/{petId}/uploadImage") - fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String? = null, @Part file: MultipartBody.Part? = null): Call - -} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 3fba219b7904..000000000000 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,68 +0,0 @@ -package org.openapitools.client.apis - -import org.openapitools.client.infrastructure.CollectionFormats.* -import retrofit2.http.* -import retrofit2.Call -import okhttp3.RequestBody -import kotlinx.serialization.SerialName -import kotlinx.serialization.Serializable - -import org.openapitools.client.models.Order - -interface StoreApi { - /** - * DELETE store/order/{orderId} - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Responses: - * - 400: Invalid ID supplied - * - 404: Order not found - * - * @param orderId ID of the order that needs to be deleted - * @return [Call]<[Unit]> - */ - @DELETE("store/order/{orderId}") - fun deleteOrder(@Path("orderId") orderId: kotlin.String): Call - - /** - * GET store/inventory - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Responses: - * - 200: successful operation - * - * @return [Call]<[kotlin.collections.Map]> - */ - @GET("store/inventory") - fun getInventory(): Call> - - /** - * GET store/order/{orderId} - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - * Responses: - * - 200: successful operation - * - 400: Invalid ID supplied - * - 404: Order not found - * - * @param orderId ID of pet that needs to be fetched - * @return [Call]<[Order]> - */ - @GET("store/order/{orderId}") - fun getOrderById(@Path("orderId") orderId: kotlin.Long): Call - - /** - * POST store/order - * Place an order for a pet - * - * Responses: - * - 200: successful operation - * - 400: Invalid Order - * - * @param order order placed for purchasing the pet - * @return [Call]<[Order]> - */ - @POST("store/order") - fun placeOrder(@Body order: Order): Call - -} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/TestApi.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/TestApi.kt new file mode 100644 index 000000000000..c8efb8289cac --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/TestApi.kt @@ -0,0 +1,90 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import retrofit2.Call +import okhttp3.RequestBody +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +import org.openapitools.client.models.AnyOfUserOrPet +import org.openapitools.client.models.AnyOfUserOrPetOrArrayString +import org.openapitools.client.models.BooleanOrLong +import org.openapitools.client.models.StringOrLong +import org.openapitools.client.models.UserOrPet +import org.openapitools.client.models.UserOrPetOrArrayString + +interface TestApi { + /** + * GET v1/test/anyOf + * + * + * Responses: + * - 200: OK + * + * @return [Call]<[AnyOfUserOrPet]> + */ + @GET("v1/test/anyOf") + fun getAnyOf(): Call + + /** + * GET v1/test/anyOfArray + * + * + * Responses: + * - 200: OK + * + * @return [Call]<[AnyOfUserOrPetOrArrayString]> + */ + @GET("v1/test/anyOfArray") + fun getAnyOfArray(): Call + + /** + * GET v1/test/oneOf + * + * + * Responses: + * - 200: OK + * + * @return [Call]<[UserOrPet]> + */ + @GET("v1/test/oneOf") + fun getOneOf(): Call + + /** + * GET v1/test/oneOfArray + * + * + * Responses: + * - 200: OK + * + * @return [Call]<[UserOrPetOrArrayString]> + */ + @GET("v1/test/oneOfArray") + fun getOneOfArray(): Call + + /** + * GET v1/test/oneOfBooleanPrimitive + * + * + * Responses: + * - 200: OK + * + * @return [Call]<[BooleanOrLong]> + */ + @GET("v1/test/oneOfBooleanPrimitive") + fun getOneOfBooleanPrimitive(): Call + + /** + * GET v1/test/oneOfPrimitive + * + * + * Responses: + * - 200: OK + * + * @return [Call]<[StringOrLong]> + */ + @GET("v1/test/oneOfPrimitive") + fun getOneOfPrimitive(): Call + +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 9b267e9b2eb4..000000000000 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,123 +0,0 @@ -package org.openapitools.client.apis - -import org.openapitools.client.infrastructure.CollectionFormats.* -import retrofit2.http.* -import retrofit2.Call -import okhttp3.RequestBody -import kotlinx.serialization.SerialName -import kotlinx.serialization.Serializable - -import org.openapitools.client.models.User - -interface UserApi { - /** - * POST user - * Create user - * This can only be done by the logged in user. - * Responses: - * - 0: successful operation - * - * @param user Created user object - * @return [Call]<[Unit]> - */ - @POST("user") - fun createUser(@Body user: User): Call - - /** - * POST user/createWithArray - * Creates list of users with given input array - * - * Responses: - * - 0: successful operation - * - * @param user List of user object - * @return [Call]<[Unit]> - */ - @POST("user/createWithArray") - fun createUsersWithArrayInput(@Body user: kotlin.collections.List): Call - - /** - * POST user/createWithList - * Creates list of users with given input array - * - * Responses: - * - 0: successful operation - * - * @param user List of user object - * @return [Call]<[Unit]> - */ - @POST("user/createWithList") - fun createUsersWithListInput(@Body user: kotlin.collections.List): Call - - /** - * DELETE user/{username} - * Delete user - * This can only be done by the logged in user. - * Responses: - * - 400: Invalid username supplied - * - 404: User not found - * - * @param username The name that needs to be deleted - * @return [Call]<[Unit]> - */ - @DELETE("user/{username}") - fun deleteUser(@Path("username") username: kotlin.String): Call - - /** - * GET user/{username} - * Get user by user name - * - * Responses: - * - 200: successful operation - * - 400: Invalid username supplied - * - 404: User not found - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return [Call]<[User]> - */ - @GET("user/{username}") - fun getUserByName(@Path("username") username: kotlin.String): Call - - /** - * GET user/login - * Logs user into the system - * - * Responses: - * - 200: successful operation - * - 400: Invalid username/password supplied - * - * @param username The user name for login - * @param password The password for login in clear text - * @return [Call]<[kotlin.String]> - */ - @GET("user/login") - fun loginUser(@Query("username") username: kotlin.String, @Query("password") password: kotlin.String): Call - - /** - * GET user/logout - * Logs out current logged in user session - * - * Responses: - * - 0: successful operation - * - * @return [Call]<[Unit]> - */ - @GET("user/logout") - fun logoutUser(): Call - - /** - * PUT user/{username} - * Updated user - * This can only be done by the logged in user. - * Responses: - * - 400: Invalid user supplied - * - 404: User not found - * - * @param username name that need to be deleted - * @param user Updated user object - * @return [Call]<[Unit]> - */ - @PUT("user/{username}") - fun updateUser(@Path("username") username: kotlin.String, @Body user: User): Call - -} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt deleted file mode 100644 index ddb369be5f8f..000000000000 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt +++ /dev/null @@ -1,50 +0,0 @@ -package org.openapitools.client.auth - -import java.io.IOException -import java.net.URI -import java.net.URISyntaxException - -import okhttp3.Interceptor -import okhttp3.Response - -class ApiKeyAuth( - private val location: String = "", - private val paramName: String = "", - private var apiKey: String = "" -) : Interceptor { - - @Throws(IOException::class) - override fun intercept(chain: Interceptor.Chain): Response { - var request = chain.request() - - if ("query" == location) { - var newQuery = request.url.toUri().query - val paramValue = "$paramName=$apiKey" - if (newQuery == null) { - newQuery = paramValue - } else { - newQuery += "&$paramValue" - } - - val newUri: URI - try { - val oldUri = request.url.toUri() - newUri = URI(oldUri.scheme, oldUri.authority, - oldUri.path, newQuery, oldUri.fragment) - } catch (e: URISyntaxException) { - throw IOException(e) - } - - request = request.newBuilder().url(newUri.toURL()).build() - } else if ("header" == location) { - request = request.newBuilder() - .addHeader(paramName, apiKey) - .build() - } else if ("cookie" == location) { - request = request.newBuilder() - .addHeader("Cookie", "$paramName=$apiKey") - .build() - } - return chain.proceed(request) - } -} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/OAuth.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/OAuth.kt deleted file mode 100644 index 69582551f376..000000000000 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/OAuth.kt +++ /dev/null @@ -1,151 +0,0 @@ -package org.openapitools.client.auth - -import java.net.HttpURLConnection.HTTP_UNAUTHORIZED -import java.net.HttpURLConnection.HTTP_FORBIDDEN - -import java.io.IOException - -import org.apache.oltu.oauth2.client.OAuthClient -import org.apache.oltu.oauth2.client.request.OAuthBearerClientRequest -import org.apache.oltu.oauth2.client.request.OAuthClientRequest -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder -import org.apache.oltu.oauth2.common.exception.OAuthProblemException -import org.apache.oltu.oauth2.common.exception.OAuthSystemException -import org.apache.oltu.oauth2.common.message.types.GrantType -import org.apache.oltu.oauth2.common.token.BasicOAuthToken - -import okhttp3.Interceptor -import okhttp3.OkHttpClient -import okhttp3.Response - -class OAuth( - client: OkHttpClient, - var tokenRequestBuilder: TokenRequestBuilder -) : Interceptor { - - interface AccessTokenListener { - fun notify(token: BasicOAuthToken) - } - - private var oauthClient: OAuthClient = OAuthClient(OAuthOkHttpClient(client)) - - @Volatile - private var accessToken: String? = null - var authenticationRequestBuilder: AuthenticationRequestBuilder? = null - private var accessTokenListener: AccessTokenListener? = null - - constructor( - requestBuilder: TokenRequestBuilder - ) : this( - OkHttpClient(), - requestBuilder - ) - - constructor( - flow: OAuthFlow, - authorizationUrl: String, - tokenUrl: String, - scopes: String - ) : this( - OAuthClientRequest.tokenLocation(tokenUrl).setScope(scopes) - ) { - setFlow(flow) - authenticationRequestBuilder = OAuthClientRequest.authorizationLocation(authorizationUrl) - } - - fun setFlow(flow: OAuthFlow) { - when (flow) { - OAuthFlow.accessCode, OAuthFlow.implicit -> - tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE) - OAuthFlow.password -> - tokenRequestBuilder.setGrantType(GrantType.PASSWORD) - OAuthFlow.application -> - tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS) - } - } - - @Throws(IOException::class) - override fun intercept(chain: Interceptor.Chain): Response { - return retryingIntercept(chain, true) - } - - @Throws(IOException::class) - private fun retryingIntercept(chain: Interceptor.Chain, updateTokenAndRetryOnAuthorizationFailure: Boolean): Response { - var request = chain.request() - - // If the request already have an authorization (eg. Basic auth), do nothing - if (request.header("Authorization") != null) { - return chain.proceed(request) - } - - // If first time, get the token - val oAuthRequest: OAuthClientRequest - if (accessToken == null) { - updateAccessToken(null) - } - - if (accessToken != null) { - // Build the request - val rb = request.newBuilder() - - val requestAccessToken = accessToken - try { - oAuthRequest = OAuthBearerClientRequest(request.url.toString()) - .setAccessToken(requestAccessToken) - .buildHeaderMessage() - } catch (e: OAuthSystemException) { - throw IOException(e) - } - - oAuthRequest.headers.entries.forEach { header -> - rb.addHeader(header.key, header.value) - } - rb.url(oAuthRequest.locationUri) - - //Execute the request - val response = chain.proceed(rb.build()) - - // 401/403 most likely indicates that access token has expired. Unless it happens two times in a row. - if ((response.code == HTTP_UNAUTHORIZED || response.code == HTTP_FORBIDDEN) && updateTokenAndRetryOnAuthorizationFailure) { - try { - if (updateAccessToken(requestAccessToken)) { - response.body?.close() - return retryingIntercept(chain, false) - } - } catch (e: Exception) { - response.body?.close() - throw e - } - } - return response - } else { - return chain.proceed(chain.request()) - } - } - - /** - * Returns true if the access token has been updated - */ - @Throws(IOException::class) - @Synchronized - fun updateAccessToken(requestAccessToken: String?): Boolean { - if (accessToken == null || accessToken.equals(requestAccessToken)) { - return try { - val accessTokenResponse = oauthClient.accessToken(this.tokenRequestBuilder.buildBodyMessage()) - if (accessTokenResponse != null && accessTokenResponse.accessToken != null) { - accessToken = accessTokenResponse.accessToken - accessTokenListener?.notify(accessTokenResponse.oAuthToken as BasicOAuthToken) - !accessToken.equals(requestAccessToken) - } else { - false - } - } catch (e: OAuthSystemException) { - throw IOException(e) - } catch (e: OAuthProblemException) { - throw IOException(e) - } - } - return true - } -} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/OAuthFlow.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/OAuthFlow.kt deleted file mode 100644 index bcada9b7a6a2..000000000000 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/OAuthFlow.kt +++ /dev/null @@ -1,5 +0,0 @@ -package org.openapitools.client.auth - -enum class OAuthFlow { - accessCode, implicit, password, application -} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/OAuthOkHttpClient.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/OAuthOkHttpClient.kt deleted file mode 100644 index 6680059d0536..000000000000 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/auth/OAuthOkHttpClient.kt +++ /dev/null @@ -1,61 +0,0 @@ -package org.openapitools.client.auth - -import java.io.IOException - -import org.apache.oltu.oauth2.client.HttpClient -import org.apache.oltu.oauth2.client.request.OAuthClientRequest -import org.apache.oltu.oauth2.client.response.OAuthClientResponse -import org.apache.oltu.oauth2.client.response.OAuthClientResponseFactory -import org.apache.oltu.oauth2.common.exception.OAuthProblemException -import org.apache.oltu.oauth2.common.exception.OAuthSystemException - -import okhttp3.OkHttpClient -import okhttp3.Request -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.toRequestBody - - -class OAuthOkHttpClient( - private var client: OkHttpClient = OkHttpClient() -) : HttpClient { - - @Throws(OAuthSystemException::class, OAuthProblemException::class) - override fun execute( - request: OAuthClientRequest, - headers: Map?, - requestMethod: String, - responseClass: Class?): T { - - var mediaType = "application/json".toMediaTypeOrNull() - val requestBuilder = Request.Builder().url(request.locationUri) - - headers?.forEach { entry -> - if (entry.key.equals("Content-Type", true)) { - mediaType = entry.value.toMediaTypeOrNull() - } else { - requestBuilder.addHeader(entry.key, entry.value) - } - } - - val body: RequestBody? = if (request.body != null) request.body.toRequestBody(mediaType) else null - requestBuilder.method(requestMethod, body) - - try { - val response = client.newCall(requestBuilder.build()).execute() - return OAuthClientResponseFactory.createCustomResponse( - response.body?.string(), - response.body?.contentType()?.toString(), - response.code, - response.headers.toMultimap(), - responseClass) - } catch (e: IOException) { - throw OAuthSystemException(e) - } - } - - override fun shutdown() { - // Nothing to do here - } - -} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 9a4b719801ca..556870f29311 100644 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -1,11 +1,5 @@ package org.openapitools.client.infrastructure -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder -import org.openapitools.client.auth.OAuth -import org.openapitools.client.auth.OAuth.AccessTokenListener -import org.openapitools.client.auth.OAuthFlow -import org.openapitools.client.auth.ApiKeyAuth import okhttp3.Call import okhttp3.Interceptor @@ -65,111 +59,6 @@ class ApiClient( normalizeBaseUrl() } - constructor( - baseUrl: String = defaultBasePath, - okHttpClientBuilder: OkHttpClient.Builder? = null, - - authNames: Array - ) : this(baseUrl, okHttpClientBuilder) { - authNames.forEach { authName -> - val auth: Interceptor? = when (authName) { - "petstore_auth" -> OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets") - - "api_key" -> ApiKeyAuth("header", "api_key") - - else -> throw RuntimeException("auth name $authName not found in available auth names") - } - if (auth != null) { - addAuthorization(authName, auth) - } - } - } - - constructor( - baseUrl: String = defaultBasePath, - okHttpClientBuilder: OkHttpClient.Builder? = null, - - authName: String, - clientId: String, - secret: String, - username: String, - password: String - ) : this(baseUrl, okHttpClientBuilder, arrayOf(authName)) { - getTokenEndPoint() - ?.setClientId(clientId) - ?.setClientSecret(secret) - ?.setUsername(username) - ?.setPassword(password) - } - - /** - * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Token request builder - */ - fun getTokenEndPoint(): TokenRequestBuilder? { - var result: TokenRequestBuilder? = null - apiAuthorizations.values.runOnFirst { - result = tokenRequestBuilder - } - return result - } - - /** - * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Authentication request builder - */ - fun getAuthorizationEndPoint(): AuthenticationRequestBuilder? { - var result: AuthenticationRequestBuilder? = null - apiAuthorizations.values.runOnFirst { - result = authenticationRequestBuilder - } - return result - } - - /** - * Helper method to pre-set the oauth access token of the first oauth found in the apiAuthorizations (there should be only one) - * @param accessToken Access token - * @return ApiClient - */ - fun setAccessToken(accessToken: String): ApiClient { - apiAuthorizations.values.runOnFirst { - setAccessToken(accessToken) - } - return this - } - - /** - * Helper method to configure the oauth accessCode/implicit flow parameters - * @param clientId Client ID - * @param clientSecret Client secret - * @param redirectURI Redirect URI - * @return ApiClient - */ - fun configureAuthorizationFlow(clientId: String, clientSecret: String, redirectURI: String): ApiClient { - apiAuthorizations.values.runOnFirst { - tokenRequestBuilder - .setClientId(clientId) - .setClientSecret(clientSecret) - .setRedirectURI(redirectURI) - authenticationRequestBuilder - ?.setClientId(clientId) - ?.setRedirectURI(redirectURI) - } - return this - } - - /** - * Configures a listener which is notified when a new access token is received. - * @param accessTokenListener Access token listener - * @return ApiClient - */ - fun registerAccessTokenListener(accessTokenListener: AccessTokenListener): ApiClient { - apiAuthorizations.values.runOnFirst { - registerAccessTokenListener(accessTokenListener) - } - return this - } - /** * Adds an authorization to be used by the client * @param authName Authentication name @@ -216,7 +105,7 @@ class ApiClient( @JvmStatic val defaultBasePath: String by lazy { - System.getProperties().getProperty(baseUrlKey, "http://petstore.swagger.io/v2") + System.getProperties().getProperty(baseUrlKey, "http://example.org") } } } diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Annotation.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Annotation.kt deleted file mode 100644 index d05428c31fc0..000000000000 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Annotation.kt +++ /dev/null @@ -1,44 +0,0 @@ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package org.openapitools.client.models - - -import kotlinx.serialization.Serializable -import kotlinx.serialization.SerialName -import kotlinx.serialization.Contextual -import kotlinx.serialization.KSerializer -import kotlinx.serialization.Serializer -import kotlinx.serialization.builtins.serializer -import kotlinx.serialization.encoding.Decoder -import kotlinx.serialization.encoding.Encoder - -/** - * - * - * @param id - */ -@Serializable - -data class Annotation ( - - @Contextual @SerialName(value = "id") - val id: java.util.UUID? = null - -) { - - -} - diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/AnyOfUserOrPet.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/AnyOfUserOrPet.kt index f3d981ddf2e7..f20267693032 100644 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/AnyOfUserOrPet.kt +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/AnyOfUserOrPet.kt @@ -15,9 +15,7 @@ package org.openapitools.client.models -import org.openapitools.client.models.Category import org.openapitools.client.models.Pet -import org.openapitools.client.models.Tag import org.openapitools.client.models.User import kotlinx.serialization.Serializable diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/AnyOfUserOrPetOrArrayString.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/AnyOfUserOrPetOrArrayString.kt index 7a79b0aeb140..af52eab554bf 100644 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/AnyOfUserOrPetOrArrayString.kt +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/AnyOfUserOrPetOrArrayString.kt @@ -15,9 +15,7 @@ package org.openapitools.client.models -import org.openapitools.client.models.Category import org.openapitools.client.models.Pet -import org.openapitools.client.models.Tag import org.openapitools.client.models.User import kotlinx.serialization.Serializable diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/BooleanOrLong.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/BooleanOrLong.kt new file mode 100644 index 000000000000..630293f1274d --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/BooleanOrLong.kt @@ -0,0 +1,90 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import kotlinx.serialization.Serializable +import kotlinx.serialization.SerialName +import kotlinx.serialization.Contextual +import kotlinx.serialization.KSerializer +import kotlinx.serialization.Serializer +import kotlinx.serialization.builtins.serializer +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder +import kotlinx.serialization.SerializationException +import kotlinx.serialization.descriptors.SerialDescriptor +import kotlinx.serialization.descriptors.buildClassSerialDescriptor +import kotlinx.serialization.json.JsonDecoder +import kotlinx.serialization.json.JsonElement +import kotlinx.serialization.json.JsonEncoder +import kotlinx.serialization.json.JsonPrimitive +import kotlinx.serialization.json.JsonArray +import kotlinx.serialization.json.decodeFromJsonElement +import kotlinx.serialization.json.encodeToJsonElement + +/** + * + * + */ +@Serializable(with = BooleanOrLongSerializer::class) +sealed interface BooleanOrLong { + @JvmInline + value class BooleanValue(val value: kotlin.Boolean) : BooleanOrLong + + @JvmInline + value class LongValue(val value: kotlin.Long) : BooleanOrLong + +} + +object BooleanOrLongSerializer : KSerializer { + override val descriptor: SerialDescriptor = buildClassSerialDescriptor("BooleanOrLong") + + override fun serialize(encoder: Encoder, value: BooleanOrLong) { + val jsonEncoder = encoder as? JsonEncoder ?: throw SerializationException("BooleanOrLong can only be serialized with Json") + + when (value) { + is BooleanOrLong.BooleanValue -> jsonEncoder.encodeBoolean(value.value) + is BooleanOrLong.LongValue -> jsonEncoder.encodeLong(value.value) + } + } + + override fun deserialize(decoder: Decoder): BooleanOrLong { + val jsonDecoder = decoder as? JsonDecoder ?: throw SerializationException("BooleanOrLong can only be deserialized with Json") + val jsonElement = jsonDecoder.decodeJsonElement() + + val errorMessages = mutableListOf() + + if (jsonElement is JsonPrimitive && !jsonElement.isString) { + try { + val instance = jsonDecoder.json.decodeFromJsonElement(jsonElement) + return BooleanOrLong.BooleanValue(instance) + } catch (e: Exception) { + errorMessages.add("Failed to deserialize as kotlin.Boolean: ${e.message}") + } + } + if (jsonElement is JsonPrimitive && !jsonElement.isString) { + try { + val instance = jsonDecoder.json.decodeFromJsonElement(jsonElement) + return BooleanOrLong.LongValue(instance) + } catch (e: Exception) { + errorMessages.add("Failed to deserialize as kotlin.Long: ${e.message}") + } + } + + throw SerializationException("Cannot deserialize BooleanOrLong. Tried: ${errorMessages.joinToString(", ")}") + } +} + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Category.kt deleted file mode 100644 index 2460ffd5f605..000000000000 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,48 +0,0 @@ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package org.openapitools.client.models - - -import kotlinx.serialization.Serializable -import kotlinx.serialization.SerialName -import kotlinx.serialization.Contextual -import kotlinx.serialization.KSerializer -import kotlinx.serialization.Serializer -import kotlinx.serialization.builtins.serializer -import kotlinx.serialization.encoding.Decoder -import kotlinx.serialization.encoding.Encoder - -/** - * A category for a pet - * - * @param id - * @param name - */ -@Serializable - -data class Category ( - - @SerialName(value = "id") - val id: kotlin.Long? = null, - - @SerialName(value = "name") - val name: kotlin.String? = null - -) { - - -} - diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt deleted file mode 100644 index d41b0c8629e4..000000000000 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt +++ /dev/null @@ -1,52 +0,0 @@ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package org.openapitools.client.models - - -import kotlinx.serialization.Serializable -import kotlinx.serialization.SerialName -import kotlinx.serialization.Contextual -import kotlinx.serialization.KSerializer -import kotlinx.serialization.Serializer -import kotlinx.serialization.builtins.serializer -import kotlinx.serialization.encoding.Decoder -import kotlinx.serialization.encoding.Encoder - -/** - * Describes the result of uploading an image resource - * - * @param code - * @param type - * @param message - */ -@Serializable - -data class ModelApiResponse ( - - @SerialName(value = "code") - val code: kotlin.Int? = null, - - @SerialName(value = "type") - val type: kotlin.String? = null, - - @SerialName(value = "message") - val message: kotlin.String? = null - -) { - - -} - diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Order.kt deleted file mode 100644 index f741a6924db5..000000000000 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,91 +0,0 @@ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package org.openapitools.client.models - - -import kotlinx.serialization.Serializable -import kotlinx.serialization.SerialName -import kotlinx.serialization.Contextual -import kotlinx.serialization.KSerializer -import kotlinx.serialization.Serializer -import kotlinx.serialization.builtins.serializer -import kotlinx.serialization.encoding.Decoder -import kotlinx.serialization.encoding.Encoder - -/** - * An order for a pets from the pet store - * - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ -@Serializable - -data class Order ( - - @SerialName(value = "id") - val id: kotlin.Long? = null, - - @SerialName(value = "petId") - val petId: kotlin.Long? = null, - - @SerialName(value = "quantity") - val quantity: kotlin.Int? = null, - - @Contextual @SerialName(value = "shipDate") - val shipDate: java.time.OffsetDateTime? = null, - - /* Order Status */ - @SerialName(value = "status") - val status: Order.Status? = null, - - @SerialName(value = "complete") - val complete: kotlin.Boolean? = false - -) { - - /** - * Order Status - * - * Values: placed,approved,delivered,unknown_default_open_api - */ - @Serializable(with = StatusSerializer::class) - enum class Status(val value: kotlin.String) { - @SerialName(value = "placed") placed("placed"), - @SerialName(value = "approved") approved("approved"), - @SerialName(value = "delivered") delivered("delivered"), - @SerialName(value = "unknown_default_open_api") unknown_default_open_api("unknown_default_open_api"); - } - - internal object StatusSerializer : KSerializer { - override val descriptor = kotlin.String.serializer().descriptor - - override fun deserialize(decoder: Decoder): Status { - val value = decoder.decodeSerializableValue(kotlin.String.serializer()) - return Status.entries.firstOrNull { it.value == value } - ?: Status.unknown_default_open_api - } - - override fun serialize(encoder: Encoder, value: Status) { - encoder.encodeSerializableValue(kotlin.String.serializer(), value.value) - } - } - -} - diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Pet.kt index 16bfc63d6ef8..449d1430d70a 100644 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -15,8 +15,6 @@ package org.openapitools.client.models -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag import kotlinx.serialization.Serializable import kotlinx.serialization.SerialName @@ -28,67 +26,23 @@ import kotlinx.serialization.encoding.Decoder import kotlinx.serialization.encoding.Encoder /** - * A pet for sale in the pet store + * * - * @param name - * @param photoUrls * @param id - * @param category - * @param tags - * @param status pet status in the store + * @param name */ @Serializable data class Pet ( - @SerialName(value = "name") - val name: kotlin.String, - - @SerialName(value = "photoUrls") - val photoUrls: kotlin.collections.List, - @SerialName(value = "id") - val id: kotlin.Long? = null, - - @SerialName(value = "category") - val category: Category? = null, + val id: kotlin.Long, - @SerialName(value = "tags") - val tags: kotlin.collections.List? = null, - - /* pet status in the store */ - @SerialName(value = "status") - @Deprecated(message = "This property is deprecated.") - val status: Pet.Status? = null + @SerialName(value = "name") + val name: kotlin.String ) { - /** - * pet status in the store - * - * Values: available,pending,sold,unknown_default_open_api - */ - @Serializable(with = StatusSerializer::class) - enum class Status(val value: kotlin.String) { - @SerialName(value = "available") available("available"), - @SerialName(value = "pending") pending("pending"), - @SerialName(value = "sold") sold("sold"), - @SerialName(value = "unknown_default_open_api") unknown_default_open_api("unknown_default_open_api"); - } - - internal object StatusSerializer : KSerializer { - override val descriptor = kotlin.String.serializer().descriptor - - override fun deserialize(decoder: Decoder): Status { - val value = decoder.decodeSerializableValue(kotlin.String.serializer()) - return Status.entries.firstOrNull { it.value == value } - ?: Status.unknown_default_open_api - } - - override fun serialize(encoder: Encoder, value: Status) { - encoder.encodeSerializableValue(kotlin.String.serializer(), value.value) - } - } } diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/StringOrLong.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/StringOrLong.kt new file mode 100644 index 000000000000..1073f71a25a8 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/StringOrLong.kt @@ -0,0 +1,90 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import kotlinx.serialization.Serializable +import kotlinx.serialization.SerialName +import kotlinx.serialization.Contextual +import kotlinx.serialization.KSerializer +import kotlinx.serialization.Serializer +import kotlinx.serialization.builtins.serializer +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder +import kotlinx.serialization.SerializationException +import kotlinx.serialization.descriptors.SerialDescriptor +import kotlinx.serialization.descriptors.buildClassSerialDescriptor +import kotlinx.serialization.json.JsonDecoder +import kotlinx.serialization.json.JsonElement +import kotlinx.serialization.json.JsonEncoder +import kotlinx.serialization.json.JsonPrimitive +import kotlinx.serialization.json.JsonArray +import kotlinx.serialization.json.decodeFromJsonElement +import kotlinx.serialization.json.encodeToJsonElement + +/** + * + * + */ +@Serializable(with = StringOrLongSerializer::class) +sealed interface StringOrLong { + @JvmInline + value class StringValue(val value: kotlin.String) : StringOrLong + + @JvmInline + value class LongValue(val value: kotlin.Long) : StringOrLong + +} + +object StringOrLongSerializer : KSerializer { + override val descriptor: SerialDescriptor = buildClassSerialDescriptor("StringOrLong") + + override fun serialize(encoder: Encoder, value: StringOrLong) { + val jsonEncoder = encoder as? JsonEncoder ?: throw SerializationException("StringOrLong can only be serialized with Json") + + when (value) { + is StringOrLong.StringValue -> jsonEncoder.encodeString(value.value) + is StringOrLong.LongValue -> jsonEncoder.encodeLong(value.value) + } + } + + override fun deserialize(decoder: Decoder): StringOrLong { + val jsonDecoder = decoder as? JsonDecoder ?: throw SerializationException("StringOrLong can only be deserialized with Json") + val jsonElement = jsonDecoder.decodeJsonElement() + + val errorMessages = mutableListOf() + + if (jsonElement is JsonPrimitive && jsonElement.isString) { + try { + val instance = jsonDecoder.json.decodeFromJsonElement(jsonElement) + return StringOrLong.StringValue(instance) + } catch (e: Exception) { + errorMessages.add("Failed to deserialize as kotlin.String: ${e.message}") + } + } + if (jsonElement is JsonPrimitive && !jsonElement.isString) { + try { + val instance = jsonDecoder.json.decodeFromJsonElement(jsonElement) + return StringOrLong.LongValue(instance) + } catch (e: Exception) { + errorMessages.add("Failed to deserialize as kotlin.Long: ${e.message}") + } + } + + throw SerializationException("Cannot deserialize StringOrLong. Tried: ${errorMessages.joinToString(", ")}") + } +} + diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 4d365d3a3cd5..000000000000 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,48 +0,0 @@ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package org.openapitools.client.models - - -import kotlinx.serialization.Serializable -import kotlinx.serialization.SerialName -import kotlinx.serialization.Contextual -import kotlinx.serialization.KSerializer -import kotlinx.serialization.Serializer -import kotlinx.serialization.builtins.serializer -import kotlinx.serialization.encoding.Decoder -import kotlinx.serialization.encoding.Encoder - -/** - * A tag for a pet - * - * @param id - * @param name - */ -@Serializable - -data class Tag ( - - @SerialName(value = "id") - val id: kotlin.Long? = null, - - @SerialName(value = "name") - val name: kotlin.String? = null - -) { - - -} - diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/User.kt index 98ff7ee53490..f048a06c2aa9 100644 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/User.kt @@ -26,45 +26,20 @@ import kotlinx.serialization.encoding.Decoder import kotlinx.serialization.encoding.Encoder /** - * A User who is purchasing from the pet store + * * - * @param username * @param id - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status + * @param username */ @Serializable data class User ( - @SerialName(value = "username") - val username: kotlin.String, - @SerialName(value = "id") - val id: kotlin.Long? = null, - - @SerialName(value = "firstName") - val firstName: kotlin.String? = null, + val id: kotlin.Long, - @SerialName(value = "lastName") - val lastName: kotlin.String? = null, - - @SerialName(value = "email") - val email: kotlin.String? = null, - - @SerialName(value = "password") - val password: kotlin.String? = null, - - @SerialName(value = "phone") - val phone: kotlin.String? = null, - - /* User Status */ - @SerialName(value = "userStatus") - val userStatus: kotlin.Int? = null + @SerialName(value = "username") + val username: kotlin.String ) { diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/UserOrPet.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/UserOrPet.kt index 35d25939597b..b4b010d17f95 100644 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/UserOrPet.kt +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/UserOrPet.kt @@ -15,9 +15,7 @@ package org.openapitools.client.models -import org.openapitools.client.models.Category import org.openapitools.client.models.Pet -import org.openapitools.client.models.Tag import org.openapitools.client.models.User import kotlinx.serialization.Serializable diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/UserOrPetOrArrayString.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/UserOrPetOrArrayString.kt index 1a0ed5b32e76..6f8503f59bc7 100644 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/UserOrPetOrArrayString.kt +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/main/kotlin/org/openapitools/client/models/UserOrPetOrArrayString.kt @@ -15,9 +15,7 @@ package org.openapitools.client.models -import org.openapitools.client.models.Category import org.openapitools.client.models.Pet -import org.openapitools.client.models.Tag import org.openapitools.client.models.User import kotlinx.serialization.Serializable diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/FakeApiTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/FakeApiTest.kt deleted file mode 100644 index 05b5f3967390..000000000000 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/FakeApiTest.kt +++ /dev/null @@ -1,47 +0,0 @@ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package org.openapitools.client.apis - -import io.kotlintest.shouldBe -import io.kotlintest.specs.ShouldSpec - -import org.openapitools.client.apis.FakeApi -import org.openapitools.client.models.Annotation - -class FakeApiTest : ShouldSpec() { - init { - // uncomment below to create an instance of FakeApi - //val apiInstance = FakeApi() - - // to test annotations - should("test annotations") { - // uncomment below to test annotations - //val `annotation` : Annotation = // Annotation | - //apiInstance.annotations(`annotation`) - } - - // to test updatePetWithFormNumber - should("test updatePetWithFormNumber") { - // uncomment below to test updatePetWithFormNumber - //val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated - //val name : kotlin.String = name_example // kotlin.String | Updated name of the pet - //val status : kotlin.Int = 56 // kotlin.Int | integer type - //val status2 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | number type - //apiInstance.updatePetWithFormNumber(petId, name, status, status2) - } - - } -} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/PetApiTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/PetApiTest.kt deleted file mode 100644 index 9289330db4fd..000000000000 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/PetApiTest.kt +++ /dev/null @@ -1,98 +0,0 @@ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package org.openapitools.client.apis - -import io.kotlintest.shouldBe -import io.kotlintest.specs.ShouldSpec - -import org.openapitools.client.apis.PetApi -import org.openapitools.client.models.ModelApiResponse -import org.openapitools.client.models.Pet - -class PetApiTest : ShouldSpec() { - init { - // uncomment below to create an instance of PetApi - //val apiInstance = PetApi() - - // to test addPet - should("test addPet") { - // uncomment below to test addPet - //val pet : Pet = // Pet | Pet object that needs to be added to the store - //val result : Pet = apiInstance.addPet(pet) - //result shouldBe ("TODO") - } - - // to test deletePet - should("test deletePet") { - // uncomment below to test deletePet - //val petId : kotlin.Long = 789 // kotlin.Long | Pet id to delete - //val apiKey : kotlin.String = apiKey_example // kotlin.String | - //apiInstance.deletePet(petId, apiKey) - } - - // to test findPetsByStatus - should("test findPetsByStatus") { - // uncomment below to test findPetsByStatus - //val status : kotlin.collections.List = // kotlin.collections.List | Status values that need to be considered for filter - //val result : kotlin.collections.List = apiInstance.findPetsByStatus(status) - //result shouldBe ("TODO") - } - - // to test findPetsByTags - should("test findPetsByTags") { - // uncomment below to test findPetsByTags - //val tags : kotlin.collections.List = // kotlin.collections.List | Tags to filter by - //val result : kotlin.collections.List = apiInstance.findPetsByTags(tags) - //result shouldBe ("TODO") - } - - // to test getPetById - should("test getPetById") { - // uncomment below to test getPetById - //val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to return - //val result : Pet = apiInstance.getPetById(petId) - //result shouldBe ("TODO") - } - - // to test updatePet - should("test updatePet") { - // uncomment below to test updatePet - //val pet : Pet = // Pet | Pet object that needs to be added to the store - //val result : Pet = apiInstance.updatePet(pet) - //result shouldBe ("TODO") - } - - // to test updatePetWithForm - should("test updatePetWithForm") { - // uncomment below to test updatePetWithForm - //val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated - //val name : kotlin.String = name_example // kotlin.String | Updated name of the pet - //val status : kotlin.String = status_example // kotlin.String | Updated status of the pet - //apiInstance.updatePetWithForm(petId, name, status) - } - - // to test uploadFile - should("test uploadFile") { - // uncomment below to test uploadFile - //val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update - //val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server - //val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload - //val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) - //result shouldBe ("TODO") - } - - } -} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/StoreApiTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/StoreApiTest.kt deleted file mode 100644 index f37863047d30..000000000000 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/StoreApiTest.kt +++ /dev/null @@ -1,60 +0,0 @@ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package org.openapitools.client.apis - -import io.kotlintest.shouldBe -import io.kotlintest.specs.ShouldSpec - -import org.openapitools.client.apis.StoreApi -import org.openapitools.client.models.Order - -class StoreApiTest : ShouldSpec() { - init { - // uncomment below to create an instance of StoreApi - //val apiInstance = StoreApi() - - // to test deleteOrder - should("test deleteOrder") { - // uncomment below to test deleteOrder - //val orderId : kotlin.String = orderId_example // kotlin.String | ID of the order that needs to be deleted - //apiInstance.deleteOrder(orderId) - } - - // to test getInventory - should("test getInventory") { - // uncomment below to test getInventory - //val result : kotlin.collections.Map = apiInstance.getInventory() - //result shouldBe ("TODO") - } - - // to test getOrderById - should("test getOrderById") { - // uncomment below to test getOrderById - //val orderId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be fetched - //val result : Order = apiInstance.getOrderById(orderId) - //result shouldBe ("TODO") - } - - // to test placeOrder - should("test placeOrder") { - // uncomment below to test placeOrder - //val order : Order = // Order | order placed for purchasing the pet - //val result : Order = apiInstance.placeOrder(order) - //result shouldBe ("TODO") - } - - } -} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/TestApiTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/TestApiTest.kt new file mode 100644 index 000000000000..d9843a145fd3 --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/TestApiTest.kt @@ -0,0 +1,77 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.apis + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.apis.TestApi +import org.openapitools.client.models.AnyOfUserOrPet +import org.openapitools.client.models.AnyOfUserOrPetOrArrayString +import org.openapitools.client.models.BooleanOrLong +import org.openapitools.client.models.StringOrLong +import org.openapitools.client.models.UserOrPet +import org.openapitools.client.models.UserOrPetOrArrayString + +class TestApiTest : ShouldSpec() { + init { + // uncomment below to create an instance of TestApi + //val apiInstance = TestApi() + + // to test getAnyOf + should("test getAnyOf") { + // uncomment below to test getAnyOf + //val result : AnyOfUserOrPet = apiInstance.getAnyOf() + //result shouldBe ("TODO") + } + + // to test getAnyOfArray + should("test getAnyOfArray") { + // uncomment below to test getAnyOfArray + //val result : AnyOfUserOrPetOrArrayString = apiInstance.getAnyOfArray() + //result shouldBe ("TODO") + } + + // to test getOneOf + should("test getOneOf") { + // uncomment below to test getOneOf + //val result : UserOrPet = apiInstance.getOneOf() + //result shouldBe ("TODO") + } + + // to test getOneOfArray + should("test getOneOfArray") { + // uncomment below to test getOneOfArray + //val result : UserOrPetOrArrayString = apiInstance.getOneOfArray() + //result shouldBe ("TODO") + } + + // to test getOneOfBooleanPrimitive + should("test getOneOfBooleanPrimitive") { + // uncomment below to test getOneOfBooleanPrimitive + //val result : BooleanOrLong = apiInstance.getOneOfBooleanPrimitive() + //result shouldBe ("TODO") + } + + // to test getOneOfPrimitive + should("test getOneOfPrimitive") { + // uncomment below to test getOneOfPrimitive + //val result : StringOrLong = apiInstance.getOneOfPrimitive() + //result shouldBe ("TODO") + } + + } +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/UserApiTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/UserApiTest.kt deleted file mode 100644 index b617fb9fd0e4..000000000000 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/apis/UserApiTest.kt +++ /dev/null @@ -1,89 +0,0 @@ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package org.openapitools.client.apis - -import io.kotlintest.shouldBe -import io.kotlintest.specs.ShouldSpec - -import org.openapitools.client.apis.UserApi -import org.openapitools.client.models.User - -class UserApiTest : ShouldSpec() { - init { - // uncomment below to create an instance of UserApi - //val apiInstance = UserApi() - - // to test createUser - should("test createUser") { - // uncomment below to test createUser - //val user : User = // User | Created user object - //apiInstance.createUser(user) - } - - // to test createUsersWithArrayInput - should("test createUsersWithArrayInput") { - // uncomment below to test createUsersWithArrayInput - //val user : kotlin.collections.List = // kotlin.collections.List | List of user object - //apiInstance.createUsersWithArrayInput(user) - } - - // to test createUsersWithListInput - should("test createUsersWithListInput") { - // uncomment below to test createUsersWithListInput - //val user : kotlin.collections.List = // kotlin.collections.List | List of user object - //apiInstance.createUsersWithListInput(user) - } - - // to test deleteUser - should("test deleteUser") { - // uncomment below to test deleteUser - //val username : kotlin.String = username_example // kotlin.String | The name that needs to be deleted - //apiInstance.deleteUser(username) - } - - // to test getUserByName - should("test getUserByName") { - // uncomment below to test getUserByName - //val username : kotlin.String = username_example // kotlin.String | The name that needs to be fetched. Use user1 for testing. - //val result : User = apiInstance.getUserByName(username) - //result shouldBe ("TODO") - } - - // to test loginUser - should("test loginUser") { - // uncomment below to test loginUser - //val username : kotlin.String = username_example // kotlin.String | The user name for login - //val password : kotlin.String = password_example // kotlin.String | The password for login in clear text - //val result : kotlin.String = apiInstance.loginUser(username, password) - //result shouldBe ("TODO") - } - - // to test logoutUser - should("test logoutUser") { - // uncomment below to test logoutUser - //apiInstance.logoutUser() - } - - // to test updateUser - should("test updateUser") { - // uncomment below to test updateUser - //val username : kotlin.String = username_example // kotlin.String | name that need to be deleted - //val user : User = // User | Updated user object - //apiInstance.updateUser(username, user) - } - - } -} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/AnyOfUserOrPetOrArrayStringTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/AnyOfUserOrPetOrArrayStringTest.kt index 76a2fc35450d..55540c2798d4 100644 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/AnyOfUserOrPetOrArrayStringTest.kt +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/AnyOfUserOrPetOrArrayStringTest.kt @@ -19,9 +19,7 @@ import io.kotlintest.shouldBe import io.kotlintest.specs.ShouldSpec import org.openapitools.client.models.AnyOfUserOrPetOrArrayString -import org.openapitools.client.models.Category import org.openapitools.client.models.Pet -import org.openapitools.client.models.Tag import org.openapitools.client.models.User class AnyOfUserOrPetOrArrayStringTest : ShouldSpec() { @@ -29,82 +27,22 @@ class AnyOfUserOrPetOrArrayStringTest : ShouldSpec() { // uncomment below to create an instance of AnyOfUserOrPetOrArrayString //val modelInstance = AnyOfUserOrPetOrArrayString() - // to test the property `username` - should("test username") { - // uncomment below to test the property - //modelInstance.username shouldBe ("TODO") - } - - // to test the property `name` - should("test name") { - // uncomment below to test the property - //modelInstance.name shouldBe ("TODO") - } - - // to test the property `photoUrls` - should("test photoUrls") { - // uncomment below to test the property - //modelInstance.photoUrls shouldBe ("TODO") - } - // to test the property `id` should("test id") { // uncomment below to test the property //modelInstance.id shouldBe ("TODO") } - // to test the property `firstName` - should("test firstName") { - // uncomment below to test the property - //modelInstance.firstName shouldBe ("TODO") - } - - // to test the property `lastName` - should("test lastName") { - // uncomment below to test the property - //modelInstance.lastName shouldBe ("TODO") - } - - // to test the property `email` - should("test email") { - // uncomment below to test the property - //modelInstance.email shouldBe ("TODO") - } - - // to test the property `password` - should("test password") { - // uncomment below to test the property - //modelInstance.password shouldBe ("TODO") - } - - // to test the property `phone` - should("test phone") { - // uncomment below to test the property - //modelInstance.phone shouldBe ("TODO") - } - - // to test the property `userStatus` - User Status - should("test userStatus") { - // uncomment below to test the property - //modelInstance.userStatus shouldBe ("TODO") - } - - // to test the property `category` - should("test category") { - // uncomment below to test the property - //modelInstance.category shouldBe ("TODO") - } - - // to test the property `tags` - should("test tags") { + // to test the property `username` + should("test username") { // uncomment below to test the property - //modelInstance.tags shouldBe ("TODO") + //modelInstance.username shouldBe ("TODO") } - // to test the property `status` - pet status in the store - should("test status") { + // to test the property `name` + should("test name") { // uncomment below to test the property - //modelInstance.status shouldBe ("TODO") + //modelInstance.name shouldBe ("TODO") } } diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/AnyOfUserOrPetTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/AnyOfUserOrPetTest.kt index cf4d7db01792..fd72e111c26a 100644 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/AnyOfUserOrPetTest.kt +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/AnyOfUserOrPetTest.kt @@ -19,9 +19,7 @@ import io.kotlintest.shouldBe import io.kotlintest.specs.ShouldSpec import org.openapitools.client.models.AnyOfUserOrPet -import org.openapitools.client.models.Category import org.openapitools.client.models.Pet -import org.openapitools.client.models.Tag import org.openapitools.client.models.User class AnyOfUserOrPetTest : ShouldSpec() { @@ -29,82 +27,22 @@ class AnyOfUserOrPetTest : ShouldSpec() { // uncomment below to create an instance of AnyOfUserOrPet //val modelInstance = AnyOfUserOrPet() - // to test the property `username` - should("test username") { - // uncomment below to test the property - //modelInstance.username shouldBe ("TODO") - } - - // to test the property `name` - should("test name") { - // uncomment below to test the property - //modelInstance.name shouldBe ("TODO") - } - - // to test the property `photoUrls` - should("test photoUrls") { - // uncomment below to test the property - //modelInstance.photoUrls shouldBe ("TODO") - } - // to test the property `id` should("test id") { // uncomment below to test the property //modelInstance.id shouldBe ("TODO") } - // to test the property `firstName` - should("test firstName") { - // uncomment below to test the property - //modelInstance.firstName shouldBe ("TODO") - } - - // to test the property `lastName` - should("test lastName") { - // uncomment below to test the property - //modelInstance.lastName shouldBe ("TODO") - } - - // to test the property `email` - should("test email") { - // uncomment below to test the property - //modelInstance.email shouldBe ("TODO") - } - - // to test the property `password` - should("test password") { - // uncomment below to test the property - //modelInstance.password shouldBe ("TODO") - } - - // to test the property `phone` - should("test phone") { - // uncomment below to test the property - //modelInstance.phone shouldBe ("TODO") - } - - // to test the property `userStatus` - User Status - should("test userStatus") { - // uncomment below to test the property - //modelInstance.userStatus shouldBe ("TODO") - } - - // to test the property `category` - should("test category") { - // uncomment below to test the property - //modelInstance.category shouldBe ("TODO") - } - - // to test the property `tags` - should("test tags") { + // to test the property `username` + should("test username") { // uncomment below to test the property - //modelInstance.tags shouldBe ("TODO") + //modelInstance.username shouldBe ("TODO") } - // to test the property `status` - pet status in the store - should("test status") { + // to test the property `name` + should("test name") { // uncomment below to test the property - //modelInstance.status shouldBe ("TODO") + //modelInstance.name shouldBe ("TODO") } } diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/ApiResponseTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/ApiResponseTest.kt deleted file mode 100644 index 61fe0207cf0a..000000000000 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/ApiResponseTest.kt +++ /dev/null @@ -1,47 +0,0 @@ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package org.openapitools.client.models - -import io.kotlintest.shouldBe -import io.kotlintest.specs.ShouldSpec - -import org.openapitools.client.models.ModelApiResponse - -class ModelApiResponseTest : ShouldSpec() { - init { - // uncomment below to create an instance of ModelApiResponse - //val modelInstance = ModelApiResponse() - - // to test the property `code` - should("test code") { - // uncomment below to test the property - //modelInstance.code shouldBe ("TODO") - } - - // to test the property `type` - should("test type") { - // uncomment below to test the property - //modelInstance.type shouldBe ("TODO") - } - - // to test the property `message` - should("test message") { - // uncomment below to test the property - //modelInstance.message shouldBe ("TODO") - } - - } -} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/BooleanOrLongTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/BooleanOrLongTest.kt new file mode 100644 index 000000000000..68c6b42a61cc --- /dev/null +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/BooleanOrLongTest.kt @@ -0,0 +1,29 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.BooleanOrLong + +class BooleanOrLongTest : ShouldSpec() { + init { + // uncomment below to create an instance of BooleanOrLong + //val modelInstance = BooleanOrLong() + + } +} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/CategoryTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/CategoryTest.kt deleted file mode 100644 index 4cfde8e19c63..000000000000 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/CategoryTest.kt +++ /dev/null @@ -1,41 +0,0 @@ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package org.openapitools.client.models - -import io.kotlintest.shouldBe -import io.kotlintest.specs.ShouldSpec - -import org.openapitools.client.models.Category - -class CategoryTest : ShouldSpec() { - init { - // uncomment below to create an instance of Category - //val modelInstance = Category() - - // to test the property `id` - should("test id") { - // uncomment below to test the property - //modelInstance.id shouldBe ("TODO") - } - - // to test the property `name` - should("test name") { - // uncomment below to test the property - //modelInstance.name shouldBe ("TODO") - } - - } -} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/OrderTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/OrderTest.kt deleted file mode 100644 index 1f2eb1dfa888..000000000000 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/OrderTest.kt +++ /dev/null @@ -1,65 +0,0 @@ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package org.openapitools.client.models - -import io.kotlintest.shouldBe -import io.kotlintest.specs.ShouldSpec - -import org.openapitools.client.models.Order - -class OrderTest : ShouldSpec() { - init { - // uncomment below to create an instance of Order - //val modelInstance = Order() - - // to test the property `id` - should("test id") { - // uncomment below to test the property - //modelInstance.id shouldBe ("TODO") - } - - // to test the property `petId` - should("test petId") { - // uncomment below to test the property - //modelInstance.petId shouldBe ("TODO") - } - - // to test the property `quantity` - should("test quantity") { - // uncomment below to test the property - //modelInstance.quantity shouldBe ("TODO") - } - - // to test the property `shipDate` - should("test shipDate") { - // uncomment below to test the property - //modelInstance.shipDate shouldBe ("TODO") - } - - // to test the property `status` - Order Status - should("test status") { - // uncomment below to test the property - //modelInstance.status shouldBe ("TODO") - } - - // to test the property `complete` - should("test complete") { - // uncomment below to test the property - //modelInstance.complete shouldBe ("TODO") - } - - } -} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/PetTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/PetTest.kt index ef7128c4d0b9..d1e36c1ac8fd 100644 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/PetTest.kt +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/PetTest.kt @@ -19,48 +19,22 @@ import io.kotlintest.shouldBe import io.kotlintest.specs.ShouldSpec import org.openapitools.client.models.Pet -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag class PetTest : ShouldSpec() { init { // uncomment below to create an instance of Pet //val modelInstance = Pet() - // to test the property `name` - should("test name") { - // uncomment below to test the property - //modelInstance.name shouldBe ("TODO") - } - - // to test the property `photoUrls` - should("test photoUrls") { - // uncomment below to test the property - //modelInstance.photoUrls shouldBe ("TODO") - } - // to test the property `id` should("test id") { // uncomment below to test the property //modelInstance.id shouldBe ("TODO") } - // to test the property `category` - should("test category") { - // uncomment below to test the property - //modelInstance.category shouldBe ("TODO") - } - - // to test the property `tags` - should("test tags") { - // uncomment below to test the property - //modelInstance.tags shouldBe ("TODO") - } - - // to test the property `status` - pet status in the store - should("test status") { + // to test the property `name` + should("test name") { // uncomment below to test the property - //modelInstance.status shouldBe ("TODO") + //modelInstance.name shouldBe ("TODO") } } diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/AnnotationTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/StringOrLongTest.kt similarity index 52% rename from samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/AnnotationTest.kt rename to samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/StringOrLongTest.kt index 7110952e1508..4fac1bc3eb4a 100644 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/AnnotationTest.kt +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/StringOrLongTest.kt @@ -18,18 +18,12 @@ package org.openapitools.client.models import io.kotlintest.shouldBe import io.kotlintest.specs.ShouldSpec -import org.openapitools.client.models.Annotation +import org.openapitools.client.models.StringOrLong -class AnnotationTest : ShouldSpec() { +class StringOrLongTest : ShouldSpec() { init { - // uncomment below to create an instance of Annotation - //val modelInstance = Annotation() - - // to test the property `id` - should("test id") { - // uncomment below to test the property - //modelInstance.id shouldBe ("TODO") - } + // uncomment below to create an instance of StringOrLong + //val modelInstance = StringOrLong() } } diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/TagTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/TagTest.kt deleted file mode 100644 index 65e729bb4985..000000000000 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/TagTest.kt +++ /dev/null @@ -1,41 +0,0 @@ -/** - * - * Please note: - * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * Do not edit this file manually. - * - */ - -@file:Suppress( - "ArrayInDataClass", - "EnumEntryName", - "RemoveRedundantQualifierName", - "UnusedImport" -) - -package org.openapitools.client.models - -import io.kotlintest.shouldBe -import io.kotlintest.specs.ShouldSpec - -import org.openapitools.client.models.Tag - -class TagTest : ShouldSpec() { - init { - // uncomment below to create an instance of Tag - //val modelInstance = Tag() - - // to test the property `id` - should("test id") { - // uncomment below to test the property - //modelInstance.id shouldBe ("TODO") - } - - // to test the property `name` - should("test name") { - // uncomment below to test the property - //modelInstance.name shouldBe ("TODO") - } - - } -} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/UserOrPetOrArrayStringTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/UserOrPetOrArrayStringTest.kt index f996252e919f..e7b2f745b51c 100644 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/UserOrPetOrArrayStringTest.kt +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/UserOrPetOrArrayStringTest.kt @@ -19,9 +19,7 @@ import io.kotlintest.shouldBe import io.kotlintest.specs.ShouldSpec import org.openapitools.client.models.UserOrPetOrArrayString -import org.openapitools.client.models.Category import org.openapitools.client.models.Pet -import org.openapitools.client.models.Tag import org.openapitools.client.models.User class UserOrPetOrArrayStringTest : ShouldSpec() { @@ -29,82 +27,22 @@ class UserOrPetOrArrayStringTest : ShouldSpec() { // uncomment below to create an instance of UserOrPetOrArrayString //val modelInstance = UserOrPetOrArrayString() - // to test the property `username` - should("test username") { - // uncomment below to test the property - //modelInstance.username shouldBe ("TODO") - } - - // to test the property `name` - should("test name") { - // uncomment below to test the property - //modelInstance.name shouldBe ("TODO") - } - - // to test the property `photoUrls` - should("test photoUrls") { - // uncomment below to test the property - //modelInstance.photoUrls shouldBe ("TODO") - } - // to test the property `id` should("test id") { // uncomment below to test the property //modelInstance.id shouldBe ("TODO") } - // to test the property `firstName` - should("test firstName") { - // uncomment below to test the property - //modelInstance.firstName shouldBe ("TODO") - } - - // to test the property `lastName` - should("test lastName") { - // uncomment below to test the property - //modelInstance.lastName shouldBe ("TODO") - } - - // to test the property `email` - should("test email") { - // uncomment below to test the property - //modelInstance.email shouldBe ("TODO") - } - - // to test the property `password` - should("test password") { - // uncomment below to test the property - //modelInstance.password shouldBe ("TODO") - } - - // to test the property `phone` - should("test phone") { - // uncomment below to test the property - //modelInstance.phone shouldBe ("TODO") - } - - // to test the property `userStatus` - User Status - should("test userStatus") { - // uncomment below to test the property - //modelInstance.userStatus shouldBe ("TODO") - } - - // to test the property `category` - should("test category") { - // uncomment below to test the property - //modelInstance.category shouldBe ("TODO") - } - - // to test the property `tags` - should("test tags") { + // to test the property `username` + should("test username") { // uncomment below to test the property - //modelInstance.tags shouldBe ("TODO") + //modelInstance.username shouldBe ("TODO") } - // to test the property `status` - pet status in the store - should("test status") { + // to test the property `name` + should("test name") { // uncomment below to test the property - //modelInstance.status shouldBe ("TODO") + //modelInstance.name shouldBe ("TODO") } } diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/UserOrPetTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/UserOrPetTest.kt index 645e8e5de206..463c5d666bc9 100644 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/UserOrPetTest.kt +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/UserOrPetTest.kt @@ -19,9 +19,7 @@ import io.kotlintest.shouldBe import io.kotlintest.specs.ShouldSpec import org.openapitools.client.models.UserOrPet -import org.openapitools.client.models.Category import org.openapitools.client.models.Pet -import org.openapitools.client.models.Tag import org.openapitools.client.models.User class UserOrPetTest : ShouldSpec() { @@ -29,82 +27,22 @@ class UserOrPetTest : ShouldSpec() { // uncomment below to create an instance of UserOrPet //val modelInstance = UserOrPet() - // to test the property `username` - should("test username") { - // uncomment below to test the property - //modelInstance.username shouldBe ("TODO") - } - - // to test the property `name` - should("test name") { - // uncomment below to test the property - //modelInstance.name shouldBe ("TODO") - } - - // to test the property `photoUrls` - should("test photoUrls") { - // uncomment below to test the property - //modelInstance.photoUrls shouldBe ("TODO") - } - // to test the property `id` should("test id") { // uncomment below to test the property //modelInstance.id shouldBe ("TODO") } - // to test the property `firstName` - should("test firstName") { - // uncomment below to test the property - //modelInstance.firstName shouldBe ("TODO") - } - - // to test the property `lastName` - should("test lastName") { - // uncomment below to test the property - //modelInstance.lastName shouldBe ("TODO") - } - - // to test the property `email` - should("test email") { - // uncomment below to test the property - //modelInstance.email shouldBe ("TODO") - } - - // to test the property `password` - should("test password") { - // uncomment below to test the property - //modelInstance.password shouldBe ("TODO") - } - - // to test the property `phone` - should("test phone") { - // uncomment below to test the property - //modelInstance.phone shouldBe ("TODO") - } - - // to test the property `userStatus` - User Status - should("test userStatus") { - // uncomment below to test the property - //modelInstance.userStatus shouldBe ("TODO") - } - - // to test the property `category` - should("test category") { - // uncomment below to test the property - //modelInstance.category shouldBe ("TODO") - } - - // to test the property `tags` - should("test tags") { + // to test the property `username` + should("test username") { // uncomment below to test the property - //modelInstance.tags shouldBe ("TODO") + //modelInstance.username shouldBe ("TODO") } - // to test the property `status` - pet status in the store - should("test status") { + // to test the property `name` + should("test name") { // uncomment below to test the property - //modelInstance.status shouldBe ("TODO") + //modelInstance.name shouldBe ("TODO") } } diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/UserTest.kt b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/UserTest.kt index a4d689ca231f..40b69f12dd4a 100644 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/UserTest.kt +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/src/test/kotlin/org/openapitools/client/models/UserTest.kt @@ -25,52 +25,16 @@ class UserTest : ShouldSpec() { // uncomment below to create an instance of User //val modelInstance = User() - // to test the property `username` - should("test username") { - // uncomment below to test the property - //modelInstance.username shouldBe ("TODO") - } - // to test the property `id` should("test id") { // uncomment below to test the property //modelInstance.id shouldBe ("TODO") } - // to test the property `firstName` - should("test firstName") { - // uncomment below to test the property - //modelInstance.firstName shouldBe ("TODO") - } - - // to test the property `lastName` - should("test lastName") { - // uncomment below to test the property - //modelInstance.lastName shouldBe ("TODO") - } - - // to test the property `email` - should("test email") { - // uncomment below to test the property - //modelInstance.email shouldBe ("TODO") - } - - // to test the property `password` - should("test password") { - // uncomment below to test the property - //modelInstance.password shouldBe ("TODO") - } - - // to test the property `phone` - should("test phone") { - // uncomment below to test the property - //modelInstance.phone shouldBe ("TODO") - } - - // to test the property `userStatus` - User Status - should("test userStatus") { + // to test the property `username` + should("test username") { // uncomment below to test the property - //modelInstance.userStatus shouldBe ("TODO") + //modelInstance.username shouldBe ("TODO") } } From dffd95855d60303533de1f09f25c38db120052d2 Mon Sep 17 00:00:00 2001 From: wakata_sansan Date: Thu, 19 Feb 2026 14:01:10 +0900 Subject: [PATCH 4/7] add CI path filter for kotlin-oneOf-anyOf-kotlinx-serialization sample --- .github/workflows/samples-kotlin-client.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/samples-kotlin-client.yaml b/.github/workflows/samples-kotlin-client.yaml index 0a5dafbbed1a..b7339adcee16 100644 --- a/.github/workflows/samples-kotlin-client.yaml +++ b/.github/workflows/samples-kotlin-client.yaml @@ -6,11 +6,13 @@ on: - 'samples/client/petstore/kotlin*/**' - 'samples/client/others/kotlin-jvm-okhttp-parameter-tests/**' - samples/client/others/kotlin-integer-enum/** + - samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/** pull_request: paths: - 'samples/client/petstore/kotlin*/**' - 'samples/client/others/kotlin-jvm-okhttp-parameter-tests/**' - samples/client/others/kotlin-integer-enum/** + - samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/** jobs: build: From 35c1a6be5eba5743a33e622ea3a5fda71f46418a Mon Sep 17 00:00:00 2001 From: wakata_sansan Date: Thu, 19 Feb 2026 14:40:25 +0900 Subject: [PATCH 5/7] add x-duplicated-data-type guard to kotlinx_serialization oneOf/anyOf templates The Gson path already uses {{^vendorExtensions.x-duplicated-data-type}} to skip duplicate data types, but the new kotlinx_serialization path was missing this guard. Without it, duplicate value class names would be generated if multiple schemas resolve to the same Kotlin dataType, causing compilation errors. --- .../main/resources/kotlin-client/anyof_class.mustache | 6 ++++++ .../main/resources/kotlin-client/oneof_class.mustache | 6 ++++++ .../.openapi-generator/FILES | 10 ---------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/anyof_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/anyof_class.mustache index b326e9f14649..dfc48ab336b0 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/anyof_class.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/anyof_class.mustache @@ -105,9 +105,11 @@ import java.io.IOException {{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}sealed interface {{classname}} { {{#composedSchemas}} {{#anyOf}} +{{^vendorExtensions.x-duplicated-data-type}} @JvmInline {{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}value class {{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}}(val value: {{{dataType}}}) : {{classname}} +{{/vendorExtensions.x-duplicated-data-type}} {{/anyOf}} {{/composedSchemas}} } @@ -121,6 +123,7 @@ import java.io.IOException when (value) { {{#composedSchemas}} {{#anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} {{#isArray}} is {{classname}}.{{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}} -> jsonEncoder.encodeJsonElement(jsonEncoder.json.encodeToJsonElement(value.value)) {{/isArray}} @@ -153,6 +156,7 @@ import java.io.IOException is {{classname}}.{{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}} -> jsonEncoder.encodeSerializableValue({{{dataType}}}.serializer(), value.value) {{/isPrimitiveType}} {{/isArray}} + {{/vendorExtensions.x-duplicated-data-type}} {{/anyOf}} {{/composedSchemas}} } @@ -166,6 +170,7 @@ import java.io.IOException {{#composedSchemas}} {{#anyOf}} + {{^vendorExtensions.x-duplicated-data-type}} {{#isArray}} if (jsonElement is JsonArray) { try { @@ -210,6 +215,7 @@ import java.io.IOException } {{/isPrimitiveType}} {{/isArray}} + {{/vendorExtensions.x-duplicated-data-type}} {{/anyOf}} {{/composedSchemas}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/oneof_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/oneof_class.mustache index 0d02bb2439ca..80b3baa97f60 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/oneof_class.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/oneof_class.mustache @@ -167,9 +167,11 @@ import java.io.IOException {{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}sealed interface {{classname}} { {{#composedSchemas}} {{#oneOf}} +{{^vendorExtensions.x-duplicated-data-type}} @JvmInline {{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}value class {{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}}(val value: {{{dataType}}}) : {{classname}} +{{/vendorExtensions.x-duplicated-data-type}} {{/oneOf}} {{/composedSchemas}} } @@ -183,6 +185,7 @@ import java.io.IOException when (value) { {{#composedSchemas}} {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} {{#isArray}} is {{classname}}.{{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}} -> jsonEncoder.encodeJsonElement(jsonEncoder.json.encodeToJsonElement(value.value)) {{/isArray}} @@ -215,6 +218,7 @@ import java.io.IOException is {{classname}}.{{#fnToValueClassName}}{{{dataType}}}{{/fnToValueClassName}} -> jsonEncoder.encodeSerializableValue({{{dataType}}}.serializer(), value.value) {{/isPrimitiveType}} {{/isArray}} + {{/vendorExtensions.x-duplicated-data-type}} {{/oneOf}} {{/composedSchemas}} } @@ -228,6 +232,7 @@ import java.io.IOException {{#composedSchemas}} {{#oneOf}} + {{^vendorExtensions.x-duplicated-data-type}} {{#isArray}} if (jsonElement is JsonArray) { try { @@ -272,6 +277,7 @@ import java.io.IOException } {{/isPrimitiveType}} {{/isArray}} + {{/vendorExtensions.x-duplicated-data-type}} {{/oneOf}} {{/composedSchemas}} diff --git a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/.openapi-generator/FILES b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/.openapi-generator/FILES index bbe6037c9289..3cff65854d3d 100644 --- a/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/.openapi-generator/FILES +++ b/samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/.openapi-generator/FILES @@ -1,4 +1,3 @@ -.openapi-generator-ignore README.md build.gradle docs/AnyOfUserOrPet.md @@ -41,12 +40,3 @@ src/main/kotlin/org/openapitools/client/models/StringOrLong.kt src/main/kotlin/org/openapitools/client/models/User.kt src/main/kotlin/org/openapitools/client/models/UserOrPet.kt src/main/kotlin/org/openapitools/client/models/UserOrPetOrArrayString.kt -src/test/kotlin/org/openapitools/client/apis/TestApiTest.kt -src/test/kotlin/org/openapitools/client/models/AnyOfUserOrPetOrArrayStringTest.kt -src/test/kotlin/org/openapitools/client/models/AnyOfUserOrPetTest.kt -src/test/kotlin/org/openapitools/client/models/BooleanOrLongTest.kt -src/test/kotlin/org/openapitools/client/models/PetTest.kt -src/test/kotlin/org/openapitools/client/models/StringOrLongTest.kt -src/test/kotlin/org/openapitools/client/models/UserOrPetOrArrayStringTest.kt -src/test/kotlin/org/openapitools/client/models/UserOrPetTest.kt -src/test/kotlin/org/openapitools/client/models/UserTest.kt From ad5bd708b2cd16c38a8eed6c5d601ba92627afb5 Mon Sep 17 00:00:00 2001 From: wakata_sansan Date: Thu, 19 Feb 2026 14:40:37 +0900 Subject: [PATCH 6/7] remove invalid path pattern from push.branches in CI config push.branches filters by branch name, not file paths. The sample directory pattern added here had no effect. The pull_request.paths filter remains and correctly triggers CI for this sample. --- .github/workflows/samples-kotlin-client.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/samples-kotlin-client.yaml b/.github/workflows/samples-kotlin-client.yaml index b7339adcee16..7c4fa316aba0 100644 --- a/.github/workflows/samples-kotlin-client.yaml +++ b/.github/workflows/samples-kotlin-client.yaml @@ -6,7 +6,6 @@ on: - 'samples/client/petstore/kotlin*/**' - 'samples/client/others/kotlin-jvm-okhttp-parameter-tests/**' - samples/client/others/kotlin-integer-enum/** - - samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization/** pull_request: paths: - 'samples/client/petstore/kotlin*/**' From 87bed3bfef3f235b04631240872098fd05a51a55 Mon Sep 17 00:00:00 2001 From: wakata_sansan Date: Thu, 19 Feb 2026 16:39:06 +0900 Subject: [PATCH 7/7] update generateOneOfAnyOfWrappers docs to include kotlinx_serialization support --- docs/generators/kotlin.md | 2 +- .../org/openapitools/codegen/languages/KotlinClientCodegen.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index fe2da8f0b41c..5c1a70330b6e 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -27,7 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |original| |explicitApi|Generates code with explicit access modifiers to comply with Kotlin Explicit API Mode.| |false| |failOnUnknownProperties|Fail Jackson de-serialization on unknown properties| |false| -|generateOneOfAnyOfWrappers|Generate oneOf, anyOf schemas as wrappers. Only `jvm-retrofit2`(library), `gson`(serializationLibrary) support this option.| |false| +|generateOneOfAnyOfWrappers|Generate oneOf, anyOf schemas as wrappers. Only `jvm-retrofit2`(library) with `gson` or `kotlinx_serialization`(serializationLibrary) support this option.| |false| |generateRoomModels|Generate Android Room database models in addition to API models (JVM Volley library only)| |false| |groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools| |idea|Add IntelliJ Idea plugin and mark Kotlin main and test folders as source folders.| |false| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java index ad0e40501b5b..e0b51976ce5c 100755 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java @@ -286,7 +286,7 @@ public KotlinClientCodegen() { cliOptions.add(new CliOption(MAP_FILE_BINARY_TO_BYTE_ARRAY, "Map File and Binary to ByteArray (default: false)").defaultValue(Boolean.FALSE.toString())); - cliOptions.add(CliOption.newBoolean(GENERATE_ONEOF_ANYOF_WRAPPERS, "Generate oneOf, anyOf schemas as wrappers. Only `jvm-retrofit2`(library), `gson`(serializationLibrary) support this option.")); + cliOptions.add(CliOption.newBoolean(GENERATE_ONEOF_ANYOF_WRAPPERS, "Generate oneOf, anyOf schemas as wrappers. Only `jvm-retrofit2`(library) with `gson` or `kotlinx_serialization`(serializationLibrary) support this option.")); CliOption serializationLibraryOpt = new CliOption(CodegenConstants.SERIALIZATION_LIBRARY, SERIALIZATION_LIBRARY_DESC); cliOptions.add(serializationLibraryOpt.defaultValue(serializationLibrary.name()));