feat!: Support JSON conversion for scalar wrappers#2201
feat!: Support JSON conversion for scalar wrappers#2201
Conversation
alexander-fenster
left a comment
There was a problem hiding this comment.
This is great; I'm a little bit concerned that it's a breaking change for those who depend on the existing format. If we are considering major version bump soon, maybe feat!: just to be safe?
|
True, this is essentially two pieces:
So yes, as-is, marking this as |
|
One good argument against splitting is that there's more WKT work perspectively, so locking the mechanism in 8.x already is risky. Likely best to keep the mechanism itself for 9.x then. |
|
Let's just do a single I'm surely aware of at least one package that would be affected by the breaking change, it's proto3-json-serializer that I wrote a few years ago for Google. It still depends on v7, but upgrading it to v9 will require someone to go make some (trivial) changes in this code that depends on the internal representation. Shall we probably make a branch for collecting 9.x features? |
Adds JSON conversion support for
google.protobuf.*Valuescalar wrapper types in converters:google.protobuf.DoubleValuegoogle.protobuf.FloatValuegoogle.protobuf.Int64Valuegoogle.protobuf.UInt64Valuegoogle.protobuf.Int32Valuegoogle.protobuf.UInt32Valuegoogle.protobuf.BoolValuegoogle.protobuf.StringValuegoogle.protobuf.BytesValueExample:
Unlike the existing
google.protobuf.Anywrapper inwrappers.js, these value wrappers are simple enough to implement at the shared codegen level, so they also apply to generated static code.Related: #677, #1312, #1304