You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: migrate from deprecated jsonpb to modern protojson APIs (#1890)
* refactor: migrate from deprecated jsonpb to modern protojson APIs
Replace github.com/golang/protobuf/jsonpb with google.golang.org/protobuf/encoding/protojson
and google.golang.org/protobuf/types/dynamicpb for better performance and future compatibility.
- Remove deprecated jsonpb.Marshaler/Unmarshaler usage
- Migrate to dynamicpb.NewMessage for dynamic message creation
- Update anyResolver to implement modern protoreflect interfaces
- Preserve cross-package Any field resolution functionality (PR #425)
- Update tests to use modern resolver methods
- Maintain backward compatibility for all public APIs
All tests pass, ensuring no functional regressions.
* fix: resolve linting errors in protobuf migration
- Replace unused method receivers with underscore
- Use errors.New instead of fmt.Errorf for static messages
- Replace interface{} with any for Go 1.18+ compatibility
- Remove commented code and unnecessary nolint directives
- Use t.Log instead of t.Logf for simple messages
* refactor: clean up protobuf deserialization comments
* test: update protobuf error assertion message
* test: fix protobuf field ordering in message comparison
@@ -907,7 +905,7 @@ func (s *APIIntegrationTestSuite) TestPublishMessages() {
907
905
assert.Nil(res)
908
906
909
907
require.Error(err)
910
-
assert.Contains(err.Error(), "invalid_argument: failed to serialize json protobuf payload: failed to unmarshal protobuf message from JSON: bad Timestamp: parsing time")
908
+
assert.Contains(err.Error(), "failed to serialize json protobuf payload: failed to unmarshal JSON into protobuf message: proto:")
0 commit comments