socotecio / django-socio-grpc

gRPC for Django.
https://django-socio-grpc.readthedocs.io/
Apache License 2.0
104 stars 22 forks source link

Reflection APIs is not supported by the server #307

Closed chapellu closed 2 months ago

chapellu commented 5 months ago

Reflection is a protocol that gRPC servers can use to declare the protobuf-defined APIs they export over a standardized RPC service, including all types referenced by the request and response messages. Clients can then use this information to encode requests and decode responses in human-readable manner.

Reflection is used heavily by debugging tools such as grpcurl and Postman. One coming from the REST world might compare the gRPC reflection API to serving an OpenAPI document on the HTTP server presenting the REST API being described.

https://grpc.io/docs/guides/reflection/

AMontagu commented 4 months ago

Sorry for the late answer. This could be a really great feature even we didn't prioritize it.

The main point to check is:

If yes we could easily find all the service used and declare them for reflection. (just adding the enable_server_reflection here: https://github.com/socotecio/django-socio-grpc/blob/master/django_socio_grpc/services/app_handler_registry.py#L137) If no we need a way to get all the service of the server before launching the server like an extra file written by generateproto of something like that.

In both case we also need to consider that developer that use DSG may want to keep some service not reflected. This can be done with a service attribute or decorator.

legau commented 4 months ago

Already in #224