poem-web / poem

A full-featured and easy-to-use web framework with the Rust programming language.
Apache License 2.0
3.62k stars 295 forks source link

Grpc Build: Format service name as `.{proto_name}` when package is empty #840

Closed 4t145 closed 4 months ago

4t145 commented 4 months ago

Expected Behavior

Actual Behavior

When package is empty the service name is formated as .{proto_name} https://github.com/poem-web/poem/blob/e2f3c581bfec086cee1eed27deae2f67a1a8abfc/poem-grpc-build/src/server.rs#L39-L43

However the reflection api don't think so https://github.com/poem-web/poem/blob/e2f3c581bfec086cee1eed27deae2f67a1a8abfc/poem-grpc/src/reflection.rs#L233-L239

May we emit package when package name is empty?

Steps to Reproduce the Problem

  1. Create a service with empty package name
  2. Use reflection
  3. Use postman to get service definition by server reflection. And send a request
  4. Result 404 not found

Specifications