forked from loafle/openapi-generator-original
[kotlin-client][multiplatform] update dependency versions (#17180)
This commit is contained in:
parent
3fa21b5603
commit
9fa3aec2e0
@ -1,17 +1,17 @@
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform"){{^omitGradlePluginVersions}} version "1.7.21" // kotlin_version{{/omitGradlePluginVersions}}
|
||||
kotlin("plugin.serialization"){{^omitGradlePluginVersions}} version "1.7.21" // kotlin_version{{/omitGradlePluginVersions}}
|
||||
kotlin("multiplatform"){{^omitGradlePluginVersions}} version "1.9.20" // kotlin_version{{/omitGradlePluginVersions}}
|
||||
kotlin("plugin.serialization"){{^omitGradlePluginVersions}} version "1.9.20" // kotlin_version{{/omitGradlePluginVersions}}
|
||||
}
|
||||
|
||||
group = "{{groupId}}"
|
||||
version = "{{artifactVersion}}"
|
||||
|
||||
val kotlin_version = "1.7.21"
|
||||
val coroutines_version = "1.6.4"
|
||||
val serialization_version = "1.3.3"
|
||||
val ktor_version = "2.2.3"
|
||||
val kotlin_version = "1.9.20"
|
||||
val coroutines_version = "1.7.3"
|
||||
val serialization_version = "1.6.1"
|
||||
val ktor_version = "2.3.6"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@ -19,15 +19,16 @@ repositories {
|
||||
|
||||
kotlin {
|
||||
jvm()
|
||||
ios { binaries { framework { freeCompilerArgs += "-Xobjc-generics" } } }
|
||||
iosSimulatorArm64 { binaries { framework { freeCompilerArgs += "-Xobjc-generics" } } }
|
||||
iosX64()
|
||||
iosArm64()
|
||||
iosSimulatorArm64()
|
||||
js {
|
||||
browser()
|
||||
nodejs()
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
val commonMain by getting {
|
||||
commonMain {
|
||||
dependencies {
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:$serialization_version")
|
||||
@ -38,54 +39,43 @@ kotlin {
|
||||
api("io.ktor:ktor-serialization-kotlinx-json:$ktor_version")
|
||||
|
||||
{{#kotlinx-datetime}}
|
||||
api("org.jetbrains.kotlinx:kotlinx-datetime:0.4.0")
|
||||
api("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1")
|
||||
{{/kotlinx-datetime}}
|
||||
}
|
||||
}
|
||||
|
||||
val commonTest by getting {
|
||||
commonTest {
|
||||
dependencies {
|
||||
implementation(kotlin("test"))
|
||||
implementation("io.ktor:ktor-client-mock:$ktor_version")
|
||||
}
|
||||
}
|
||||
|
||||
val jvmMain by getting {
|
||||
jvmMain {
|
||||
dependencies {
|
||||
implementation(kotlin("stdlib-jdk7"))
|
||||
implementation("io.ktor:ktor-client-cio-jvm:$ktor_version")
|
||||
}
|
||||
}
|
||||
|
||||
val jvmTest by getting {
|
||||
jvmTest {
|
||||
dependencies {
|
||||
implementation(kotlin("test-junit"))
|
||||
}
|
||||
}
|
||||
|
||||
val iosMain by getting {
|
||||
iosMain {
|
||||
dependencies {
|
||||
api("io.ktor:ktor-client-ios:$ktor_version")
|
||||
}
|
||||
}
|
||||
|
||||
val iosTest by getting
|
||||
|
||||
val iosSimulatorArm64Main by getting
|
||||
|
||||
val iosSimulatorArm64Test by getting
|
||||
|
||||
iosSimulatorArm64Main.dependsOn(iosMain)
|
||||
iosSimulatorArm64Test.dependsOn(iosTest)
|
||||
|
||||
val jsMain by getting {
|
||||
dependencies {
|
||||
api("io.ktor:ktor-client-js:$ktor_version")
|
||||
}
|
||||
}
|
||||
|
||||
val jsTest by getting
|
||||
|
||||
all {
|
||||
languageSettings.apply {
|
||||
optIn("kotlin.Experimental")
|
||||
|
@ -4,9 +4,8 @@ import kotlinx.serialization.*
|
||||
import kotlinx.serialization.descriptors.*
|
||||
import kotlinx.serialization.encoding.*
|
||||
|
||||
@Serializable
|
||||
@Serializable(Base64ByteArray.Companion::class)
|
||||
class Base64ByteArray(val value: ByteArray) {
|
||||
@Serializer(Base64ByteArray::class)
|
||||
companion object : KSerializer<Base64ByteArray> {
|
||||
override val descriptor = PrimitiveSerialDescriptor("Base64ByteArray", PrimitiveKind.STRING)
|
||||
override fun serialize(encoder: Encoder, obj: Base64ByteArray) = encoder.encodeString(obj.value.encodeBase64())
|
||||
|
@ -82,6 +82,7 @@ private fun ByteReadPacket.encodeBase64(): String = buildString {
|
||||
*
|
||||
* Taken from https://github.com/ktorio/ktor/blob/424d1d2cfaa3281302c60af9500f738c8c2fc846/ktor-utils/common/src/io/ktor/util/Base64.kt
|
||||
*/
|
||||
@Suppress("DEPRECATION")
|
||||
private fun ByteReadPacket.decodeBase64Bytes(): Input = buildPacket {
|
||||
val data = ByteArray(4)
|
||||
|
||||
|
@ -4,9 +4,8 @@ import kotlinx.serialization.*
|
||||
import kotlinx.serialization.descriptors.*
|
||||
import kotlinx.serialization.encoding.*
|
||||
|
||||
@Serializable
|
||||
@Serializable(OctetByteArray.Companion::class)
|
||||
class OctetByteArray(val value: ByteArray) {
|
||||
@Serializer(OctetByteArray::class)
|
||||
companion object : KSerializer<OctetByteArray> {
|
||||
override val descriptor = PrimitiveSerialDescriptor("OctetByteArray", PrimitiveKind.STRING)
|
||||
override fun serialize(encoder: Encoder, obj: OctetByteArray) = encoder.encodeString(hex(obj.value))
|
||||
|
@ -1,6 +1,5 @@
|
||||
@Serializable
|
||||
@Serializable({{operationIdCamelCase}}Request.Companion::class)
|
||||
private class {{operationIdCamelCase}}Request(val value: List<{{#bodyParam}}{{baseType}}{{/bodyParam}}>) {
|
||||
@Serializer({{operationIdCamelCase}}Request::class)
|
||||
{{#nonPublicApi}}internal {{/nonPublicApi}}companion object : KSerializer<{{operationIdCamelCase}}Request> {
|
||||
private val serializer: KSerializer<List<{{#bodyParam}}{{baseType}}{{/bodyParam}}>> = serializer<List<{{#bodyParam}}{{baseType}}{{/bodyParam}}>>()
|
||||
override val descriptor = serializer.descriptor
|
||||
|
@ -1,6 +1,5 @@
|
||||
@Serializable
|
||||
@Serializable({{operationIdCamelCase}}Request.Companion::class)
|
||||
private class {{operationIdCamelCase}}Request(val value: Map<kotlin.String, {{#bodyParam}}{{baseType}}{{/bodyParam}}>) {
|
||||
@Serializer({{operationIdCamelCase}}Request::class)
|
||||
{{#nonPublicApi}}internal {{/nonPublicApi}}companion object : KSerializer<{{operationIdCamelCase}}Request> {
|
||||
private val serializer: KSerializer<Map<kotlin.String, {{#bodyParam}}{{baseType}}{{/bodyParam}}>> = serializer<Map<String, {{#bodyParam}}{{baseType}}{{/bodyParam}}>>()
|
||||
override val descriptor = serializer.descriptor
|
||||
|
@ -1,6 +1,5 @@
|
||||
@Serializable
|
||||
@Serializable({{operationIdCamelCase}}Response.Companion::class)
|
||||
private class {{operationIdCamelCase}}Response(val value: List<{{returnBaseType}}>) {
|
||||
@Serializer({{operationIdCamelCase}}Response::class)
|
||||
{{#nonPublicApi}}internal {{/nonPublicApi}}companion object : KSerializer<{{operationIdCamelCase}}Response> {
|
||||
private val serializer: KSerializer<List<{{returnBaseType}}>> = serializer<List<{{returnBaseType}}>>()
|
||||
override val descriptor = serializer.descriptor
|
||||
|
@ -1,6 +1,5 @@
|
||||
@Serializable
|
||||
@Serializable({{operationIdCamelCase}}Response.Companion::class)
|
||||
private class {{operationIdCamelCase}}Response(val value: Map<kotlin.String, {{returnBaseType}}>) {
|
||||
@Serializer({{operationIdCamelCase}}Response::class)
|
||||
{{#nonPublicApi}}internal {{/nonPublicApi}}companion object : KSerializer<{{operationIdCamelCase}}Response> {
|
||||
private val serializer: KSerializer<Map<kotlin.String, {{returnBaseType}}>> = serializer<Map<String, {{returnBaseType}}>>()
|
||||
override val descriptor = serializer.descriptor
|
||||
|
@ -1,17 +1,17 @@
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform") version "1.7.21" // kotlin_version
|
||||
kotlin("plugin.serialization") version "1.7.21" // kotlin_version
|
||||
kotlin("multiplatform") version "1.9.20" // kotlin_version
|
||||
kotlin("plugin.serialization") version "1.9.20" // kotlin_version
|
||||
}
|
||||
|
||||
group = "org.openapitools"
|
||||
version = "1.0.0"
|
||||
|
||||
val kotlin_version = "1.7.21"
|
||||
val coroutines_version = "1.6.4"
|
||||
val serialization_version = "1.3.3"
|
||||
val ktor_version = "2.2.3"
|
||||
val kotlin_version = "1.9.20"
|
||||
val coroutines_version = "1.7.3"
|
||||
val serialization_version = "1.6.1"
|
||||
val ktor_version = "2.3.6"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@ -19,15 +19,16 @@ repositories {
|
||||
|
||||
kotlin {
|
||||
jvm()
|
||||
ios { binaries { framework { freeCompilerArgs += "-Xobjc-generics" } } }
|
||||
iosSimulatorArm64 { binaries { framework { freeCompilerArgs += "-Xobjc-generics" } } }
|
||||
iosX64()
|
||||
iosArm64()
|
||||
iosSimulatorArm64()
|
||||
js {
|
||||
browser()
|
||||
nodejs()
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
val commonMain by getting {
|
||||
commonMain {
|
||||
dependencies {
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:$serialization_version")
|
||||
@ -37,53 +38,42 @@ kotlin {
|
||||
api("io.ktor:ktor-client-content-negotiation:$ktor_version")
|
||||
api("io.ktor:ktor-serialization-kotlinx-json:$ktor_version")
|
||||
|
||||
api("org.jetbrains.kotlinx:kotlinx-datetime:0.4.0")
|
||||
api("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1")
|
||||
}
|
||||
}
|
||||
|
||||
val commonTest by getting {
|
||||
commonTest {
|
||||
dependencies {
|
||||
implementation(kotlin("test"))
|
||||
implementation("io.ktor:ktor-client-mock:$ktor_version")
|
||||
}
|
||||
}
|
||||
|
||||
val jvmMain by getting {
|
||||
jvmMain {
|
||||
dependencies {
|
||||
implementation(kotlin("stdlib-jdk7"))
|
||||
implementation("io.ktor:ktor-client-cio-jvm:$ktor_version")
|
||||
}
|
||||
}
|
||||
|
||||
val jvmTest by getting {
|
||||
jvmTest {
|
||||
dependencies {
|
||||
implementation(kotlin("test-junit"))
|
||||
}
|
||||
}
|
||||
|
||||
val iosMain by getting {
|
||||
iosMain {
|
||||
dependencies {
|
||||
api("io.ktor:ktor-client-ios:$ktor_version")
|
||||
}
|
||||
}
|
||||
|
||||
val iosTest by getting
|
||||
|
||||
val iosSimulatorArm64Main by getting
|
||||
|
||||
val iosSimulatorArm64Test by getting
|
||||
|
||||
iosSimulatorArm64Main.dependsOn(iosMain)
|
||||
iosSimulatorArm64Test.dependsOn(iosTest)
|
||||
|
||||
val jsMain by getting {
|
||||
dependencies {
|
||||
api("io.ktor:ktor-client-js:$ktor_version")
|
||||
}
|
||||
}
|
||||
|
||||
val jsTest by getting
|
||||
|
||||
all {
|
||||
languageSettings.apply {
|
||||
optIn("kotlin.Experimental")
|
||||
|
@ -4,9 +4,8 @@ import kotlinx.serialization.*
|
||||
import kotlinx.serialization.descriptors.*
|
||||
import kotlinx.serialization.encoding.*
|
||||
|
||||
@Serializable
|
||||
@Serializable(Base64ByteArray.Companion::class)
|
||||
class Base64ByteArray(val value: ByteArray) {
|
||||
@Serializer(Base64ByteArray::class)
|
||||
companion object : KSerializer<Base64ByteArray> {
|
||||
override val descriptor = PrimitiveSerialDescriptor("Base64ByteArray", PrimitiveKind.STRING)
|
||||
override fun serialize(encoder: Encoder, obj: Base64ByteArray) = encoder.encodeString(obj.value.encodeBase64())
|
||||
|
@ -82,6 +82,7 @@ private fun ByteReadPacket.encodeBase64(): String = buildString {
|
||||
*
|
||||
* Taken from https://github.com/ktorio/ktor/blob/424d1d2cfaa3281302c60af9500f738c8c2fc846/ktor-utils/common/src/io/ktor/util/Base64.kt
|
||||
*/
|
||||
@Suppress("DEPRECATION")
|
||||
private fun ByteReadPacket.decodeBase64Bytes(): Input = buildPacket {
|
||||
val data = ByteArray(4)
|
||||
|
||||
|
@ -4,9 +4,8 @@ import kotlinx.serialization.*
|
||||
import kotlinx.serialization.descriptors.*
|
||||
import kotlinx.serialization.encoding.*
|
||||
|
||||
@Serializable
|
||||
@Serializable(OctetByteArray.Companion::class)
|
||||
class OctetByteArray(val value: ByteArray) {
|
||||
@Serializer(OctetByteArray::class)
|
||||
companion object : KSerializer<OctetByteArray> {
|
||||
override val descriptor = PrimitiveSerialDescriptor("OctetByteArray", PrimitiveKind.STRING)
|
||||
override fun serialize(encoder: Encoder, obj: OctetByteArray) = encoder.encodeString(hex(obj.value))
|
||||
|
@ -1,17 +1,17 @@
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform") version "1.7.21" // kotlin_version
|
||||
kotlin("plugin.serialization") version "1.7.21" // kotlin_version
|
||||
kotlin("multiplatform") version "1.9.20" // kotlin_version
|
||||
kotlin("plugin.serialization") version "1.9.20" // kotlin_version
|
||||
}
|
||||
|
||||
group = "org.openapitools"
|
||||
version = "1.0.0"
|
||||
|
||||
val kotlin_version = "1.7.21"
|
||||
val coroutines_version = "1.6.4"
|
||||
val serialization_version = "1.3.3"
|
||||
val ktor_version = "2.2.3"
|
||||
val kotlin_version = "1.9.20"
|
||||
val coroutines_version = "1.7.3"
|
||||
val serialization_version = "1.6.1"
|
||||
val ktor_version = "2.3.6"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@ -19,15 +19,16 @@ repositories {
|
||||
|
||||
kotlin {
|
||||
jvm()
|
||||
ios { binaries { framework { freeCompilerArgs += "-Xobjc-generics" } } }
|
||||
iosSimulatorArm64 { binaries { framework { freeCompilerArgs += "-Xobjc-generics" } } }
|
||||
iosX64()
|
||||
iosArm64()
|
||||
iosSimulatorArm64()
|
||||
js {
|
||||
browser()
|
||||
nodejs()
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
val commonMain by getting {
|
||||
commonMain {
|
||||
dependencies {
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:$serialization_version")
|
||||
@ -37,53 +38,42 @@ kotlin {
|
||||
api("io.ktor:ktor-client-content-negotiation:$ktor_version")
|
||||
api("io.ktor:ktor-serialization-kotlinx-json:$ktor_version")
|
||||
|
||||
api("org.jetbrains.kotlinx:kotlinx-datetime:0.4.0")
|
||||
api("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1")
|
||||
}
|
||||
}
|
||||
|
||||
val commonTest by getting {
|
||||
commonTest {
|
||||
dependencies {
|
||||
implementation(kotlin("test"))
|
||||
implementation("io.ktor:ktor-client-mock:$ktor_version")
|
||||
}
|
||||
}
|
||||
|
||||
val jvmMain by getting {
|
||||
jvmMain {
|
||||
dependencies {
|
||||
implementation(kotlin("stdlib-jdk7"))
|
||||
implementation("io.ktor:ktor-client-cio-jvm:$ktor_version")
|
||||
}
|
||||
}
|
||||
|
||||
val jvmTest by getting {
|
||||
jvmTest {
|
||||
dependencies {
|
||||
implementation(kotlin("test-junit"))
|
||||
}
|
||||
}
|
||||
|
||||
val iosMain by getting {
|
||||
iosMain {
|
||||
dependencies {
|
||||
api("io.ktor:ktor-client-ios:$ktor_version")
|
||||
}
|
||||
}
|
||||
|
||||
val iosTest by getting
|
||||
|
||||
val iosSimulatorArm64Main by getting
|
||||
|
||||
val iosSimulatorArm64Test by getting
|
||||
|
||||
iosSimulatorArm64Main.dependsOn(iosMain)
|
||||
iosSimulatorArm64Test.dependsOn(iosTest)
|
||||
|
||||
val jsMain by getting {
|
||||
dependencies {
|
||||
api("io.ktor:ktor-client-js:$ktor_version")
|
||||
}
|
||||
}
|
||||
|
||||
val jsTest by getting
|
||||
|
||||
all {
|
||||
languageSettings.apply {
|
||||
optIn("kotlin.Experimental")
|
||||
|
@ -4,9 +4,8 @@ import kotlinx.serialization.*
|
||||
import kotlinx.serialization.descriptors.*
|
||||
import kotlinx.serialization.encoding.*
|
||||
|
||||
@Serializable
|
||||
@Serializable(Base64ByteArray.Companion::class)
|
||||
class Base64ByteArray(val value: ByteArray) {
|
||||
@Serializer(Base64ByteArray::class)
|
||||
companion object : KSerializer<Base64ByteArray> {
|
||||
override val descriptor = PrimitiveSerialDescriptor("Base64ByteArray", PrimitiveKind.STRING)
|
||||
override fun serialize(encoder: Encoder, obj: Base64ByteArray) = encoder.encodeString(obj.value.encodeBase64())
|
||||
|
@ -82,6 +82,7 @@ private fun ByteReadPacket.encodeBase64(): String = buildString {
|
||||
*
|
||||
* Taken from https://github.com/ktorio/ktor/blob/424d1d2cfaa3281302c60af9500f738c8c2fc846/ktor-utils/common/src/io/ktor/util/Base64.kt
|
||||
*/
|
||||
@Suppress("DEPRECATION")
|
||||
private fun ByteReadPacket.decodeBase64Bytes(): Input = buildPacket {
|
||||
val data = ByteArray(4)
|
||||
|
||||
|
@ -4,9 +4,8 @@ import kotlinx.serialization.*
|
||||
import kotlinx.serialization.descriptors.*
|
||||
import kotlinx.serialization.encoding.*
|
||||
|
||||
@Serializable
|
||||
@Serializable(OctetByteArray.Companion::class)
|
||||
class OctetByteArray(val value: ByteArray) {
|
||||
@Serializer(OctetByteArray::class)
|
||||
companion object : KSerializer<OctetByteArray> {
|
||||
override val descriptor = PrimitiveSerialDescriptor("OctetByteArray", PrimitiveKind.STRING)
|
||||
override fun serialize(encoder: Encoder, obj: OctetByteArray) = encoder.encodeString(hex(obj.value))
|
||||
|
@ -1,17 +1,17 @@
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform") version "1.7.21" // kotlin_version
|
||||
kotlin("plugin.serialization") version "1.7.21" // kotlin_version
|
||||
kotlin("multiplatform") version "1.9.20" // kotlin_version
|
||||
kotlin("plugin.serialization") version "1.9.20" // kotlin_version
|
||||
}
|
||||
|
||||
group = "org.openapitools"
|
||||
version = "1.0.0"
|
||||
|
||||
val kotlin_version = "1.7.21"
|
||||
val coroutines_version = "1.6.4"
|
||||
val serialization_version = "1.3.3"
|
||||
val ktor_version = "2.2.3"
|
||||
val kotlin_version = "1.9.20"
|
||||
val coroutines_version = "1.7.3"
|
||||
val serialization_version = "1.6.1"
|
||||
val ktor_version = "2.3.6"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@ -19,15 +19,16 @@ repositories {
|
||||
|
||||
kotlin {
|
||||
jvm()
|
||||
ios { binaries { framework { freeCompilerArgs += "-Xobjc-generics" } } }
|
||||
iosSimulatorArm64 { binaries { framework { freeCompilerArgs += "-Xobjc-generics" } } }
|
||||
iosX64()
|
||||
iosArm64()
|
||||
iosSimulatorArm64()
|
||||
js {
|
||||
browser()
|
||||
nodejs()
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
val commonMain by getting {
|
||||
commonMain {
|
||||
dependencies {
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:$serialization_version")
|
||||
@ -37,53 +38,42 @@ kotlin {
|
||||
api("io.ktor:ktor-client-content-negotiation:$ktor_version")
|
||||
api("io.ktor:ktor-serialization-kotlinx-json:$ktor_version")
|
||||
|
||||
api("org.jetbrains.kotlinx:kotlinx-datetime:0.4.0")
|
||||
api("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1")
|
||||
}
|
||||
}
|
||||
|
||||
val commonTest by getting {
|
||||
commonTest {
|
||||
dependencies {
|
||||
implementation(kotlin("test"))
|
||||
implementation("io.ktor:ktor-client-mock:$ktor_version")
|
||||
}
|
||||
}
|
||||
|
||||
val jvmMain by getting {
|
||||
jvmMain {
|
||||
dependencies {
|
||||
implementation(kotlin("stdlib-jdk7"))
|
||||
implementation("io.ktor:ktor-client-cio-jvm:$ktor_version")
|
||||
}
|
||||
}
|
||||
|
||||
val jvmTest by getting {
|
||||
jvmTest {
|
||||
dependencies {
|
||||
implementation(kotlin("test-junit"))
|
||||
}
|
||||
}
|
||||
|
||||
val iosMain by getting {
|
||||
iosMain {
|
||||
dependencies {
|
||||
api("io.ktor:ktor-client-ios:$ktor_version")
|
||||
}
|
||||
}
|
||||
|
||||
val iosTest by getting
|
||||
|
||||
val iosSimulatorArm64Main by getting
|
||||
|
||||
val iosSimulatorArm64Test by getting
|
||||
|
||||
iosSimulatorArm64Main.dependsOn(iosMain)
|
||||
iosSimulatorArm64Test.dependsOn(iosTest)
|
||||
|
||||
val jsMain by getting {
|
||||
dependencies {
|
||||
api("io.ktor:ktor-client-js:$ktor_version")
|
||||
}
|
||||
}
|
||||
|
||||
val jsTest by getting
|
||||
|
||||
all {
|
||||
languageSettings.apply {
|
||||
optIn("kotlin.Experimental")
|
||||
|
@ -4,9 +4,8 @@ import kotlinx.serialization.*
|
||||
import kotlinx.serialization.descriptors.*
|
||||
import kotlinx.serialization.encoding.*
|
||||
|
||||
@Serializable
|
||||
@Serializable(Base64ByteArray.Companion::class)
|
||||
class Base64ByteArray(val value: ByteArray) {
|
||||
@Serializer(Base64ByteArray::class)
|
||||
companion object : KSerializer<Base64ByteArray> {
|
||||
override val descriptor = PrimitiveSerialDescriptor("Base64ByteArray", PrimitiveKind.STRING)
|
||||
override fun serialize(encoder: Encoder, obj: Base64ByteArray) = encoder.encodeString(obj.value.encodeBase64())
|
||||
|
@ -82,6 +82,7 @@ private fun ByteReadPacket.encodeBase64(): String = buildString {
|
||||
*
|
||||
* Taken from https://github.com/ktorio/ktor/blob/424d1d2cfaa3281302c60af9500f738c8c2fc846/ktor-utils/common/src/io/ktor/util/Base64.kt
|
||||
*/
|
||||
@Suppress("DEPRECATION")
|
||||
private fun ByteReadPacket.decodeBase64Bytes(): Input = buildPacket {
|
||||
val data = ByteArray(4)
|
||||
|
||||
|
@ -4,9 +4,8 @@ import kotlinx.serialization.*
|
||||
import kotlinx.serialization.descriptors.*
|
||||
import kotlinx.serialization.encoding.*
|
||||
|
||||
@Serializable
|
||||
@Serializable(OctetByteArray.Companion::class)
|
||||
class OctetByteArray(val value: ByteArray) {
|
||||
@Serializer(OctetByteArray::class)
|
||||
companion object : KSerializer<OctetByteArray> {
|
||||
override val descriptor = PrimitiveSerialDescriptor("OctetByteArray", PrimitiveKind.STRING)
|
||||
override fun serialize(encoder: Encoder, obj: OctetByteArray) = encoder.encodeString(hex(obj.value))
|
||||
|
@ -1,17 +1,17 @@
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform") version "1.7.21" // kotlin_version
|
||||
kotlin("plugin.serialization") version "1.7.21" // kotlin_version
|
||||
kotlin("multiplatform") version "1.9.20" // kotlin_version
|
||||
kotlin("plugin.serialization") version "1.9.20" // kotlin_version
|
||||
}
|
||||
|
||||
group = "org.openapitools"
|
||||
version = "1.0.0"
|
||||
|
||||
val kotlin_version = "1.7.21"
|
||||
val coroutines_version = "1.6.4"
|
||||
val serialization_version = "1.3.3"
|
||||
val ktor_version = "2.2.3"
|
||||
val kotlin_version = "1.9.20"
|
||||
val coroutines_version = "1.7.3"
|
||||
val serialization_version = "1.6.1"
|
||||
val ktor_version = "2.3.6"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@ -19,15 +19,16 @@ repositories {
|
||||
|
||||
kotlin {
|
||||
jvm()
|
||||
ios { binaries { framework { freeCompilerArgs += "-Xobjc-generics" } } }
|
||||
iosSimulatorArm64 { binaries { framework { freeCompilerArgs += "-Xobjc-generics" } } }
|
||||
iosX64()
|
||||
iosArm64()
|
||||
iosSimulatorArm64()
|
||||
js {
|
||||
browser()
|
||||
nodejs()
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
val commonMain by getting {
|
||||
commonMain {
|
||||
dependencies {
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:$serialization_version")
|
||||
@ -37,53 +38,42 @@ kotlin {
|
||||
api("io.ktor:ktor-client-content-negotiation:$ktor_version")
|
||||
api("io.ktor:ktor-serialization-kotlinx-json:$ktor_version")
|
||||
|
||||
api("org.jetbrains.kotlinx:kotlinx-datetime:0.4.0")
|
||||
api("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1")
|
||||
}
|
||||
}
|
||||
|
||||
val commonTest by getting {
|
||||
commonTest {
|
||||
dependencies {
|
||||
implementation(kotlin("test"))
|
||||
implementation("io.ktor:ktor-client-mock:$ktor_version")
|
||||
}
|
||||
}
|
||||
|
||||
val jvmMain by getting {
|
||||
jvmMain {
|
||||
dependencies {
|
||||
implementation(kotlin("stdlib-jdk7"))
|
||||
implementation("io.ktor:ktor-client-cio-jvm:$ktor_version")
|
||||
}
|
||||
}
|
||||
|
||||
val jvmTest by getting {
|
||||
jvmTest {
|
||||
dependencies {
|
||||
implementation(kotlin("test-junit"))
|
||||
}
|
||||
}
|
||||
|
||||
val iosMain by getting {
|
||||
iosMain {
|
||||
dependencies {
|
||||
api("io.ktor:ktor-client-ios:$ktor_version")
|
||||
}
|
||||
}
|
||||
|
||||
val iosTest by getting
|
||||
|
||||
val iosSimulatorArm64Main by getting
|
||||
|
||||
val iosSimulatorArm64Test by getting
|
||||
|
||||
iosSimulatorArm64Main.dependsOn(iosMain)
|
||||
iosSimulatorArm64Test.dependsOn(iosTest)
|
||||
|
||||
val jsMain by getting {
|
||||
dependencies {
|
||||
api("io.ktor:ktor-client-js:$ktor_version")
|
||||
}
|
||||
}
|
||||
|
||||
val jsTest by getting
|
||||
|
||||
all {
|
||||
languageSettings.apply {
|
||||
optIn("kotlin.Experimental")
|
||||
|
@ -160,9 +160,8 @@ open class PetApi : ApiClient {
|
||||
).wrap<FindPetsByStatusResponse>().map { value }
|
||||
}
|
||||
|
||||
@Serializable
|
||||
@Serializable(FindPetsByStatusResponse.Companion::class)
|
||||
private class FindPetsByStatusResponse(val value: List<Pet>) {
|
||||
@Serializer(FindPetsByStatusResponse::class)
|
||||
companion object : KSerializer<FindPetsByStatusResponse> {
|
||||
private val serializer: KSerializer<List<Pet>> = serializer<List<Pet>>()
|
||||
override val descriptor = serializer.descriptor
|
||||
@ -204,9 +203,8 @@ open class PetApi : ApiClient {
|
||||
).wrap<FindPetsByTagsResponse>().map { value }
|
||||
}
|
||||
|
||||
@Serializable
|
||||
@Serializable(FindPetsByTagsResponse.Companion::class)
|
||||
private class FindPetsByTagsResponse(val value: List<Pet>) {
|
||||
@Serializer(FindPetsByTagsResponse::class)
|
||||
companion object : KSerializer<FindPetsByTagsResponse> {
|
||||
private val serializer: KSerializer<List<Pet>> = serializer<List<Pet>>()
|
||||
override val descriptor = serializer.descriptor
|
||||
|
@ -105,9 +105,8 @@ open class StoreApi : ApiClient {
|
||||
).wrap<GetInventoryResponse>().map { value }
|
||||
}
|
||||
|
||||
@Serializable
|
||||
@Serializable(GetInventoryResponse.Companion::class)
|
||||
private class GetInventoryResponse(val value: Map<kotlin.String, kotlin.Int>) {
|
||||
@Serializer(GetInventoryResponse::class)
|
||||
companion object : KSerializer<GetInventoryResponse> {
|
||||
private val serializer: KSerializer<Map<kotlin.String, kotlin.Int>> = serializer<Map<String, kotlin.Int>>()
|
||||
override val descriptor = serializer.descriptor
|
||||
|
@ -104,9 +104,8 @@ open class UserApi : ApiClient {
|
||||
).wrap()
|
||||
}
|
||||
|
||||
@Serializable
|
||||
@Serializable(CreateUsersWithArrayInputRequest.Companion::class)
|
||||
private class CreateUsersWithArrayInputRequest(val value: List<User>) {
|
||||
@Serializer(CreateUsersWithArrayInputRequest::class)
|
||||
companion object : KSerializer<CreateUsersWithArrayInputRequest> {
|
||||
private val serializer: KSerializer<List<User>> = serializer<List<User>>()
|
||||
override val descriptor = serializer.descriptor
|
||||
@ -145,9 +144,8 @@ open class UserApi : ApiClient {
|
||||
).wrap()
|
||||
}
|
||||
|
||||
@Serializable
|
||||
@Serializable(CreateUsersWithListInputRequest.Companion::class)
|
||||
private class CreateUsersWithListInputRequest(val value: List<User>) {
|
||||
@Serializer(CreateUsersWithListInputRequest::class)
|
||||
companion object : KSerializer<CreateUsersWithListInputRequest> {
|
||||
private val serializer: KSerializer<List<User>> = serializer<List<User>>()
|
||||
override val descriptor = serializer.descriptor
|
||||
|
@ -4,9 +4,8 @@ import kotlinx.serialization.*
|
||||
import kotlinx.serialization.descriptors.*
|
||||
import kotlinx.serialization.encoding.*
|
||||
|
||||
@Serializable
|
||||
@Serializable(Base64ByteArray.Companion::class)
|
||||
class Base64ByteArray(val value: ByteArray) {
|
||||
@Serializer(Base64ByteArray::class)
|
||||
companion object : KSerializer<Base64ByteArray> {
|
||||
override val descriptor = PrimitiveSerialDescriptor("Base64ByteArray", PrimitiveKind.STRING)
|
||||
override fun serialize(encoder: Encoder, obj: Base64ByteArray) = encoder.encodeString(obj.value.encodeBase64())
|
||||
|
@ -82,6 +82,7 @@ private fun ByteReadPacket.encodeBase64(): String = buildString {
|
||||
*
|
||||
* Taken from https://github.com/ktorio/ktor/blob/424d1d2cfaa3281302c60af9500f738c8c2fc846/ktor-utils/common/src/io/ktor/util/Base64.kt
|
||||
*/
|
||||
@Suppress("DEPRECATION")
|
||||
private fun ByteReadPacket.decodeBase64Bytes(): Input = buildPacket {
|
||||
val data = ByteArray(4)
|
||||
|
||||
|
@ -4,9 +4,8 @@ import kotlinx.serialization.*
|
||||
import kotlinx.serialization.descriptors.*
|
||||
import kotlinx.serialization.encoding.*
|
||||
|
||||
@Serializable
|
||||
@Serializable(OctetByteArray.Companion::class)
|
||||
class OctetByteArray(val value: ByteArray) {
|
||||
@Serializer(OctetByteArray::class)
|
||||
companion object : KSerializer<OctetByteArray> {
|
||||
override val descriptor = PrimitiveSerialDescriptor("OctetByteArray", PrimitiveKind.STRING)
|
||||
override fun serialize(encoder: Encoder, obj: OctetByteArray) = encoder.encodeString(hex(obj.value))
|
||||
|
@ -1,17 +1,17 @@
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform") version "1.7.21" // kotlin_version
|
||||
kotlin("plugin.serialization") version "1.7.21" // kotlin_version
|
||||
kotlin("multiplatform") version "1.9.20" // kotlin_version
|
||||
kotlin("plugin.serialization") version "1.9.20" // kotlin_version
|
||||
}
|
||||
|
||||
group = "org.openapitools"
|
||||
version = "1.0.0"
|
||||
|
||||
val kotlin_version = "1.7.21"
|
||||
val coroutines_version = "1.6.4"
|
||||
val serialization_version = "1.3.3"
|
||||
val ktor_version = "2.2.3"
|
||||
val kotlin_version = "1.9.20"
|
||||
val coroutines_version = "1.7.3"
|
||||
val serialization_version = "1.6.1"
|
||||
val ktor_version = "2.3.6"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@ -19,15 +19,16 @@ repositories {
|
||||
|
||||
kotlin {
|
||||
jvm()
|
||||
ios { binaries { framework { freeCompilerArgs += "-Xobjc-generics" } } }
|
||||
iosSimulatorArm64 { binaries { framework { freeCompilerArgs += "-Xobjc-generics" } } }
|
||||
iosX64()
|
||||
iosArm64()
|
||||
iosSimulatorArm64()
|
||||
js {
|
||||
browser()
|
||||
nodejs()
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
val commonMain by getting {
|
||||
commonMain {
|
||||
dependencies {
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:$serialization_version")
|
||||
@ -37,53 +38,42 @@ kotlin {
|
||||
api("io.ktor:ktor-client-content-negotiation:$ktor_version")
|
||||
api("io.ktor:ktor-serialization-kotlinx-json:$ktor_version")
|
||||
|
||||
api("org.jetbrains.kotlinx:kotlinx-datetime:0.4.0")
|
||||
api("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1")
|
||||
}
|
||||
}
|
||||
|
||||
val commonTest by getting {
|
||||
commonTest {
|
||||
dependencies {
|
||||
implementation(kotlin("test"))
|
||||
implementation("io.ktor:ktor-client-mock:$ktor_version")
|
||||
}
|
||||
}
|
||||
|
||||
val jvmMain by getting {
|
||||
jvmMain {
|
||||
dependencies {
|
||||
implementation(kotlin("stdlib-jdk7"))
|
||||
implementation("io.ktor:ktor-client-cio-jvm:$ktor_version")
|
||||
}
|
||||
}
|
||||
|
||||
val jvmTest by getting {
|
||||
jvmTest {
|
||||
dependencies {
|
||||
implementation(kotlin("test-junit"))
|
||||
}
|
||||
}
|
||||
|
||||
val iosMain by getting {
|
||||
iosMain {
|
||||
dependencies {
|
||||
api("io.ktor:ktor-client-ios:$ktor_version")
|
||||
}
|
||||
}
|
||||
|
||||
val iosTest by getting
|
||||
|
||||
val iosSimulatorArm64Main by getting
|
||||
|
||||
val iosSimulatorArm64Test by getting
|
||||
|
||||
iosSimulatorArm64Main.dependsOn(iosMain)
|
||||
iosSimulatorArm64Test.dependsOn(iosTest)
|
||||
|
||||
val jsMain by getting {
|
||||
dependencies {
|
||||
api("io.ktor:ktor-client-js:$ktor_version")
|
||||
}
|
||||
}
|
||||
|
||||
val jsTest by getting
|
||||
|
||||
all {
|
||||
languageSettings.apply {
|
||||
optIn("kotlin.Experimental")
|
||||
|
@ -160,9 +160,8 @@ open class PetApi : ApiClient {
|
||||
).wrap<FindPetsByStatusResponse>().map { value }
|
||||
}
|
||||
|
||||
@Serializable
|
||||
@Serializable(FindPetsByStatusResponse.Companion::class)
|
||||
private class FindPetsByStatusResponse(val value: List<Pet>) {
|
||||
@Serializer(FindPetsByStatusResponse::class)
|
||||
companion object : KSerializer<FindPetsByStatusResponse> {
|
||||
private val serializer: KSerializer<List<Pet>> = serializer<List<Pet>>()
|
||||
override val descriptor = serializer.descriptor
|
||||
@ -204,9 +203,8 @@ open class PetApi : ApiClient {
|
||||
).wrap<FindPetsByTagsResponse>().map { value }
|
||||
}
|
||||
|
||||
@Serializable
|
||||
@Serializable(FindPetsByTagsResponse.Companion::class)
|
||||
private class FindPetsByTagsResponse(val value: List<Pet>) {
|
||||
@Serializer(FindPetsByTagsResponse::class)
|
||||
companion object : KSerializer<FindPetsByTagsResponse> {
|
||||
private val serializer: KSerializer<List<Pet>> = serializer<List<Pet>>()
|
||||
override val descriptor = serializer.descriptor
|
||||
|
@ -105,9 +105,8 @@ open class StoreApi : ApiClient {
|
||||
).wrap<GetInventoryResponse>().map { value }
|
||||
}
|
||||
|
||||
@Serializable
|
||||
@Serializable(GetInventoryResponse.Companion::class)
|
||||
private class GetInventoryResponse(val value: Map<kotlin.String, kotlin.Int>) {
|
||||
@Serializer(GetInventoryResponse::class)
|
||||
companion object : KSerializer<GetInventoryResponse> {
|
||||
private val serializer: KSerializer<Map<kotlin.String, kotlin.Int>> = serializer<Map<String, kotlin.Int>>()
|
||||
override val descriptor = serializer.descriptor
|
||||
|
@ -104,9 +104,8 @@ open class UserApi : ApiClient {
|
||||
).wrap()
|
||||
}
|
||||
|
||||
@Serializable
|
||||
@Serializable(CreateUsersWithArrayInputRequest.Companion::class)
|
||||
private class CreateUsersWithArrayInputRequest(val value: List<User>) {
|
||||
@Serializer(CreateUsersWithArrayInputRequest::class)
|
||||
companion object : KSerializer<CreateUsersWithArrayInputRequest> {
|
||||
private val serializer: KSerializer<List<User>> = serializer<List<User>>()
|
||||
override val descriptor = serializer.descriptor
|
||||
@ -145,9 +144,8 @@ open class UserApi : ApiClient {
|
||||
).wrap()
|
||||
}
|
||||
|
||||
@Serializable
|
||||
@Serializable(CreateUsersWithListInputRequest.Companion::class)
|
||||
private class CreateUsersWithListInputRequest(val value: List<User>) {
|
||||
@Serializer(CreateUsersWithListInputRequest::class)
|
||||
companion object : KSerializer<CreateUsersWithListInputRequest> {
|
||||
private val serializer: KSerializer<List<User>> = serializer<List<User>>()
|
||||
override val descriptor = serializer.descriptor
|
||||
|
@ -4,9 +4,8 @@ import kotlinx.serialization.*
|
||||
import kotlinx.serialization.descriptors.*
|
||||
import kotlinx.serialization.encoding.*
|
||||
|
||||
@Serializable
|
||||
@Serializable(Base64ByteArray.Companion::class)
|
||||
class Base64ByteArray(val value: ByteArray) {
|
||||
@Serializer(Base64ByteArray::class)
|
||||
companion object : KSerializer<Base64ByteArray> {
|
||||
override val descriptor = PrimitiveSerialDescriptor("Base64ByteArray", PrimitiveKind.STRING)
|
||||
override fun serialize(encoder: Encoder, obj: Base64ByteArray) = encoder.encodeString(obj.value.encodeBase64())
|
||||
|
@ -82,6 +82,7 @@ private fun ByteReadPacket.encodeBase64(): String = buildString {
|
||||
*
|
||||
* Taken from https://github.com/ktorio/ktor/blob/424d1d2cfaa3281302c60af9500f738c8c2fc846/ktor-utils/common/src/io/ktor/util/Base64.kt
|
||||
*/
|
||||
@Suppress("DEPRECATION")
|
||||
private fun ByteReadPacket.decodeBase64Bytes(): Input = buildPacket {
|
||||
val data = ByteArray(4)
|
||||
|
||||
|
@ -4,9 +4,8 @@ import kotlinx.serialization.*
|
||||
import kotlinx.serialization.descriptors.*
|
||||
import kotlinx.serialization.encoding.*
|
||||
|
||||
@Serializable
|
||||
@Serializable(OctetByteArray.Companion::class)
|
||||
class OctetByteArray(val value: ByteArray) {
|
||||
@Serializer(OctetByteArray::class)
|
||||
companion object : KSerializer<OctetByteArray> {
|
||||
override val descriptor = PrimitiveSerialDescriptor("OctetByteArray", PrimitiveKind.STRING)
|
||||
override fun serialize(encoder: Encoder, obj: OctetByteArray) = encoder.encodeString(hex(obj.value))
|
||||
|
Loading…
x
Reference in New Issue
Block a user