You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
e: /tmp/oas/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt: (118, 29): Expecting an element
e: /tmp/oas/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt: (101, 82): Type mismatch: inferred type is T but DeserializationStrategy<TypeVariable(T)> was expected
e: /tmp/oas/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt: (101, 89): No value passed for parameter 'string'
e: /tmp/oas/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt: (101, 91): Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public final fun ByteArray.toRequestBody(contentType: MediaType? = ..., offset: Int = ..., byteCount: Int = ...): RequestBody defined in okhttp3.RequestBody.Companion
public final fun String.toRequestBody(contentType: MediaType? = ...): RequestBody defined in okhttp3.RequestBody.Companion
public final fun ByteString.toRequestBody(contentType: MediaType? = ...): RequestBody defined in okhttp3.RequestBody.Companion
e: /tmp/oas/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt: (249, 50): Type mismatch: inferred type is T but SerializationStrategy<TypeVariable(T)> was expected
e: /tmp/oas/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt: (249, 55): No value passed for parameter 'value'
And update to Kotlin 1.5.0 and kotlinx.serialization 1.2.1. Fix nested
enum annotation '@serializable' instead of '@KSerializable' when
'kotlinx_serialization' is used. Fix missing JsonMediaType in
ApiClient.kt (OpenAPITools#9242). Add 'kotlinx_serialization' serialization library
to documentation. Use explicity type in RequestConfig to keep type
information for JSON serialization.
ResolvesOpenAPITools#9242
And update to Kotlin 1.5.0 and kotlinx.serialization 1.2.1. Fix nested
enum annotation '@serializable' instead of '@KSerializable' when
'kotlinx_serialization' is used. Fix missing JsonMediaType in
ApiClient.kt (#9242). Add 'kotlinx_serialization' serialization library
to documentation. Use explicity type in RequestConfig to keep type
information for JSON serialization.
Resolves#9242
Description
Generator generates invalid code when using kotlinx.serialization
openapi-generator version
5.1.0 installed from the official ArchLinux package repository
OpenAPI declaration file content or url
https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml
Generation Details
openapi-generator generate -g kotlin -i petstore.yaml -p serializationLibrary=kotlinx_serialization
Steps to reproduce
gradle build
Suggest a fix
This line is probably missing support for kotlinx.serialization: https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache#L175
The text was updated successfully, but these errors were encountered: