Fixed that super.typeFromId() didn't resolve Lists and Sets (but still don't know why Jackson writes their classes as id to output)

This commit is contained in:
dankito 2020-09-21 00:48:14 +02:00
parent a4a70bbd32
commit 07446568ed
1 changed files with 2 additions and 2 deletions

View File

@ -24,11 +24,11 @@ open class JacksonClassNameIdResolver : ClassNameIdResolver(SimpleType.construct
return super.idFromValue(value) return super.idFromValue(value)
} }
override fun typeFromId(context: DatabindContext?, id: String?): JavaType { override fun typeFromId(context: DatabindContext, id: String): JavaType {
return when (id) { return when (id) {
RetrieveAccountTransactionsInMt940Parameters::class.jvmName -> _typeFactory.constructSpecializedType(_baseType, RetrieveAccountTransactionsInMt940Parameters::class.java) RetrieveAccountTransactionsInMt940Parameters::class.jvmName -> _typeFactory.constructSpecializedType(_baseType, RetrieveAccountTransactionsInMt940Parameters::class.java)
SepaAccountInfoParameters::class.jvmName -> _typeFactory.constructSpecializedType(_baseType, SepaAccountInfoParameters::class.java) SepaAccountInfoParameters::class.jvmName -> _typeFactory.constructSpecializedType(_baseType, SepaAccountInfoParameters::class.java)
else -> super.typeFromId(context, id) else -> _typeFactory.constructFromCanonical(id) // don't know why classes of Lists and Sets also get written as id to output, but for deserialization call to type factory is needed, super.typeFromId() does not work
} }
} }