Open
Description
I'm using msgpack to transmit objects with a fixed schema, so it feels wasteful to encode the property names with each payload. Is there some way to provide some schema information to the encoder/decoder during initialization so that property names can be excluded from the serialization output?
Proposal of what this api could look potentially like:
import { ValueOnlyEncoder, ValueOnlyDecoder } from "@msgpack/msgpack";
const schema = ... // some representation of your object schema, contains the property names
const encoder = new ValueOnlyEncoder(schema);
const decoder = new ValueOnlyDecoder(schema);
const data = { foo: [1, 2, 3], bar: "baz" };
const encoded = encoder.encode(data); // fails if data doesn't conform to schema
const decoded = decoder.decode(encoded);
Metadata
Metadata
Assignees
Labels
No labels