monix / monix-grpc

Apache License 2.0
6 stars 2 forks source link

Add automatic conversions between protobuf and Java types #6

Closed borissmidt closed 3 years ago

borissmidt commented 3 years ago

This might be an issue that would better fit in scalapb itself i think. But it would be nice if we could register some types to the generator and tell it to use a certain class to wrap and unwrap certain grpc types. So protobuf.Time would become java.time.Instant and thus request response would use these domain level 'types' instead of the very crude protobuf.Time pojo.

jvican commented 3 years ago

I think this is a nice idea. I believe if scalapb could provide these helpers, it'd be ideal, though we might also want to implement them ourselves. This would avoid a lot of duplication on downstream users that need to create their own helpers to turn protobuf types into java types reliably.

borissmidt commented 3 years ago

JUst so your are up to date. in the latest scalapb you can actually do all the conversions by the generator and describe it into the proto file or with auxiliarian descriptions. So that is very cool! https://scalapb.github.io/docs/customizations