AkroMentos
AkroMentos
Explore posts from servers
CC#
Created by AkroMentos on 10/6/2023 in #help
❔ Mapping common primitive types with protobuf & grpc
that way I'm still not married to grpc.tools
70 replies
CC#
Created by AkroMentos on 10/6/2023 in #help
❔ Mapping common primitive types with protobuf & grpc
it doesn't have to be, I have a code generator for other purposes where I already do my own .proto -> .desc -> c# code, I can just hook into that and generate these mappings from a config file as well
70 replies
CC#
Created by AkroMentos on 10/6/2023 in #help
❔ Mapping common primitive types with protobuf & grpc
good point, but will have to look out for name collisions
70 replies
CC#
Created by AkroMentos on 10/6/2023 in #help
❔ Mapping common primitive types with protobuf & grpc
so you'd still see the generated type in the protobuf but that can be implicitly converted to the desired domain type
70 replies
CC#
Created by AkroMentos on 10/6/2023 in #help
❔ Mapping common primitive types with protobuf & grpc
that or just simply
public static implicit operator Generated.Protobuf.Vector3(System.Numerics.Vector3 val)
public static implicit operator Generated.Protobuf.Vector3(System.Numerics.Vector3 val)
70 replies
CC#
Created by AkroMentos on 10/6/2023 in #help
❔ Mapping common primitive types with protobuf & grpc
protobuf generates partial classes so I can also generate implicit conversions "into" the proto classes
70 replies
CC#
Created by AkroMentos on 10/6/2023 in #help
❔ Mapping common primitive types with protobuf & grpc
ooo that's clever, like generate the converters as well
70 replies
CC#
Created by AkroMentos on 10/6/2023 in #help
❔ Mapping common primitive types with protobuf & grpc
then it's either some msbuild step of source generators that do the magic
70 replies
CC#
Created by AkroMentos on 10/6/2023 in #help
❔ Mapping common primitive types with protobuf & grpc
<Protobuf Include="../../proto/common/*.proto" ProtoRoot="../../proto" />
<Protobuf Include="../../proto/common/*.proto" ProtoRoot="../../proto" />
70 replies
CC#
Created by AkroMentos on 10/6/2023 in #help
❔ Mapping common primitive types with protobuf & grpc
at the end of the day that mapping has to be defined somewhere
70 replies
CC#
Created by AkroMentos on 10/6/2023 in #help
❔ Mapping common primitive types with protobuf & grpc
I do that already for other stuff, and I would do it here as well. My main issue is that I have no idea how a solution could look like
70 replies
CC#
Created by AkroMentos on 10/6/2023 in #help
❔ Mapping common primitive types with protobuf & grpc
hm, interesting approach, unfortunately I get the proto files so I have to use that as source
70 replies
CC#
Created by AkroMentos on 10/6/2023 in #help
❔ Mapping common primitive types with protobuf & grpc
sorry, I thought you had something specific in mind when you said
it's entirely possible, but I have no idea if Grpc.Tools supports anything like that
it came across that you are also using protobuf and know of a library or tool that supports what I need or have solved this issue otherwise
70 replies
CC#
Created by AkroMentos on 10/6/2023 in #help
❔ Mapping common primitive types with protobuf & grpc
if it has the featureset that I need... I'm not married to grpc.tools...
70 replies
CC#
Created by AkroMentos on 10/6/2023 in #help
❔ Mapping common primitive types with protobuf & grpc
I mean.. it's open source I can fork / rewrite do anything, I can also switch over to what you're using
70 replies
CC#
Created by AkroMentos on 10/6/2023 in #help
❔ Mapping common primitive types with protobuf & grpc
(and yes grpctools has basically no docs..)
70 replies
CC#
Created by AkroMentos on 10/6/2023 in #help
❔ Mapping common primitive types with protobuf & grpc
that's fine, can you please give me the tool whith which you're familiar where it's possible? I can take inspiration from that
70 replies
CC#
Created by AkroMentos on 10/6/2023 in #help
❔ Mapping common primitive types with protobuf & grpc
so what you're suggesting is that if there was a way it'd be best if instead of the generated Vector3, the code generator could already put System.Numerics.Vector3 in there. just imagingin how that could possible work, at that point the generated code couldn't possibly call the proto write on that vector3 because obviously System.Numerics.Vector3 is not a proto class. There'd need to exist a mapping still somewhere 😐
70 replies
CC#
Created by AkroMentos on 10/6/2023 in #help
❔ Mapping common primitive types with protobuf & grpc
Even if it did I wouldn't want to define any project/tool specific thing in the proto file as these are shared between completely different teams using different tech stack
70 replies
CC#
Created by AkroMentos on 10/6/2023 in #help
❔ Mapping common primitive types with protobuf & grpc
but no idea how they choose to implement codegen
70 replies