Skip to content

Nullable unsigned numbers do not serialize correctly #182

Closed
@bholzman

Description

@bholzman

Using Kotin 1.3.0-rc-190 and jackson 2.9.7, nullable unsigned integers serialize as an empty object, even when they have a value.

Given:

data class Foo(val signed: Int, val unsigned: UInt, val nullableSigned: Int?, val nullableUnsigned: UInt?) {
    private val mapper = jacksonObjectMapper()

    fun asJson() : String{
        return mapper.writeValueAsString(this)
    }
}

Then this:

println(Foo(23, 23U, 23, 23U).asJson())

outputs:

{"signed":23,"unsigned":23,"nullableSigned":23,"nullableUnsigned":{}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions