Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Kotlin DSL style builders #83

Closed
dariuszkuc opened this issue Apr 30, 2020 · 1 comment
Closed

Support for Kotlin DSL style builders #83

dariuszkuc opened this issue Apr 30, 2020 · 1 comment

Comments

@dariuszkuc
Copy link

Instead of relying on Java builders it would be great if this library supported Kotlin DSL, e.g. given

service HelloWorldAPI {
    rpc HelloWorld(HelloWorldRequest) returns (HelloWorldResponse);
}

message HelloWorldRequest {
    string hello_message = 1;
}

message HelloWorldResponse {
    string hello_response = 1;
}

It would be great if we could construct proto objects as

val hello = HelloWorldRequest {
  helloMessage = "hello"
}

instead of using ugly Java builders

val hello = HelloWorldRequest.newBuilder()
  .setHelloMessage("hello")
  .build()
@lowasser
Copy link
Collaborator

lowasser commented May 5, 2020

This project is specifically for gRPC only, not for protocol buffers in general. That project is happening separately, as mentioned in this project's readme:

Note: The Kotlin protoc plugin uses the Java protoc plugin behind the scenes to generate message types as Java classes. Generation of Kotlin sources for proto messages is being discussed in protocolbuffers/protobuf#3742.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants