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
|
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("multiplatform"){{^omitGradlePluginVersions}} version "1.7.21" // kotlin_version{{/omitGradlePluginVersions}}
|
kotlin("multiplatform"){{^omitGradlePluginVersions}} version "1.9.20" // kotlin_version{{/omitGradlePluginVersions}}
|
||||||
kotlin("plugin.serialization"){{^omitGradlePluginVersions}} version "1.7.21" // kotlin_version{{/omitGradlePluginVersions}}
|
kotlin("plugin.serialization"){{^omitGradlePluginVersions}} version "1.9.20" // kotlin_version{{/omitGradlePluginVersions}}
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "{{groupId}}"
|
group = "{{groupId}}"
|
||||||
version = "{{artifactVersion}}"
|
version = "{{artifactVersion}}"
|
||||||
|
|
||||||
val kotlin_version = "1.7.21"
|
val kotlin_version = "1.9.20"
|
||||||
val coroutines_version = "1.6.4"
|
val coroutines_version = "1.7.3"
|
||||||
val serialization_version = "1.3.3"
|
val serialization_version = "1.6.1"
|
||||||
val ktor_version = "2.2.3"
|
val ktor_version = "2.3.6"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
@ -19,15 +19,16 @@ repositories {
|
|||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
jvm()
|
jvm()
|
||||||
ios { binaries { framework { freeCompilerArgs += "-Xobjc-generics" } } }
|
iosX64()
|
||||||
iosSimulatorArm64 { binaries { framework { freeCompilerArgs += "-Xobjc-generics" } } }
|
iosArm64()
|
||||||
|
iosSimulatorArm64()
|
||||||
js {
|
js {
|
||||||
browser()
|
browser()
|
||||||
nodejs()
|
nodejs()
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
val commonMain by getting {
|
commonMain {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")
|
||||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:$serialization_version")
|
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:$serialization_version")
|
||||||
@ -38,54 +39,43 @@ kotlin {
|
|||||||
api("io.ktor:ktor-serialization-kotlinx-json:$ktor_version")
|
api("io.ktor:ktor-serialization-kotlinx-json:$ktor_version")
|
||||||
|
|
||||||
{{#kotlinx-datetime}}
|
{{#kotlinx-datetime}}
|
||||||
api("org.jetbrains.kotlinx:kotlinx-datetime:0.4.0")
|
api("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1")
|
||||||
{{/kotlinx-datetime}}
|
{{/kotlinx-datetime}}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val commonTest by getting {
|
commonTest {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(kotlin("test"))
|
implementation(kotlin("test"))
|
||||||
implementation("io.ktor:ktor-client-mock:$ktor_version")
|
implementation("io.ktor:ktor-client-mock:$ktor_version")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val jvmMain by getting {
|
jvmMain {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(kotlin("stdlib-jdk7"))
|
implementation(kotlin("stdlib-jdk7"))
|
||||||
implementation("io.ktor:ktor-client-cio-jvm:$ktor_version")
|
implementation("io.ktor:ktor-client-cio-jvm:$ktor_version")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val jvmTest by getting {
|
jvmTest {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(kotlin("test-junit"))
|
implementation(kotlin("test-junit"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val iosMain by getting {
|
iosMain {
|
||||||
dependencies {
|
dependencies {
|
||||||
api("io.ktor:ktor-client-ios:$ktor_version")
|
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 {
|
val jsMain by getting {
|
||||||
dependencies {
|
dependencies {
|
||||||
api("io.ktor:ktor-client-js:$ktor_version")
|
api("io.ktor:ktor-client-js:$ktor_version")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val jsTest by getting
|
|
||||||
|
|
||||||
all {
|
all {
|
||||||
languageSettings.apply {
|
languageSettings.apply {
|
||||||
optIn("kotlin.Experimental")
|
optIn("kotlin.Experimental")
|
||||||
|
@ -4,9 +4,8 @@ import kotlinx.serialization.*
|
|||||||
import kotlinx.serialization.descriptors.*
|
import kotlinx.serialization.descriptors.*
|
||||||
import kotlinx.serialization.encoding.*
|
import kotlinx.serialization.encoding.*
|
||||||
|
|
||||||
@Serializable
|
@Serializable(Base64ByteArray.Companion::class)
|
||||||
class Base64ByteArray(val value: ByteArray) {
|
class Base64ByteArray(val value: ByteArray) {
|
||||||
@Serializer(Base64ByteArray::class)
|
|
||||||
companion object : KSerializer<Base64ByteArray> {
|
companion object : KSerializer<Base64ByteArray> {
|
||||||
override val descriptor = PrimitiveSerialDescriptor("Base64ByteArray", PrimitiveKind.STRING)
|
override val descriptor = PrimitiveSerialDescriptor("Base64ByteArray", PrimitiveKind.STRING)
|
||||||
override fun serialize(encoder: Encoder, obj: Base64ByteArray) = encoder.encodeString(obj.value.encodeBase64())
|
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
|
* 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 {
|
private fun ByteReadPacket.decodeBase64Bytes(): Input = buildPacket {
|
||||||
val data = ByteArray(4)
|
val data = ByteArray(4)
|
||||||
|
|
||||||
|
@ -4,9 +4,8 @@ import kotlinx.serialization.*
|
|||||||
import kotlinx.serialization.descriptors.*
|
import kotlinx.serialization.descriptors.*
|
||||||
import kotlinx.serialization.encoding.*
|
import kotlinx.serialization.encoding.*
|
||||||
|
|
||||||
@Serializable
|
@Serializable(OctetByteArray.Companion::class)
|
||||||
class OctetByteArray(val value: ByteArray) {
|
class OctetByteArray(val value: ByteArray) {
|
||||||
@Serializer(OctetByteArray::class)
|
|
||||||
companion object : KSerializer<OctetByteArray> {
|
companion object : KSerializer<OctetByteArray> {
|
||||||
override val descriptor = PrimitiveSerialDescriptor("OctetByteArray", PrimitiveKind.STRING)
|
override val descriptor = PrimitiveSerialDescriptor("OctetByteArray", PrimitiveKind.STRING)
|
||||||
override fun serialize(encoder: Encoder, obj: OctetByteArray) = encoder.encodeString(hex(obj.value))
|
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}}>) {
|
private class {{operationIdCamelCase}}Request(val value: List<{{#bodyParam}}{{baseType}}{{/bodyParam}}>) {
|
||||||
@Serializer({{operationIdCamelCase}}Request::class)
|
|
||||||
{{#nonPublicApi}}internal {{/nonPublicApi}}companion object : KSerializer<{{operationIdCamelCase}}Request> {
|
{{#nonPublicApi}}internal {{/nonPublicApi}}companion object : KSerializer<{{operationIdCamelCase}}Request> {
|
||||||
private val serializer: KSerializer<List<{{#bodyParam}}{{baseType}}{{/bodyParam}}>> = serializer<List<{{#bodyParam}}{{baseType}}{{/bodyParam}}>>()
|
private val serializer: KSerializer<List<{{#bodyParam}}{{baseType}}{{/bodyParam}}>> = serializer<List<{{#bodyParam}}{{baseType}}{{/bodyParam}}>>()
|
||||||
override val descriptor = serializer.descriptor
|
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}}>) {
|
private class {{operationIdCamelCase}}Request(val value: Map<kotlin.String, {{#bodyParam}}{{baseType}}{{/bodyParam}}>) {
|
||||||
@Serializer({{operationIdCamelCase}}Request::class)
|
|
||||||
{{#nonPublicApi}}internal {{/nonPublicApi}}companion object : KSerializer<{{operationIdCamelCase}}Request> {
|
{{#nonPublicApi}}internal {{/nonPublicApi}}companion object : KSerializer<{{operationIdCamelCase}}Request> {
|
||||||
private val serializer: KSerializer<Map<kotlin.String, {{#bodyParam}}{{baseType}}{{/bodyParam}}>> = serializer<Map<String, {{#bodyParam}}{{baseType}}{{/bodyParam}}>>()
|
private val serializer: KSerializer<Map<kotlin.String, {{#bodyParam}}{{baseType}}{{/bodyParam}}>> = serializer<Map<String, {{#bodyParam}}{{baseType}}{{/bodyParam}}>>()
|
||||||
override val descriptor = serializer.descriptor
|
override val descriptor = serializer.descriptor
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
@Serializable
|
@Serializable({{operationIdCamelCase}}Response.Companion::class)
|
||||||
private class {{operationIdCamelCase}}Response(val value: List<{{returnBaseType}}>) {
|
private class {{operationIdCamelCase}}Response(val value: List<{{returnBaseType}}>) {
|
||||||
@Serializer({{operationIdCamelCase}}Response::class)
|
|
||||||
{{#nonPublicApi}}internal {{/nonPublicApi}}companion object : KSerializer<{{operationIdCamelCase}}Response> {
|
{{#nonPublicApi}}internal {{/nonPublicApi}}companion object : KSerializer<{{operationIdCamelCase}}Response> {
|
||||||
private val serializer: KSerializer<List<{{returnBaseType}}>> = serializer<List<{{returnBaseType}}>>()
|
private val serializer: KSerializer<List<{{returnBaseType}}>> = serializer<List<{{returnBaseType}}>>()
|
||||||
override val descriptor = serializer.descriptor
|
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}}>) {
|
private class {{operationIdCamelCase}}Response(val value: Map<kotlin.String, {{returnBaseType}}>) {
|
||||||
@Serializer({{operationIdCamelCase}}Response::class)
|
|
||||||
{{#nonPublicApi}}internal {{/nonPublicApi}}companion object : KSerializer<{{operationIdCamelCase}}Response> {
|
{{#nonPublicApi}}internal {{/nonPublicApi}}companion object : KSerializer<{{operationIdCamelCase}}Response> {
|
||||||
private val serializer: KSerializer<Map<kotlin.String, {{returnBaseType}}>> = serializer<Map<String, {{returnBaseType}}>>()
|
private val serializer: KSerializer<Map<kotlin.String, {{returnBaseType}}>> = serializer<Map<String, {{returnBaseType}}>>()
|
||||||
override val descriptor = serializer.descriptor
|
override val descriptor = serializer.descriptor
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
|
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("multiplatform") version "1.7.21" // kotlin_version
|
kotlin("multiplatform") version "1.9.20" // kotlin_version
|
||||||
kotlin("plugin.serialization") version "1.7.21" // kotlin_version
|
kotlin("plugin.serialization") version "1.9.20" // kotlin_version
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "org.openapitools"
|
group = "org.openapitools"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
|
|
||||||
val kotlin_version = "1.7.21"
|
val kotlin_version = "1.9.20"
|
||||||
val coroutines_version = "1.6.4"
|
val coroutines_version = "1.7.3"
|
||||||
val serialization_version = "1.3.3"
|
val serialization_version = "1.6.1"
|
||||||
val ktor_version = "2.2.3"
|
val ktor_version = "2.3.6"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
@ -19,15 +19,16 @@ repositories {
|
|||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
jvm()
|
jvm()
|
||||||
ios { binaries { framework { freeCompilerArgs += "-Xobjc-generics" } } }
|
iosX64()
|
||||||
iosSimulatorArm64 { binaries { framework { freeCompilerArgs += "-Xobjc-generics" } } }
|
iosArm64()
|
||||||
|
iosSimulatorArm64()
|
||||||
js {
|
js {
|
||||||
browser()
|
browser()
|
||||||
nodejs()
|
nodejs()
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
val commonMain by getting {
|
commonMain {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")
|
||||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:$serialization_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-client-content-negotiation:$ktor_version")
|
||||||
api("io.ktor:ktor-serialization-kotlinx-json:$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 {
|
dependencies {
|
||||||
implementation(kotlin("test"))
|
implementation(kotlin("test"))
|
||||||
implementation("io.ktor:ktor-client-mock:$ktor_version")
|
implementation("io.ktor:ktor-client-mock:$ktor_version")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val jvmMain by getting {
|
jvmMain {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(kotlin("stdlib-jdk7"))
|
implementation(kotlin("stdlib-jdk7"))
|
||||||
implementation("io.ktor:ktor-client-cio-jvm:$ktor_version")
|
implementation("io.ktor:ktor-client-cio-jvm:$ktor_version")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val jvmTest by getting {
|
jvmTest {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(kotlin("test-junit"))
|
implementation(kotlin("test-junit"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val iosMain by getting {
|
iosMain {
|
||||||
dependencies {
|
dependencies {
|
||||||
api("io.ktor:ktor-client-ios:$ktor_version")
|
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 {
|
val jsMain by getting {
|
||||||
dependencies {
|
dependencies {
|
||||||
api("io.ktor:ktor-client-js:$ktor_version")
|
api("io.ktor:ktor-client-js:$ktor_version")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val jsTest by getting
|
|
||||||
|
|
||||||
all {
|
all {
|
||||||
languageSettings.apply {
|
languageSettings.apply {
|
||||||
optIn("kotlin.Experimental")
|
optIn("kotlin.Experimental")
|
||||||
|
@ -4,9 +4,8 @@ import kotlinx.serialization.*
|
|||||||
import kotlinx.serialization.descriptors.*
|
import kotlinx.serialization.descriptors.*
|
||||||
import kotlinx.serialization.encoding.*
|
import kotlinx.serialization.encoding.*
|
||||||
|
|
||||||
@Serializable
|
@Serializable(Base64ByteArray.Companion::class)
|
||||||
class Base64ByteArray(val value: ByteArray) {
|
class Base64ByteArray(val value: ByteArray) {
|
||||||
@Serializer(Base64ByteArray::class)
|
|
||||||
companion object : KSerializer<Base64ByteArray> {
|
companion object : KSerializer<Base64ByteArray> {
|
||||||
override val descriptor = PrimitiveSerialDescriptor("Base64ByteArray", PrimitiveKind.STRING)
|
override val descriptor = PrimitiveSerialDescriptor("Base64ByteArray", PrimitiveKind.STRING)
|
||||||
override fun serialize(encoder: Encoder, obj: Base64ByteArray) = encoder.encodeString(obj.value.encodeBase64())
|
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
|
* 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 {
|
private fun ByteReadPacket.decodeBase64Bytes(): Input = buildPacket {
|
||||||
val data = ByteArray(4)
|
val data = ByteArray(4)
|
||||||
|
|
||||||
|
@ -4,9 +4,8 @@ import kotlinx.serialization.*
|
|||||||
import kotlinx.serialization.descriptors.*
|
import kotlinx.serialization.descriptors.*
|
||||||
import kotlinx.serialization.encoding.*
|
import kotlinx.serialization.encoding.*
|
||||||
|
|
||||||
@Serializable
|
@Serializable(OctetByteArray.Companion::class)
|
||||||
class OctetByteArray(val value: ByteArray) {
|
class OctetByteArray(val value: ByteArray) {
|
||||||
@Serializer(OctetByteArray::class)
|
|
||||||
companion object : KSerializer<OctetByteArray> {
|
companion object : KSerializer<OctetByteArray> {
|
||||||
override val descriptor = PrimitiveSerialDescriptor("OctetByteArray", PrimitiveKind.STRING)
|
override val descriptor = PrimitiveSerialDescriptor("OctetByteArray", PrimitiveKind.STRING)
|
||||||
override fun serialize(encoder: Encoder, obj: OctetByteArray) = encoder.encodeString(hex(obj.value))
|
override fun serialize(encoder: Encoder, obj: OctetByteArray) = encoder.encodeString(hex(obj.value))
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
|
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("multiplatform") version "1.7.21" // kotlin_version
|
kotlin("multiplatform") version "1.9.20" // kotlin_version
|
||||||
kotlin("plugin.serialization") version "1.7.21" // kotlin_version
|
kotlin("plugin.serialization") version "1.9.20" // kotlin_version
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "org.openapitools"
|
group = "org.openapitools"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
|
|
||||||
val kotlin_version = "1.7.21"
|
val kotlin_version = "1.9.20"
|
||||||
val coroutines_version = "1.6.4"
|
val coroutines_version = "1.7.3"
|
||||||
val serialization_version = "1.3.3"
|
val serialization_version = "1.6.1"
|
||||||
val ktor_version = "2.2.3"
|
val ktor_version = "2.3.6"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
@ -19,15 +19,16 @@ repositories {
|
|||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
jvm()
|
jvm()
|
||||||
ios { binaries { framework { freeCompilerArgs += "-Xobjc-generics" } } }
|
iosX64()
|
||||||
iosSimulatorArm64 { binaries { framework { freeCompilerArgs += "-Xobjc-generics" } } }
|
iosArm64()
|
||||||
|
iosSimulatorArm64()
|
||||||
js {
|
js {
|
||||||
browser()
|
browser()
|
||||||
nodejs()
|
nodejs()
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
val commonMain by getting {
|
commonMain {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")
|
||||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:$serialization_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-client-content-negotiation:$ktor_version")
|
||||||
api("io.ktor:ktor-serialization-kotlinx-json:$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 {
|
dependencies {
|
||||||
implementation(kotlin("test"))
|
implementation(kotlin("test"))
|
||||||
implementation("io.ktor:ktor-client-mock:$ktor_version")
|
implementation("io.ktor:ktor-client-mock:$ktor_version")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val jvmMain by getting {
|
jvmMain {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(kotlin("stdlib-jdk7"))
|
implementation(kotlin("stdlib-jdk7"))
|
||||||
implementation("io.ktor:ktor-client-cio-jvm:$ktor_version")
|
implementation("io.ktor:ktor-client-cio-jvm:$ktor_version")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val jvmTest by getting {
|
jvmTest {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(kotlin("test-junit"))
|
implementation(kotlin("test-junit"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val iosMain by getting {
|
iosMain {
|
||||||
dependencies {
|
dependencies {
|
||||||
api("io.ktor:ktor-client-ios:$ktor_version")
|
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 {
|
val jsMain by getting {
|
||||||
dependencies {
|
dependencies {
|
||||||
api("io.ktor:ktor-client-js:$ktor_version")
|
api("io.ktor:ktor-client-js:$ktor_version")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val jsTest by getting
|
|
||||||
|
|
||||||
all {
|
all {
|
||||||
languageSettings.apply {
|
languageSettings.apply {
|
||||||
optIn("kotlin.Experimental")
|
optIn("kotlin.Experimental")
|
||||||
|
@ -4,9 +4,8 @@ import kotlinx.serialization.*
|
|||||||
import kotlinx.serialization.descriptors.*
|
import kotlinx.serialization.descriptors.*
|
||||||
import kotlinx.serialization.encoding.*
|
import kotlinx.serialization.encoding.*
|
||||||
|
|
||||||
@Serializable
|
@Serializable(Base64ByteArray.Companion::class)
|
||||||
class Base64ByteArray(val value: ByteArray) {
|
class Base64ByteArray(val value: ByteArray) {
|
||||||
@Serializer(Base64ByteArray::class)
|
|
||||||
companion object : KSerializer<Base64ByteArray> {
|
companion object : KSerializer<Base64ByteArray> {
|
||||||
override val descriptor = PrimitiveSerialDescriptor("Base64ByteArray", PrimitiveKind.STRING)
|
override val descriptor = PrimitiveSerialDescriptor("Base64ByteArray", PrimitiveKind.STRING)
|
||||||
override fun serialize(encoder: Encoder, obj: Base64ByteArray) = encoder.encodeString(obj.value.encodeBase64())
|
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
|
* 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 {
|
private fun ByteReadPacket.decodeBase64Bytes(): Input = buildPacket {
|
||||||
val data = ByteArray(4)
|
val data = ByteArray(4)
|
||||||
|
|
||||||
|
@ -4,9 +4,8 @@ import kotlinx.serialization.*
|
|||||||
import kotlinx.serialization.descriptors.*
|
import kotlinx.serialization.descriptors.*
|
||||||
import kotlinx.serialization.encoding.*
|
import kotlinx.serialization.encoding.*
|
||||||
|
|
||||||
@Serializable
|
@Serializable(OctetByteArray.Companion::class)
|
||||||
class OctetByteArray(val value: ByteArray) {
|
class OctetByteArray(val value: ByteArray) {
|
||||||
@Serializer(OctetByteArray::class)
|
|
||||||
companion object : KSerializer<OctetByteArray> {
|
companion object : KSerializer<OctetByteArray> {
|
||||||
override val descriptor = PrimitiveSerialDescriptor("OctetByteArray", PrimitiveKind.STRING)
|
override val descriptor = PrimitiveSerialDescriptor("OctetByteArray", PrimitiveKind.STRING)
|
||||||
override fun serialize(encoder: Encoder, obj: OctetByteArray) = encoder.encodeString(hex(obj.value))
|
override fun serialize(encoder: Encoder, obj: OctetByteArray) = encoder.encodeString(hex(obj.value))
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
|
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("multiplatform") version "1.7.21" // kotlin_version
|
kotlin("multiplatform") version "1.9.20" // kotlin_version
|
||||||
kotlin("plugin.serialization") version "1.7.21" // kotlin_version
|
kotlin("plugin.serialization") version "1.9.20" // kotlin_version
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "org.openapitools"
|
group = "org.openapitools"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
|
|
||||||
val kotlin_version = "1.7.21"
|
val kotlin_version = "1.9.20"
|
||||||
val coroutines_version = "1.6.4"
|
val coroutines_version = "1.7.3"
|
||||||
val serialization_version = "1.3.3"
|
val serialization_version = "1.6.1"
|
||||||
val ktor_version = "2.2.3"
|
val ktor_version = "2.3.6"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
@ -19,15 +19,16 @@ repositories {
|
|||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
jvm()
|
jvm()
|
||||||
ios { binaries { framework { freeCompilerArgs += "-Xobjc-generics" } } }
|
iosX64()
|
||||||
iosSimulatorArm64 { binaries { framework { freeCompilerArgs += "-Xobjc-generics" } } }
|
iosArm64()
|
||||||
|
iosSimulatorArm64()
|
||||||
js {
|
js {
|
||||||
browser()
|
browser()
|
||||||
nodejs()
|
nodejs()
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
val commonMain by getting {
|
commonMain {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")
|
||||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:$serialization_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-client-content-negotiation:$ktor_version")
|
||||||
api("io.ktor:ktor-serialization-kotlinx-json:$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 {
|
dependencies {
|
||||||
implementation(kotlin("test"))
|
implementation(kotlin("test"))
|
||||||
implementation("io.ktor:ktor-client-mock:$ktor_version")
|
implementation("io.ktor:ktor-client-mock:$ktor_version")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val jvmMain by getting {
|
jvmMain {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(kotlin("stdlib-jdk7"))
|
implementation(kotlin("stdlib-jdk7"))
|
||||||
implementation("io.ktor:ktor-client-cio-jvm:$ktor_version")
|
implementation("io.ktor:ktor-client-cio-jvm:$ktor_version")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val jvmTest by getting {
|
jvmTest {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(kotlin("test-junit"))
|
implementation(kotlin("test-junit"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val iosMain by getting {
|
iosMain {
|
||||||
dependencies {
|
dependencies {
|
||||||
api("io.ktor:ktor-client-ios:$ktor_version")
|
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 {
|
val jsMain by getting {
|
||||||
dependencies {
|
dependencies {
|
||||||
api("io.ktor:ktor-client-js:$ktor_version")
|
api("io.ktor:ktor-client-js:$ktor_version")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val jsTest by getting
|
|
||||||
|
|
||||||
all {
|
all {
|
||||||
languageSettings.apply {
|
languageSettings.apply {
|
||||||
optIn("kotlin.Experimental")
|
optIn("kotlin.Experimental")
|
||||||
|
@ -4,9 +4,8 @@ import kotlinx.serialization.*
|
|||||||
import kotlinx.serialization.descriptors.*
|
import kotlinx.serialization.descriptors.*
|
||||||
import kotlinx.serialization.encoding.*
|
import kotlinx.serialization.encoding.*
|
||||||
|
|
||||||
@Serializable
|
@Serializable(Base64ByteArray.Companion::class)
|
||||||
class Base64ByteArray(val value: ByteArray) {
|
class Base64ByteArray(val value: ByteArray) {
|
||||||
@Serializer(Base64ByteArray::class)
|
|
||||||
companion object : KSerializer<Base64ByteArray> {
|
companion object : KSerializer<Base64ByteArray> {
|
||||||
override val descriptor = PrimitiveSerialDescriptor("Base64ByteArray", PrimitiveKind.STRING)
|
override val descriptor = PrimitiveSerialDescriptor("Base64ByteArray", PrimitiveKind.STRING)
|
||||||
override fun serialize(encoder: Encoder, obj: Base64ByteArray) = encoder.encodeString(obj.value.encodeBase64())
|
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
|
* 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 {
|
private fun ByteReadPacket.decodeBase64Bytes(): Input = buildPacket {
|
||||||
val data = ByteArray(4)
|
val data = ByteArray(4)
|
||||||
|
|
||||||
|
@ -4,9 +4,8 @@ import kotlinx.serialization.*
|
|||||||
import kotlinx.serialization.descriptors.*
|
import kotlinx.serialization.descriptors.*
|
||||||
import kotlinx.serialization.encoding.*
|
import kotlinx.serialization.encoding.*
|
||||||
|
|
||||||
@Serializable
|
@Serializable(OctetByteArray.Companion::class)
|
||||||
class OctetByteArray(val value: ByteArray) {
|
class OctetByteArray(val value: ByteArray) {
|
||||||
@Serializer(OctetByteArray::class)
|
|
||||||
companion object : KSerializer<OctetByteArray> {
|
companion object : KSerializer<OctetByteArray> {
|
||||||
override val descriptor = PrimitiveSerialDescriptor("OctetByteArray", PrimitiveKind.STRING)
|
override val descriptor = PrimitiveSerialDescriptor("OctetByteArray", PrimitiveKind.STRING)
|
||||||
override fun serialize(encoder: Encoder, obj: OctetByteArray) = encoder.encodeString(hex(obj.value))
|
override fun serialize(encoder: Encoder, obj: OctetByteArray) = encoder.encodeString(hex(obj.value))
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
|
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("multiplatform") version "1.7.21" // kotlin_version
|
kotlin("multiplatform") version "1.9.20" // kotlin_version
|
||||||
kotlin("plugin.serialization") version "1.7.21" // kotlin_version
|
kotlin("plugin.serialization") version "1.9.20" // kotlin_version
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "org.openapitools"
|
group = "org.openapitools"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
|
|
||||||
val kotlin_version = "1.7.21"
|
val kotlin_version = "1.9.20"
|
||||||
val coroutines_version = "1.6.4"
|
val coroutines_version = "1.7.3"
|
||||||
val serialization_version = "1.3.3"
|
val serialization_version = "1.6.1"
|
||||||
val ktor_version = "2.2.3"
|
val ktor_version = "2.3.6"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
@ -19,15 +19,16 @@ repositories {
|
|||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
jvm()
|
jvm()
|
||||||
ios { binaries { framework { freeCompilerArgs += "-Xobjc-generics" } } }
|
iosX64()
|
||||||
iosSimulatorArm64 { binaries { framework { freeCompilerArgs += "-Xobjc-generics" } } }
|
iosArm64()
|
||||||
|
iosSimulatorArm64()
|
||||||
js {
|
js {
|
||||||
browser()
|
browser()
|
||||||
nodejs()
|
nodejs()
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
val commonMain by getting {
|
commonMain {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")
|
||||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:$serialization_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-client-content-negotiation:$ktor_version")
|
||||||
api("io.ktor:ktor-serialization-kotlinx-json:$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 {
|
dependencies {
|
||||||
implementation(kotlin("test"))
|
implementation(kotlin("test"))
|
||||||
implementation("io.ktor:ktor-client-mock:$ktor_version")
|
implementation("io.ktor:ktor-client-mock:$ktor_version")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val jvmMain by getting {
|
jvmMain {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(kotlin("stdlib-jdk7"))
|
implementation(kotlin("stdlib-jdk7"))
|
||||||
implementation("io.ktor:ktor-client-cio-jvm:$ktor_version")
|
implementation("io.ktor:ktor-client-cio-jvm:$ktor_version")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val jvmTest by getting {
|
jvmTest {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(kotlin("test-junit"))
|
implementation(kotlin("test-junit"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val iosMain by getting {
|
iosMain {
|
||||||
dependencies {
|
dependencies {
|
||||||
api("io.ktor:ktor-client-ios:$ktor_version")
|
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 {
|
val jsMain by getting {
|
||||||
dependencies {
|
dependencies {
|
||||||
api("io.ktor:ktor-client-js:$ktor_version")
|
api("io.ktor:ktor-client-js:$ktor_version")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val jsTest by getting
|
|
||||||
|
|
||||||
all {
|
all {
|
||||||
languageSettings.apply {
|
languageSettings.apply {
|
||||||
optIn("kotlin.Experimental")
|
optIn("kotlin.Experimental")
|
||||||
|
@ -160,9 +160,8 @@ open class PetApi : ApiClient {
|
|||||||
).wrap<FindPetsByStatusResponse>().map { value }
|
).wrap<FindPetsByStatusResponse>().map { value }
|
||||||
}
|
}
|
||||||
|
|
||||||
@Serializable
|
@Serializable(FindPetsByStatusResponse.Companion::class)
|
||||||
private class FindPetsByStatusResponse(val value: List<Pet>) {
|
private class FindPetsByStatusResponse(val value: List<Pet>) {
|
||||||
@Serializer(FindPetsByStatusResponse::class)
|
|
||||||
companion object : KSerializer<FindPetsByStatusResponse> {
|
companion object : KSerializer<FindPetsByStatusResponse> {
|
||||||
private val serializer: KSerializer<List<Pet>> = serializer<List<Pet>>()
|
private val serializer: KSerializer<List<Pet>> = serializer<List<Pet>>()
|
||||||
override val descriptor = serializer.descriptor
|
override val descriptor = serializer.descriptor
|
||||||
@ -204,9 +203,8 @@ open class PetApi : ApiClient {
|
|||||||
).wrap<FindPetsByTagsResponse>().map { value }
|
).wrap<FindPetsByTagsResponse>().map { value }
|
||||||
}
|
}
|
||||||
|
|
||||||
@Serializable
|
@Serializable(FindPetsByTagsResponse.Companion::class)
|
||||||
private class FindPetsByTagsResponse(val value: List<Pet>) {
|
private class FindPetsByTagsResponse(val value: List<Pet>) {
|
||||||
@Serializer(FindPetsByTagsResponse::class)
|
|
||||||
companion object : KSerializer<FindPetsByTagsResponse> {
|
companion object : KSerializer<FindPetsByTagsResponse> {
|
||||||
private val serializer: KSerializer<List<Pet>> = serializer<List<Pet>>()
|
private val serializer: KSerializer<List<Pet>> = serializer<List<Pet>>()
|
||||||
override val descriptor = serializer.descriptor
|
override val descriptor = serializer.descriptor
|
||||||
|
@ -105,9 +105,8 @@ open class StoreApi : ApiClient {
|
|||||||
).wrap<GetInventoryResponse>().map { value }
|
).wrap<GetInventoryResponse>().map { value }
|
||||||
}
|
}
|
||||||
|
|
||||||
@Serializable
|
@Serializable(GetInventoryResponse.Companion::class)
|
||||||
private class GetInventoryResponse(val value: Map<kotlin.String, kotlin.Int>) {
|
private class GetInventoryResponse(val value: Map<kotlin.String, kotlin.Int>) {
|
||||||
@Serializer(GetInventoryResponse::class)
|
|
||||||
companion object : KSerializer<GetInventoryResponse> {
|
companion object : KSerializer<GetInventoryResponse> {
|
||||||
private val serializer: KSerializer<Map<kotlin.String, kotlin.Int>> = serializer<Map<String, kotlin.Int>>()
|
private val serializer: KSerializer<Map<kotlin.String, kotlin.Int>> = serializer<Map<String, kotlin.Int>>()
|
||||||
override val descriptor = serializer.descriptor
|
override val descriptor = serializer.descriptor
|
||||||
|
@ -104,9 +104,8 @@ open class UserApi : ApiClient {
|
|||||||
).wrap()
|
).wrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Serializable
|
@Serializable(CreateUsersWithArrayInputRequest.Companion::class)
|
||||||
private class CreateUsersWithArrayInputRequest(val value: List<User>) {
|
private class CreateUsersWithArrayInputRequest(val value: List<User>) {
|
||||||
@Serializer(CreateUsersWithArrayInputRequest::class)
|
|
||||||
companion object : KSerializer<CreateUsersWithArrayInputRequest> {
|
companion object : KSerializer<CreateUsersWithArrayInputRequest> {
|
||||||
private val serializer: KSerializer<List<User>> = serializer<List<User>>()
|
private val serializer: KSerializer<List<User>> = serializer<List<User>>()
|
||||||
override val descriptor = serializer.descriptor
|
override val descriptor = serializer.descriptor
|
||||||
@ -145,9 +144,8 @@ open class UserApi : ApiClient {
|
|||||||
).wrap()
|
).wrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Serializable
|
@Serializable(CreateUsersWithListInputRequest.Companion::class)
|
||||||
private class CreateUsersWithListInputRequest(val value: List<User>) {
|
private class CreateUsersWithListInputRequest(val value: List<User>) {
|
||||||
@Serializer(CreateUsersWithListInputRequest::class)
|
|
||||||
companion object : KSerializer<CreateUsersWithListInputRequest> {
|
companion object : KSerializer<CreateUsersWithListInputRequest> {
|
||||||
private val serializer: KSerializer<List<User>> = serializer<List<User>>()
|
private val serializer: KSerializer<List<User>> = serializer<List<User>>()
|
||||||
override val descriptor = serializer.descriptor
|
override val descriptor = serializer.descriptor
|
||||||
|
@ -4,9 +4,8 @@ import kotlinx.serialization.*
|
|||||||
import kotlinx.serialization.descriptors.*
|
import kotlinx.serialization.descriptors.*
|
||||||
import kotlinx.serialization.encoding.*
|
import kotlinx.serialization.encoding.*
|
||||||
|
|
||||||
@Serializable
|
@Serializable(Base64ByteArray.Companion::class)
|
||||||
class Base64ByteArray(val value: ByteArray) {
|
class Base64ByteArray(val value: ByteArray) {
|
||||||
@Serializer(Base64ByteArray::class)
|
|
||||||
companion object : KSerializer<Base64ByteArray> {
|
companion object : KSerializer<Base64ByteArray> {
|
||||||
override val descriptor = PrimitiveSerialDescriptor("Base64ByteArray", PrimitiveKind.STRING)
|
override val descriptor = PrimitiveSerialDescriptor("Base64ByteArray", PrimitiveKind.STRING)
|
||||||
override fun serialize(encoder: Encoder, obj: Base64ByteArray) = encoder.encodeString(obj.value.encodeBase64())
|
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
|
* 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 {
|
private fun ByteReadPacket.decodeBase64Bytes(): Input = buildPacket {
|
||||||
val data = ByteArray(4)
|
val data = ByteArray(4)
|
||||||
|
|
||||||
|
@ -4,9 +4,8 @@ import kotlinx.serialization.*
|
|||||||
import kotlinx.serialization.descriptors.*
|
import kotlinx.serialization.descriptors.*
|
||||||
import kotlinx.serialization.encoding.*
|
import kotlinx.serialization.encoding.*
|
||||||
|
|
||||||
@Serializable
|
@Serializable(OctetByteArray.Companion::class)
|
||||||
class OctetByteArray(val value: ByteArray) {
|
class OctetByteArray(val value: ByteArray) {
|
||||||
@Serializer(OctetByteArray::class)
|
|
||||||
companion object : KSerializer<OctetByteArray> {
|
companion object : KSerializer<OctetByteArray> {
|
||||||
override val descriptor = PrimitiveSerialDescriptor("OctetByteArray", PrimitiveKind.STRING)
|
override val descriptor = PrimitiveSerialDescriptor("OctetByteArray", PrimitiveKind.STRING)
|
||||||
override fun serialize(encoder: Encoder, obj: OctetByteArray) = encoder.encodeString(hex(obj.value))
|
override fun serialize(encoder: Encoder, obj: OctetByteArray) = encoder.encodeString(hex(obj.value))
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
|
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
kotlin("multiplatform") version "1.7.21" // kotlin_version
|
kotlin("multiplatform") version "1.9.20" // kotlin_version
|
||||||
kotlin("plugin.serialization") version "1.7.21" // kotlin_version
|
kotlin("plugin.serialization") version "1.9.20" // kotlin_version
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "org.openapitools"
|
group = "org.openapitools"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
|
|
||||||
val kotlin_version = "1.7.21"
|
val kotlin_version = "1.9.20"
|
||||||
val coroutines_version = "1.6.4"
|
val coroutines_version = "1.7.3"
|
||||||
val serialization_version = "1.3.3"
|
val serialization_version = "1.6.1"
|
||||||
val ktor_version = "2.2.3"
|
val ktor_version = "2.3.6"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
@ -19,15 +19,16 @@ repositories {
|
|||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
jvm()
|
jvm()
|
||||||
ios { binaries { framework { freeCompilerArgs += "-Xobjc-generics" } } }
|
iosX64()
|
||||||
iosSimulatorArm64 { binaries { framework { freeCompilerArgs += "-Xobjc-generics" } } }
|
iosArm64()
|
||||||
|
iosSimulatorArm64()
|
||||||
js {
|
js {
|
||||||
browser()
|
browser()
|
||||||
nodejs()
|
nodejs()
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
val commonMain by getting {
|
commonMain {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")
|
||||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:$serialization_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-client-content-negotiation:$ktor_version")
|
||||||
api("io.ktor:ktor-serialization-kotlinx-json:$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 {
|
dependencies {
|
||||||
implementation(kotlin("test"))
|
implementation(kotlin("test"))
|
||||||
implementation("io.ktor:ktor-client-mock:$ktor_version")
|
implementation("io.ktor:ktor-client-mock:$ktor_version")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val jvmMain by getting {
|
jvmMain {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(kotlin("stdlib-jdk7"))
|
implementation(kotlin("stdlib-jdk7"))
|
||||||
implementation("io.ktor:ktor-client-cio-jvm:$ktor_version")
|
implementation("io.ktor:ktor-client-cio-jvm:$ktor_version")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val jvmTest by getting {
|
jvmTest {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(kotlin("test-junit"))
|
implementation(kotlin("test-junit"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val iosMain by getting {
|
iosMain {
|
||||||
dependencies {
|
dependencies {
|
||||||
api("io.ktor:ktor-client-ios:$ktor_version")
|
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 {
|
val jsMain by getting {
|
||||||
dependencies {
|
dependencies {
|
||||||
api("io.ktor:ktor-client-js:$ktor_version")
|
api("io.ktor:ktor-client-js:$ktor_version")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val jsTest by getting
|
|
||||||
|
|
||||||
all {
|
all {
|
||||||
languageSettings.apply {
|
languageSettings.apply {
|
||||||
optIn("kotlin.Experimental")
|
optIn("kotlin.Experimental")
|
||||||
|
@ -160,9 +160,8 @@ open class PetApi : ApiClient {
|
|||||||
).wrap<FindPetsByStatusResponse>().map { value }
|
).wrap<FindPetsByStatusResponse>().map { value }
|
||||||
}
|
}
|
||||||
|
|
||||||
@Serializable
|
@Serializable(FindPetsByStatusResponse.Companion::class)
|
||||||
private class FindPetsByStatusResponse(val value: List<Pet>) {
|
private class FindPetsByStatusResponse(val value: List<Pet>) {
|
||||||
@Serializer(FindPetsByStatusResponse::class)
|
|
||||||
companion object : KSerializer<FindPetsByStatusResponse> {
|
companion object : KSerializer<FindPetsByStatusResponse> {
|
||||||
private val serializer: KSerializer<List<Pet>> = serializer<List<Pet>>()
|
private val serializer: KSerializer<List<Pet>> = serializer<List<Pet>>()
|
||||||
override val descriptor = serializer.descriptor
|
override val descriptor = serializer.descriptor
|
||||||
@ -204,9 +203,8 @@ open class PetApi : ApiClient {
|
|||||||
).wrap<FindPetsByTagsResponse>().map { value }
|
).wrap<FindPetsByTagsResponse>().map { value }
|
||||||
}
|
}
|
||||||
|
|
||||||
@Serializable
|
@Serializable(FindPetsByTagsResponse.Companion::class)
|
||||||
private class FindPetsByTagsResponse(val value: List<Pet>) {
|
private class FindPetsByTagsResponse(val value: List<Pet>) {
|
||||||
@Serializer(FindPetsByTagsResponse::class)
|
|
||||||
companion object : KSerializer<FindPetsByTagsResponse> {
|
companion object : KSerializer<FindPetsByTagsResponse> {
|
||||||
private val serializer: KSerializer<List<Pet>> = serializer<List<Pet>>()
|
private val serializer: KSerializer<List<Pet>> = serializer<List<Pet>>()
|
||||||
override val descriptor = serializer.descriptor
|
override val descriptor = serializer.descriptor
|
||||||
|
@ -105,9 +105,8 @@ open class StoreApi : ApiClient {
|
|||||||
).wrap<GetInventoryResponse>().map { value }
|
).wrap<GetInventoryResponse>().map { value }
|
||||||
}
|
}
|
||||||
|
|
||||||
@Serializable
|
@Serializable(GetInventoryResponse.Companion::class)
|
||||||
private class GetInventoryResponse(val value: Map<kotlin.String, kotlin.Int>) {
|
private class GetInventoryResponse(val value: Map<kotlin.String, kotlin.Int>) {
|
||||||
@Serializer(GetInventoryResponse::class)
|
|
||||||
companion object : KSerializer<GetInventoryResponse> {
|
companion object : KSerializer<GetInventoryResponse> {
|
||||||
private val serializer: KSerializer<Map<kotlin.String, kotlin.Int>> = serializer<Map<String, kotlin.Int>>()
|
private val serializer: KSerializer<Map<kotlin.String, kotlin.Int>> = serializer<Map<String, kotlin.Int>>()
|
||||||
override val descriptor = serializer.descriptor
|
override val descriptor = serializer.descriptor
|
||||||
|
@ -104,9 +104,8 @@ open class UserApi : ApiClient {
|
|||||||
).wrap()
|
).wrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Serializable
|
@Serializable(CreateUsersWithArrayInputRequest.Companion::class)
|
||||||
private class CreateUsersWithArrayInputRequest(val value: List<User>) {
|
private class CreateUsersWithArrayInputRequest(val value: List<User>) {
|
||||||
@Serializer(CreateUsersWithArrayInputRequest::class)
|
|
||||||
companion object : KSerializer<CreateUsersWithArrayInputRequest> {
|
companion object : KSerializer<CreateUsersWithArrayInputRequest> {
|
||||||
private val serializer: KSerializer<List<User>> = serializer<List<User>>()
|
private val serializer: KSerializer<List<User>> = serializer<List<User>>()
|
||||||
override val descriptor = serializer.descriptor
|
override val descriptor = serializer.descriptor
|
||||||
@ -145,9 +144,8 @@ open class UserApi : ApiClient {
|
|||||||
).wrap()
|
).wrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Serializable
|
@Serializable(CreateUsersWithListInputRequest.Companion::class)
|
||||||
private class CreateUsersWithListInputRequest(val value: List<User>) {
|
private class CreateUsersWithListInputRequest(val value: List<User>) {
|
||||||
@Serializer(CreateUsersWithListInputRequest::class)
|
|
||||||
companion object : KSerializer<CreateUsersWithListInputRequest> {
|
companion object : KSerializer<CreateUsersWithListInputRequest> {
|
||||||
private val serializer: KSerializer<List<User>> = serializer<List<User>>()
|
private val serializer: KSerializer<List<User>> = serializer<List<User>>()
|
||||||
override val descriptor = serializer.descriptor
|
override val descriptor = serializer.descriptor
|
||||||
|
@ -4,9 +4,8 @@ import kotlinx.serialization.*
|
|||||||
import kotlinx.serialization.descriptors.*
|
import kotlinx.serialization.descriptors.*
|
||||||
import kotlinx.serialization.encoding.*
|
import kotlinx.serialization.encoding.*
|
||||||
|
|
||||||
@Serializable
|
@Serializable(Base64ByteArray.Companion::class)
|
||||||
class Base64ByteArray(val value: ByteArray) {
|
class Base64ByteArray(val value: ByteArray) {
|
||||||
@Serializer(Base64ByteArray::class)
|
|
||||||
companion object : KSerializer<Base64ByteArray> {
|
companion object : KSerializer<Base64ByteArray> {
|
||||||
override val descriptor = PrimitiveSerialDescriptor("Base64ByteArray", PrimitiveKind.STRING)
|
override val descriptor = PrimitiveSerialDescriptor("Base64ByteArray", PrimitiveKind.STRING)
|
||||||
override fun serialize(encoder: Encoder, obj: Base64ByteArray) = encoder.encodeString(obj.value.encodeBase64())
|
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
|
* 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 {
|
private fun ByteReadPacket.decodeBase64Bytes(): Input = buildPacket {
|
||||||
val data = ByteArray(4)
|
val data = ByteArray(4)
|
||||||
|
|
||||||
|
@ -4,9 +4,8 @@ import kotlinx.serialization.*
|
|||||||
import kotlinx.serialization.descriptors.*
|
import kotlinx.serialization.descriptors.*
|
||||||
import kotlinx.serialization.encoding.*
|
import kotlinx.serialization.encoding.*
|
||||||
|
|
||||||
@Serializable
|
@Serializable(OctetByteArray.Companion::class)
|
||||||
class OctetByteArray(val value: ByteArray) {
|
class OctetByteArray(val value: ByteArray) {
|
||||||
@Serializer(OctetByteArray::class)
|
|
||||||
companion object : KSerializer<OctetByteArray> {
|
companion object : KSerializer<OctetByteArray> {
|
||||||
override val descriptor = PrimitiveSerialDescriptor("OctetByteArray", PrimitiveKind.STRING)
|
override val descriptor = PrimitiveSerialDescriptor("OctetByteArray", PrimitiveKind.STRING)
|
||||||
override fun serialize(encoder: Encoder, obj: OctetByteArray) = encoder.encodeString(hex(obj.value))
|
override fun serialize(encoder: Encoder, obj: OctetByteArray) = encoder.encodeString(hex(obj.value))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user