You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added a pre-defined option in the test.proto, unable to generate the json file properly. test.proto
syntax = "proto3";
import "google/protobuf/descriptor.proto";
import "google/api/field_behavior.proto";
package trinsic.protoc.gen.json.test;
// Test of a field extension
extend google.protobuf.FieldOptions {
optional bool bool_option = 50000;
}
// Just a simple, hardworking enum
enum TestEnum {
// Foo's value is 0. Foo indeed.
FOO = 0;
// Bar's value is 1. We don't like bar.
BAR = 1;
}
// A message which is referenced as the field type for
// a field in another message
message TestReferencedMessage {
// A string field
string test_string_field = 1;
}
// A message
message TestMessage {
// A message which is defined in another message
message TestSubMessage {
// A field in a message which is defined in another message
// (...at the bottom of the sea)
int64 test_sub_field = 1;
}
// A field with a type pointing to a message defined in another message.
// This field also has a custom field option set on it.
TestSubMessage test_sub_message_field = 1 [(bool_option) = false];
// A field with a type pointing to a message defined externally
TestReferencedMessage test_ref_field = 2;
// A field with a primitive type
int64 test_primitive_field = 3 [(google.api.field_behavior) = REQUIRED];
// A field with an enum type
TestEnum test_enum_field = 4;
}
// A message which is the input to a Method
message TestInputMessage {
sint32 test_input_field = 1;
}
// A message which is the output of a Method
message TestOutputMessage {
bool test_output_field = 2;
}
// A service
service TestService {
// A method defined in a service
rpc TestMethod (TestInputMessage) returns (TestOutputMessage);
}
Added a pre-defined option on line45
Line 45: int64 test_primitive_field = 3 [(google.api.field_behavior) = REQUIRED];
Error msg:
--json_out: protoc-gen-json: Plugin output is unparseable: FAILED PARSING OPTIONS FOR FIELD trinsic.protoc.gen.json.test.TestMessage.test_primitive_field: [224 65 2]
The text was updated successfully, but these errors were encountered:
I'm guessing this has to do with the following combination of factors:
It's an option defined in an imported protobuf file, which itself might not be included in compilation when sent to the plugin (maybe?)
The type of the option value seems to be an enum, which I haven't put any effort into explicitly supporting (though the wire format should just be an integer type I assume)
At this point, this repo exists to serve Trinsic's needs for our documentation site -- we'll likely get around to resolving this issue once we run into it ourselves.
Added a pre-defined option in the test.proto, unable to generate the json file properly.
test.proto
Added a pre-defined option on line45
Line 45:
int64 test_primitive_field = 3 [(google.api.field_behavior) = REQUIRED];
Error msg:
The text was updated successfully, but these errors were encountered: