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

Custom option not parsed correctly when using TextFormat #636

Closed
subk opened this Issue Jan 10, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@subk
Contributor

subk commented Jan 10, 2017

protobuf.js version: 6.4.5

Custom option are not correctly parsed when using TextFormat definition

Given this proto :

syntax = "proto3";
package test;
import "google/protobuf/descriptor.proto";

message MyOptions {
  string a = 1;
  string b = 2;
}

extend google.protobuf.FieldOptions {
  MyOptions my_options = 50000;
}

message Test {
  string value = 1 [(my_options) = { a: "foo" b: "bar" }];
}

Will result in :

{ '(my_options).a': 'foo', '(my_options).a.b': 'bar' }

Expected :

{ '(my_options).a': 'foo', '(my_options).b': 'bar' }

@dcodeIO dcodeIO added the bug label Jan 10, 2017

@subk

This comment has been minimized.

Contributor

subk commented Jan 10, 2017

As a workaround, protobuf syntax perfectly works :

message Test {
  string value = 1 [(my_options).a = "foo", (my_options).b = "bar"];
}

Result :

{ '(my_options).a': 'foo', '(my_options).b': 'bar' }

@dcodeIO dcodeIO closed this in 7e57f4c Jan 10, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment