forked from loafle/openapi-generator-original
[kotlin] fix Date types usages (#8594)
* [kotlin] fix Date types usages
This commit is contained in:
@@ -1 +1 @@
|
||||
5.0.0-SNAPSHOT
|
||||
5.0.1-SNAPSHOT
|
||||
@@ -33,6 +33,5 @@ dependencies {
|
||||
compile "com.squareup.moshi:moshi-kotlin:1.9.2"
|
||||
compile "com.squareup.moshi:moshi-adapters:1.9.2"
|
||||
compile "com.squareup.okhttp3:okhttp:4.2.2"
|
||||
compile "com.squareup.okhttp3:logging-interceptor:4.4.0"
|
||||
testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0"
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ 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")
|
||||
val Response.isRedirect : Boolean get() = this.code in 300..399
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
package org.openapitools.client.infrastructure
|
||||
|
||||
import com.squareup.moshi.Moshi
|
||||
import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
|
||||
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
|
||||
import java.util.Date
|
||||
|
||||
object Serializer {
|
||||
@JvmStatic
|
||||
val moshiBuilder: Moshi.Builder = Moshi.Builder()
|
||||
.add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe())
|
||||
.add(OffsetDateTimeAdapter())
|
||||
.add(LocalDateTimeAdapter())
|
||||
.add(LocalDateAdapter())
|
||||
|
||||
Reference in New Issue
Block a user