diff --git a/.github/workflows/samples-kotlin-client.yaml b/.github/workflows/samples-kotlin-client.yaml
index 9689c0d02b6d..c83dac3cfd25 100644
--- a/.github/workflows/samples-kotlin-client.yaml
+++ b/.github/workflows/samples-kotlin-client.yaml
@@ -20,6 +20,7 @@ jobs:
sample:
# client
- samples/client/petstore/kotlin
+ - samples/client/petstore/kotlin-explicit
- samples/client/petstore/kotlin-gson
- samples/client/petstore/kotlin-jackson
- samples/client/petstore/kotlin-model-prefix-type-mappings
diff --git a/bin/configs/kotlin-explicit.yaml b/bin/configs/kotlin-explicit.yaml
new file mode 100644
index 000000000000..26e0259de95d
--- /dev/null
+++ b/bin/configs/kotlin-explicit.yaml
@@ -0,0 +1,7 @@
+generatorName: kotlin
+outputDir: samples/client/petstore/kotlin-explicit
+inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
+templateDir: modules/openapi-generator/src/main/resources/kotlin-client
+additionalProperties:
+ artifactId: kotlin-petstore-explicit
+ explicitApi: "true"
diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md
index 7dbee25f2f7e..1499bfe2cfcf 100644
--- a/docs/generators/kotlin.md
+++ b/docs/generators/kotlin.md
@@ -25,6 +25,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|collectionType|Option. Collection type to use|
- **array**
- kotlin.Array
- **list**
- kotlin.collections.List
|list|
|dateLibrary|Option. Date library to use|- **threetenbp-localdatetime**
- Threetenbp - Backport of JSR310 (jvm only, for legacy app only)
- **kotlinx-datetime**
- kotlinx-datetime (preferred for multiplatform)
- **string**
- String
- **java8-localdatetime**
- Java 8 native JSR310 (jvm only, for legacy app only)
- **java8**
- Java 8 native JSR310 (jvm only, preferred for jdk 1.8+)
- **threetenbp**
- Threetenbp - Backport of JSR310 (jvm only, preferred for jdk < 1.8)
|java8|
|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.| |false|
|generateRoomModels|Generate Android Room database models in addition to API models (JVM Volley library only)| |false|
@@ -34,6 +35,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|mapFileBinaryToByteArray|Map File and Binary to ByteArray (default: false)| |false|
|modelMutable|Create mutable models| |false|
|moshiCodeGen|Whether to enable codegen with the Moshi library. Refer to the [official Moshi doc](https://github.com/square/moshi#codegen) for more info.| |false|
+|nonPublicApi|Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.| |false|
|nullableReturnType|Nullable return type| |false|
|omitGradlePluginVersions|Whether to declare Gradle plugin versions in build files.| |false|
|omitGradleWrapper|Whether to omit Gradle wrapper for creating a sub project.| |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 69258bdf092b..fe4071cffbba 100644
--- 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
@@ -90,6 +90,7 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {
public static final String MOSHI_CODE_GEN = "moshiCodeGen";
+ public static final String EXPLICIT_API = "explicitApi";
public static final String NULLABLE_RETURN_TYPE = "nullableReturnType";
public static final String SUPPORT_ANDROID_API_LEVEL_25_AND_BELLOW = "supportAndroidApiLevel25AndBelow";
@@ -268,6 +269,8 @@ public KotlinClientCodegen() {
cliOptions.add(CliOption.newBoolean(MOSHI_CODE_GEN, "Whether to enable codegen with the Moshi library. Refer to the [official Moshi doc](https://github.com/square/moshi#codegen) for more info."));
cliOptions.add(CliOption.newBoolean(FAIL_ON_UNKNOWN_PROPERTIES, "Fail Jackson de-serialization on unknown properties", false));
+ cliOptions.add(CliOption.newBoolean(EXPLICIT_API, "Generates code with explicit access modifiers to comply with Kotlin Explicit API Mode."));
+ cliOptions.add(CliOption.newBoolean(CodegenConstants.NON_PUBLIC_API, CodegenConstants.NON_PUBLIC_API_DESC));
cliOptions.add(CliOption.newBoolean(NULLABLE_RETURN_TYPE, "Nullable return type"));
cliOptions.add(CliOption.newBoolean(GENERATE_ROOM_MODELS, "Generate Android Room database models in addition to API models (JVM Volley library only)", false));
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 bac91b313f90..c3622ff6cd75 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
@@ -71,7 +71,7 @@ import java.io.IOException
@Deprecated(message = "This schema is deprecated.")
{{/isDeprecated}}
{{>additionalModelTypeAnnotations}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}data class {{classname}}(var actualInstance: Any? = null) {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}data class {{classname}}(var actualInstance: Any? = null) {
class CustomTypeAdapterFactory : TypeAdapterFactory {
override fun create(gson: Gson, type: TypeToken): TypeAdapter? {
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/build.gradle.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/build.gradle.mustache
index 1dfe6fd0636f..9f2719ce9da0 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/build.gradle.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/build.gradle.mustache
@@ -99,6 +99,11 @@ idea {
}
}
{{/idea}}
+{{#explicitApi}}
+kotlin {
+ explicitApi()
+}
+{{/explicitApi}}
{{#jvm-spring-webclient}}{{#useSpringBoot3}}
kotlin {
jvmToolchain {
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache
index 394af616a128..7da269811587 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache
@@ -77,7 +77,7 @@ import {{packageName}}.infrastructure.ITransformForStorage
{{#vendorExtensions.x-class-extra-annotation}}
{{{vendorExtensions.x-class-extra-annotation}}}
{{/vendorExtensions.x-class-extra-annotation}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}{{#discriminator}}interface{{/discriminator}}{{^discriminator}}{{#hasVars}}data {{/hasVars}}class{{/discriminator}} {{classname}}{{^discriminator}} (
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}{{#discriminator}}interface{{/discriminator}}{{^discriminator}}{{#hasVars}}data {{/hasVars}}class{{/discriminator}} {{classname}}{{^discriminator}} (
{{#allVars}}
{{#required}}{{>data_class_req_var}}{{/required}}{{^required}}{{>data_class_opt_var}}{{/required}}{{^-last}},{{/-last}}
@@ -94,7 +94,7 @@ import {{packageName}}.infrastructure.ITransformForStorage
){{/discriminator}}
{{/generateRoomModels}}
{{#serializableModel}}
- {{#nonPublicApi}}internal {{/nonPublicApi}}companion object {
+ {{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}companion object {
private const val serialVersionUID: Long = 123
}
{{/serializableModel}}
@@ -120,7 +120,7 @@ import {{packageName}}.infrastructure.ITransformForStorage
{{#multiplatform}}
@Serializable
{{/multiplatform}}
- {{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{{nameInPascalCase}}}(val value: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}kotlin.String{{/isContainer}}) {
+ {{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}enum class {{{nameInPascalCase}}}({{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val value: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}kotlin.String{{/isContainer}}) {
{{#allowableValues}}
{{#enumVars}}
{{^multiplatform}}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/enum_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/enum_class.mustache
index acbd45f92c7e..a05b071d90a6 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/enum_class.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/enum_class.mustache
@@ -39,7 +39,7 @@ import kotlinx.serialization.*
@JsonClass(generateAdapter = false)
{{/moshi}}
{{/multiplatform}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{classname}}(val value: {{{dataType}}}) {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}enum class {{classname}}({{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val value: {{{dataType}}}) {
{{#allowableValues}}{{#enumVars}}
{{^multiplatform}}
{{#moshi}}
@@ -79,16 +79,16 @@ import kotlinx.serialization.*
*/
override fun toString(): kotlin.String = value{{^isString}}.toString(){{/isString}}
- companion object {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}companion object {
/**
* Converts the provided [data] to a [String] on success, null otherwise.
*/
- fun encode(data: kotlin.Any?): kotlin.String? = if (data is {{classname}}) "$data" else null
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun encode(data: kotlin.Any?): kotlin.String? = if (data is {{classname}}) "$data" else null
/**
* Returns a valid [{{classname}}] for [data], null otherwise.
*/
- fun decode(data: kotlin.Any?): {{classname}}? = data?.let {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun decode(data: kotlin.Any?): {{classname}}? = data?.let {
val normalizedData = "$it".lowercase()
values().firstOrNull { value ->
it == value || normalizedData == "$value".lowercase()
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ApiAbstractions.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ApiAbstractions.kt.mustache
index 523503eef9d0..a32c97748387 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ApiAbstractions.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ApiAbstractions.kt.mustache
@@ -1,8 +1,8 @@
package {{packageName}}.infrastructure
-{{#nonPublicApi}}internal {{/nonPublicApi}}typealias MultiValueMap = MutableMap>
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}typealias MultiValueMap = MutableMap>
-{{#nonPublicApi}}internal {{/nonPublicApi}}fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun collectionDelimiter(collectionFormat: String): String = when(collectionFormat) {
"csv" -> ","
"tsv" -> "\t"
"pipe" -> "|"
@@ -10,12 +10,12 @@ package {{packageName}}.infrastructure
else -> ""
}
-{{#nonPublicApi}}internal {{/nonPublicApi}}val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" }
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" }
-{{#nonPublicApi}}internal {{/nonPublicApi}}fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter)
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List
= toMultiValue(items.asIterable(), collectionFormat, map)
-{{#nonPublicApi}}internal {{/nonPublicApi}}fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List {
return when(collectionFormat) {
"multi" -> items.map(map)
else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map))
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/PartConfig.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/PartConfig.kt.mustache
index f70c18eff465..36c970b7f7ca 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/PartConfig.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/PartConfig.kt.mustache
@@ -5,7 +5,7 @@ package {{packageName}}.infrastructure
* NOTE: Headers is a Map because rfc2616 defines
* multi-valued headers as csv-only.
*/
-{{#nonPublicApi}}internal {{/nonPublicApi}}data class PartConfig(
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}data class PartConfig(
val headers: MutableMap = mutableMapOf(),
val body: T? = null
)
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/RequestConfig.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/RequestConfig.kt.mustache
index 7de4c68ae02e..99f46f81f923 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/RequestConfig.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/RequestConfig.kt.mustache
@@ -8,7 +8,7 @@ package {{packageName}}.infrastructure
* NOTE: Headers is a Map because rfc2616 defines
* multi-valued headers as csv-only.
*/
-{{#nonPublicApi}}internal {{/nonPublicApi}}data class RequestConfig(
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}data class RequestConfig(
val method: RequestMethod,
val path: String,
val headers: MutableMap = mutableMapOf(),
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/RequestMethod.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/RequestMethod.kt.mustache
index cb59c4f58c8c..1ef3ba25506e 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/RequestMethod.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/RequestMethod.kt.mustache
@@ -3,6 +3,6 @@ package {{packageName}}.infrastructure
/**
* Provides enumerated HTTP verbs
*/
-{{#nonPublicApi}}internal {{/nonPublicApi}}enum class RequestMethod {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}enum class RequestMethod {
GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT
}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/AtomicBooleanAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/AtomicBooleanAdapter.kt.mustache
index 098ff54c6a1c..4bdd86a134b3 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/AtomicBooleanAdapter.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/AtomicBooleanAdapter.kt.mustache
@@ -10,7 +10,7 @@ import kotlinx.serialization.descriptors.SerialDescriptor
import java.util.concurrent.atomic.AtomicBoolean
@Serializer(forClass = AtomicBoolean::class)
-{{#nonPublicApi}}internal {{/nonPublicApi}}object AtomicBooleanAdapter : KSerializer {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}object AtomicBooleanAdapter : KSerializer {
override fun serialize(encoder: Encoder, value: AtomicBoolean) {
encoder.encodeBoolean(value.get())
}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/AtomicIntegerAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/AtomicIntegerAdapter.kt.mustache
index 6e16b5b78a6d..592145434cc4 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/AtomicIntegerAdapter.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/AtomicIntegerAdapter.kt.mustache
@@ -10,7 +10,7 @@ import kotlinx.serialization.descriptors.SerialDescriptor
import java.util.concurrent.atomic.AtomicInteger
@Serializer(forClass = AtomicInteger::class)
-{{#nonPublicApi}}internal {{/nonPublicApi}}object AtomicIntegerAdapter : KSerializer {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}object AtomicIntegerAdapter : KSerializer {
override fun serialize(encoder: Encoder, value: AtomicInteger) {
encoder.encodeInt(value.get())
}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/AtomicLongAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/AtomicLongAdapter.kt.mustache
index bc2142c676a7..e7006397ac0f 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/AtomicLongAdapter.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/AtomicLongAdapter.kt.mustache
@@ -10,7 +10,7 @@ import kotlinx.serialization.descriptors.SerialDescriptor
import java.util.concurrent.atomic.AtomicLong
@Serializer(forClass = AtomicLong::class)
-{{#nonPublicApi}}internal {{/nonPublicApi}}object AtomicLongAdapter : KSerializer {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}object AtomicLongAdapter : KSerializer {
override fun serialize(encoder: Encoder, value: AtomicLong) {
encoder.encodeLong(value.get())
}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/BigDecimalAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/BigDecimalAdapter.kt.mustache
index fd08ed4a04cc..6fc173cf0c26 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/BigDecimalAdapter.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/BigDecimalAdapter.kt.mustache
@@ -17,21 +17,21 @@ import java.math.BigDecimal
{{#kotlinx_serialization}}
@Serializer(forClass = BigDecimal::class)
-{{#nonPublicApi}}internal {{/nonPublicApi}}object BigDecimalAdapter : KSerializer {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}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())
}
{{/kotlinx_serialization}}
{{#moshi}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}class BigDecimalAdapter {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class BigDecimalAdapter {
@ToJson
- fun toJson(value: BigDecimal): String {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun toJson(value: BigDecimal): String {
return value.toPlainString()
}
@FromJson
- fun fromJson(value: String): BigDecimal {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun fromJson(value: String): BigDecimal {
return BigDecimal(value)
}
}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/BigIntegerAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/BigIntegerAdapter.kt.mustache
index e7403a6882af..8a0ddada6d54 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/BigIntegerAdapter.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/BigIntegerAdapter.kt.mustache
@@ -17,7 +17,7 @@ import java.math.BigInteger
{{#kotlinx_serialization}}
@Serializer(forClass = BigInteger::class)
-{{#nonPublicApi}}internal {{/nonPublicApi}}object BigIntegerAdapter : KSerializer {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}object BigIntegerAdapter : KSerializer {
override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("BigInteger", PrimitiveKind.STRING)
override fun deserialize(decoder: Decoder): BigInteger {
return BigInteger(decoder.decodeString())
@@ -29,14 +29,14 @@ import java.math.BigInteger
}
{{/kotlinx_serialization}}
{{#moshi}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}class BigIntegerAdapter {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class BigIntegerAdapter {
@ToJson
- fun toJson(value: BigInteger): String {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun toJson(value: BigInteger): String {
return value.toString()
}
@FromJson
- fun fromJson(value: String): BigInteger {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun fromJson(value: String): BigInteger {
return BigInteger(value)
}
}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/ByteArrayAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/ByteArrayAdapter.kt.mustache
index edc967afdbc2..fd7f76169d66 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/ByteArrayAdapter.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/ByteArrayAdapter.kt.mustache
@@ -13,16 +13,16 @@ import java.io.IOException
{{/gson}}
{{#moshi}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}class ByteArrayAdapter {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class ByteArrayAdapter {
@ToJson
- fun toJson(data: ByteArray): String = String(data)
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun toJson(data: ByteArray): String = String(data)
@FromJson
- fun fromJson(data: String): ByteArray = data.toByteArray()
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun fromJson(data: String): ByteArray = data.toByteArray()
}
{{/moshi}}
{{#gson}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}class ByteArrayAdapter : TypeAdapter() {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class ByteArrayAdapter : TypeAdapter() {
@Throws(IOException::class)
override fun write(out: JsonWriter?, value: ByteArray?) {
if (value == null) {
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/InstantAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/InstantAdapter.kt.mustache
index 66d389c3f6d0..d2b8d4b5dd58 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/InstantAdapter.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/InstantAdapter.kt.mustache
@@ -14,21 +14,21 @@ import java.io.IOException
import kotlinx.datetime.Instant
{{#moshi}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}class InstantAdapter {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class InstantAdapter {
@ToJson
- fun toJson(value: Instant): String {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun toJson(value: Instant): String {
return value.toString()
}
@FromJson
- fun fromJson(value: String): Instant {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun fromJson(value: String): Instant {
return Instant.parse(value)
}
}
{{/moshi}}
{{#gson}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}class InstantAdapter : TypeAdapter() {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class InstantAdapter : TypeAdapter() {
@Throws(IOException::class)
override fun write(out: JsonWriter?, value: Instant?) {
if (value == null) {
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/LocalDateAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/LocalDateAdapter.kt.mustache
index 6809c74c3a77..641f7d7ab304 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/LocalDateAdapter.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/LocalDateAdapter.kt.mustache
@@ -35,9 +35,9 @@ import kotlinx.datetime.LocalDate
{{/kotlinx-datetime}}
{{#moshi}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}class LocalDateAdapter {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class LocalDateAdapter {
@ToJson
- fun toJson(value: LocalDate): String {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun toJson(value: LocalDate): String {
{{#kotlinx-datetime}}
return value.toString()
{{/kotlinx-datetime}}
@@ -47,14 +47,14 @@ import kotlinx.datetime.LocalDate
}
@FromJson
- fun fromJson(value: String): LocalDate {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun fromJson(value: String): LocalDate {
return LocalDate.parse(value{{^kotlinx-datetime}}, DateTimeFormatter.ISO_LOCAL_DATE{{/kotlinx-datetime}})
}
}
{{/moshi}}
{{#gson}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}class LocalDateAdapter({{^kotlinx-datetime}}private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE{{/kotlinx-datetime}}) : TypeAdapter() {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class LocalDateAdapter({{^kotlinx-datetime}}private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE{{/kotlinx-datetime}}) : TypeAdapter() {
@Throws(IOException::class)
override fun write(out: JsonWriter?, value: LocalDate?) {
if (value == null) {
@@ -88,7 +88,7 @@ import kotlinx.datetime.LocalDate
{{#kotlinx_serialization}}
{{^kotlinx-datetime}}
@Serializer(forClass = LocalDate::class)
-{{#nonPublicApi}}internal {{/nonPublicApi}}object LocalDateAdapter : KSerializer {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}object LocalDateAdapter : KSerializer {
override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("LocalDate", PrimitiveKind.STRING)
override fun serialize(encoder: Encoder, value: LocalDate) {
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/LocalDateTimeAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/LocalDateTimeAdapter.kt.mustache
index f56cf12d5b77..168d4b272061 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/LocalDateTimeAdapter.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/LocalDateTimeAdapter.kt.mustache
@@ -35,9 +35,9 @@ import kotlinx.datetime.LocalDateTime
{{/kotlinx-datetime}}
{{#moshi}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}class LocalDateTimeAdapter {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class LocalDateTimeAdapter {
@ToJson
- fun toJson(value: LocalDateTime): String {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun toJson(value: LocalDateTime): String {
{{#kotlinx-datetime}}
return value.toString()
{{/kotlinx-datetime}}
@@ -47,14 +47,14 @@ import kotlinx.datetime.LocalDateTime
}
@FromJson
- fun fromJson(value: String): LocalDateTime {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun fromJson(value: String): LocalDateTime {
return LocalDateTime.parse(value{{^kotlinx-datetime}}, DateTimeFormatter.ISO_LOCAL_DATE_TIME{{/kotlinx-datetime}})
}
}
{{/moshi}}
{{#gson}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}class LocalDateTimeAdapter({{^kotlinx-datetime}}private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME{{/kotlinx-datetime}}) : TypeAdapter() {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class LocalDateTimeAdapter({{^kotlinx-datetime}}private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME{{/kotlinx-datetime}}) : TypeAdapter() {
@Throws(IOException::class)
override fun write(out: JsonWriter?, value: LocalDateTime?) {
if (value == null) {
@@ -88,7 +88,7 @@ import kotlinx.datetime.LocalDateTime
{{#kotlinx_serialization}}
{{^kotlinx-datetime}}
@Serializer(forClass = LocalDateTime::class)
-{{#nonPublicApi}}internal {{/nonPublicApi}}object LocalDateTimeAdapter : KSerializer {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}object LocalDateTimeAdapter : KSerializer {
override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("LocalDateTime", PrimitiveKind.STRING)
override fun serialize(encoder: Encoder, value: LocalDateTime) {
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/LocalTimeAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/LocalTimeAdapter.kt.mustache
index 3a294f8ef7df..a3f2fde6c476 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/LocalTimeAdapter.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/LocalTimeAdapter.kt.mustache
@@ -14,21 +14,21 @@ import java.io.IOException
import kotlinx.datetime.LocalTime
{{#moshi}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}class LocalTimeAdapter {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class LocalTimeAdapter {
@ToJson
- fun toJson(value: LocalTime): String {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun toJson(value: LocalTime): String {
return value.toString()
}
@FromJson
- fun fromJson(value: String): LocalTime {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun fromJson(value: String): LocalTime {
return LocalTime.parse(value)
}
}
{{/moshi}}
{{#gson}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}class LocalTimeAdapter : TypeAdapter() {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class LocalTimeAdapter : TypeAdapter() {
@Throws(IOException::class)
override fun write(out: JsonWriter?, value: LocalTime?) {
if (value == null) {
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/OffsetDateTimeAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/OffsetDateTimeAdapter.kt.mustache
index b2d47121654b..0bf0e381690d 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/OffsetDateTimeAdapter.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/OffsetDateTimeAdapter.kt.mustache
@@ -30,21 +30,21 @@ import org.threeten.bp.format.DateTimeFormatter
{{/threetenbp}}
{{#moshi}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}class OffsetDateTimeAdapter {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class OffsetDateTimeAdapter {
@ToJson
- fun toJson(value: OffsetDateTime): String {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun toJson(value: OffsetDateTime): String {
return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value)
}
@FromJson
- fun fromJson(value: String): OffsetDateTime {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun fromJson(value: String): OffsetDateTime {
return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME)
}
}
{{/moshi}}
{{#gson}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}class OffsetDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME) : TypeAdapter() {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class OffsetDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME) : TypeAdapter() {
@Throws(IOException::class)
override fun write(out: JsonWriter?, value: OffsetDateTime?) {
if (value == null) {
@@ -72,7 +72,7 @@ import org.threeten.bp.format.DateTimeFormatter
{{/gson}}
{{#kotlinx_serialization}}
@Serializer(forClass = OffsetDateTime::class)
-{{#nonPublicApi}}internal {{/nonPublicApi}}object OffsetDateTimeAdapter : KSerializer {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}object OffsetDateTimeAdapter : KSerializer {
override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("OffsetDateTime", PrimitiveKind.STRING)
override fun serialize(encoder: Encoder, value: OffsetDateTime) {
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache
index 6b78b03b7af8..241c462f3ad1 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache
@@ -58,10 +58,10 @@ import java.util.concurrent.atomic.AtomicInteger
import java.util.concurrent.atomic.AtomicLong
{{/kotlinx_serialization}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}object Serializer {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}object Serializer {
{{#moshi}}
@JvmStatic
- val moshiBuilder: Moshi.Builder = Moshi.Builder()
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val moshiBuilder: Moshi.Builder = Moshi.Builder()
.add(OffsetDateTimeAdapter())
{{#kotlinx-datetime}}
.add(InstantAdapter())
@@ -79,7 +79,7 @@ import java.util.concurrent.atomic.AtomicLong
.add(BigIntegerAdapter())
@JvmStatic
- val moshi: Moshi by lazy {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val moshi: Moshi by lazy {
{{#enumUnknownDefaultCase}}
SerializerHelper.addEnumUnknownDefaultCase(moshiBuilder)
{{/enumUnknownDefaultCase}}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/SerializerHelper.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/SerializerHelper.kt.mustache
index 27f4d1ee617c..7e0fb08639d8 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/SerializerHelper.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/SerializerHelper.kt.mustache
@@ -7,9 +7,9 @@ import com.squareup.moshi.adapters.EnumJsonAdapter
{{/enumUnknownDefaultCase}}
{{/moshi}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}object SerializerHelper {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}object SerializerHelper {
{{#moshi}}
- fun addEnumUnknownDefaultCase(moshiBuilder: Moshi.Builder): Moshi.Builder {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun addEnumUnknownDefaultCase(moshiBuilder: Moshi.Builder): Moshi.Builder {
return moshiBuilder
{{#enumUnknownDefaultCase}}
{{#models}}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/StringBuilderAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/StringBuilderAdapter.kt.mustache
index 3d5367030716..05f6e48a0877 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/StringBuilderAdapter.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/StringBuilderAdapter.kt.mustache
@@ -9,7 +9,7 @@ import kotlinx.serialization.descriptors.PrimitiveKind
import kotlinx.serialization.descriptors.SerialDescriptor
@Serializer(forClass = StringBuilder::class)
-{{#nonPublicApi}}internal {{/nonPublicApi}}object StringBuilderAdapter : KSerializer {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}object StringBuilderAdapter : KSerializer {
override fun serialize(encoder: Encoder, value: StringBuilder) {
encoder.encodeString(value.toString())
}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/URIAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/URIAdapter.kt.mustache
index 563b39cdb9a9..490121052563 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/URIAdapter.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/URIAdapter.kt.mustache
@@ -16,17 +16,17 @@ import com.squareup.moshi.ToJson
import java.net.URI
{{#moshi}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}class URIAdapter {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class URIAdapter {
@ToJson
- fun toJson(uri: URI) = uri.toString()
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun toJson(uri: URI): String = uri.toString()
@FromJson
- fun fromJson(s: String): URI = URI.create(s)
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun fromJson(s: String): URI = URI.create(s)
}
{{/moshi}}
{{#kotlinx_serialization}}
@Serializer(forClass = URI::class)
-{{#nonPublicApi}}internal {{/nonPublicApi}}object URIAdapter : KSerializer {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}object URIAdapter : KSerializer {
override fun serialize(encoder: Encoder, value: URI) {
encoder.encodeString(value.toASCIIString())
}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/URLAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/URLAdapter.kt.mustache
index b437ff89ae0e..9f70cf878a3e 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/URLAdapter.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/URLAdapter.kt.mustache
@@ -10,7 +10,7 @@ import kotlinx.serialization.descriptors.SerialDescriptor
import java.net.URL
@Serializer(forClass = URL::class)
-{{#nonPublicApi}}internal {{/nonPublicApi}}object URLAdapter : KSerializer {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}object URLAdapter : KSerializer {
override fun serialize(encoder: Encoder, value: URL) {
encoder.encodeString(value.toExternalForm())
}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/UUIDAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/UUIDAdapter.kt.mustache
index 925532d6aa3f..6fd24cacc4c2 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/UUIDAdapter.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/UUIDAdapter.kt.mustache
@@ -16,17 +16,17 @@ import com.squareup.moshi.ToJson
import java.util.UUID
{{#moshi}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}class UUIDAdapter {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class UUIDAdapter {
@ToJson
- fun toJson(uuid: UUID) = uuid.toString()
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun toJson(uuid: UUID): String = uuid.toString()
@FromJson
- fun fromJson(s: String): UUID = UUID.fromString(s)
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun fromJson(s: String): UUID = UUID.fromString(s)
}
{{/moshi}}
{{#kotlinx_serialization}}
@Serializer(forClass = UUID::class)
-{{#nonPublicApi}}internal {{/nonPublicApi}}object UUIDAdapter : KSerializer {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}object UUIDAdapter : KSerializer {
override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("UUID", PrimitiveKind.STRING)
override fun serialize(encoder: Encoder, value: UUID) {
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/api.mustache
index c246003421c6..2b03a52edac8 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/api.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/api.mustache
@@ -19,7 +19,7 @@ import com.fasterxml.jackson.databind.ObjectMapper
{{/jackson}}
{{#operations}}
- {{#nonPublicApi}}internal {{/nonPublicApi}}open class {{classname}}(
+ {{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}open class {{classname}}(
baseUrl: String = ApiClient.BASE_URL,
httpClientEngine: HttpClientEngine? = null,
httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null,
@@ -51,7 +51,7 @@ import com.fasterxml.jackson.databind.ObjectMapper
{{#returnType}}
@Suppress("UNCHECKED_CAST")
{{/returnType}}
- open suspend fun {{operationId}}({{#allParams}}{{{paramName}}}: {{{dataType}}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): HttpResponse<{{{returnType}}}{{^returnType}}Unit{{/returnType}}> {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}open suspend fun {{operationId}}({{#allParams}}{{{paramName}}}: {{{dataType}}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): HttpResponse<{{{returnType}}}{{^returnType}}Unit{{/returnType}}> {
val localVariableAuthNames = listOf({{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}})
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/auth/ApiKeyAuth.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/auth/ApiKeyAuth.kt.mustache
index 618fd7a88903..91f2de7114ab 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/auth/ApiKeyAuth.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/auth/ApiKeyAuth.kt.mustache
@@ -1,8 +1,8 @@
package {{packageName}}.auth
-class ApiKeyAuth(private val location: String, val paramName: String) : Authentication {
- var apiKey: String? = null
- var apiKeyPrefix: String? = null
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class ApiKeyAuth(private val location: String, {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val paramName: String) : Authentication {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}var apiKey: String? = null
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}var apiKeyPrefix: String? = null
override fun apply(query: MutableMap>, headers: MutableMap) {
val key: String = apiKey ?: return
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/auth/Authentication.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/auth/Authentication.kt.mustache
index 1aab9156d98b..f6d131645adc 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/auth/Authentication.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/auth/Authentication.kt.mustache
@@ -1,6 +1,6 @@
package {{packageName}}.auth
-interface Authentication {
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}interface Authentication {
/**
* Apply authentication settings to header and query params.
@@ -8,6 +8,6 @@ interface Authentication {
* @param query Query parameters.
* @param headers Header parameters.
*/
- fun apply(query: MutableMap>, headers: MutableMap)
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun apply(query: MutableMap>, headers: MutableMap)
}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/auth/HttpBasicAuth.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/auth/HttpBasicAuth.kt.mustache
index 26325424e5dd..fbf39cb55b38 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/auth/HttpBasicAuth.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/auth/HttpBasicAuth.kt.mustache
@@ -3,9 +3,9 @@ package {{packageName}}.auth
import io.ktor.util.InternalAPI
import io.ktor.util.encodeBase64
-class HttpBasicAuth : Authentication {
- var username: String? = null
- var password: String? = null
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class HttpBasicAuth : Authentication {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}var username: String? = null
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}var password: String? = null
@OptIn(InternalAPI::class)
override fun apply(query: MutableMap>, headers: MutableMap) {
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/auth/HttpBearerAuth.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/auth/HttpBearerAuth.kt.mustache
index 982389d09609..a7be654e123f 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/auth/HttpBearerAuth.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/auth/HttpBearerAuth.kt.mustache
@@ -1,7 +1,7 @@
package {{packageName}}.auth
-class HttpBearerAuth(private val scheme: String?) : Authentication {
- var bearerToken: String? = null
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class HttpBearerAuth(private val scheme: String?) : Authentication {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}var bearerToken: String? = null
override fun apply(query: MutableMap>, headers: MutableMap) {
val token: String = bearerToken ?: return
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/auth/OAuth.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/auth/OAuth.kt.mustache
index 98bb449a6096..4a2726c0b167 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/auth/OAuth.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/auth/OAuth.kt.mustache
@@ -1,7 +1,7 @@
package {{packageName}}.auth
-class OAuth : Authentication {
- var accessToken: String? = null
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class OAuth : Authentication {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}var accessToken: String? = null
override fun apply(query: MutableMap>, headers: MutableMap) {
val token: String = accessToken ?: return
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/infrastructure/ApiClient.kt.mustache
index c189f9f9ed93..f8d10ef265e0 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/infrastructure/ApiClient.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/infrastructure/ApiClient.kt.mustache
@@ -38,7 +38,7 @@ import com.fasterxml.jackson.core.util.DefaultPrettyPrinter
{{/jackson}}
import {{packageName}}.auth.*
-{{#nonPublicApi}}internal {{/nonPublicApi}}open class ApiClient(
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}open class ApiClient(
private val baseUrl: String,
httpClientEngine: HttpClientEngine?,
httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null,
@@ -81,16 +81,16 @@ import {{packageName}}.auth.*
private val authentications: kotlin.collections.Map? = null
{{/hasAuthMethods}}
- {{#nonPublicApi}}internal {{/nonPublicApi}}companion object {
- const val BASE_URL = "{{{basePath}}}"
+ {{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}companion object {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}const val BASE_URL: String = "{{{basePath}}}"
{{#gson}}
- val JSON_DEFAULT : GsonBuilder.() -> Unit = {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val JSON_DEFAULT : GsonBuilder.() -> Unit = {
setDateFormat(DateFormat.LONG)
setPrettyPrinting()
}
{{/gson}}
{{#jackson}}
- val JSON_DEFAULT: ObjectMapper.() -> Unit = {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val JSON_DEFAULT: ObjectMapper.() -> Unit = {
configure(SerializationFeature.INDENT_OUTPUT, true)
setDefaultPrettyPrinter(DefaultPrettyPrinter().apply {
indentArraysWith(DefaultPrettyPrinter.FixedSpaceIndenter.instance)
@@ -99,7 +99,7 @@ import {{packageName}}.auth.*
registerModule(JavaTimeModule())
}
{{/jackson}}
- protected val UNSAFE_HEADERS = listOf(HttpHeaders.ContentType)
+ protected val UNSAFE_HEADERS: List = listOf(HttpHeaders.ContentType)
}
/**
@@ -107,7 +107,7 @@ import {{packageName}}.auth.*
*
* @param username Username
*/
- fun setUsername(username: String) {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun setUsername(username: String) {
val auth = authentications?.values?.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth?
?: throw Exception("No HTTP basic authentication configured")
auth.username = username
@@ -118,7 +118,7 @@ import {{packageName}}.auth.*
*
* @param password Password
*/
- fun setPassword(password: String) {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun setPassword(password: String) {
val auth = authentications?.values?.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth?
?: throw Exception("No HTTP basic authentication configured")
auth.password = password
@@ -130,7 +130,7 @@ import {{packageName}}.auth.*
* @param apiKey API key
* @param paramName The name of the API key parameter, or null or set the first key.
*/
- fun setApiKey(apiKey: String, paramName: String? = null) {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun setApiKey(apiKey: String, paramName: String? = null) {
val auth = authentications?.values?.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName)} as ApiKeyAuth?
?: throw Exception("No API key authentication configured")
auth.apiKey = apiKey
@@ -142,7 +142,7 @@ import {{packageName}}.auth.*
* @param apiKeyPrefix API key prefix
* @param paramName The name of the API key parameter, or null or set the first key.
*/
- fun setApiKeyPrefix(apiKeyPrefix: String, paramName: String? = null) {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun setApiKeyPrefix(apiKeyPrefix: String, paramName: String? = null) {
val auth = authentications?.values?.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName) } as ApiKeyAuth?
?: throw Exception("No API key authentication configured")
auth.apiKeyPrefix = apiKeyPrefix
@@ -153,7 +153,7 @@ import {{packageName}}.auth.*
*
* @param accessToken Access token
*/
- fun setAccessToken(accessToken: String) {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun setAccessToken(accessToken: String) {
val auth = authentications?.values?.firstOrNull { it is OAuth } as OAuth?
?: throw Exception("No OAuth2 authentication configured")
auth.accessToken = accessToken
@@ -164,7 +164,7 @@ import {{packageName}}.auth.*
*
* @param bearerToken The bearer token.
*/
- fun setBearerToken(bearerToken: String) {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun setBearerToken(bearerToken: String) {
val auth = authentications?.values?.firstOrNull { it is HttpBearerAuth } as HttpBearerAuth?
?: throw Exception("No Bearer authentication configured")
auth.bearerToken = bearerToken
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/infrastructure/HttpResponse.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/infrastructure/HttpResponse.kt.mustache
index 87a68f3084e5..be6d259adfd0 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/infrastructure/HttpResponse.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/infrastructure/HttpResponse.kt.mustache
@@ -5,14 +5,14 @@ import io.ktor.http.isSuccess
import io.ktor.util.reflect.TypeInfo
import io.ktor.util.reflect.typeInfo
-{{#nonPublicApi}}internal {{/nonPublicApi}}open class HttpResponse(val response: io.ktor.client.statement.HttpResponse, val provider: BodyProvider) {
- val status: Int = response.status.value
- val success: Boolean = response.status.isSuccess()
- val headers: Map> = response.headers.mapEntries()
- suspend fun body(): T = provider.body(response)
- suspend fun typedBody(type: TypeInfo): V = provider.typedBody(response, type)
-
- {{#nonPublicApi}}internal {{/nonPublicApi}}companion object {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}open class HttpResponse({{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val response: io.ktor.client.statement.HttpResponse, {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val provider: BodyProvider) {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val status: Int = response.status.value
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val success: Boolean = response.status.isSuccess()
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val headers: Map> = response.headers.mapEntries()
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}suspend fun body(): T = provider.body(response)
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}suspend fun typedBody(type: TypeInfo): V = provider.typedBody(response, type)
+
+ {{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}companion object {
private fun Headers.mapEntries(): Map> {
val result = mutableMapOf>()
entries().forEach { result[it.key] = it.value }
@@ -21,12 +21,12 @@ import io.ktor.util.reflect.typeInfo
}
}
-{{#nonPublicApi}}internal {{/nonPublicApi}}interface BodyProvider {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}interface BodyProvider {
suspend fun body(response: io.ktor.client.statement.HttpResponse): T
suspend fun typedBody(response: io.ktor.client.statement.HttpResponse, type: TypeInfo): V
}
-{{#nonPublicApi}}internal {{/nonPublicApi}}class TypedBodyProvider(private val type: TypeInfo) : BodyProvider {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class TypedBodyProvider(private val type: TypeInfo) : BodyProvider {
@Suppress("UNCHECKED_CAST")
override suspend fun body(response: io.ktor.client.statement.HttpResponse): T =
response.call.body(type) as T
@@ -36,7 +36,7 @@ import io.ktor.util.reflect.typeInfo
response.call.body(type) as V
}
-{{#nonPublicApi}}internal {{/nonPublicApi}}class MappedBodyProvider(private val provider: BodyProvider, private val block: S.() -> T) : BodyProvider {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class MappedBodyProvider(private val provider: BodyProvider, private val block: S.() -> T) : BodyProvider {
override suspend fun body(response: io.ktor.client.statement.HttpResponse): T =
block(provider.body(response))
@@ -44,8 +44,8 @@ import io.ktor.util.reflect.typeInfo
provider.typedBody(response, type)
}
-{{#nonPublicApi}}internal {{/nonPublicApi}}inline fun io.ktor.client.statement.HttpResponse.wrap(): HttpResponse =
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}inline fun io.ktor.client.statement.HttpResponse.wrap(): HttpResponse =
HttpResponse(this, TypedBodyProvider(typeInfo()))
-{{#nonPublicApi}}internal {{/nonPublicApi}}fun HttpResponse.map(block: T.() -> V): HttpResponse =
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun HttpResponse.map(block: T.() -> V): HttpResponse =
HttpResponse(response, MappedBodyProvider(provider, block))
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache
index bd262322887c..741299d052c8 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache
@@ -48,10 +48,10 @@ import {{packageName}}.infrastructure.Success
import {{packageName}}.infrastructure.toMultiValue
{{#operations}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}class {{classname}}(basePath: kotlin.String = defaultBasePath, client: Call.Factory = ApiClient.defaultClient) : ApiClient(basePath, client) {
- companion object {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class {{classname}}(basePath: kotlin.String = defaultBasePath, client: Call.Factory = ApiClient.defaultClient) : ApiClient(basePath, client) {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}companion object {
@JvmStatic
- val defaultBasePath: String by lazy {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val defaultBasePath: String by lazy {
System.getProperties().getProperty(ApiClient.baseUrlKey, "{{{basePath}}}")
}
}
@@ -62,7 +62,7 @@ import {{packageName}}.infrastructure.toMultiValue
/**
* enum for parameter {{paramName}}
*/
- {{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{enumName}}{{operationIdCamelCase}}(val value: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}kotlin.String{{/isContainer}}) {
+ {{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}enum class {{enumName}}{{operationIdCamelCase}}({{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val value: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}kotlin.String{{/isContainer}}) {
{{^enumUnknownDefaultCase}}
{{#allowableValues}}
{{#enumVars}}
@@ -138,7 +138,7 @@ import {{packageName}}.infrastructure.toMultiValue
{{#isDeprecated}}
@Deprecated(message = "This operation is deprecated.")
{{/isDeprecated}}
- {{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : {{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}{{^doNotUseRxAndCoroutines}}{{#useCoroutines}} = withContext(Dispatchers.IO){{/useCoroutines}}{{/doNotUseRxAndCoroutines}} {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}{{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : {{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}{{^doNotUseRxAndCoroutines}}{{#useCoroutines}} = withContext(Dispatchers.IO){{/useCoroutines}}{{/doNotUseRxAndCoroutines}} {
{{#isDeprecated}}
@Suppress("DEPRECATION")
{{/isDeprecated}}
@@ -172,7 +172,7 @@ import {{packageName}}.infrastructure.toMultiValue
{{#isDeprecated}}
@Deprecated(message = "This operation is deprecated.")
{{/isDeprecated}}
- {{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : ApiResponse<{{#returnType}}{{{returnType}}}?{{/returnType}}{{^returnType}}Unit?{{/returnType}}>{{^doNotUseRxAndCoroutines}}{{#useCoroutines}} = withContext(Dispatchers.IO){{/useCoroutines}}{{/doNotUseRxAndCoroutines}} {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}{{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : ApiResponse<{{#returnType}}{{{returnType}}}?{{/returnType}}{{^returnType}}Unit?{{/returnType}}>{{^doNotUseRxAndCoroutines}}{{#useCoroutines}} = withContext(Dispatchers.IO){{/useCoroutines}}{{/doNotUseRxAndCoroutines}} {
{{#isDeprecated}}
@Suppress("DEPRECATION")
{{/isDeprecated}}
@@ -192,7 +192,7 @@ import {{packageName}}.infrastructure.toMultiValue
{{#isDeprecated}}
@Deprecated(message = "This operation is deprecated.")
{{/isDeprecated}}
- fun {{operationId}}RequestConfig({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : RequestConfig<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map>{{/hasFormParams}}{{/hasBodyParam}}> {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun {{operationId}}RequestConfig({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : RequestConfig<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map>{{/hasFormParams}}{{/hasBodyParam}}> {
val localVariableBody = {{#hasBodyParam}}{{!
}}{{#bodyParams}}{{{paramName}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{!
}}{{^hasFormParams}}null{{/hasFormParams}}{{!
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache
index c5f5cb8a6f9e..17cb97938a3e 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache
@@ -58,33 +58,33 @@ import com.fasterxml.jackson.core.type.TypeReference
import com.squareup.moshi.adapter
{{/moshi}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody()
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody()
-{{#nonPublicApi}}internal {{/nonPublicApi}}open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClient) {
- {{#nonPublicApi}}internal {{/nonPublicApi}}companion object {
- protected const val ContentType = "Content-Type"
- protected const val Accept = "Accept"
- protected const val Authorization = "Authorization"
- protected const val JsonMediaType = "application/json"
- protected const val FormDataMediaType = "multipart/form-data"
- protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded"
- protected const val XmlMediaType = "application/xml"
- protected const val OctetMediaType = "application/octet-stream"
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}open class ApiClient({{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val baseUrl: String, {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val client: Call.Factory = defaultClient) {
+ {{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}companion object {
+ protected const val ContentType: String = "Content-Type"
+ protected const val Accept: String = "Accept"
+ protected const val Authorization: String = "Authorization"
+ protected const val JsonMediaType: String = "application/json"
+ protected const val FormDataMediaType: String = "multipart/form-data"
+ protected const val FormUrlEncMediaType: String = "application/x-www-form-urlencoded"
+ protected const val XmlMediaType: String = "application/xml"
+ protected const val OctetMediaType: String = "application/octet-stream"
- val apiKey: MutableMap = mutableMapOf()
- val apiKeyPrefix: MutableMap = mutableMapOf()
- var username: String? = null
- var password: String? = null
- var accessToken: String? = null
- const val baseUrlKey = "{{packageName}}.baseUrl"
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val apiKey: MutableMap = mutableMapOf()
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val apiKeyPrefix: MutableMap = mutableMapOf()
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}var username: String? = null
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}var password: String? = null
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}var accessToken: String? = null
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}const val baseUrlKey: String = "{{packageName}}.baseUrl"
@JvmStatic
- val defaultClient: OkHttpClient by lazy {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val defaultClient: OkHttpClient by lazy {
builder.build()
}
@JvmStatic
- val builder: OkHttpClient.Builder = OkHttpClient.Builder()
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val builder: OkHttpClient.Builder = OkHttpClient.Builder()
}
/**
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiResponse.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiResponse.kt.mustache
index d529ad5599f1..ae7f7f4a11f5 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiResponse.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiResponse.kt.mustache
@@ -1,43 +1,43 @@
package {{packageName}}.infrastructure
-{{#nonPublicApi}}internal {{/nonPublicApi}}enum class ResponseType {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}enum class ResponseType {
Success, Informational, Redirection, ClientError, ServerError
}
-{{#nonPublicApi}}internal {{/nonPublicApi}}interface Response
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}interface Response
-{{#nonPublicApi}}internal {{/nonPublicApi}}abstract class ApiResponse(val responseType: ResponseType): Response {
- abstract val statusCode: Int
- abstract val headers: Map>
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}abstract class ApiResponse({{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val responseType: ResponseType): Response {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}abstract val statusCode: Int
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}abstract val headers: Map>
}
-{{#nonPublicApi}}internal {{/nonPublicApi}}class Success(
- val data: T{{#nullableReturnType}}?{{/nullableReturnType}},
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class Success(
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val data: T{{#nullableReturnType}}?{{/nullableReturnType}},
override val statusCode: Int = -1,
override val headers: Map> = mapOf()
): ApiResponse(ResponseType.Success)
-{{#nonPublicApi}}internal {{/nonPublicApi}}class Informational(
- val statusText: String,
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class Informational(
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val statusText: String,
override val statusCode: Int = -1,
override val headers: Map> = mapOf()
) : ApiResponse(ResponseType.Informational)
-{{#nonPublicApi}}internal {{/nonPublicApi}}class Redirection(
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class Redirection(
override val statusCode: Int = -1,
override val headers: Map> = mapOf()
) : ApiResponse(ResponseType.Redirection)
-{{#nonPublicApi}}internal {{/nonPublicApi}}class ClientError(
- val message: String? = null,
- val body: Any? = null,
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class ClientError(
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val message: String? = null,
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val body: Any? = null,
override val statusCode: Int = -1,
override val headers: Map> = mapOf()
) : ApiResponse(ResponseType.ClientError)
-{{#nonPublicApi}}internal {{/nonPublicApi}}class ServerError(
- val message: String? = null,
- val body: Any? = null,
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class ServerError(
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val message: String? = null,
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val body: Any? = null,
override val statusCode: Int = -1,
override val headers: Map>
): ApiResponse(ResponseType.ServerError)
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/Errors.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/Errors.kt.mustache
index 1357da8d599c..f1ab8a0e1593 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/Errors.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/Errors.kt.mustache
@@ -3,16 +3,16 @@ package {{packageName}}.infrastructure
import java.lang.RuntimeException
-{{#nonPublicApi}}internal {{/nonPublicApi}}open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}open class ClientException(message: kotlin.String? = null, {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val statusCode: Int = -1, {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val response: Response? = null) : RuntimeException(message) {
- {{#nonPublicApi}}internal {{/nonPublicApi}}companion object {
+ {{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}companion object {
private const val serialVersionUID: Long = 123L
}
}
-{{#nonPublicApi}}internal {{/nonPublicApi}}open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}open class ServerException(message: kotlin.String? = null, {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val statusCode: Int = -1, {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val response: Response? = null) : RuntimeException(message) {
- {{#nonPublicApi}}internal {{/nonPublicApi}}companion object {
+ {{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}companion object {
private const val serialVersionUID: Long = 456L
}
}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ResponseExtensions.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ResponseExtensions.kt.mustache
index 8bf8d157f6c2..351907b273d5 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ResponseExtensions.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ResponseExtensions.kt.mustache
@@ -5,20 +5,20 @@ import okhttp3.Response
/**
* Provides an extension to evaluation whether the response is a 1xx code
*/
-{{#nonPublicApi}}internal {{/nonPublicApi}}val Response.isInformational : Boolean get() = this.code in 100..199
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val Response.isInformational : Boolean get() = this.code in 100..199
/**
* Provides an extension to evaluation whether the response is a 3xx code
*/
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
-{{#nonPublicApi}}internal {{/nonPublicApi}}val Response.isRedirect : Boolean get() = this.code in 300..399
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val Response.isRedirect : Boolean get() = this.code in 300..399
/**
* Provides an extension to evaluation whether the response is a 4xx code
*/
-{{#nonPublicApi}}internal {{/nonPublicApi}}val Response.isClientError : Boolean get() = this.code in 400..499
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val Response.isClientError : Boolean get() = this.code in 400..499
/**
* Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code
*/
-{{#nonPublicApi}}internal {{/nonPublicApi}}val Response.isServerError : Boolean get() = this.code in 500..999
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val Response.isServerError : Boolean get() = this.code in 500..999
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/api.mustache
index 4381539414cd..108940e9b411 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/api.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/api.mustache
@@ -69,7 +69,7 @@ import okhttp3.MultipartBody
{{/isMultipart}}
{{/x-kotlin-multipart-import}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}interface {{classname}} {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}interface {{classname}} {
{{#operation}}
{{#allParams}}
{{#isEnum}}
@@ -77,7 +77,7 @@ import okhttp3.MultipartBody
/**
* enum for parameter {{paramName}}
*/
- {{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{enumName}}{{operationIdCamelCase}}(val value: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}kotlin.String{{/isContainer}}) {
+ {{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}enum class {{enumName}}{{operationIdCamelCase}}({{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val value: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}kotlin.String{{/isContainer}}) {
{{^enumUnknownDefaultCase}}
{{#allowableValues}}
{{#enumVars}}
@@ -154,7 +154,7 @@ import okhttp3.MultipartBody
{{/prioritizedContentTypes}}
{{/formParams}}
@{{httpMethod}}("{{{path}}}")
- {{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}({{^allParams}}){{/allParams}}{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{#-last}}){{/-last}}{{/allParams}}: {{^doNotUseRxAndCoroutines}}{{#useRxJava}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{^returnType}}Unit{{/returnType}}{{/isResponseFile}}>{{/useRxJava}}{{#useRxJava2}}{{#returnType}}Single<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Single<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{#useCoroutines}}Response<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{^returnType}}Unit{{/returnType}}{{/isResponseFile}}>{{/useCoroutines}}{{/doNotUseRxAndCoroutines}}{{#doNotUseRxAndCoroutines}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{^returnType}}Unit{{/returnType}}{{/isResponseFile}}>{{/doNotUseRxAndCoroutines}}
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}{{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}({{^allParams}}){{/allParams}}{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{#-last}}){{/-last}}{{/allParams}}: {{^doNotUseRxAndCoroutines}}{{#useRxJava}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{^returnType}}Unit{{/returnType}}{{/isResponseFile}}>{{/useRxJava}}{{#useRxJava2}}{{#returnType}}Single<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Single<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{#useCoroutines}}Response<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{^returnType}}Unit{{/returnType}}{{/isResponseFile}}>{{/useCoroutines}}{{/doNotUseRxAndCoroutines}}{{#doNotUseRxAndCoroutines}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{^returnType}}Unit{{/returnType}}{{/isResponseFile}}>{{/doNotUseRxAndCoroutines}}
{{/operation}}
}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/auth/ApiKeyAuth.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/auth/ApiKeyAuth.kt.mustache
index 967980ae7fb5..93b4a2510894 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/auth/ApiKeyAuth.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/auth/ApiKeyAuth.kt.mustache
@@ -7,7 +7,7 @@ import java.net.URISyntaxException
import okhttp3.Interceptor
import okhttp3.Response
-class ApiKeyAuth(
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class ApiKeyAuth(
private val location: String = "",
private val paramName: String = "",
private var apiKey: String = ""
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/auth/HttpBasicAuth.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/auth/HttpBasicAuth.kt.mustache
index fc122514388c..e585a461d5a1 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/auth/HttpBasicAuth.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/auth/HttpBasicAuth.kt.mustache
@@ -8,12 +8,12 @@ import okhttp3.Interceptor.Chain
import okhttp3.Response
import okhttp3.Credentials
-class HttpBasicAuth(
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class HttpBasicAuth(
private var username: String = "",
private var password: String = ""
) : Interceptor {
- fun setCredentials(username: String, password: String) {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun setCredentials(username: String, password: String) {
this.username = username
this.password = password
}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/auth/HttpBearerAuth.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/auth/HttpBearerAuth.kt.mustache
index 7488e6a9f573..64cd57398385 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/auth/HttpBearerAuth.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/auth/HttpBearerAuth.kt.mustache
@@ -6,7 +6,7 @@ import okhttp3.Interceptor
import okhttp3.Interceptor.Chain
import okhttp3.Response
-class HttpBearerAuth(
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class HttpBearerAuth(
private var schema: String = "",
var bearerToken: String = ""
) : Interceptor {
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/auth/OAuth.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/auth/OAuth.kt.mustache
index 8063b6c71861..b8c7044fa33b 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/auth/OAuth.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/auth/OAuth.kt.mustache
@@ -19,13 +19,13 @@ import okhttp3.Interceptor
import okhttp3.OkHttpClient
import okhttp3.Response
-class OAuth(
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class OAuth(
client: OkHttpClient,
var tokenRequestBuilder: TokenRequestBuilder
) : Interceptor {
- interface AccessTokenListener {
- fun notify(token: BasicOAuthToken)
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}interface AccessTokenListener {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun notify(token: BasicOAuthToken)
}
private var oauthClient: OAuthClient = OAuthClient(OAuthOkHttpClient(client))
@@ -35,14 +35,14 @@ class OAuth(
var authenticationRequestBuilder: AuthenticationRequestBuilder? = null
private var accessTokenListener: AccessTokenListener? = null
- constructor(
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}constructor(
requestBuilder: TokenRequestBuilder
) : this(
OkHttpClient(),
requestBuilder
)
- constructor(
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}constructor(
flow: OAuthFlow,
authorizationUrl: String,
tokenUrl: String,
@@ -54,7 +54,7 @@ class OAuth(
authenticationRequestBuilder = OAuthClientRequest.authorizationLocation(authorizationUrl)
}
- fun setFlow(flow: OAuthFlow) {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun setFlow(flow: OAuthFlow) {
when (flow) {
OAuthFlow.accessCode, OAuthFlow.implicit ->
tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE)
@@ -129,7 +129,7 @@ class OAuth(
*/
@Throws(IOException::class)
@Synchronized
- fun updateAccessToken(requestAccessToken: String?): Boolean {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun updateAccessToken(requestAccessToken: String?): Boolean {
if (accessToken == null || accessToken.equals(requestAccessToken)) {
return try {
val accessTokenResponse = oauthClient.accessToken(this.tokenRequestBuilder.buildBodyMessage())
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/auth/OAuthFlow.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/auth/OAuthFlow.kt.mustache
index 05ad3f7e547b..3e1e895d24f6 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/auth/OAuthFlow.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/auth/OAuthFlow.kt.mustache
@@ -1,5 +1,5 @@
package {{packageName}}.auth
-enum class OAuthFlow {
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}enum class OAuthFlow {
accessCode, implicit, password, application
}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/auth/OAuthOkHttpClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/auth/OAuthOkHttpClient.kt.mustache
index 0731e92a890c..4b29681cf9dd 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/auth/OAuthOkHttpClient.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/auth/OAuthOkHttpClient.kt.mustache
@@ -16,7 +16,7 @@ import okhttp3.RequestBody
import okhttp3.RequestBody.Companion.toRequestBody
-class OAuthOkHttpClient(
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class OAuthOkHttpClient(
private var client: OkHttpClient = OkHttpClient()
) : HttpClient {
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache
index a10257b657f5..94c128e7967d 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache
@@ -60,7 +60,7 @@ import {{packageName}}.infrastructure.Serializer.kotlinxSerializationJson
import okhttp3.MediaType.Companion.toMediaType
{{/kotlinx_serialization}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}class ApiClient(
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class ApiClient(
private var baseUrl: String = defaultBasePath,
private val okHttpClientBuilder: OkHttpClient.Builder? = null,
{{^kotlinx_serialization}}
@@ -95,7 +95,7 @@ import okhttp3.MediaType.Companion.toMediaType
)
) {
private val apiAuthorizations = mutableMapOf()
- var logger: ((String) -> Unit)? = null
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}var logger: ((String) -> Unit)? = null
private val retrofitBuilder: Retrofit.Builder by lazy {
Retrofit.Builder()
@@ -129,7 +129,7 @@ import okhttp3.MediaType.Companion.toMediaType
}
{{#hasAuthMethods}}
- constructor(
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}constructor(
baseUrl: String = defaultBasePath,
okHttpClientBuilder: OkHttpClient.Builder? = null,
{{^kotlinx_serialization}}serializerBuilder: {{#gson}}GsonBuilder{{/gson}}{{#moshi}}Moshi.Builder{{/moshi}}{{#jackson}}ObjectMapper{{/jackson}} = Serializer.{{#gson}}gsonBuilder{{/gson}}{{#moshi}}moshiBuilder{{/moshi}}{{#jackson}}jacksonObjectMapper{{/jackson}},{{/kotlinx_serialization}}
@@ -168,7 +168,7 @@ import okhttp3.MediaType.Companion.toMediaType
{{#authMethods}}
{{#isBasic}}
{{#isBasicBasic}}
- constructor(
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}constructor(
baseUrl: String = defaultBasePath,
okHttpClientBuilder: OkHttpClient.Builder? = null,
{{^kotlinx_serialization}}serializerBuilder: {{#gson}}GsonBuilder{{/gson}}{{#moshi}}Moshi.Builder{{/moshi}}{{#jackson}}ObjectMapper{{/jackson}} = Serializer.{{#gson}}gsonBuilder{{/gson}}{{#moshi}}moshiBuilder{{/moshi}}{{#jackson}}jacksonObjectMapper{{/jackson}},{{/kotlinx_serialization}}
@@ -181,7 +181,7 @@ import okhttp3.MediaType.Companion.toMediaType
{{/isBasicBasic}}
{{#isBasicBearer}}
- constructor(
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}constructor(
baseUrl: String = defaultBasePath,
okHttpClientBuilder: OkHttpClient.Builder? = null,
{{^kotlinx_serialization}}serializerBuilder: {{#gson}}GsonBuilder{{/gson}}{{#moshi}}Moshi.Builder{{/moshi}}{{#jackson}}ObjectMapper{{/jackson}} = Serializer.{{#gson}}gsonBuilder{{/gson}}{{#moshi}}moshiBuilder{{/moshi}}{{#jackson}}jacksonObjectMapper{{/jackson}},{{/kotlinx_serialization}}
@@ -195,7 +195,7 @@ import okhttp3.MediaType.Companion.toMediaType
{{/isBasic}}
{{/authMethods}}
{{#hasOAuthMethods}}
- constructor(
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}constructor(
baseUrl: String = defaultBasePath,
okHttpClientBuilder: OkHttpClient.Builder? = null,
{{^kotlinx_serialization}}serializerBuilder: {{#gson}}GsonBuilder{{/gson}}{{#moshi}}Moshi.Builder{{/moshi}}{{#jackson}}ObjectMapper{{/jackson}} = Serializer.{{#gson}}gsonBuilder{{/gson}}{{#moshi}}moshiBuilder{{/moshi}}{{#jackson}}jacksonObjectMapper{{/jackson}},{{/kotlinx_serialization}}
@@ -216,7 +216,7 @@ import okhttp3.MediaType.Companion.toMediaType
{{#authMethods}}
{{#isBasic}}
{{#isBasicBasic}}
- fun setCredentials(username: String, password: String): ApiClient {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun setCredentials(username: String, password: String): ApiClient {
apiAuthorizations.values.runOnFirst {
setCredentials(username, password)
}
@@ -231,7 +231,7 @@ import okhttp3.MediaType.Companion.toMediaType
{{/isBasicBasic}}
{{^isBasicBasic}}
{{#hasOAuthMethods}}
- fun setCredentials(username: String, password: String): ApiClient {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun setCredentials(username: String, password: String): ApiClient {
apiAuthorizations.values.runOnFirst {
tokenRequestBuilder.setUsername(username).setPassword(password)
}
@@ -240,7 +240,7 @@ import okhttp3.MediaType.Companion.toMediaType
{{/hasOAuthMethods}}
{{/isBasicBasic}}
{{#isBasicBearer}}
- fun setBearerToken(bearerToken: String): ApiClient {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun setBearerToken(bearerToken: String): ApiClient {
apiAuthorizations.values.runOnFirst {
this.bearerToken = bearerToken
}
@@ -256,7 +256,7 @@ import okhttp3.MediaType.Companion.toMediaType
* 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? {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun getTokenEndPoint(): TokenRequestBuilder? {
var result: TokenRequestBuilder? = null
apiAuthorizations.values.runOnFirst {
result = tokenRequestBuilder
@@ -268,7 +268,7 @@ import okhttp3.MediaType.Companion.toMediaType
* 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? {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun getAuthorizationEndPoint(): AuthenticationRequestBuilder? {
var result: AuthenticationRequestBuilder? = null
apiAuthorizations.values.runOnFirst {
result = authenticationRequestBuilder
@@ -281,7 +281,7 @@ import okhttp3.MediaType.Companion.toMediaType
* @param accessToken Access token
* @return ApiClient
*/
- fun setAccessToken(accessToken: String): ApiClient {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun setAccessToken(accessToken: String): ApiClient {
apiAuthorizations.values.runOnFirst {
setAccessToken(accessToken)
}
@@ -295,7 +295,7 @@ import okhttp3.MediaType.Companion.toMediaType
* @param redirectURI Redirect URI
* @return ApiClient
*/
- fun configureAuthorizationFlow(clientId: String, clientSecret: String, redirectURI: String): ApiClient {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun configureAuthorizationFlow(clientId: String, clientSecret: String, redirectURI: String): ApiClient {
apiAuthorizations.values.runOnFirst {
tokenRequestBuilder
.setClientId(clientId)
@@ -313,7 +313,7 @@ import okhttp3.MediaType.Companion.toMediaType
* @param accessTokenListener Access token listener
* @return ApiClient
*/
- fun registerAccessTokenListener(accessTokenListener: AccessTokenListener): ApiClient {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun registerAccessTokenListener(accessTokenListener: AccessTokenListener): ApiClient {
apiAuthorizations.values.runOnFirst {
registerAccessTokenListener(accessTokenListener)
}
@@ -327,7 +327,7 @@ import okhttp3.MediaType.Companion.toMediaType
* @param authorization Authorization interceptor
* @return ApiClient
*/
- fun addAuthorization(authName: String, authorization: Interceptor): ApiClient {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun addAuthorization(authName: String, authorization: Interceptor): ApiClient {
if (apiAuthorizations.containsKey(authName)) {
throw RuntimeException("auth name $authName already in api authorizations")
}
@@ -336,12 +336,12 @@ import okhttp3.MediaType.Companion.toMediaType
return this
}
- fun setLogger(logger: (String) -> Unit): ApiClient {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun setLogger(logger: (String) -> Unit): ApiClient {
this.logger = logger
return this
}
- fun createService(serviceClass: Class): S {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun createService(serviceClass: Class): S {
val usedCallFactory = this.callFactory ?: clientBuilder.build()
return retrofitBuilder.callFactory(usedCallFactory).build().create(serviceClass)
}
@@ -353,7 +353,7 @@ import okhttp3.MediaType.Companion.toMediaType
* Gets the serializer builder.
* @return serial builder
*/
- fun getSerializerBuilder(): GsonBuilder {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun getSerializerBuilder(): GsonBuilder {
return serializerBuilder
}
@@ -375,12 +375,12 @@ import okhttp3.MediaType.Companion.toMediaType
}
}
- companion object {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}companion object {
@JvmStatic
- protected val baseUrlKey = "{{packageName}}.baseUrl"
+ protected val baseUrlKey: String = "{{packageName}}.baseUrl"
@JvmStatic
- val defaultBasePath: String by lazy {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val defaultBasePath: String by lazy {
System.getProperties().getProperty(baseUrlKey, "{{{basePath}}}")
}
}
@@ -395,7 +395,7 @@ import okhttp3.MediaType.Companion.toMediaType
* @param gsonBuilder gson builder
* @return GSON builder
*/
-fun registerTypeAdapterFactoryForAllModels(gsonBuilder: GsonBuilder): GsonBuilder {
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun registerTypeAdapterFactoryForAllModels(gsonBuilder: GsonBuilder): GsonBuilder {
{{#models}}
{{#model}}
{{^isEnum}}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/CollectionFormats.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/CollectionFormats.kt.mustache
index 4e8030cb56f3..b6d79790a829 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/CollectionFormats.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/CollectionFormats.kt.mustache
@@ -1,16 +1,16 @@
package {{packageName}}.infrastructure
-class CollectionFormats {
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class CollectionFormats {
- open class CSVParams {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}open class CSVParams {
- var params: List
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}var params: List
- constructor(params: List) {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}constructor(params: List) {
this.params = params
}
- constructor(vararg params: String) {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}constructor(vararg params: String) {
this.params = listOf(*params)
}
@@ -19,38 +19,38 @@ class CollectionFormats {
}
}
- open class SSVParams : CSVParams {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}open class SSVParams : CSVParams {
- constructor(params: List) : super(params)
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}constructor(params: List) : super(params)
- constructor(vararg params: String) : super(*params)
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}constructor(vararg params: String) : super(*params)
override fun toString(): String {
return params.joinToString(" ")
}
}
- class TSVParams : CSVParams {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class TSVParams : CSVParams {
- constructor(params: List) : super(params)
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}constructor(params: List) : super(params)
- constructor(vararg params: String) : super(*params)
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}constructor(vararg params: String) : super(*params)
override fun toString(): String {
return params.joinToString("\t")
}
}
- class PIPESParams : CSVParams {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class PIPESParams : CSVParams {
- constructor(params: List) : super(params)
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}constructor(params: List) : super(params)
- constructor(vararg params: String) : super(*params)
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}constructor(vararg params: String) : super(*params)
override fun toString(): String {
return params.joinToString("|")
}
}
- class SPACEParams : SSVParams()
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class SPACEParams : SSVParams()
}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ResponseExt.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ResponseExt.kt.mustache
index a920e0482022..f71771a592a4 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ResponseExt.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ResponseExt.kt.mustache
@@ -12,7 +12,7 @@ import retrofit2.Response
{{#moshi}}
@Throws(JsonDataException::class)
-inline fun Response<*>.getErrorResponse(serializerBuilder: Moshi.Builder = Serializer.moshiBuilder): T? {
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}inline fun Response<*>.getErrorResponse(serializerBuilder: Moshi.Builder = Serializer.moshiBuilder): T? {
val serializer = serializerBuilder.build()
val parser = serializer.adapter(T::class.java)
val response = errorBody()?.string()
@@ -24,7 +24,7 @@ inline fun Response<*>.getErrorResponse(serializerBuilder: Moshi.Bui
{{/moshi}}
{{#gson}}
@Throws(JsonParseException::class)
-inline fun Response<*>.getErrorResponse(serializerBuilder: GsonBuilder = Serializer.gsonBuilder): T? {
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}inline fun Response<*>.getErrorResponse(serializerBuilder: GsonBuilder = Serializer.gsonBuilder): T? {
val serializer = serializerBuilder.create()
val reader = errorBody()?.charStream()
if (reader != null) {
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-restclient/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-restclient/api.mustache
index e1ad1abe32fb..2c4d5986aa8b 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-restclient/api.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-restclient/api.mustache
@@ -20,10 +20,10 @@ import org.springframework.http.MediaType
import {{packageName}}.infrastructure.*
{{#operations}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}class {{classname}}(client: RestClient) : ApiClient(client) {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class {{classname}}(client: RestClient) : ApiClient(client) {
{{#jackson}}
- constructor(baseUrl: String) : this(RestClient.builder()
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}constructor(baseUrl: String) : this(RestClient.builder()
.baseUrl(baseUrl)
.messageConverters { it.add(MappingJackson2HttpMessageConverter()) }
.build()
@@ -36,7 +36,7 @@ import {{packageName}}.infrastructure.*
/**
* enum for parameter {{paramName}}
*/
- {{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{enumName}}{{operationIdCamelCase}}(val value: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}kotlin.String{{/isContainer}}) {
+ {{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}enum class {{enumName}}{{operationIdCamelCase}}({{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val value: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}kotlin.String{{/isContainer}}) {
{{^enumUnknownDefaultCase}}
{{#allowableValues}}
{{#enumVars}}
@@ -66,7 +66,7 @@ import {{packageName}}.infrastructure.*
{{#isDeprecated}}
@Deprecated(message = "This operation is deprecated.")
{{/isDeprecated}}
- fun {{operationId}}({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{#defaultValue}} = {{>param_default_value}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): {{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}} {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun {{operationId}}({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{#defaultValue}} = {{>param_default_value}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): {{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}} {
{{#returnType}}val result = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}})
{{#returnType}}
return result.body!!
@@ -77,7 +77,7 @@ import {{packageName}}.infrastructure.*
{{#isDeprecated}}
@Deprecated(message = "This operation is deprecated.")
{{/isDeprecated}}
- fun {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{#defaultValue}} = {{>param_default_value}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): ResponseEntity<{{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}> {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{#defaultValue}} = {{>param_default_value}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): ResponseEntity<{{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}> {
val localVariableConfig = {{operationId}}RequestConfig({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}})
return request<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map>{{/hasFormParams}}{{/hasBodyParam}}, {{{returnType}}}{{^returnType}}Unit{{/returnType}}>(
localVariableConfig
@@ -87,7 +87,7 @@ import {{packageName}}.infrastructure.*
{{#isDeprecated}}
@Deprecated(message = "This operation is deprecated.")
{{/isDeprecated}}
- fun {{operationId}}RequestConfig({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{#defaultValue}} = {{>param_default_value}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : RequestConfig<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map>{{/hasFormParams}}{{/hasBodyParam}}> {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun {{operationId}}RequestConfig({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{#defaultValue}} = {{>param_default_value}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : RequestConfig<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map>{{/hasFormParams}}{{/hasBodyParam}}> {
val localVariableBody = {{#hasBodyParam}}{{!
}}{{#bodyParams}}{{{paramName}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{!
}}{{^hasFormParams}}null{{/hasFormParams}}{{!
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-restclient/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-restclient/infrastructure/ApiClient.kt.mustache
index 9d116ed9b175..62876703d700 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-restclient/infrastructure/ApiClient.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-restclient/infrastructure/ApiClient.kt.mustache
@@ -8,7 +8,7 @@ import org.springframework.web.client.RestClient
import org.springframework.http.ResponseEntity
import org.springframework.util.LinkedMultiValueMap
-open class ApiClient(protected val client: RestClient) {
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}open class ApiClient(protected val client: RestClient) {
protected inline fun request(requestConfig: RequestConfig): ResponseEntity {
return prepare(defaults(requestConfig))
@@ -50,7 +50,7 @@ open class ApiClient(protected val client: RestClient) {
apply { if (requestConfig.body != null) body(requestConfig.body) }
}
-inline fun parseDateToQueryString(value : T): String {
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}inline fun parseDateToQueryString(value : T): String {
{{#toJson}}
/*
.replace("\"", "") converts the json object string to an actual string for the query parameter.
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-webclient/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-webclient/api.mustache
index 177a918b06ef..8668d4bbf1c4 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-webclient/api.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-webclient/api.mustache
@@ -21,10 +21,10 @@ import org.springframework.util.LinkedMultiValueMap
import {{packageName}}.infrastructure.*
{{#operations}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}class {{classname}}(client: WebClient) : ApiClient(client) {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class {{classname}}(client: WebClient) : ApiClient(client) {
{{#jackson}}
- constructor(baseUrl: String) : this(WebClient.builder()
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}constructor(baseUrl: String) : this(WebClient.builder()
.baseUrl(baseUrl)
.codecs {
it.defaultCodecs().jackson2JsonEncoder(Jackson2JsonEncoder(Serializer.jacksonObjectMapper, MediaType.APPLICATION_JSON))
@@ -40,7 +40,7 @@ import {{packageName}}.infrastructure.*
/**
* enum for parameter {{paramName}}
*/
- {{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{enumName}}{{operationIdCamelCase}}(val value: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}kotlin.String{{/isContainer}}) {
+ {{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}enum class {{enumName}}{{operationIdCamelCase}}({{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val value: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}kotlin.String{{/isContainer}}) {
{{^enumUnknownDefaultCase}}
{{#allowableValues}}
{{#enumVars}}
@@ -70,7 +70,7 @@ import {{packageName}}.infrastructure.*
{{#isDeprecated}}
@Deprecated(message = "This operation is deprecated.")
{{/isDeprecated}}
- fun {{operationId}}({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{#defaultValue}} = {{>param_default_value}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): Mono<{{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}> {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun {{operationId}}({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{#defaultValue}} = {{>param_default_value}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): Mono<{{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}> {
return {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}})
.map { {{#returnType}}it.body{{/returnType}}{{^returnType}}Unit{{/returnType}} }
}
@@ -79,7 +79,7 @@ import {{packageName}}.infrastructure.*
{{#isDeprecated}}
@Deprecated(message = "This operation is deprecated.")
{{/isDeprecated}}
- fun {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{#defaultValue}} = {{>param_default_value}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): Mono> {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{#defaultValue}} = {{>param_default_value}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): Mono> {
val localVariableConfig = {{operationId}}RequestConfig({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}})
return request<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map>{{/hasFormParams}}{{/hasBodyParam}}, {{{returnType}}}{{^returnType}}Unit{{/returnType}}>(
localVariableConfig
@@ -89,7 +89,7 @@ import {{packageName}}.infrastructure.*
{{#isDeprecated}}
@Deprecated(message = "This operation is deprecated.")
{{/isDeprecated}}
- fun {{operationId}}RequestConfig({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{#defaultValue}} = {{>param_default_value}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : RequestConfig<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map>{{/hasFormParams}}{{/hasBodyParam}}> {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun {{operationId}}RequestConfig({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{#defaultValue}} = {{>param_default_value}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : RequestConfig<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map>{{/hasFormParams}}{{/hasBodyParam}}> {
val localVariableBody = {{#hasBodyParam}}{{!
}}{{#bodyParams}}{{{paramName}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{!
}}{{^hasFormParams}}null{{/hasFormParams}}{{!
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-webclient/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-webclient/infrastructure/ApiClient.kt.mustache
index 3e54c65f099d..7417df0106ee 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-webclient/infrastructure/ApiClient.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-webclient/infrastructure/ApiClient.kt.mustache
@@ -10,7 +10,7 @@ import org.springframework.http.client.MultipartBodyBuilder
import org.springframework.util.LinkedMultiValueMap
import reactor.core.publisher.Mono
-open class ApiClient(protected val client: WebClient) {
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}open class ApiClient(protected val client: WebClient) {
protected inline fun request(requestConfig: RequestConfig): Mono> {
return prepare(defaults(requestConfig))
@@ -68,7 +68,7 @@ open class ApiClient(protected val client: WebClient) {
}
}
-inline fun parseDateToQueryString(value : T): String {
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}inline fun parseDateToQueryString(value : T): String {
{{#toJson}}
/*
.replace("\"", "") converts the json object string to an actual string for the query parameter.
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/api.mustache
index 1ccca7f298f1..81b7fe98693a 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/api.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/api.mustache
@@ -37,14 +37,14 @@ import {{packageName}}.infrastructure.*
@Suppress ("UNUSED")
{{#operations}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}class {{classname}}(basePath: kotlin.String = ApiClient.defaultBasePath, accessToken: String? = null, apiKey: MutableMap = mutableMapOf(), apiKeyPrefix: MutableMap = mutableMapOf(), username: String? = null, password: String? = null, vertx: Vertx): ApiClient(basePath, accessToken, apiKey, apiKeyPrefix, username, password, vertx) {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class {{classname}}(basePath: kotlin.String = ApiClient.defaultBasePath, accessToken: String? = null, apiKey: MutableMap = mutableMapOf(), apiKeyPrefix: MutableMap = mutableMapOf(), username: String? = null, password: String? = null, vertx: Vertx): ApiClient(basePath, accessToken, apiKey, apiKeyPrefix, username, password, vertx) {
{{#operation}}
{{#allParams}}
{{#isEnum}}
/**
* enum for parameter {{paramName}}
*/
- {{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{enumName}}{{operationIdCamelCase}}(val value: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}kotlin.String{{/isContainer}}) {
+ {{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}enum class {{enumName}}{{operationIdCamelCase}}({{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val value: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}kotlin.String{{/isContainer}}) {
{{^enumUnknownDefaultCase}}
{{#allowableValues}}
{{#enumVars}}
@@ -103,7 +103,7 @@ import {{packageName}}.infrastructure.*
{{#isDeprecated}}
@Deprecated(message = "This operation is deprecated.")
{{/isDeprecated}}
- {{#useCoroutines}}suspend {{/useCoroutines}}fun {{operationId}}({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : {{^useCoroutines}}Future<{{/useCoroutines}}{{#returnType}}{{{returnType}}}{{#nullableReturnType}}{{^isResponseOptional}}?{{/isResponseOptional}}{{/nullableReturnType}}{{#isResponseOptional}}?{{/isResponseOptional}}{{/returnType}}{{^returnType}}Unit{{/returnType}}{{^useCoroutines}}>{{/useCoroutines}} {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}{{#useCoroutines}}suspend {{/useCoroutines}}fun {{operationId}}({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : {{^useCoroutines}}Future<{{/useCoroutines}}{{#returnType}}{{{returnType}}}{{#nullableReturnType}}{{^isResponseOptional}}?{{/isResponseOptional}}{{/nullableReturnType}}{{#isResponseOptional}}?{{/isResponseOptional}}{{/returnType}}{{^returnType}}Unit{{/returnType}}{{^useCoroutines}}>{{/useCoroutines}} {
return {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}).map { localVarResponse ->
when (localVarResponse.responseType) {
ResponseType.Success -> {{#returnType}}(localVarResponse as Success<*>).data as {{{returnType}}}{{#nullableReturnType}}{{^isResponseOptional}}?{{/isResponseOptional}}{{/nullableReturnType}}{{#isResponseOptional}}?{{/isResponseOptional}}{{/returnType}}{{^returnType}}Unit{{/returnType}}
@@ -134,7 +134,7 @@ import {{packageName}}.infrastructure.*
{{#isDeprecated}}
@Deprecated(message = "This operation is deprecated.")
{{/isDeprecated}}
- fun {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : Future> {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : Future> {
val vertxClient = WebClient.create(vertx)
val request = vertxClient.requestAbs(HttpMethod.{{httpMethod}}, UriTemplate.of("$basePath{{{path}}}"{{#pathParams}}.replace("{"+"{{baseName}}"+"}", encodeURIComponent({{#isContainer}}{{paramName}}.joinToString(","){{/isContainer}}{{^isContainer}}{{{paramName}}}{{#isEnum}}{{^required}}?{{/required}}.value{{/isEnum}}.toString(){{/isContainer}})){{/pathParams}}))
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/infrastructure/ApiClient.kt.mustache
index dacce6f4742a..4a82f4680a5e 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/infrastructure/ApiClient.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/infrastructure/ApiClient.kt.mustache
@@ -10,12 +10,12 @@ import com.fasterxml.jackson.core.type.TypeReference
import com.google.gson.reflect.TypeToken
{{/gson}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}open class ApiClient(val basePath: kotlin.String = defaultBasePath, val accessToken: String? = null, val apiKey: MutableMap = mutableMapOf(), val apiKeyPrefix: MutableMap = mutableMapOf(), var username: String? = null, var password: String? = null, val vertx: Vertx) {
- companion object {
- const val baseUrlKey = "{{packageName}}.baseUrl"
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}open class ApiClient(val basePath: kotlin.String = defaultBasePath, val accessToken: String? = null, val apiKey: MutableMap = mutableMapOf(), val apiKeyPrefix: MutableMap = mutableMapOf(), var username: String? = null, var password: String? = null, val vertx: Vertx) {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}companion object {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}const val baseUrlKey: String = "{{packageName}}.baseUrl"
@JvmStatic
- val defaultBasePath: String by lazy {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val defaultBasePath: String by lazy {
System.getProperties().getProperty(baseUrlKey, "{{{basePath}}}")
}
}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/infrastructure/ApiResponse.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/infrastructure/ApiResponse.kt.mustache
index d529ad5599f1..ae7f7f4a11f5 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/infrastructure/ApiResponse.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/infrastructure/ApiResponse.kt.mustache
@@ -1,43 +1,43 @@
package {{packageName}}.infrastructure
-{{#nonPublicApi}}internal {{/nonPublicApi}}enum class ResponseType {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}enum class ResponseType {
Success, Informational, Redirection, ClientError, ServerError
}
-{{#nonPublicApi}}internal {{/nonPublicApi}}interface Response
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}interface Response
-{{#nonPublicApi}}internal {{/nonPublicApi}}abstract class ApiResponse(val responseType: ResponseType): Response {
- abstract val statusCode: Int
- abstract val headers: Map>
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}abstract class ApiResponse({{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val responseType: ResponseType): Response {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}abstract val statusCode: Int
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}abstract val headers: Map>
}
-{{#nonPublicApi}}internal {{/nonPublicApi}}class Success(
- val data: T{{#nullableReturnType}}?{{/nullableReturnType}},
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class Success(
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val data: T{{#nullableReturnType}}?{{/nullableReturnType}},
override val statusCode: Int = -1,
override val headers: Map> = mapOf()
): ApiResponse(ResponseType.Success)
-{{#nonPublicApi}}internal {{/nonPublicApi}}class Informational(
- val statusText: String,
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class Informational(
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val statusText: String,
override val statusCode: Int = -1,
override val headers: Map> = mapOf()
) : ApiResponse(ResponseType.Informational)
-{{#nonPublicApi}}internal {{/nonPublicApi}}class Redirection(
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class Redirection(
override val statusCode: Int = -1,
override val headers: Map> = mapOf()
) : ApiResponse(ResponseType.Redirection)
-{{#nonPublicApi}}internal {{/nonPublicApi}}class ClientError(
- val message: String? = null,
- val body: Any? = null,
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class ClientError(
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val message: String? = null,
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val body: Any? = null,
override val statusCode: Int = -1,
override val headers: Map> = mapOf()
) : ApiResponse(ResponseType.ClientError)
-{{#nonPublicApi}}internal {{/nonPublicApi}}class ServerError(
- val message: String? = null,
- val body: Any? = null,
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class ServerError(
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val message: String? = null,
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val body: Any? = null,
override val statusCode: Int = -1,
override val headers: Map>
): ApiResponse(ResponseType.ServerError)
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/infrastructure/Errors.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/infrastructure/Errors.kt.mustache
index 1357da8d599c..84f10e8ca0a1 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/infrastructure/Errors.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/infrastructure/Errors.kt.mustache
@@ -3,16 +3,16 @@ package {{packageName}}.infrastructure
import java.lang.RuntimeException
-{{#nonPublicApi}}internal {{/nonPublicApi}}open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) {
- {{#nonPublicApi}}internal {{/nonPublicApi}}companion object {
+ {{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}companion object {
private const val serialVersionUID: Long = 123L
}
}
-{{#nonPublicApi}}internal {{/nonPublicApi}}open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) {
- {{#nonPublicApi}}internal {{/nonPublicApi}}companion object {
+ {{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}companion object {
private const val serialVersionUID: Long = 456L
}
}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/api.mustache
index 515c3c6efbaf..9a1deb7f5ef9 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/api.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/api.mustache
@@ -26,7 +26,7 @@ import {{packageName}}.infrastructure.CollectionFormats.*
* can pass that to the request queue like:
* Volley.newRequestQueue(context.applicationContext, myCustomHttpStack)
*/
-class {{classname}} (
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class {{classname}} (
private val context: Context,
private val requestQueue: Lazy = lazy(initializer = {
Volley.newRequestQueue(context.applicationContext)
@@ -45,7 +45,7 @@ class {{classname}} (
{{#isDeprecated}}
@Deprecated("This api was deprecated")
{{/isDeprecated}}
- suspend fun {{operationId}}({{^allParams}}){{/allParams}}{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{#-last}}{{#operationAuthMethod}}, opAuthHeaderFactory = () -> map{{/operationAuthMethod}}){{/-last}}{{/allParams}}: {{#returnType}}{{{returnType}}}?{{/returnType}}{{^returnType}}Unit{{/returnType}} {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}suspend fun {{operationId}}({{^allParams}}){{/allParams}}{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{#-last}}{{#operationAuthMethod}}, opAuthHeaderFactory = () -> map{{/operationAuthMethod}}){{/-last}}{{/allParams}}: {{#returnType}}{{{returnType}}}?{{/returnType}}{{^returnType}}Unit{{/returnType}} {
{{#bodyParam}}
val body: Any? = {{paramName}}
{{/bodyParam}}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/apikeyauth.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/apikeyauth.mustache
index 919da64ce3de..28491678c54a 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/apikeyauth.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/apikeyauth.mustache
@@ -3,7 +3,7 @@
// TODO: Not sure about cookie auth form
// If implementing api key in query parameter use the ^isKeyInHeader property
- val apiKeyAuthHeaderFactoryBuilder = {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val apiKeyAuthHeaderFactoryBuilder = {
paramName: String, apiKeyPrefix: String?, apiKey: String? -> {
mapOf(paramName to
if (apiKeyPrefix != null) {
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/httpbasicauth.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/httpbasicauth.mustache
index f4cf1e11fe6b..8f768ff661d7 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/httpbasicauth.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/httpbasicauth.mustache
@@ -1,3 +1,3 @@
-val basicAuthHeaderFactoryBuilder = { username: String?, password: String? ->
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val basicAuthHeaderFactoryBuilder = { username: String?, password: String? ->
{ mapOf("Authorization" to "Basic " + Base64.encodeToString("${username ?: ""}:${password ?: ""}".toByteArray(), Base64.DEFAULT))}
}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/oauth.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/oauth.mustache
index 81a285bc4782..abbda1d574be 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/oauth.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/oauth.mustache
@@ -1,4 +1,4 @@
-val basicAuthHeaderFactoryBuilder = { username: String?, password: String? ->
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val basicAuthHeaderFactoryBuilder = { username: String?, password: String? ->
{
throw NotImplementedError("OAuth security scheme header factory not implemented yet - see open api generator auth/oauth.mustache")
mapOf("" to "")}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/infrastructure/CollectionFormats.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/infrastructure/CollectionFormats.kt.mustache
index 4e8030cb56f3..b6d79790a829 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/infrastructure/CollectionFormats.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/infrastructure/CollectionFormats.kt.mustache
@@ -1,16 +1,16 @@
package {{packageName}}.infrastructure
-class CollectionFormats {
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class CollectionFormats {
- open class CSVParams {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}open class CSVParams {
- var params: List
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}var params: List
- constructor(params: List) {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}constructor(params: List) {
this.params = params
}
- constructor(vararg params: String) {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}constructor(vararg params: String) {
this.params = listOf(*params)
}
@@ -19,38 +19,38 @@ class CollectionFormats {
}
}
- open class SSVParams : CSVParams {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}open class SSVParams : CSVParams {
- constructor(params: List) : super(params)
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}constructor(params: List) : super(params)
- constructor(vararg params: String) : super(*params)
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}constructor(vararg params: String) : super(*params)
override fun toString(): String {
return params.joinToString(" ")
}
}
- class TSVParams : CSVParams {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class TSVParams : CSVParams {
- constructor(params: List) : super(params)
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}constructor(params: List) : super(params)
- constructor(vararg params: String) : super(*params)
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}constructor(vararg params: String) : super(*params)
override fun toString(): String {
return params.joinToString("\t")
}
}
- class PIPESParams : CSVParams {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class PIPESParams : CSVParams {
- constructor(params: List) : super(params)
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}constructor(params: List) : super(params)
- constructor(vararg params: String) : super(*params)
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}constructor(vararg params: String) : super(*params)
override fun toString(): String {
return params.joinToString("|")
}
}
- class SPACEParams : SSVParams()
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class SPACEParams : SSVParams()
}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/infrastructure/ITransformForStorage.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/infrastructure/ITransformForStorage.mustache
index 48bb25d19b56..088a51124a56 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/infrastructure/ITransformForStorage.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/infrastructure/ITransformForStorage.mustache
@@ -4,6 +4,6 @@ package {{packageName}}.infrastructure
import {{roomModelPackage}}.*
// TODO ITransformForStorage
-interface ITransformForStorage {
- fun toRoomModel(): T
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}interface ITransformForStorage {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun toRoomModel(): T
}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/GsonRequest.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/GsonRequest.mustache
index 9bda9b1f0b62..c6da955a3676 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/GsonRequest.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/GsonRequest.mustache
@@ -21,7 +21,7 @@ import {{packageName}}.infrastructure.LocalDateTimeAdapter
import {{packageName}}.infrastructure.LocalDateAdapter
import {{packageName}}.infrastructure.ByteArrayAdapter
-class GsonRequest(
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class GsonRequest(
method: Int,
url: String,
private val body: Any?,
@@ -35,7 +35,7 @@ class GsonRequest(
errorListener: Response.ErrorListener
) : Request(method, url, errorListener) {
- val gsonBuilder: GsonBuilder = GsonBuilder()
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val gsonBuilder: GsonBuilder = GsonBuilder()
.registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter())
.registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter())
.registerTypeAdapter(LocalDate::class.java, LocalDateAdapter())
@@ -46,7 +46,7 @@ class GsonRequest(
}
}
- val gson: Gson by lazy {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val gson: Gson by lazy {
gsonBuilder.create()
}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/IRequestFactory.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/IRequestFactory.mustache
index 6a007c4194d9..0d1e81429274 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/IRequestFactory.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/IRequestFactory.mustache
@@ -13,17 +13,17 @@ import java.time.OffsetDateTime
import java.time.LocalDate
-interface IRequestFactory {
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}interface IRequestFactory {
- companion object {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}companion object {
/**
* ISO 8601 date time format.
* @see https://en.wikipedia.org/wiki/ISO_8601
*/
- fun formatDateTime(datetime: OffsetDateTime) = DateTimeFormatter.ISO_INSTANT.format(datetime)
- fun formatDate(date: LocalDate) = DateTimeFormatter.ISO_LOCAL_DATE.format(date)
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun formatDateTime(datetime: OffsetDateTime) = DateTimeFormatter.ISO_INSTANT.format(datetime)
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun formatDate(date: LocalDate) = DateTimeFormatter.ISO_LOCAL_DATE.format(date)
- fun escapeString(str: String): String {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun escapeString(str: String): String {
return try {
URLEncoder.encode(str, "UTF-8")
} catch (e: UnsupportedEncodingException) {
@@ -31,7 +31,7 @@ interface IRequestFactory {
}
}
- fun parameterToString(param: Any?) =
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun parameterToString(param: Any?) =
when (param) {
null -> ""
is OffsetDateTime -> formatDateTime(param)
@@ -50,7 +50,7 @@ interface IRequestFactory {
}
- fun build(
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun build(
method: Int,
url : String,
body: Any?,
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/RequestFactory.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/RequestFactory.mustache
index 46507bff1b5d..a8fa5a6ca071 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/RequestFactory.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/RequestFactory.mustache
@@ -12,7 +12,7 @@ import java.lang.reflect.Type
import java.util.Locale
import java.util.UUID
-class RequestFactory(private val headerFactories : List<() -> Map> = listOf(), private val postProcessors :List <(Request<*>) -> Unit> = listOf(), private val gsonAdapters: Map = mapOf()): IRequestFactory {
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class RequestFactory(private val headerFactories : List<() -> Map> = listOf(), private val postProcessors :List <(Request<*>) -> Unit> = listOf(), private val gsonAdapters: Map = mapOf()): IRequestFactory {
{{#hasAuthMethods}}
{{>auth/authentication}}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache
index 6566f40d9651..e5234cf69590 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache
@@ -16,16 +16,16 @@ import kotlinx.serialization.descriptors.*
import kotlinx.serialization.encoding.*
{{#operations}}
-{{#nonPublicApi}}internal {{/nonPublicApi}}open class {{classname}} : ApiClient {
+{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}open class {{classname}} : ApiClient {
- constructor(
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}constructor(
baseUrl: String = ApiClient.BASE_URL,
httpClientEngine: HttpClientEngine? = null,
httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null,
jsonSerializer: Json = ApiClient.JSON_DEFAULT
) : super(baseUrl = baseUrl, httpClientEngine = httpClientEngine, httpClientConfig = httpClientConfig, jsonBlock = jsonSerializer)
- constructor(
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}constructor(
baseUrl: String,
httpClient: HttpClient
): super(baseUrl = baseUrl, httpClient = httpClient)
@@ -38,7 +38,7 @@ import kotlinx.serialization.encoding.*
* enum for parameter {{paramName}}
*/
@Serializable
- {{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{enumName}}{{operationIdCamelCase}}(val value: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}kotlin.String{{/isContainer}}) {
+ {{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}enum class {{enumName}}{{operationIdCamelCase}}({{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val value: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}kotlin.String{{/isContainer}}) {
{{^enumUnknownDefaultCase}}
{{#allowableValues}}{{#enumVars}}
@SerialName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}})
@@ -64,7 +64,7 @@ import kotlinx.serialization.encoding.*
{{#returnType}}
@Suppress("UNCHECKED_CAST")
{{/returnType}}
- open suspend fun {{operationId}}({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{defaultValue}}}.toDouble(){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{defaultValue}}}.toDouble(){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): HttpResponse<{{{returnType}}}{{^returnType}}Unit{{/returnType}}> {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}open suspend fun {{operationId}}({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{defaultValue}}}.toDouble(){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{defaultValue}}}.toDouble(){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): HttpResponse<{{{returnType}}}{{^returnType}}Unit{{/returnType}}> {
val localVariableAuthNames = listOf({{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}})
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/auth/ApiKeyAuth.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/auth/ApiKeyAuth.kt.mustache
index 618fd7a88903..91f2de7114ab 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/auth/ApiKeyAuth.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/auth/ApiKeyAuth.kt.mustache
@@ -1,8 +1,8 @@
package {{packageName}}.auth
-class ApiKeyAuth(private val location: String, val paramName: String) : Authentication {
- var apiKey: String? = null
- var apiKeyPrefix: String? = null
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class ApiKeyAuth(private val location: String, {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}val paramName: String) : Authentication {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}var apiKey: String? = null
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}var apiKeyPrefix: String? = null
override fun apply(query: MutableMap>, headers: MutableMap) {
val key: String = apiKey ?: return
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/auth/Authentication.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/auth/Authentication.kt.mustache
index 1aab9156d98b..f6d131645adc 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/auth/Authentication.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/auth/Authentication.kt.mustache
@@ -1,6 +1,6 @@
package {{packageName}}.auth
-interface Authentication {
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}interface Authentication {
/**
* Apply authentication settings to header and query params.
@@ -8,6 +8,6 @@ interface Authentication {
* @param query Query parameters.
* @param headers Header parameters.
*/
- fun apply(query: MutableMap>, headers: MutableMap)
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun apply(query: MutableMap>, headers: MutableMap)
}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/auth/HttpBasicAuth.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/auth/HttpBasicAuth.kt.mustache
index 26325424e5dd..fbf39cb55b38 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/auth/HttpBasicAuth.kt.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/auth/HttpBasicAuth.kt.mustache
@@ -3,9 +3,9 @@ package {{packageName}}.auth
import io.ktor.util.InternalAPI
import io.ktor.util.encodeBase64
-class HttpBasicAuth : Authentication {
- var username: String? = null
- var password: String? = null
+{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class HttpBasicAuth : Authentication {
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}var username: String? = null
+ {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}var password: String? = null
@OptIn(InternalAPI::class)
override fun apply(query: MutableMap>, headers: MutableMap