-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
@msoucy
proto syntax supports annotations via option:
https://developers.google.com/protocol-buffers/docs/proto
import "google/protobuf/descriptor.proto";
extend google.protobuf.FieldOptions {
optional float my_field_option = 50002;
}
message MyMessage {
optional int32 foo = 1 [(my_field_option) = 4.5];
}
this could map into a UDA on D side, which I could then use to customize behavior for D code that uses these protos, eg, customizing vibe serialization (via tagging a field as @optional or @ignore, etc)
Is theer a simple way to do this?
looks like extend declarations are allowed but ignored in import/dproto/parse.d
/** Reads an extend declaration (just ignores the content).
@todo */
-
void readExtend() { readName(); // Ignore this for now unexpected(readChar() == '{', "Expected '{'"); while (true) { readDocumentation(); if (peekChar() == '}') { pos++; break; } //readDeclaration(); } return; }
Is there a simpler way (at least in meantime) to do what I want in my particular case, ie add a @optional or @ignore UDA for a particular field in a generated proto message?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels