-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Objective
{
"name": "Mo Kweon",
"some_objects": [ { "key": 123 }, { "key": 1234 } ]
}to
message Root {
string name = 1;
repeated SomeObject some_objects = 2;
}
message SomeObject {
int64 key = 1;
}Details
Proto Message 는 다음과 같이 나타내어 질 수 있음
message {{ name }} {
[repeated] {{ fieldType }} {{ fieldName }} = {{ fieldTag }}
}fieldType 은 Message 형 혹은 Primitive형으로 구분됨 (이 프로젝트에서 enum과 oneof 및 기타 complex type은 제외. JSON에서 추론 불가능함.)
syntax = "proto3";
message ProtoMessage {
string name = 1;
repeated ProtoField fields = 2;
}
message ProtoField {
ProtoType type = 1;
string name = 2;
int64 tag = 3;
bool repeated = 4;
}
message ProtoType {
oneof type {
ProtoMessage proto_message = 1;
ProtoField proto_field = 2;
}
}음 될까요??
parseJSONToProtoMessage:: string -> ProtoMessage
generateProtoDefinition:: ProtoMessage -> stringTangoEnSkai
Metadata
Metadata
Assignees
Labels
No labels