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

Add protobuf support #518

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

denysvitali
Copy link

No description provided.

@decebals
Copy link
Member

decebals commented Jun 5, 2019

Interesting. This PR is a particular case of #407. I will push my work on GitHub in a separate branch to make my work public.

@denysvitali
Copy link
Author

Does my work look good? I think this may solve #407 as well, as you said 👍

@denysvitali
Copy link
Author

I use it like this, where LoginResponse obviously is a Protobuf Message:

ctx.status(HttpStatus.OK_200);
if(req.getUsername().equals("user") && req.getPassword().equals("password")){
resp = LoginResponse.newBuilder()
      .setSuccess(true)
      .setMessage("Login successful")
      .build();
  ctx.protobuf().send(resp);
} else {
  resp = LoginResponse.newBuilder()
      .setSuccess(false)
      .setMessage("Invalid username/password")
      .build();
  ctx.protobuf().send(resp);
}

@decebals
Copy link
Member

decebals commented Jun 5, 2019

Does my work look good? I think this may solve #407 as well, as you said

I will do an evaluation and I will come with a response. Thanks!

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

Successfully merging this pull request may close these issues.

3 participants