Skip to content

Commit

Permalink
Down-integrate from google internal.
Browse files Browse the repository at this point in the history
  • Loading branch information
liujisi committed Oct 5, 2015
1 parent ff1f87e commit e2836fc
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
6 changes: 6 additions & 0 deletions google/protobuf/descriptor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@ message FieldDescriptorProto {
// list. This field is a member of that oneof.
optional int32 oneof_index = 9;

// JSON name of this field. The value is set by protocol compiler. If the
// user has set a "json_name" option on this field, that option's value
// will be used. Otherwise, it's deduced from the field's name by converting
// it to camelCase.
optional string json_name = 10;

optional FieldOptions options = 8;
}

Expand Down
6 changes: 6 additions & 0 deletions google/protobuf/map_proto2_unittest.proto
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
syntax = "proto2";


import "google/protobuf/unittest_import.proto";

// We don't put this in a package within proto2 because we need to make sure
// that the generated code doesn't depend on being in the proto2 namespace.
// In map_test_util.h we do "using namespace unittest = protobuf_unittest".
Expand Down Expand Up @@ -58,3 +60,7 @@ message TestEnumMapPlusExtra {
map<int32, Proto2MapEnumPlusExtra> known_map_field = 101;
map<int32, Proto2MapEnumPlusExtra> unknown_map_field = 102;
}

message TestImportEnumMap {
map<int32, protobuf_unittest_import.ImportEnumForMap> import_enum_amp = 1;
}
7 changes: 7 additions & 0 deletions google/protobuf/unittest_import.proto
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,10 @@ enum ImportEnum {
IMPORT_BAZ = 9;
}


// To use an enum in a map, it must has the first value as 0.
enum ImportEnumForMap {
UNKNOWN = 0;
FOO = 1;
BAR = 2;
}
10 changes: 10 additions & 0 deletions google/protobuf/util/json_format_proto3.proto
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@ message TestMap {
map<string, int32> string_map = 6;
}

message TestNestedMap {
map<bool, int32> bool_map = 1;
map<int32, int32> int32_map = 2;
map<int64, int32> int64_map = 3;
map<uint32, int32> uint32_map = 4;
map<uint64, int32> uint64_map = 5;
map<string, int32> string_map = 6;
map<string, TestNestedMap> map_map = 7;
}

message TestWrapper {
google.protobuf.BoolValue bool_value = 1;
google.protobuf.Int32Value int32_value = 2;
Expand Down

0 comments on commit e2836fc

Please sign in to comment.