Skip to content

Support serialize objects as integer keyed maps #1953

@pkindruk

Description

@pkindruk

Question

Any plans on adding built-in support of object serialization as integer keyed maps? Or maybe there is an extension package available already? As mentioned in #265 this can be done using custom formatter.

Context

Currently library supports 2 ways:

  1. msgpack map with string keys
  2. msgpack array

My use case involves a lot of nullable fields (think of ModifyRequest where you send only changed fields) and some class inheritance (which leads to reserved indexes). When using interger keys there is a significant number of nil bytes in output. And string keys are just heavier (though you can sacrifice readability and assign shorter names in attributes).

An integer keyed map (like Protobuf does) seems like a perfect addition to library.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions