max-ieremenko / ServiceModel.Grpc

Code-first for gRPC
https://max-ieremenko.github.io/ServiceModel.Grpc/
Apache License 2.0
90 stars 11 forks source link

(Question|Feature request): gRPC server reflection #219

Closed ikopytko closed 2 months ago

ikopytko commented 2 months ago

I haven't found any discussion or references in code about gRPC reflection feature. To give a context - it is possible to enable reflection on both Grpc.AspNetCore and protobuf-net.Grpc, which will add service discovery feature which can be used in different clients like Postman, grpcurl, grpc-cli, etc. This is slightly more useful than swagger in some cases. I don't know if this is a matter of correct configuration or it will require an implementation as ServiceModel feature.

max-ieremenko commented 2 months ago

ServiceModel.Grpc enables applications to communicate with gRPC services using a code-first approach (no .proto files), helps to get around limitations of gRPC protocol like "only reference types", "exact one input", "no nulls", "no value-types"

gRPC reflection is not supported.

ikopytko commented 2 months ago

Check out, please, second link. There is an example of reflection together with code first server using protobuf-net. Thought this may be similar to what ServiceModel can do.

P.S. Appreciate for the quick response.

max-ieremenko commented 2 months ago

protobuf-net is a serializer compatible with Google Protobuf. With ServiceModel.Grpc you are not limited to Google Protobuf, using any other serializer by design does not support gRPC reflection.

ikopytko commented 2 months ago

I see, now I'm curious if it is possible to implement for Protobuf Marshaller. protobuf-net creates service descriptor dynamically in schema generator, smth like reverse engineering .proto files from C# contracts and services. But this might be outside of this question. Thanks