Skip to content

Commit 2bed335

Browse files
committed
feat: update Kotlin client generation in Makefile to remove Gson serialization and OneOf/AnyOf wrappers
1 parent 64c8d11 commit 2bed335

File tree

200 files changed

+11240
-16978
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+11240
-16978
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ generate-api-kotlin:
5454
@echo "--> Creating directory for the main API client..."
5555
@mkdir -p kotlin/api
5656
@echo "--> Generating Kotlin client for the main API..."
57-
pnpx @openapitools/openapi-generator-cli generate -i https://api.deadlock-api.com/openapi.json -g kotlin -o kotlin/api/ --skip-validate-spec --additional-properties=packageName=deadlock_api_client,idea=true,artifactId=deadlock_api_client,groupId=com.deadlock-api,artifactUrl=https://github.com/deadlock-api/openapi-clients,omitGradleWrapper=true,serializableModel=true,serializationLibrary=gson,generateOneOfAnyOfWrappers=true,library=jvm-ktor
57+
pnpx @openapitools/openapi-generator-cli generate -i https://api.deadlock-api.com/openapi.json -g kotlin -o kotlin/api/ --skip-validate-spec --additional-properties=packageName=deadlock_api_client,idea=true,artifactId=deadlock_api_client,groupId=com.deadlock-api,artifactUrl=https://github.com/deadlock-api/openapi-clients,omitGradleWrapper=true,serializableModel=true
5858
@echo "--> Adding publishing configuration..."
5959
@echo "" >> kotlin/api/build.gradle
6060
@echo "publishing {" >> kotlin/api/build.gradle
@@ -70,7 +70,7 @@ generate-assets-api-kotlin:
7070
@echo "--> Creating directory for the assets API client..."
7171
@mkdir -p kotlin/assets-api
7272
@echo "--> Generating Kotlin client for the assets API..."
73-
pnpx @openapitools/openapi-generator-cli generate -i https://assets.deadlock-api.com/openapi.json -g kotlin -o kotlin/assets-api/ --skip-validate-spec --additional-properties=packageName=assets_deadlock_api_client,idea=true,artifactId=assets_deadlock_api_client,groupId=com.deadlock-api,artifactUrl=https://github.com/deadlock-api/openapi-clients,omitGradleWrapper=true,serializableModel=true,serializationLibrary=gson,generateOneOfAnyOfWrappers=true,library=jvm-ktor
73+
pnpx @openapitools/openapi-generator-cli generate -i https://assets.deadlock-api.com/openapi.json -g kotlin -o kotlin/assets-api/ --skip-validate-spec --additional-properties=packageName=assets_deadlock_api_client,idea=true,artifactId=assets_deadlock_api_client,groupId=com.deadlock-api,artifactUrl=https://github.com/deadlock-api/openapi-clients,omitGradleWrapper=true,serializableModel=true
7474
@echo "--> Adding publishing configuration..."
7575
@echo "" >> kotlin/assets-api/build.gradle
7676
@echo "publishing {" >> kotlin/assets-api/build.gradle

kotlin/api/.openapi-generator/FILES

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,23 @@ src/main/kotlin/deadlock_api_client/apis/MatchesApi.kt
8282
src/main/kotlin/deadlock_api_client/apis/PatchesApi.kt
8383
src/main/kotlin/deadlock_api_client/apis/PlayersApi.kt
8484
src/main/kotlin/deadlock_api_client/apis/SQLApi.kt
85-
src/main/kotlin/deadlock_api_client/auth/ApiKeyAuth.kt
86-
src/main/kotlin/deadlock_api_client/auth/Authentication.kt
87-
src/main/kotlin/deadlock_api_client/auth/HttpBasicAuth.kt
88-
src/main/kotlin/deadlock_api_client/auth/HttpBearerAuth.kt
89-
src/main/kotlin/deadlock_api_client/auth/OAuth.kt
9085
src/main/kotlin/deadlock_api_client/infrastructure/ApiAbstractions.kt
9186
src/main/kotlin/deadlock_api_client/infrastructure/ApiClient.kt
92-
src/main/kotlin/deadlock_api_client/infrastructure/HttpResponse.kt
87+
src/main/kotlin/deadlock_api_client/infrastructure/ApiResponse.kt
88+
src/main/kotlin/deadlock_api_client/infrastructure/BigDecimalAdapter.kt
89+
src/main/kotlin/deadlock_api_client/infrastructure/BigIntegerAdapter.kt
90+
src/main/kotlin/deadlock_api_client/infrastructure/ByteArrayAdapter.kt
91+
src/main/kotlin/deadlock_api_client/infrastructure/Errors.kt
92+
src/main/kotlin/deadlock_api_client/infrastructure/LocalDateAdapter.kt
93+
src/main/kotlin/deadlock_api_client/infrastructure/LocalDateTimeAdapter.kt
94+
src/main/kotlin/deadlock_api_client/infrastructure/OffsetDateTimeAdapter.kt
95+
src/main/kotlin/deadlock_api_client/infrastructure/PartConfig.kt
9396
src/main/kotlin/deadlock_api_client/infrastructure/RequestConfig.kt
9497
src/main/kotlin/deadlock_api_client/infrastructure/RequestMethod.kt
98+
src/main/kotlin/deadlock_api_client/infrastructure/ResponseExtensions.kt
99+
src/main/kotlin/deadlock_api_client/infrastructure/Serializer.kt
100+
src/main/kotlin/deadlock_api_client/infrastructure/URIAdapter.kt
101+
src/main/kotlin/deadlock_api_client/infrastructure/UUIDAdapter.kt
95102
src/main/kotlin/deadlock_api_client/models/APIInfo.kt
96103
src/main/kotlin/deadlock_api_client/models/ActiveMatch.kt
97104
src/main/kotlin/deadlock_api_client/models/ActiveMatchGameMode.kt

kotlin/api/build.gradle

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ version '1.0.0'
33

44
buildscript {
55
ext.kotlin_version = '2.2.20'
6-
ext.ktor_version = '3.2.3'
76
ext.spotless_version = "7.2.1"
87

98
repositories {
@@ -58,11 +57,10 @@ idea {
5857

5958
dependencies {
6059
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
61-
implementation "com.google.code.gson:gson:2.13.2"
62-
implementation "io.ktor:ktor-client-core:$ktor_version"
63-
implementation "io.ktor:ktor-client-content-negotiation:$ktor_version"
64-
implementation "io.ktor:ktor-serialization-gson:$ktor_version"
65-
implementation "io.ktor:ktor-client-gson:$ktor_version"
60+
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
61+
implementation "com.squareup.moshi:moshi-kotlin:1.15.2"
62+
implementation "com.squareup.moshi:moshi-adapters:1.15.2"
63+
implementation "com.squareup.okhttp3:okhttp:5.1.0"
6664
testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2"
6765
}
6866

0 commit comments

Comments
 (0)