https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
jackson-kotlin
  • r

    Rodrigo Silva

    06/16/2020, 7:18 PM
    Hello all. I'm using the lib, 
    jackson-module-kotlin,
     to serialize but I'm having an error:
    a
    j
    • 3
    • 15
  • g

    gmariotti

    07/02/2020, 8:34 AM
    Hi folks, apologies in advances for the not “kotlin specific” question. Does anyone knows if it is possible to set the mapper to write nested json as a string? For example, a map like
    mapOf("key" to mapOf("innerKey" to "value"))
    serialized as
    { "key": "{\"innerKey\": \"value\"}" }
    instead of
    {"key": {"innerKey": "value"}}
    a
    • 2
    • 2
  • d

    Dariusz Kuc

    07/20/2020, 5:50 PM
    hello 👋 JSON fields can have 3 states ->
    undefined
    (field is omitted),
    null
    (field=null) and also can have a
    value
    (field=value). Within JVM we either have value or no-value (i.e.
    null
    ) so we are trying to represent those 3 states using Kotlin sealed classes - something along the lines
    sealed class OptionallyDefined<T> {
        object Undefined : OptionallyDefined<Nothing>()
        data class Defined<T>(val data: T) : OptionallyDefined<T>()
    }
    Unfortunately cannot get the deserialization to work. I tried using custom serializer (i.e.
    @JsonDeserialize(using = NullAwareDeserializer::class)
    ) but cannot get it to work correctly. Any pointers would be greatly appreciated!
    ➕ 1
    j
    • 2
    • 5
  • j

    Jgafner

    10/07/2020, 10:06 AM
    Hi all. I am trying to understand the equivalent for Mapping Nested Values with Jackson for example:
    public class SimpleClass {
    
        private String path;
    
        @JsonProperty("somePath")
        private void unpackPath(Map<String, Object> somePath) {
            this.path = (String) somePath.get("toString");
        }
    }
    When I use the IDE convertor I am getting this:
    class SimpleClass {
        private var path: String? = null
        @JsonProperty("somePath")
        private fun unpackPath(somePath: Map<String, Any>) {
            path = somePath["toString"] as String?
        }
    }
    Is that correct ?
    d
    • 2
    • 2
  • j

    Jukka Siivonen

    10/21/2020, 4:47 PM
    Hello, I'm having a problem with deserializing object using delegate interface, any ideas?
    a
    • 2
    • 8
  • d

    Dariusz Kuc

    03/18/2021, 4:14 PM
    Hello 👋 I got a requirement for my server to accept either a single JSON object or an array of those so I modeled it using a sealed class
    sealed class MyServerRequest
    
    @JsonIgnoreProperties(ignoreUnknown = true)
    @JsonInclude(JsonInclude.Include.NON_NULL)
    data class SingleRequest(val request: String) : MyServerRequest()
    
    @JsonIgnoreProperties(ignoreUnknown = true)
    @JsonInclude(JsonInclude.Include.NON_NULL)
    class BatchRequest @JsonCreator constructor(@get:JsonValue val requests: List<SingleRequest>) : MyServerRequest()
    Between those two there is no extra
    type
    field that I could use to detect correct type using
    @JsonTypeInfo/@JsonSubTypes
    . Instead, I parse the incoming requests to a
    JsonNode
    and check whether it is an array to determine appropriate target, i.e.
    val jsonNode = rawRequest.bodyToMono(JsonNode::class.java).awaitFirst()
    if (jsonNode.isArray) {
      objectMapper.treeToValue(jsonNode, BatchRequest::class.java)
    } else {
      objectMapper.treeToValue(jsonNode, SingleRequest::class.java)
    }
    the above works fine but I'd like to simplify it and use custom deserializer to handle it, i.e.
    @JsonDeserialize(using = MyRequestDeserializer::class)
    sealed class MyServerRequest
    
    class MyRequestDeserializer : JsonDeserializer<MyServerRequest>() {
        override fun deserialize(parser: JsonParser, ctxt: DeserializationContext): MyServerRequest {
            val codec = parser.codec
            val jsonNode = codec.readTree<JsonNode>(parser)
            return if (jsonNode.isArray) {
                codec.treeToValue(jsonNode, SingleRequest::class.java)
            } else {
                codec.treeToValue(jsonNode, BatchRequest::class.java)
            }
        }
    }
    this though fails with stackoverflow error as sealed class implementations look up the root deserializer... any ideas how to make it work?
    d
    • 2
    • 9
  • s

    Slackbot

    03/31/2021, 3:06 PM
    This message was deleted.
    d
    d
    • 3
    • 15
  • j

    Joe

    04/30/2021, 8:02 PM
    I'm trying to construct an object from json, with some members injected via
    @JacksonInject
    . I've got it working like this:
    class ClassToDeserialize {
        @JacksonInject
        private val dependency: ThirdPartyUndeserializableObject? = null
        @JsonPropery
        private val simpleValue: String
        /// ... etc 
    }
    To avoid nullability (and since I don't really have an instance of the dependency I can assign statically), I'd like to use constructor injection instead:
    class ClassToDeserialize(
        @JacksonInject
        private val dependency: ThirdPartyUndeserializableObject
    ) {
        @JsonPropery
        private val simpleValue: String
        /// ... etc 
    }
    but doing so still results in jackson trying to manage the dependency prior to using the injected value (manifests as
    Invalid definition for property
    since the class isn't json deserializable due to conflicting setters within the third party class). Adding a
    @JsonIgnore
    doesn't appear to have any effect, either. Is there a way to do this?
    • 1
    • 1
  • f

    Fredrik Larsen

    05/19/2021, 11:08 AM
    Hi, I have an issue with Jackson, Spring Boot and Kotlin 1.5 when using value classes. The converted json key includes the “special” class name suffix generated by the kotlin compiler for value classes. E.g. for
    data class Resource(
        val fooInterval: Milliseconds,
        val barInterval: Milliseconds?,
        …
    )
    @JvmInline
    value class Milliseconds(val units: Int)
    The generated json for
    fooInterval
    becomes
    "fooInterval-kqdxTu8": 900,
    And for the nullable property it becomes
    "barInterval-OO-hnm0": {
            "units": 900
    }
    The suffix comes from the generated type (value class) but It looks like a bug that it is used as part of the parameter name. Any thoughts?
    ✅ 1
    d
    • 2
    • 4
  • d

    Dariusz Kuc

    05/21/2021, 9:49 PM
    hello 👋 by any chance anyone tried conditional serialization of fields based on some condition? (I tried using custom filter as was suggested here -> https://www.baeldung.com/jackson-serialize-field-custom-criteria but with no luck). See thread for code
    • 1
    • 3
  • k

    kenkyee

    06/28/2021, 2:43 PM
    Does anyone know how to get Jackson CSV to honor @JsonPropertyOrder? It does need the JsonProperty attached to the getter or it'll use the field name. But it doesn't seem to honor the order despite following the technique mentioned in a few Java Stackoverflow posts....i.e., disable alphabetical ordering and use @JsonPropertyOrder. The order it's emitting is: Module,FilePath,Line,Offset,Severity,UniqueID,Category,Description,ComplexityTotal,CoverageTotal,NumBlockers,NumCriticals,NumMajors,NumMinors,NumInfos,FileCount,LinesOfCode Which bizarrely isn't alphabetical and also not the same as the definition of the data class and isn't in @JsonPropertyOrder either 🤔
    Untitled
    d
    • 2
    • 5
  • m

    maxmello

    08/18/2021, 2:21 PM
    Hey 👋 I had a weird behavior just now and wanted to understand it:
    data class Example(@get:JsonProperty("element") val elements: List<Element> = listOf())
    I remembered somehow that you need to add the get: part to a JsonProperty annotation such that it would be at the getter and not the field from Javas point of view, or else it woudn’t work right (which seems to be not the case after all), but this code above resulted in the following exception:
    com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `int` from Array value (token `JsonToken.START_ARRAY`)
    Now I strongly assume this is because List has a method
    get
    with parameter of type
    Int
    , but is this really how this annotation format should work? How would I even attach an annotation to the java getter in this case then? I fixed it now by removing the get:, just curious 🤔
    d
    • 2
    • 4
  • p

    Philipp Mayer

    08/31/2021, 1:28 PM
    Hello everyone, I think I had a solution for the following problem some time ago but I can’t think of one right now, so here I am: I have the following structure:
    sealed class ApiResult {
        data class Error(val errors: List<ApiError>) : ApiResult() {
            data class ApiError(
                val propertyName: String,
                val errorMessage: String,
                val errorCode: String,
            )
        }
    }
    And I want to serialize some response json into 
    ApiResult.Error
    . The Json looks like that:
    [
      {
        "propertyName": "...",
        "errorMessage": "...",
        "errorCode": "..."
      }
    ]
    So I have an object with holds a list of elements. Instantiating the object manually would look like that:
    ApiResult.Error(objectMapper.readValue(""))
    But I want to serialize directly into
    ApiResultError
    . Usually I would do something along the lines of:
    class ApiErrors: ArrayList<ApiErrors.ApiError>() {
            data class ApiError(
                val propertyName: String,
                val errorMessage: String,
                val errorCode: String,
            )
    So, implementing the ArrayList. This does not work inside a sealed class. Any idea? Thanks in advance!
    d
    • 2
    • 7
  • d

    Dariusz Kuc

    10/18/2021, 7:09 PM
    Disclaimer: This is not Kotlin specific but was hoping someone here might be able to chime in ---- Hello 👋 I have a code generator and I'm using custom Jackson serializers to support • optional serialization (so I can distinguish defined value, null value and no value cases, i.e. no value should not be serialized at all and field should be omitted) • custom object serializers/deserializers (e.g. ability to marshall/unmarshall
    ULocale
    object to/from basic
    en_US
    String) Above works fine when used in separation but now I'm trying to figure out a way to do both at the same time, i.e. conditionally serialize custom objects. Registering a module that configures custom serializer for given custom type seems to work but that also implies additional setup by the users of the library (i.e. auto generated code is used to communicate with server). Anyone has any ideas whether this setup could be automated? Or maybe there are alternatives that I could use without module registration? There is an SPI that could be used to auto register modules but its usage is supposedly discouraged....
    d
    • 2
    • 3
  • m

    martmists

    10/31/2021, 6:23 PM
    How do I read XML lists properly from kotlin? Classes:
    enum class Language {
        AmericanEnglish,
        BritishEnglish,
        Japanese,
        French,
        German,
        LatinAmericanSpanish,
        Spanish,
        Italian,
        Dutch,
        CanadianFrench,
        Russian,
        Korean,
        TraditionalChinese,
        SimplifiedChinese,
        Unknown
    }
    
    data class TitleName(
        val language: Language,
        val name: String,
        val publisher: String
    )
    
    data class NACP(
        val title: List<TitleName>,
        // TODO: Add more
    )
    XML (simplified):
    <?xml version="1.0" encoding="utf-8"?>
    <Application>
        <Title>
            <Language>AmericanEnglish</Language>
            <Name>Mario Party Superstars</Name>
            <Publisher>Nintendo</Publisher>
        </Title>
        <Title>
            <Language>BritishEnglish</Language>
            <Name>Mario Party Superstars</Name>
            <Publisher>Nintendo</Publisher>
        </Title>
        <Title>
            <Language>Japanese</Language>
            <Name> ̄デ ̄テᆰ ̄ツᆰ ̄テム ̄テᄐ ̄テニ ̄ツᆪ  ̄ツᄍ ̄テᄐ ̄テム ̄テᄐ ̄ツᄍ ̄ツ﾿ ̄テᄐ ̄ツᄎ</Name>
            <Publisher>Nintendo</Publisher>
        </Title>
    </Application>
    Code:
    val parser = XmlMapper.builder()
        .addModule(
            KotlinModule.Builder()
                // Defaults
                .withReflectionCacheSize(512)
                .configure(KotlinFeature.NullToEmptyCollection, false)
                .configure(KotlinFeature.NullToEmptyMap, false)
                .configure(KotlinFeature.NullIsSameAsDefault, false)
                .configure(KotlinFeature.SingletonSupport, false)
                .configure(KotlinFeature.StrictNullChecks, false)
                .build()
        )
        // Defaults
        .configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true)
        .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
        .configure(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES, false)
        .configure(DeserializationFeature.FAIL_ON_NUMBERS_FOR_ENUMS, false)
        .build()
    
    parser.readValue<NACP>(xml)
    // => com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `TitleName` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('AmericanEnglish')
    d
    • 2
    • 7
  • t

    thanksforallthefish

    12/29/2021, 4:45 PM
    hello 👋 has anyone tried
    value class
    with jackson?
    fun main() {
      val string = ObjectMapper().findAndRegisterModules()
        .convertValue<Map<String, String>>(Value("any"))
    
      println(string)
    }
    
    @JvmInline
    value class Value(val value: String)
    prints
    {value=any}
    with jackson 2.12.5, but fails with jackson 2.13.0. error is
    Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `java.util.LinkedHashMap` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('any')
     at [Source: UNKNOWN; byte offset: #UNKNOWN]
    though https://github.com/FasterXML/jackson-module-kotlin/issues/464 makes me wonder if my expectation is wrong. my use case is the one marked as “broken”:
    "broken": [ {"value":0}, {"value":0} ]
    , though this is exactly what I want
    w
    • 2
    • 1
  • r

    rrva

    01/17/2022, 6:16 PM
    I did some bechmarking comparing deserialization times between jackson kotlin module and marking all my data classes as @JvmRecord and using stock jackson without kotlin module. The jvm record path clearly is faster (will try to make a GH issue with more formal claims), but this is just a lazy way of putting that the kotlin module ought to be faster… any thoughts on how to approach the same speed?
    w
    • 2
    • 4
  • d

    doubov

    01/20/2022, 8:59 PM
    👋 hey folks, does anyone have any suggestions how I'd go about debugging https://github.com/FasterXML/jackson-module-kotlin/issues/522 issue that I'm also running into? I've tried going the no-args plugin compiler route, but it still doesn't fix some of the json classes (it fixed some, but not all). The only thing that worked is turning build minification off, but now we are running into another issue where our APK is too large for Play Store. Any help/pointers are greatly appreciated
    ✅ 1
    • 1
    • 2
  • p

    phil-t

    03/03/2022, 4:48 PM
    👋 Hi all, in my automated tests I’m using Jackson to deserialise responses from two different GraphQL schemas into data classes, this works fine with a separate class for each schema but I’m trying to get it working with a single class to simplify the code. The responses from both schemas have a “data” node with different fields under that, so I’ve tried applying
    @JsonAlias("data")
    to two fields in my class so that I can have separate data classes representing the underlying data, but this doesn’t work - the alias seems to apply to one field or the other. I’ve tried these two methods so far but neither work:
    data class MyResponse(
        @JsonAlias("data")
        val dataOne: dataClassOne?,
        @JsonAlias("data")
        val dataTwo: dataClassTwo?
    )
    
    data class MyResponse(
        @JsonAlias("data")
        val dataOne: dataClassOne?, val dataTwo: dataClassTwo?
    )
    Is it possible to apply the alias to both fields so that the data will be deserialised to one or the other, or should I go back to using a separate class for each schema?
    d
    d
    • 3
    • 3
  • p

    phil-t

    05/06/2022, 3:22 PM
    Hi, another question about deserialising with Jackson - is it possible to deserialise fields with unknown names? Here is an example which is part of a response which I want to deserialise:
    "types": {
      "10003327": {
        "typeNumber": 11,
        "classNumber": 335,
        "display": 0,
        "max": "2000",
        "name": "My type"
      }
    },
    The number
    10003327
    could be different in each response. If I was to use the data classes below I think it would work only for this example, but in another response with a different number it wouldn’t work:
    data class Response(
        val types: NumberType
    )
    
    data class NumberType(
        @JsonProperty("10003327") val typeField: Type
    )
    
    data class Type(
        val typeNumber: Int,
        val classNumber: Int,
        val display: Int,
        val max: String,
        val name: String
    )
    Is there a way to deserialise this completely when you don’t know what the number of the field will be, maybe with another annotation?
    c
    • 2
    • 3
  • s

    Sam

    07/13/2022, 8:11 AM
    I'd like to have a data class parameter that gets a default value when creating a new instance from code but not when deserialising. What's the simplest way to do that? I'll add examples in the thread.
    e
    • 2
    • 5
  • r

    rrva

    08/25/2022, 10:14 AM
    data classes annotated with @JvmRecord were deserializable in earlier jackson versions just through the plain java record support. But now it seems you need to register KotlinModule on the objectmapper. KotlinModule is slower than the plain java record deserializer so I would prefer to get that behavior back. How do I customize my objectmapper to use that deserializer?
  • r

    Rob Elliot

    10/24/2022, 10:28 AM
    Has anyone managed to make
    @JsonValue
    work when the property is nullable and the json has null as the value?
    Edit - I wrongly thought this was a Kotlin issue but I can't make it work in Java either so moving to https://gitter.im/FasterXML/jackson-databind?at=635675f89ee3ec22b4d9a239
    • 1
    • 5
  • f

    Fredrik Rødland

    10/28/2022, 10:42 AM
    Hi. We have a problem. we're serializing an IntRange from a server we want to upgrade to 1.7.20. This ads the field
    end_exclusive
    . We have clients which are not able to update kotlin as easily (apps in the wild). They now get the following error:
    Unrecognized field "end_exclusive" (class kotlin.ranges.IntRange), not marked as ignorable (2 known properties: "start", "end"
    Does anybody know of a nice work-around for this. we thought about implementing our own small dataclass on the serverside which adhers to the
    IntRange
    api of kotlin <= 1.7.10, but it's seems kinda hacky...
    s
    • 2
    • 2
  • a

    Adam Firen

    11/09/2022, 6:58 PM
    hi guys, in hope of stumping on someone already investigating the same issue, fyi I have started a thread here https://kotlinlang.slack.com/archives/C0AVAB92L/p1667582399032569 to move the inline classes support issue forward
  • e

    Eric

    01/03/2023, 5:03 PM
    is there a non-kotlin specific jackson channel somewhere?
    d
    • 2
    • 1
  • e

    Eric

    01/11/2023, 6:57 PM
    can the kotlin module be configured via
    application.yaml
    ? for example
    spring:
      jackson:
        kotlin:
          null-to-empty-collection: true
          null-to-empty-map: true
          null-is-same-as-default: true
  • w

    wrongwrong

    01/14/2023, 4:07 PM
    https://kotlinlang.slack.com/archives/C0BJ0GTE2/p1673712455032579
  • w

    wrongwrong

    01/21/2023, 2:15 AM
    Cross Posting. If you know how replacing
    kotlin-reflect
    with
    kotlinx-metadata-jvm
    would benefit
    jackson-module-kotlin
    users on
    Android
    , please let me know. https://kotlinlang.slack.com/archives/C0B8M7BUY/p1674267151483919
  • w

    wrongwrong

    03/19/2023, 3:19 PM
    jackson-module-kotlin 2.15.0-rc1 has been released. https://mvnrepository.com/artifact/com.fasterxml.jackson.module/jackson-module-kotlin/2.15.0-rc1 The following important changes have been made in this version • Reduction of the amount of memory consumed by the reflection cache • Fixed an issue caused by the name of is-getter (behavior change) • Removal of Kotlin 1.4 support • Scheduled deprecation of MissingKotlinParameterException For complete release notes, please see https://github.com/FasterXML/jackson-module-kotlin/blob/f66f8c4b32a64ea9e2bef45caca2ff876f8b2f6b/release-notes/VERSION-2.x#L19 Feedback and bug reports are welcome.
Powered by Linen
Title
w

wrongwrong

03/19/2023, 3:19 PM
jackson-module-kotlin 2.15.0-rc1 has been released. https://mvnrepository.com/artifact/com.fasterxml.jackson.module/jackson-module-kotlin/2.15.0-rc1 The following important changes have been made in this version • Reduction of the amount of memory consumed by the reflection cache • Fixed an issue caused by the name of is-getter (behavior change) • Removal of Kotlin 1.4 support • Scheduled deprecation of MissingKotlinParameterException For complete release notes, please see https://github.com/FasterXML/jackson-module-kotlin/blob/f66f8c4b32a64ea9e2bef45caca2ff876f8b2f6b/release-notes/VERSION-2.x#L19 Feedback and bug reports are welcome.
View count: 25