Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2: Fix wrapper extension JSON serialization #821

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/protobuf-test/extra/extensions-proto2.proto
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ extend Proto2Extendee {
repeated string repeated_string_ext = 7002;
repeated uint32 packed_uint32_ext = 7003 [packed = true];
repeated uint32 unpacked_uint32_ext = 7004; // unpacked by default in proto2
repeated uint64 repeated_uint64_ext_js_string = 7006 [jstype = JS_STRING];

optional google.protobuf.UInt32Value wrapper_ext = 8001;

Expand Down
6 changes: 6 additions & 0 deletions packages/protobuf-test/extra/extensions-proto3.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,10 @@ extend google.protobuf.FileOptions {
optional uint32 optional_uint32_ext = 1002;
repeated uint32 packed_uint32_ext = 7003;
repeated uint32 unpacked_uint32_ext = 7004 [packed = false];
Proto3ExtMessage message_ext = 7005;
}

// A message used in extensions
message Proto3ExtMessage {
string string_field = 1;
}
3 changes: 3 additions & 0 deletions packages/protobuf-test/src/extension-accessor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import {
repeated_enum_ext,
repeated_message_ext,
repeated_string_ext,
repeated_uint64_ext_js_string,
repeatedgroupext,
string_ext,
string_ext_with_default,
Expand Down Expand Up @@ -99,6 +100,7 @@ const goldenValues: extensionWithValueCollection = [
{ ext: repeated_string_ext, val: ["a", "b", "c"] },
{ ext: packed_uint32_ext, val: [1, 2, 3] },
{ ext: unpacked_uint32_ext, val: [4, 5, 6] },
{ ext: repeated_uint64_ext_js_string, val: ["1", "2", "3"] },
{ ext: wrapper_ext, val: 123 },
{ ext: groupext, val: create(GroupExtDesc, { a: 123 }) },
{
Expand Down Expand Up @@ -130,6 +132,7 @@ const goldenValuesZero: extensionWithValueCollection = [
{ ext: repeated_string_ext, val: [] },
{ ext: packed_uint32_ext, val: [] },
{ ext: unpacked_uint32_ext, val: [] },
{ ext: repeated_uint64_ext_js_string, val: [] },
{ ext: wrapper_ext, val: 0 },
{ ext: groupext, val: create(GroupExtDesc) },
{ ext: repeatedgroupext, val: [] },
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 10 additions & 4 deletions packages/protobuf-test/src/gen/js/extra/extensions-proto2_pb.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 15 additions & 2 deletions packages/protobuf-test/src/gen/js/extra/extensions-proto3_pb.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading