Yonatan Karp-Rudin 83af019603
Fix Retrofit template with Jackson for Kotlin (#14239)
* Fix Retrofit template with Jackson (Fix #8147)

This commit amends the `ApiClient` template for Retrofit. It fixes a bug where the Retrofit client uses Jackson as the serialization library.

Until now, the `ApiClient` could not be compiled when using the Jackson library (default in SpringBoot applications), as the constructor of the class had the following parameter:

`private val serializerBuilder: Builder = Serializer.Builder,`

The change done in the commit, is to ensure that in case of Jackson, the right property of the `Serializer` class is assigned

* Add sample code for `kotlin-jvm-jackson`

This commit adds a sample code for the `kotlin-jvm-jackson` generated code to test the changes on CI

* Update kotlin code samples for CI

This commit only runs the command `bin/generate-samples.sh bin/configs/kotlin-*` to ensure that all code samples are up-to-date and CI can pass successfully.
2023-08-14 10:06:49 +08:00

43 lines
1.3 KiB
Groovy

group 'org.openapitools'
version '1.0.0'
wrapper {
gradleVersion = '7.5'
distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
}
buildscript {
ext.kotlin_version = '1.8.10'
ext.retrofitVersion = '2.9.0'
repositories {
maven { url "https://repo1.maven.org/maven2" }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'kotlin'
apply plugin: 'maven-publish'
repositories {
maven { url "https://repo1.maven.org/maven2" }
}
test {
useJUnitPlatform()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.14.3"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.14.3"
implementation "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.2"
implementation "com.squareup.okhttp3:logging-interceptor:4.10.0"
implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
implementation "com.squareup.retrofit2:converter-scalars:$retrofitVersion"
testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2"
}