Skip to content

V2: Fix wrapper extension JSON serialization#821

Merged
timostamm merged 1 commit intov2from
tstamm/fix-v2-wrapper-extension-json
Apr 30, 2024
Merged

V2: Fix wrapper extension JSON serialization#821
timostamm merged 1 commit intov2from
tstamm/fix-v2-wrapper-extension-json

Conversation

@timostamm
Copy link
Member

A singular message field using one of the wrapper messages from google/protobuf/wrappers.proto uses the "unwrapped" value as the property type. For example, google.protobuf.BoolValue field = 1 is generated as field?: boolean.

The same principle applies to extension fields, but serialization to JSON and parsing from JSON for such an extension field is broken. This fixes the issue, and adds test coverage.

@timostamm timostamm requested a review from srikrsna-buf April 29, 2024 20:05
@timostamm timostamm merged commit 896338d into v2 Apr 30, 2024
@timostamm timostamm deleted the tstamm/fix-v2-wrapper-extension-json branch April 30, 2024 12:35
@timostamm timostamm changed the title Fix wrapper extension JSON serialization V2: Fix wrapper extension JSON serialization Apr 30, 2024
@timostamm timostamm mentioned this pull request May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants