Skip to content

Commit

Permalink
Fix JSON types for fields with uncommon json_name (#1004)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicole0707 authored Nov 1, 2024
1 parent d04b861 commit a2966f2
Show file tree
Hide file tree
Showing 9 changed files with 283 additions and 16 deletions.
8 changes: 8 additions & 0 deletions packages/protobuf-test/extra/json_types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ message JsonTypesMessage {
google.protobuf.BytesValue wrapped_bytes_field = 24;
repeated JsonTypeEnum repeated_enum_field = 25;
map<bool, JsonTypeEnum> map_bool_enum_field = 26;
bool json_name_ok = 27 [json_name = "Foo123_bar$"];
bool json_name_at = 28 [json_name = "foo@"];
bool json_name_hyphen = 29 [json_name = "foo-bar"];
bool json_name_start_with_digit = 30 [json_name = "1foo"];
bool json_name_space = 31 [json_name = "foo bar"];
bool json_name_tab = 32 [json_name = "foo\tbar"];
bool json_name_non_ascii = 33 [json_name = "你好"];
bool json_name_escape = 34 [json_name = "foo\nbar\\n"];
}

enum JsonTypeEnum {
Expand Down

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.

41 changes: 41 additions & 0 deletions packages/protobuf-test/src/gen/js/extra/json_types_pb.d.ts

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

2 changes: 1 addition & 1 deletion packages/protobuf-test/src/gen/js/extra/json_types_pb.js

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

Loading

0 comments on commit a2966f2

Please sign in to comment.