Closed renier closed 4 months ago
@renier, I assume you are referring to the JSON support provided by *dynamic.Message
?
I would recommend instead using the dynamic message implementation in the Protobuf Go runtime: google.golang.org/protobuf/types/dynamicpb.
My implementation pre-dates theirs. But now that there exists an implementation in the standard runtime, I strongly encourage using it. Because my implementation was based on the older v1 of the Protobuf API, it has numerous limitations, and I am not planning to invest any time in improving it. (The v1 API is what's in github.com/golang/protobuf
; the "v2" API is in google.golang.org/protobuf
.)
@jhump Yes, that's what I was referring to. Thanks for the explanation. I arrived here because I was trying out proton
(https://github.com/beatlabs/proton) which uses this implementation of dynamic. It would make more sense of that tool updated to use dynamicpb as you suggest.
I'm missing the option to using the proto field names for the resulting json keys, similar to what the protojson package allows with its UseProtoNames option. https://pkg.go.dev/google.golang.org/protobuf/encoding/protojson#MarshalOptions