Skip to content

Serialize unsigned integers to JSON #368

@ggrossetie

Description

@ggrossetie

Currently, unsigned integer types are serialized as empty object {}, I think Klaxon should serialize them as numbers.
https://kotlinlang.org/docs/unsigned-integer-types.html#unsigned-integers-literals

Actual

println(JsonObject(mapOf("uint" to 1u)).toJsonString()) // {"uint":{}}

Expected

println(JsonObject(mapOf("uint" to 1u)).toJsonString()) // {"uint":1}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions