forked from loafle/openapi-generator-original
[kotlin][client] Add Jackson as serialization library (#5236)
* [kotlin][client] Add Jackson as serialization library * [kotlin][client] Add kotlin-client-jackson.sh to kotlin-client-all.sh * update kotlin client samples * update doc Co-authored-by: William Cheng <wing328hk@gmail.com>
This commit is contained in:
parent
8b64f4d03e
commit
f6ef4fbec7
@ -1,6 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
./bin/kotlin-client-gson.sh
|
./bin/kotlin-client-gson.sh
|
||||||
|
./bin/kotlin-client-jackson.sh
|
||||||
./bin/kotlin-client-moshi-codegen.sh
|
./bin/kotlin-client-moshi-codegen.sh
|
||||||
./bin/kotlin-client-nonpublic.sh
|
./bin/kotlin-client-nonpublic.sh
|
||||||
./bin/kotlin-client-okhttp3.sh
|
./bin/kotlin-client-okhttp3.sh
|
||||||
|
32
bin/kotlin-client-jackson.sh
Executable file
32
bin/kotlin-client-jackson.sh
Executable file
@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
SCRIPT="$0"
|
||||||
|
echo "# START SCRIPT: $SCRIPT"
|
||||||
|
|
||||||
|
while [ -h "$SCRIPT" ] ; do
|
||||||
|
ls=$(ls -ld "$SCRIPT")
|
||||||
|
link=$(expr "$ls" : '.*-> \(.*\)$')
|
||||||
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
|
SCRIPT="$link"
|
||||||
|
else
|
||||||
|
SCRIPT=$(dirname "$SCRIPT")/"$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ ! -d "${APP_DIR}" ]; then
|
||||||
|
APP_DIR=$(dirname "$SCRIPT")/..
|
||||||
|
APP_DIR=$(cd "${APP_DIR}"; pwd)
|
||||||
|
fi
|
||||||
|
|
||||||
|
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||||
|
|
||||||
|
if [ ! -f "$executable" ]
|
||||||
|
then
|
||||||
|
mvn -B clean package
|
||||||
|
fi
|
||||||
|
|
||||||
|
# if you've executed sbt assembly previously it will use that instead.
|
||||||
|
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||||
|
ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-jackson --additional-properties serializationLibrary=jackson --additional-properties enumPropertyNaming=UPPERCASE -o samples/client/petstore/kotlin-jackson $@"
|
||||||
|
|
||||||
|
java ${JAVA_OPTS} -jar ${executable} ${ags}
|
@ -20,7 +20,7 @@ sidebar_label: kotlin-server
|
|||||||
|packageName|Generated artifact package name.| |org.openapitools.server|
|
|packageName|Generated artifact package name.| |org.openapitools.server|
|
||||||
|parcelizeModels|toggle "@Parcelize" for generated models| |null|
|
|parcelizeModels|toggle "@Parcelize" for generated models| |null|
|
||||||
|serializableModel|boolean - toggle "implements Serializable" for generated models| |null|
|
|serializableModel|boolean - toggle "implements Serializable" for generated models| |null|
|
||||||
|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi|
|
|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson' or 'jackson'| |moshi|
|
||||||
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null|
|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null|
|
||||||
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null|
|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null|
|
||||||
|sourceFolder|source folder for generated code| |src/main/kotlin|
|
|sourceFolder|source folder for generated code| |src/main/kotlin|
|
||||||
|
@ -23,7 +23,7 @@ sidebar_label: kotlin-spring
|
|||||||
|parcelizeModels|toggle "@Parcelize" for generated models| |null|
|
|parcelizeModels|toggle "@Parcelize" for generated models| |null|
|
||||||
|reactive|use coroutines for reactive behavior| |false|
|
|reactive|use coroutines for reactive behavior| |false|
|
||||||
|serializableModel|boolean - toggle "implements Serializable" for generated models| |null|
|
|serializableModel|boolean - toggle "implements Serializable" for generated models| |null|
|
||||||
|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi|
|
|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson' or 'jackson'| |moshi|
|
||||||
|serverPort|configuration the port in which the sever is to run on| |8080|
|
|serverPort|configuration the port in which the sever is to run on| |8080|
|
||||||
|serviceImplementation|generate stub service implementations that extends service interfaces. If this is set to true service interfaces will also be generated| |false|
|
|serviceImplementation|generate stub service implementations that extends service interfaces. If this is set to true service interfaces will also be generated| |false|
|
||||||
|serviceInterface|generate service interfaces to go alongside controllers. In most cases this option would be used to update an existing project, so not to override implementations. Useful to help facilitate the generation gap pattern| |false|
|
|serviceInterface|generate service interfaces to go alongside controllers. In most cases this option would be used to update an existing project, so not to override implementations. Useful to help facilitate the generation gap pattern| |false|
|
||||||
|
@ -14,7 +14,7 @@ sidebar_label: kotlin-vertx
|
|||||||
|packageName|Generated artifact package name.| |org.openapitools|
|
|packageName|Generated artifact package name.| |org.openapitools|
|
||||||
|parcelizeModels|toggle "@Parcelize" for generated models| |null|
|
|parcelizeModels|toggle "@Parcelize" for generated models| |null|
|
||||||
|serializableModel|boolean - toggle "implements Serializable" for generated models| |null|
|
|serializableModel|boolean - toggle "implements Serializable" for generated models| |null|
|
||||||
|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi|
|
|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson' or 'jackson'| |moshi|
|
||||||
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null|
|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null|
|
||||||
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null|
|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null|
|
||||||
|sourceFolder|source folder for generated code| |src/main/kotlin|
|
|sourceFolder|source folder for generated code| |src/main/kotlin|
|
||||||
|
@ -18,7 +18,7 @@ sidebar_label: kotlin
|
|||||||
|parcelizeModels|toggle "@Parcelize" for generated models| |null|
|
|parcelizeModels|toggle "@Parcelize" for generated models| |null|
|
||||||
|requestDateConverter|JVM-Option. Defines in how to handle date-time objects that are used for a request (as query or parameter)|<dl><dt>**toJson**</dt><dd>[DEFAULT] Date formater option using a json converter.</dd><dt>**toString**</dt><dd>Use the 'toString'-method of the date-time object to retrieve the related string representation.</dd></dl>|toJson|
|
|requestDateConverter|JVM-Option. Defines in how to handle date-time objects that are used for a request (as query or parameter)|<dl><dt>**toJson**</dt><dd>[DEFAULT] Date formater option using a json converter.</dd><dt>**toString**</dt><dd>Use the 'toString'-method of the date-time object to retrieve the related string representation.</dd></dl>|toJson|
|
||||||
|serializableModel|boolean - toggle "implements Serializable" for generated models| |null|
|
|serializableModel|boolean - toggle "implements Serializable" for generated models| |null|
|
||||||
|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi|
|
|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson' or 'jackson'| |moshi|
|
||||||
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null|
|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null|
|
||||||
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null|
|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null|
|
||||||
|sourceFolder|source folder for generated code| |src/main/kotlin|
|
|sourceFolder|source folder for generated code| |src/main/kotlin|
|
||||||
|
@ -41,9 +41,9 @@ import static org.openapitools.codegen.utils.StringUtils.*;
|
|||||||
|
|
||||||
public abstract class AbstractKotlinCodegen extends DefaultCodegen implements CodegenConfig {
|
public abstract class AbstractKotlinCodegen extends DefaultCodegen implements CodegenConfig {
|
||||||
|
|
||||||
public static final String SERIALIZATION_LIBRARY_DESC = "What serialization library to use: 'moshi' (default), or 'gson'";
|
public static final String SERIALIZATION_LIBRARY_DESC = "What serialization library to use: 'moshi' (default), or 'gson' or 'jackson'";
|
||||||
|
|
||||||
public enum SERIALIZATION_LIBRARY_TYPE {moshi, gson}
|
public enum SERIALIZATION_LIBRARY_TYPE {moshi, gson, jackson}
|
||||||
|
|
||||||
public static final String MODEL_MUTABLE = "modelMutable";
|
public static final String MODEL_MUTABLE = "modelMutable";
|
||||||
public static final String MODEL_MUTABLE_DESC = "Create mutable models";
|
public static final String MODEL_MUTABLE_DESC = "Create mutable models";
|
||||||
|
@ -323,18 +323,26 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {
|
|||||||
private void addSupportingSerializerAdapters(final String infrastructureFolder) {
|
private void addSupportingSerializerAdapters(final String infrastructureFolder) {
|
||||||
supportingFiles.add(new SupportingFile("jvm-common/infrastructure/Serializer.kt.mustache", infrastructureFolder, "Serializer.kt"));
|
supportingFiles.add(new SupportingFile("jvm-common/infrastructure/Serializer.kt.mustache", infrastructureFolder, "Serializer.kt"));
|
||||||
supportingFiles.add(new SupportingFile("jvm-common/infrastructure/ByteArrayAdapter.kt.mustache", infrastructureFolder, "ByteArrayAdapter.kt"));
|
supportingFiles.add(new SupportingFile("jvm-common/infrastructure/ByteArrayAdapter.kt.mustache", infrastructureFolder, "ByteArrayAdapter.kt"));
|
||||||
supportingFiles.add(new SupportingFile("jvm-common/infrastructure/LocalDateAdapter.kt.mustache", infrastructureFolder, "LocalDateAdapter.kt"));
|
|
||||||
supportingFiles.add(new SupportingFile("jvm-common/infrastructure/LocalDateTimeAdapter.kt.mustache", infrastructureFolder, "LocalDateTimeAdapter.kt"));
|
|
||||||
supportingFiles.add(new SupportingFile("jvm-common/infrastructure/OffsetDateTimeAdapter.kt.mustache", infrastructureFolder, "OffsetDateTimeAdapter.kt"));
|
|
||||||
|
|
||||||
switch (getSerializationLibrary()) {
|
switch (getSerializationLibrary()) {
|
||||||
case moshi:
|
case moshi:
|
||||||
supportingFiles.add(new SupportingFile("jvm-common/infrastructure/UUIDAdapter.kt.mustache", infrastructureFolder, "UUIDAdapter.kt"));
|
supportingFiles.add(new SupportingFile("jvm-common/infrastructure/UUIDAdapter.kt.mustache", infrastructureFolder, "UUIDAdapter.kt"));
|
||||||
|
supportingFiles.add(new SupportingFile("jvm-common/infrastructure/LocalDateAdapter.kt.mustache", infrastructureFolder, "LocalDateAdapter.kt"));
|
||||||
|
supportingFiles.add(new SupportingFile("jvm-common/infrastructure/LocalDateTimeAdapter.kt.mustache", infrastructureFolder, "LocalDateTimeAdapter.kt"));
|
||||||
|
supportingFiles.add(new SupportingFile("jvm-common/infrastructure/OffsetDateTimeAdapter.kt.mustache", infrastructureFolder, "OffsetDateTimeAdapter.kt"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case gson:
|
case gson:
|
||||||
supportingFiles.add(new SupportingFile("jvm-common/infrastructure/DateAdapter.kt.mustache", infrastructureFolder, "DateAdapter.kt"));
|
supportingFiles.add(new SupportingFile("jvm-common/infrastructure/DateAdapter.kt.mustache", infrastructureFolder, "DateAdapter.kt"));
|
||||||
|
supportingFiles.add(new SupportingFile("jvm-common/infrastructure/LocalDateAdapter.kt.mustache", infrastructureFolder, "LocalDateAdapter.kt"));
|
||||||
|
supportingFiles.add(new SupportingFile("jvm-common/infrastructure/LocalDateTimeAdapter.kt.mustache", infrastructureFolder, "LocalDateTimeAdapter.kt"));
|
||||||
|
supportingFiles.add(new SupportingFile("jvm-common/infrastructure/OffsetDateTimeAdapter.kt.mustache", infrastructureFolder, "OffsetDateTimeAdapter.kt"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case jackson:
|
||||||
|
//supportingFiles.add(new SupportingFile("jvm-common/infrastructure/DateAdapter.kt.mustache", infrastructureFolder, "DateAdapter.kt"));
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,6 +49,11 @@ dependencies {
|
|||||||
{{#gson}}
|
{{#gson}}
|
||||||
compile "com.google.code.gson:gson:2.8.6"
|
compile "com.google.code.gson:gson:2.8.6"
|
||||||
{{/gson}}
|
{{/gson}}
|
||||||
|
{{#jackson}}
|
||||||
|
compile "com.fasterxml.jackson.module:jackson-module-kotlin:2.10.2"
|
||||||
|
compile "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.10.2"
|
||||||
|
compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.10.2"
|
||||||
|
{{/jackson}}
|
||||||
{{#jvm-okhttp3}}
|
{{#jvm-okhttp3}}
|
||||||
compile "com.squareup.okhttp3:okhttp:3.12.6"
|
compile "com.squareup.okhttp3:okhttp:3.12.6"
|
||||||
{{/jvm-okhttp3}}
|
{{/jvm-okhttp3}}
|
||||||
|
@ -8,6 +8,10 @@ import com.squareup.moshi.Json
|
|||||||
import com.squareup.moshi.JsonClass
|
import com.squareup.moshi.JsonClass
|
||||||
{{/moshiCodeGen}}
|
{{/moshiCodeGen}}
|
||||||
{{/moshi}}
|
{{/moshi}}
|
||||||
|
{{#jackson}}
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat
|
||||||
|
{{/jackson}}
|
||||||
{{#parcelizeModels}}
|
{{#parcelizeModels}}
|
||||||
import android.os.Parcelable
|
import android.os.Parcelable
|
||||||
import kotlinx.android.parcel.Parcelize
|
import kotlinx.android.parcel.Parcelize
|
||||||
@ -53,6 +57,7 @@ import java.io.Serializable
|
|||||||
* Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}}
|
* Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}}
|
||||||
*/
|
*/
|
||||||
{{#multiplatform}}@Serializable(with = {{nameInCamelCase}}.Serializer::class){{/multiplatform}}
|
{{#multiplatform}}@Serializable(with = {{nameInCamelCase}}.Serializer::class){{/multiplatform}}
|
||||||
|
{{#jackson}}{{#isPrimitiveType}}@JsonFormat(shape = JsonFormat.Shape.NATURAL){{/isPrimitiveType}}{{^isPrimitiveType}}@JsonFormat(shape = JsonFormat.Shape.OBJECT){{/isPrimitiveType}}{{/jackson}}
|
||||||
{{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{{nameInCamelCase}}}(val value: {{#isListContainer}}{{{ nestedType }}}{{/isListContainer}}{{^isListContainer}}{{{dataType}}}{{/isListContainer}}){
|
{{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{{nameInCamelCase}}}(val value: {{#isListContainer}}{{{ nestedType }}}{{/isListContainer}}{{^isListContainer}}{{{dataType}}}{{/isListContainer}}){
|
||||||
{{#allowableValues}}
|
{{#allowableValues}}
|
||||||
{{#enumVars}}
|
{{#enumVars}}
|
||||||
@ -63,6 +68,9 @@ import java.io.Serializable
|
|||||||
{{#gson}}
|
{{#gson}}
|
||||||
@SerializedName(value={{{value}}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}}
|
@SerializedName(value={{{value}}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}}
|
||||||
{{/gson}}
|
{{/gson}}
|
||||||
|
{{#jackson}}
|
||||||
|
@JsonProperty(value={{{value}}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}}
|
||||||
|
{{/jackson}}
|
||||||
{{/multiplatform}}
|
{{/multiplatform}}
|
||||||
{{#multiplatform}}
|
{{#multiplatform}}
|
||||||
{{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}}
|
{{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}}
|
||||||
|
@ -8,5 +8,12 @@
|
|||||||
{{#gson}}
|
{{#gson}}
|
||||||
@SerializedName("{{{vendorExtensions.x-base-name-literal}}}")
|
@SerializedName("{{{vendorExtensions.x-base-name-literal}}}")
|
||||||
{{/gson}}
|
{{/gson}}
|
||||||
|
{{#jackson}}
|
||||||
|
{{#isDateTime}}
|
||||||
|
@JsonFormat
|
||||||
|
(shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy hh:mm:ss")
|
||||||
|
{{/isDateTime}}
|
||||||
|
@JsonProperty("{{{vendorExtensions.x-base-name-literal}}}")
|
||||||
|
{{/jackson}}
|
||||||
{{/multiplatform}}
|
{{/multiplatform}}
|
||||||
{{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") {{/multiplatform}}{{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isListContainer}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{classname}}.{{{nameInCamelCase}}}>{{/isListContainer}}{{^isListContainer}}{{classname}}.{{{nameInCamelCase}}}{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{#defaultvalue}}{{defaultvalue}}{{/defaultvalue}}{{^defaultvalue}}null{{/defaultvalue}}
|
{{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") {{/multiplatform}}{{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isListContainer}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{classname}}.{{{nameInCamelCase}}}>{{/isListContainer}}{{^isListContainer}}{{classname}}.{{{nameInCamelCase}}}{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{#defaultvalue}}{{defaultvalue}}{{/defaultvalue}}{{^defaultvalue}}null{{/defaultvalue}}
|
||||||
|
@ -8,5 +8,8 @@
|
|||||||
{{#gson}}
|
{{#gson}}
|
||||||
@SerializedName("{{{vendorExtensions.x-base-name-literal}}}")
|
@SerializedName("{{{vendorExtensions.x-base-name-literal}}}")
|
||||||
{{/gson}}
|
{{/gson}}
|
||||||
|
{{#jackson}}
|
||||||
|
@JsonProperty("{{{vendorExtensions.x-base-name-literal}}}")
|
||||||
|
{{/jackson}}
|
||||||
{{/multiplatform}}
|
{{/multiplatform}}
|
||||||
{{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") @Required {{/multiplatform}}{{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isListContainer}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{classname}}.{{{nameInCamelCase}}}>{{/isListContainer}}{{^isListContainer}}{{classname}}.{{{nameInCamelCase}}}{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}}?{{/isNullable}}
|
{{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") @Required {{/multiplatform}}{{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isListContainer}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{classname}}.{{{nameInCamelCase}}}>{{/isListContainer}}{{^isListContainer}}{{classname}}.{{{nameInCamelCase}}}{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}}?{{/isNullable}}
|
||||||
|
@ -16,6 +16,7 @@ import kotlinx.serialization.internal.CommonEnumSerializer
|
|||||||
* Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}}
|
* Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}}
|
||||||
*/
|
*/
|
||||||
{{#multiplatform}}@Serializable(with = {{classname}}.Serializer::class){{/multiplatform}}
|
{{#multiplatform}}@Serializable(with = {{classname}}.Serializer::class){{/multiplatform}}
|
||||||
|
{{#jackson}}@JsonFormat(shape = JsonFormat.Shape.OBJECT){{/jackson}}
|
||||||
{{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{classname}}(val value: {{{dataType}}}){
|
{{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{classname}}(val value: {{{dataType}}}){
|
||||||
|
|
||||||
{{#allowableValues}}{{#enumVars}}
|
{{#allowableValues}}{{#enumVars}}
|
||||||
@ -26,6 +27,9 @@ import kotlinx.serialization.internal.CommonEnumSerializer
|
|||||||
{{#gson}}
|
{{#gson}}
|
||||||
@SerializedName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}})
|
@SerializedName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}})
|
||||||
{{/gson}}
|
{{/gson}}
|
||||||
|
{{#jackson}}
|
||||||
|
@JsonProperty(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}})
|
||||||
|
{{/jackson}}
|
||||||
{{/multiplatform}}
|
{{/multiplatform}}
|
||||||
{{#isListContainer}}
|
{{#isListContainer}}
|
||||||
{{#isList}}
|
{{#isList}}
|
||||||
|
@ -60,4 +60,4 @@ import org.threeten.bp.format.DateTimeFormatter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{{/gson}}
|
{{/gson}}
|
||||||
|
@ -22,6 +22,13 @@ import org.threeten.bp.OffsetDateTime
|
|||||||
{{/threetenbp}}
|
{{/threetenbp}}
|
||||||
import java.util.UUID
|
import java.util.UUID
|
||||||
{{/gson}}
|
{{/gson}}
|
||||||
|
{{#jackson}}
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper
|
||||||
|
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module
|
||||||
|
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude
|
||||||
|
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
|
||||||
|
{{/jackson}}
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
|
|
||||||
{{#nonPublicApi}}internal {{/nonPublicApi}}object Serializer {
|
{{#nonPublicApi}}internal {{/nonPublicApi}}object Serializer {
|
||||||
@ -57,4 +64,11 @@ import java.util.Date
|
|||||||
gsonBuilder.create()
|
gsonBuilder.create()
|
||||||
}
|
}
|
||||||
{{/gson}}
|
{{/gson}}
|
||||||
|
{{#jackson}}
|
||||||
|
@JvmStatic
|
||||||
|
val jacksonObjectMapper: ObjectMapper = jacksonObjectMapper()
|
||||||
|
.registerModule(Jdk8Module())
|
||||||
|
.registerModule(JavaTimeModule())
|
||||||
|
.setSerializationInclusion(JsonInclude.Include.NON_ABSENT)
|
||||||
|
{{/jackson}}
|
||||||
}
|
}
|
||||||
|
@ -78,10 +78,13 @@ import java.io.File
|
|||||||
{{#gson}}
|
{{#gson}}
|
||||||
MediaType.parse(mediaType), Serializer.gson.toJson(content, T::class.java)
|
MediaType.parse(mediaType), Serializer.gson.toJson(content, T::class.java)
|
||||||
{{/gson}}
|
{{/gson}}
|
||||||
|
{{#jackson}}
|
||||||
|
MediaType.parse(mediaType), Serializer.jackson.toJson(content, T::class.java)
|
||||||
|
{{/jackson}}
|
||||||
)
|
)
|
||||||
{{/jvm-okhttp3}}
|
{{/jvm-okhttp3}}
|
||||||
{{#jvm-okhttp4}}
|
{{#jvm-okhttp4}}
|
||||||
mediaType == JsonMediaType -> {{#moshi}}Serializer.moshi.adapter(T::class.java).toJson(content){{/moshi}}{{#gson}}Serializer.gson.toJson(content, T::class.java){{/gson}}.toRequestBody(
|
mediaType == JsonMediaType -> {{#moshi}}Serializer.moshi.adapter(T::class.java).toJson(content){{/moshi}}{{#gson}}Serializer.gson.toJson(content, T::class.java){{/gson}}{{#jackson}}Serializer.jacksonObjectMapper.writeValueAsString(content){{/jackson}}.toRequestBody(
|
||||||
mediaType.toMediaTypeOrNull()
|
mediaType.toMediaTypeOrNull()
|
||||||
)
|
)
|
||||||
{{/jvm-okhttp4}}
|
{{/jvm-okhttp4}}
|
||||||
@ -99,7 +102,7 @@ import java.io.File
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
return when(mediaType) {
|
return when(mediaType) {
|
||||||
JsonMediaType -> {{#moshi}}Serializer.moshi.adapter(T::class.java).fromJson(bodyContent){{/moshi}}{{#gson}}Serializer.gson.fromJson(bodyContent, T::class.java){{/gson}}
|
JsonMediaType -> {{#moshi}}Serializer.moshi.adapter(T::class.java).fromJson(bodyContent){{/moshi}}{{#gson}}Serializer.gson.fromJson(bodyContent, T::class.java){{/gson}}{{#jackson}}Serializer.jacksonObjectMapper.readValue(bodyContent, T::class.java){{/jackson}}
|
||||||
else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.")
|
else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -146,7 +149,7 @@ import java.io.File
|
|||||||
{{#isBasicBearer}}
|
{{#isBasicBearer}}
|
||||||
if (requestConfig.headers[Authorization].isNullOrEmpty()) {
|
if (requestConfig.headers[Authorization].isNullOrEmpty()) {
|
||||||
accessToken?.let { accessToken ->
|
accessToken?.let { accessToken ->
|
||||||
requestConfig.headers[Authorization] = "Bearer " + accessToken
|
requestConfig.headers[Authorization] = "Bearer $accessToken"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{{/isBasicBearer}}
|
{{/isBasicBearer}}
|
||||||
@ -154,7 +157,7 @@ import java.io.File
|
|||||||
{{#isOAuth}}
|
{{#isOAuth}}
|
||||||
if (requestConfig.headers[Authorization].isNullOrEmpty()) {
|
if (requestConfig.headers[Authorization].isNullOrEmpty()) {
|
||||||
accessToken?.let { accessToken ->
|
accessToken?.let { accessToken ->
|
||||||
requestConfig.headers[Authorization] = "Bearer " + accessToken
|
requestConfig.headers[Authorization] = "Bearer $accessToken "
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{{/isOAuth}}
|
{{/isOAuth}}
|
||||||
@ -251,6 +254,7 @@ import java.io.File
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{{^jackson}}
|
||||||
protected inline fun <reified T: Any> parseDateToQueryString(value : T): String {
|
protected inline fun <reified T: Any> parseDateToQueryString(value : T): String {
|
||||||
{{#toJson}}
|
{{#toJson}}
|
||||||
/*
|
/*
|
||||||
@ -270,4 +274,5 @@ import java.io.File
|
|||||||
return value.toString()
|
return value.toString()
|
||||||
{{/toJson}}
|
{{/toJson}}
|
||||||
}
|
}
|
||||||
|
{{/jackson}}
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ open class ApiClient(val baseUrl: String) {
|
|||||||
}
|
}
|
||||||
if (requestConfig.headers[Authorization].isNullOrEmpty()) {
|
if (requestConfig.headers[Authorization].isNullOrEmpty()) {
|
||||||
accessToken?.let { accessToken ->
|
accessToken?.let { accessToken ->
|
||||||
requestConfig.headers[Authorization] = "Bearer " + accessToken
|
requestConfig.headers[Authorization] = "Bearer $accessToken "
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,10 +22,13 @@ import com.google.gson.annotations.SerializedName
|
|||||||
|
|
||||||
data class ApiResponse (
|
data class ApiResponse (
|
||||||
@SerializedName("code")
|
@SerializedName("code")
|
||||||
val code: kotlin.Int? = null,
|
val code: kotlin.Int? = null
|
||||||
|
,
|
||||||
@SerializedName("type")
|
@SerializedName("type")
|
||||||
val type: kotlin.String? = null,
|
val type: kotlin.String? = null
|
||||||
|
,
|
||||||
@SerializedName("message")
|
@SerializedName("message")
|
||||||
val message: kotlin.String? = null
|
val message: kotlin.String? = null
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -21,8 +21,10 @@ import com.google.gson.annotations.SerializedName
|
|||||||
|
|
||||||
data class Category (
|
data class Category (
|
||||||
@SerializedName("id")
|
@SerializedName("id")
|
||||||
val id: kotlin.Long? = null,
|
val id: kotlin.Long? = null
|
||||||
|
,
|
||||||
@SerializedName("name")
|
@SerializedName("name")
|
||||||
val name: kotlin.String? = null
|
val name: kotlin.String? = null
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -25,18 +25,24 @@ import com.google.gson.annotations.SerializedName
|
|||||||
|
|
||||||
data class Order (
|
data class Order (
|
||||||
@SerializedName("id")
|
@SerializedName("id")
|
||||||
val id: kotlin.Long? = null,
|
val id: kotlin.Long? = null
|
||||||
|
,
|
||||||
@SerializedName("petId")
|
@SerializedName("petId")
|
||||||
val petId: kotlin.Long? = null,
|
val petId: kotlin.Long? = null
|
||||||
|
,
|
||||||
@SerializedName("quantity")
|
@SerializedName("quantity")
|
||||||
val quantity: kotlin.Int? = null,
|
val quantity: kotlin.Int? = null
|
||||||
|
,
|
||||||
@SerializedName("shipDate")
|
@SerializedName("shipDate")
|
||||||
val shipDate: java.time.OffsetDateTime? = null,
|
val shipDate: java.time.OffsetDateTime? = null
|
||||||
|
,
|
||||||
/* Order Status */
|
/* Order Status */
|
||||||
@SerializedName("status")
|
@SerializedName("status")
|
||||||
val status: Order.Status? = null,
|
val status: Order.Status? = null
|
||||||
|
,
|
||||||
@SerializedName("complete")
|
@SerializedName("complete")
|
||||||
val complete: kotlin.Boolean? = null
|
val complete: kotlin.Boolean? = null
|
||||||
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -44,6 +50,7 @@ data class Order (
|
|||||||
* Values: placed,approved,delivered
|
* Values: placed,approved,delivered
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
enum class Status(val value: kotlin.String){
|
enum class Status(val value: kotlin.String){
|
||||||
@SerializedName(value="placed") placed("placed"),
|
@SerializedName(value="placed") placed("placed"),
|
||||||
@SerializedName(value="approved") approved("approved"),
|
@SerializedName(value="approved") approved("approved"),
|
||||||
|
@ -27,18 +27,24 @@ import com.google.gson.annotations.SerializedName
|
|||||||
|
|
||||||
data class Pet (
|
data class Pet (
|
||||||
@SerializedName("name")
|
@SerializedName("name")
|
||||||
val name: kotlin.String,
|
val name: kotlin.String
|
||||||
|
,
|
||||||
@SerializedName("photoUrls")
|
@SerializedName("photoUrls")
|
||||||
val photoUrls: kotlin.Array<kotlin.String>,
|
val photoUrls: kotlin.Array<kotlin.String>
|
||||||
|
,
|
||||||
@SerializedName("id")
|
@SerializedName("id")
|
||||||
val id: kotlin.Long? = null,
|
val id: kotlin.Long? = null
|
||||||
|
,
|
||||||
@SerializedName("category")
|
@SerializedName("category")
|
||||||
val category: Category? = null,
|
val category: Category? = null
|
||||||
|
,
|
||||||
@SerializedName("tags")
|
@SerializedName("tags")
|
||||||
val tags: kotlin.Array<Tag>? = null,
|
val tags: kotlin.Array<Tag>? = null
|
||||||
|
,
|
||||||
/* pet status in the store */
|
/* pet status in the store */
|
||||||
@SerializedName("status")
|
@SerializedName("status")
|
||||||
val status: Pet.Status? = null
|
val status: Pet.Status? = null
|
||||||
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -46,6 +52,7 @@ data class Pet (
|
|||||||
* Values: available,pending,sold
|
* Values: available,pending,sold
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
enum class Status(val value: kotlin.String){
|
enum class Status(val value: kotlin.String){
|
||||||
@SerializedName(value="available") available("available"),
|
@SerializedName(value="available") available("available"),
|
||||||
@SerializedName(value="pending") pending("pending"),
|
@SerializedName(value="pending") pending("pending"),
|
||||||
|
@ -21,8 +21,10 @@ import com.google.gson.annotations.SerializedName
|
|||||||
|
|
||||||
data class Tag (
|
data class Tag (
|
||||||
@SerializedName("id")
|
@SerializedName("id")
|
||||||
val id: kotlin.Long? = null,
|
val id: kotlin.Long? = null
|
||||||
|
,
|
||||||
@SerializedName("name")
|
@SerializedName("name")
|
||||||
val name: kotlin.String? = null
|
val name: kotlin.String? = null
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -27,21 +27,29 @@ import com.google.gson.annotations.SerializedName
|
|||||||
|
|
||||||
data class User (
|
data class User (
|
||||||
@SerializedName("id")
|
@SerializedName("id")
|
||||||
val id: kotlin.Long? = null,
|
val id: kotlin.Long? = null
|
||||||
|
,
|
||||||
@SerializedName("username")
|
@SerializedName("username")
|
||||||
val username: kotlin.String? = null,
|
val username: kotlin.String? = null
|
||||||
|
,
|
||||||
@SerializedName("firstName")
|
@SerializedName("firstName")
|
||||||
val firstName: kotlin.String? = null,
|
val firstName: kotlin.String? = null
|
||||||
|
,
|
||||||
@SerializedName("lastName")
|
@SerializedName("lastName")
|
||||||
val lastName: kotlin.String? = null,
|
val lastName: kotlin.String? = null
|
||||||
|
,
|
||||||
@SerializedName("email")
|
@SerializedName("email")
|
||||||
val email: kotlin.String? = null,
|
val email: kotlin.String? = null
|
||||||
|
,
|
||||||
@SerializedName("password")
|
@SerializedName("password")
|
||||||
val password: kotlin.String? = null,
|
val password: kotlin.String? = null
|
||||||
|
,
|
||||||
@SerializedName("phone")
|
@SerializedName("phone")
|
||||||
val phone: kotlin.String? = null,
|
val phone: kotlin.String? = null
|
||||||
|
,
|
||||||
/* User Status */
|
/* User Status */
|
||||||
@SerializedName("userStatus")
|
@SerializedName("userStatus")
|
||||||
val userStatus: kotlin.Int? = null
|
val userStatus: kotlin.Int? = null
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
# OpenAPI Generator Ignore
|
||||||
|
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
||||||
|
|
||||||
|
# Use this file to prevent files from being overwritten by the generator.
|
||||||
|
# The patterns follow closely to .gitignore or .dockerignore.
|
||||||
|
|
||||||
|
# As an example, the C# client generator defines ApiClient.cs.
|
||||||
|
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
||||||
|
#ApiClient.cs
|
||||||
|
|
||||||
|
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||||
|
#foo/*/qux
|
||||||
|
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||||
|
|
||||||
|
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||||
|
#foo/**/qux
|
||||||
|
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||||
|
|
||||||
|
# You can also negate patterns with an exclamation (!).
|
||||||
|
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||||
|
#docs/*.md
|
||||||
|
# Then explicitly reverse the ignore rule for a single file:
|
||||||
|
#!docs/README.md
|
@ -0,0 +1 @@
|
|||||||
|
4.3.0-SNAPSHOT
|
90
samples/client/petstore/kotlin-jackson/README.md
Normal file
90
samples/client/petstore/kotlin-jackson/README.md
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
# org.openapitools.client - Kotlin client library for OpenAPI Petstore
|
||||||
|
|
||||||
|
## Requires
|
||||||
|
|
||||||
|
* Kotlin 1.3.41
|
||||||
|
* Gradle 4.9
|
||||||
|
|
||||||
|
## Build
|
||||||
|
|
||||||
|
First, create the gradle wrapper script:
|
||||||
|
|
||||||
|
```
|
||||||
|
gradle wrapper
|
||||||
|
```
|
||||||
|
|
||||||
|
Then, run:
|
||||||
|
|
||||||
|
```
|
||||||
|
./gradlew check assemble
|
||||||
|
```
|
||||||
|
|
||||||
|
This runs all tests and packages the library.
|
||||||
|
|
||||||
|
## Features/Implementation Notes
|
||||||
|
|
||||||
|
* Supports JSON inputs/outputs, File inputs, and Form inputs.
|
||||||
|
* Supports collection formats for query parameters: csv, tsv, ssv, pipes.
|
||||||
|
* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions.
|
||||||
|
* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets.
|
||||||
|
|
||||||
|
<a name="documentation-for-api-endpoints"></a>
|
||||||
|
## Documentation for API Endpoints
|
||||||
|
|
||||||
|
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||||
|
|
||||||
|
Class | Method | HTTP request | Description
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store
|
||||||
|
*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||||
|
*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||||
|
*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||||
|
*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID
|
||||||
|
*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
|
||||||
|
*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||||
|
*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||||
|
*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
|
||||||
|
*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||||
|
*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID
|
||||||
|
*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
|
||||||
|
*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user
|
||||||
|
*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array
|
||||||
|
*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array
|
||||||
|
*UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user
|
||||||
|
*UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name
|
||||||
|
*UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system
|
||||||
|
*UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session
|
||||||
|
*UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user
|
||||||
|
|
||||||
|
|
||||||
|
<a name="documentation-for-models"></a>
|
||||||
|
## Documentation for Models
|
||||||
|
|
||||||
|
- [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md)
|
||||||
|
- [org.openapitools.client.models.Category](docs/Category.md)
|
||||||
|
- [org.openapitools.client.models.Order](docs/Order.md)
|
||||||
|
- [org.openapitools.client.models.Pet](docs/Pet.md)
|
||||||
|
- [org.openapitools.client.models.Tag](docs/Tag.md)
|
||||||
|
- [org.openapitools.client.models.User](docs/User.md)
|
||||||
|
|
||||||
|
|
||||||
|
<a name="documentation-for-authorization"></a>
|
||||||
|
## Documentation for Authorization
|
||||||
|
|
||||||
|
<a name="api_key"></a>
|
||||||
|
### api_key
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: api_key
|
||||||
|
- **Location**: HTTP header
|
||||||
|
|
||||||
|
<a name="petstore_auth"></a>
|
||||||
|
### petstore_auth
|
||||||
|
|
||||||
|
- **Type**: OAuth
|
||||||
|
- **Flow**: implicit
|
||||||
|
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||||
|
- **Scopes**:
|
||||||
|
- write:pets: modify pets in your account
|
||||||
|
- read:pets: read your pets
|
||||||
|
|
38
samples/client/petstore/kotlin-jackson/build.gradle
Normal file
38
samples/client/petstore/kotlin-jackson/build.gradle
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
group 'org.openapitools'
|
||||||
|
version '1.0.0'
|
||||||
|
|
||||||
|
wrapper {
|
||||||
|
gradleVersion = '4.9'
|
||||||
|
distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
|
||||||
|
}
|
||||||
|
|
||||||
|
buildscript {
|
||||||
|
ext.kotlin_version = '1.3.61'
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
maven { url "https://repo1.maven.org/maven2" }
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'kotlin'
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
maven { url "https://repo1.maven.org/maven2" }
|
||||||
|
}
|
||||||
|
|
||||||
|
test {
|
||||||
|
useJUnitPlatform()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
||||||
|
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
|
||||||
|
compile "com.fasterxml.jackson.module:jackson-module-kotlin:2.10.2"
|
||||||
|
compile "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.10.2"
|
||||||
|
compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.10.2"
|
||||||
|
compile "com.squareup.okhttp3:okhttp:4.2.2"
|
||||||
|
testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0"
|
||||||
|
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user