Skip to content

Kotlin support #55

@emrul

Description

@emrul

Hi, I'm wondering if there's any plan to support Kotlin code (similarly to how https://github.com/FasterXML/jackson-module-kotlin/blob/master/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinModule.kt does it)

Specifically: if I have a data class:

data class User(@JsonProperty("userName") val name: String)

Then the annotation is ignored (I believe because of how the Kotlin compiler generates related bytecode) and serializing an instance of this class will result in a JSON object with the key 'name' instead of 'userName'.

However, the following code behaves as expected:

class User(name: String) {
    @JsonProperty("userName")
    val name: String = name
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions