Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to achieve Any.Pack/Unpack from FSharp? #26

Open
iskandersierra opened this issue Jan 6, 2023 · 1 comment
Open

How to achieve Any.Pack/Unpack from FSharp? #26

iskandersierra opened this issue Jan 6, 2023 · 1 comment

Comments

@iskandersierra
Copy link

How do I create a Google.Protobuf.FSharp.WellKnownTypes.Any instance from another message?

In C# we use method static Google.Protobuf.WellKnownTypes.Any.Pack(IMessage) and Google.Protobuf.WellKnownTypes.Any.[Try]Unpack<T>(...)

Also, how to know the message type from the Any.TypeUrl?

Thanks for this libraries! I finally found some FSharp libraries to work with Protobuf/Grpc 🥳

@iskandersierra
Copy link
Author

We would have to add from https://github.com/protocolbuffers/protobuf/blob/main/csharp/src/Google.Protobuf/WellKnownTypes/AnyPartial.cs the needed operations to module Any and type Any, like pack, unpack, tryUnpack, is and a way to access descriptor from all the messages, like Dog.descriptor, taken from module DogReflection.

I would like to work on this as a PR, if you are open for it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant