grpc-swift icon indicating copy to clipboard operation
grpc-swift copied to clipboard

Question: Server Reflection Support?

Open orj opened this issue 4 years ago • 12 comments

Question Checklist

Question Subject

Server Reflection Support

Question Description

Is there any plan to support gRPC server reflection?

orj avatar Mar 29 '20 04:03 orj

Not at the moment; this would be nice to have though. Would this be something you'd be interested in working on?

glbrntt avatar Mar 30 '20 09:03 glbrntt

@glbrntt Although it sounds cool, unfortunately I do not have the time for that. :(

orj avatar Mar 30 '20 22:03 orj

@glbrntt The main reason I was asking was because I was trying to use grpcurl with a SwiftGRPC service and not getting much joy.

orj avatar Mar 30 '20 22:03 orj

@glbrntt The main reason I was asking was because I was trying to use grpcurl with a SwiftGRPC service and not getting much joy.

I presume that grpcurl can take your service definitions as a command-line argument; did you try that?

MrMage avatar Mar 31 '20 07:03 MrMage

@MrMage yes I did. That at least worked for the list and describe grpcurl features. I never got grpcurl to work calling a method however. My SwiftGRPC based service kept complaining that it couldn't determine the HTTP version.

orj avatar Apr 06 '20 23:04 orj

@MrMage yes I did. That at least worked for the list and describe grpcurl features. I never got grpcurl to work calling a method however. My SwiftGRPC based service kept complaining that it couldn't determine the HTTP version.

That sounds like a completely different problem though, which should not be related to reflection.

MrMage avatar Apr 07 '20 08:04 MrMage

For future reference:

  • The reflection service proto lives here: https://github.com/grpc/grpc-proto/blob/master/grpc/reflection/v1/reflection.proto
  • Supporting this would require additional code generation for services to expose the right descriptors
  • We'd most likely need to pull this information in from service providers in the request routing handler

glbrntt avatar Jul 03 '20 08:07 glbrntt

We could just encode the original service protobuf message as passed to the compiler into the generated code, then use that to "power" the reflection API at runtime. That would minimize the amount of extra generated code we need.

That being said, I'd say this has fairly low priority.

MrMage avatar Jul 03 '20 08:07 MrMage

Agreed, I was just looking out of curiosity as to what this would involve and leaving breadcrumbs...

glbrntt avatar Jul 03 '20 08:07 glbrntt

Any updates?

fourhundredfour avatar May 25 '22 08:05 fourhundredfour

No, this still isn't a priority.

glbrntt avatar May 25 '22 08:05 glbrntt

Would love to get on it as my first Swift project 😄

Since it has a low priority anyway, I don't think I'll be blocking anyone with it.

fourhundredfour avatar May 25 '22 08:05 fourhundredfour

+1 for making this a priority--it's immensely helpful during debugging.

Not having it makes me want to just use golang instead...

naquin avatar Dec 15 '22 21:12 naquin

This has been added in v1.21.0

glbrntt avatar Dec 11 '23 10:12 glbrntt