Skip to content

Ignore open-ended ranges in KotlinMixins.kt (to help with Kotlin 1.7.20+) #582

Closed
@poutsma

Description

@poutsma

Kotlin 1.7.20 introduced "Open-ended ranges", see https://youtrack.jetbrains.com/issue/KT-52932.
As a consequence, writing a Kotlin Range now writes not just the start and end properties, but also endExclusive.

To Reproduce

val mapper: ObjectMapper = ObjectMapper().registerModule(KotlinModule.Builder().build())
println(mapper.writeValueAsString(IntRange(1,3)))

will print out {"start":1,"end":3,"endExclusive":4}.

Expected behavior
The above code should print out {"start":1,"end":3}.

Versions
Kotlin: 1.7.20
Jackson-module-kotlin: 2.13.4
Jackson-databind: 2.13.4

Suggested solution
Add @JsonIgnore abstract public fun getEndExclusive(): T to KotlinMixins.kt

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions