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
I got the impression you should wrap your messages oneof field type in ForceEmit a, but it seems they only accept Primitive a.
I might be rambling here, but this is my take away from digesting the code a bit. If anyone, with insight into the code, think there is a chance to make it possible to model oneof's containing toplevel messages using the current generics based approach (genericDotProto) I could try to champion it with some guidance. I mean accomplishing the below sketchy example
-- MessageX below would map to proto top level messages.
data Message1 = Message1 { fld1 :: OnOff SumType1 }
data SumType1 = A Message2 | B
data Message2 = Message2 { fld1 :: NestedVec Message3 }
data Message3 = Message3 { fld1 :: Int32 }
that would translate into a .proto like (mind my .proto knowledge is very limited)
The text was updated successfully, but these errors were encountered:
gurgl
changed the title
Uable to model protobufs "oneof" when generating a proto file
Unable to model protobuf's "oneof" when generating a proto file from types
Oct 21, 2024
Even if I searched the repository extensively I couldn't find anything that hints you can do this. The function https://hackage.haskell.org/package/proto3-suite-0.7.0/docs/src/Proto3.Suite.Class.html#message seems to indicate all message fields are constructed using DotProtoMessagePart's with constructor DotProtoMessageField DotProtoField.
I got the impression you should wrap your messages oneof field type in
ForceEmit a
, but it seems they only acceptPrimitive a
.I might be rambling here, but this is my take away from digesting the code a bit. If anyone, with insight into the code, think there is a chance to make it possible to model oneof's containing toplevel messages using the current generics based approach (
genericDotProto
) I could try to champion it with some guidance. I mean accomplishing the below sketchy examplethat would translate into a .proto like (mind my .proto knowledge is very limited)
The text was updated successfully, but these errors were encountered: