Skip to content

The spec does not strictly define precedence within the output formats #186

Open

Description

@skypjack

According to this point: https://github.com/msgpack/msgpack/blob/master/spec.md#serialization

If an object can be represented in multiple possible output formats, serializers SHOULD use the format which represents the data in the smallest number of bytes.

The spec does not define precedence within the output formats.
Because of that, it's up to the different implementations to decide either to favor extended types which override default ones or not to permit this approach.
In most cases clients could highly compress some types (like strings) exploiting application-dependent patterns or something else by providing extensions.
Despite of the advantages that this choice could lead to, some implementations do not test each format (that means mainly the extensions, even though they are for internally treated types like strings) and do not "use the format which represents the data in the smallest number of bytes".

I suspect that the problem is due to a misunderstanding of the spec itself and kindly suggest to define a behavior all the implementations have to adhere to.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions