Skip to content

Latest commit

 

History

History
33 lines (26 loc) · 742 Bytes

File metadata and controls

33 lines (26 loc) · 742 Bytes

As pointed out, multiple extension fields declared in different scopes using the same name resulted in duplicate name errors.

To address this issue, extension fields now use their fully qualified name as their key:

message A {
    required string id = 1;
    extensions 2 to max;
}

extend A {
    optional string id = 2; // fqn: .id
}

message B {
    extend A {
        optional string id = 3; // fqn: .B.id
    }
    ...
}

The recommended way of setting them is:

var A = builder.build("A");
var a = new A();
a.set(".id", 234); // or a['.id'] = 234;
a.set(".B.id", 345); // or a['.B.id'] = 345;
...

Likewise, getting them can be done through Message#get.