Skip to content

Add JsonGenerator.writeFieldId(long) method to support binary formats with non-String keys #294

@cowtowncoder

Description

@cowtowncoder

Some/many binary formats allow use of keys other than Strings; CBOR for one. Since coercion from non-Strings is already needed even with JSON (to support Java Maps with typed keys), it would be easy to add a method like:

public writeFieldId(long id);

with default implementation that just converts id into String and calls writeFieldName(), and where dataformat implementations may override it. In future (2.9?) jackson-databind could then start calling this method for limited case; and users that directly use streaming API may just call this method as necessary.

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