google-api-proto icon indicating copy to clipboard operation
google-api-proto copied to clipboard

Enabling gRPC server codegen

Open hiltontj opened this issue 2 years ago • 3 comments

Hi, I was wondering if it is possible to enable the gRPC server codegen. It is disabled in the code generation (see here).

Is there a specific reason that it is disabled?

If enabled, it may be useful for creating mock servers in a testing scenario.

hiltontj avatar May 04 '22 15:05 hiltontj

@hiltontj Hi, I believe that most use cases can be satisfied with client-only code generation.

Enabling server-side code generation will increase the amount of code generated and compile time.

Alternatives to server-side mock might be to use existing implementations in other languages, docker images, or emulators provided by gcloud tools.

mechiru avatar May 06 '22 09:05 mechiru

Hey @mechiru, understood. Thanks for the quick response and suggestions.

I've spent some time reading through the code here and see that this wouldn't necessarily be a trivial change, e.g., as a feature flag. I agree, generating the server code by default may not be the best idea after all.

hiltontj avatar May 11 '22 02:05 hiltontj

Would it be possible to generate at least the use google_api_proto::google::api::expr::conformance::v1alpha1 servers?

It can be in a different crate, as long as it's compatible with the google-api-protos. This would be to support the cel-spec tests

rbtying avatar Nov 10 '22 07:11 rbtying