Skip to content

wire-grpc-server generated code depends on ProtoFileDescriptorSupplier #11

@jdbp-classpass

Description

@jdbp-classpass

The code generated by the wire-grpc-server calls ServiceDescriptor.setSchemaDescriptor with a lambda converted to a io.grpc.protobuf.ProtoFileDescriptorSupplier:

builder.addStatement(
"""
.setSchemaDescriptor(io.grpc.protobuf.ProtoFileDescriptorSupplier {
fileDescriptor("${protoFile.location.path}", emptySet())
})
""".trimIndent(),

Unfortunately ProtoFileDescriptorSupplier is defined in Google's grpc-protobuf package, which brings in all sorts of unwanted dependencies, in particular com.google.api.grpc:proto-google-common-protos which pulls in protoc-generated versions of Google common types. Using ProtoFileDescriptorSupplier is necessary if you want to use Wire with Google's ProtoReflectionServiceV1 from grpc-services, but isn't otherwise. In our application we've written our own reflection implementation to avoid this dependency.

Would the maintainers accept a PR that added an option to specify the class used for the service descriptor callback? io.grpc.protobuf.ProtoFileDescriptorSupplier would be the default, but it could be set to a different type, or left blank to generate a regular Kotlin lambda (() -> Descriptors.FileDescriptor).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions