ugorji / go

idiomatic codec and rpc lib for msgpack, cbor, json, etc. msgpack.org[Go]
MIT License
1.85k stars 295 forks source link

Add support for github.com/go-json-experiment/json / UnmarshalerV2 ? #406

Closed vanackere closed 10 months ago

vanackere commented 10 months ago

Hi,

Opening this issue since I think it would be a good fit for go-codec.

As you may probably be aware, the package github.com/go-json-experiment/json is currently in active development (and a proposal is opened to include it later as encoding/json/v2, see https://github.com/golang/go/discussions/63397 for discussion). It defines new MarshalerV2 and UnmarshalV2 interfaces that are supposed to be more efficient.

It would be really nice to have optional support in the codegen tool to generate those methods.

ugorji commented 10 months ago

Looked through the design document.

MarshalerV2 and UnmarshalerV2 are tied to jsontext, and so are not generic interfaces which any other library can implement.