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
so if protobuf integrate it can be much nicer to write mappings and also allow some more things like also add json serialization to the class, and other stuffs:
That sounds like a nice feature.
I don't have time right now, but I'd be happy to review a PR.
On July 16, 2018 at 1:47:18 AM, O_o (notifications@github.com) wrote:
crystal recently added annotations and json serialization on it (
https://github.com/crystal-lang/crystal/blob/master/src/json/serialization.cr
):
so if protobuf integrate it can be much nicer to write mappings and also
allow some more things like also add json serialization to the class, and
other stuffs:
struct MyMessage
include Protobuf::Serializable
include JSON::Serializable
# some required properties
@[Protobuf::Field(num: 1)]
property prop_name = 123
@[Protobuf::Field(num: 2)]
property prop2 : Foo
# optional propertie
@[Protobuf::Field(num: 3)]
property optional_prop_name : String?
# repeated fields
@[Protobuf::Field(num: 4)]
property my_array : Array(Int32)?end
btw, this num option also can be generated automatically.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#26>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACpPQKg4BmL878YgiNbGF5vrOSAmQ5Pks5uHCjlgaJpZM4VQlyY>
.
crystal recently added annotations and json serialization on it (https://github.com/crystal-lang/crystal/blob/master/src/json/serialization.cr):
so if protobuf integrate it can be much nicer to write mappings and also allow some more things like also add json serialization to the class, and other stuffs:
btw, this num option also can be generated automatically.
The text was updated successfully, but these errors were encountered: