protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

JsonFormat - allow one-liners

Open michaldo opened this issue 2 years ago • 18 comments

With proposed change simpler code is possible, for example

FooMessage fooMessage = JsonFormat.parser().merge(json, FooMessage.newBuilder()).build();

michaldo avatar Mar 23 '23 23:03 michaldo

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Mar 23 '23 23:03 google-cla[bot]

I see now I shoud add some generics to achieve my goal. Returning just Message.Builder needs downcasting.

FooMessage fooMessage = (FooMessage) JsonFormat.parser().merge(json, FooMessage.newBuilder()).build();

I will continue PR development

midovlvn avatar Mar 24 '23 08:03 midovlvn

@michaldo @midovlvn Be sure to sign the CLA so we can look at your PR when it is ready.

googleberg avatar Mar 24 '23 14:03 googleberg

@michaldo @midovlvn Be sure to sign the CLA so we can look at your PR when it is ready.

cla/google check pass, I think CLA is signed well

michaldo avatar Mar 27 '23 17:03 michaldo

@googleberg @shaod2 please tell me clearly if you expect any action from my side.

michaldo avatar Apr 02 '23 20:04 michaldo

We triage inactive PRs and issues in order to make it easier to find active work. If this PR should remain active, please add a comment.

This PR is labeled inactive because the last activity was over 90 days ago. This PR will be closed and archived after 14 additional days without activity.

github-actions[bot] avatar Nov 25 '23 10:11 github-actions[bot]

This PR is active.

midovlvn avatar Nov 27 '23 20:11 midovlvn

We triage inactive PRs and issues in order to make it easier to find active work. If this PR should remain active, please add a comment.

This PR is labeled inactive because the last activity was over 90 days ago. This PR will be closed and archived after 14 additional days without activity.

github-actions[bot] avatar Feb 29 '24 10:02 github-actions[bot]

This PR is active.

michaldo avatar Feb 29 '24 12:02 michaldo

We triage inactive PRs and issues in order to make it easier to find active work. If this PR should remain active, please add a comment.

This PR is labeled inactive because the last activity was over 90 days ago. This PR will be closed and archived after 14 additional days without activity.

github-actions[bot] avatar May 30 '24 10:05 github-actions[bot]

This PR is active.

michaldo avatar May 31 '24 07:05 michaldo

We triage inactive PRs and issues in order to make it easier to find active work. If this PR should remain active, please add a comment.

This PR is labeled inactive because the last activity was over 90 days ago. This PR will be closed and archived after 14 additional days without activity.

github-actions[bot] avatar Aug 30 '24 10:08 github-actions[bot]

This PR is active.

michaldo avatar Sep 02 '24 22:09 michaldo

@michaldo I've tried to rerun the tests a couple of times. I suspect that you need to rebase and we can try again.

googleberg avatar Sep 12 '24 19:09 googleberg

@michaldo I've tried to rerun the tests a couple of times. I suspect that you need to rebase and we can try again.

I just synchronized my branch with main

michaldo avatar Sep 12 '24 20:09 michaldo

Oh shoot. @midovlvn it looks like you still haven't signed the CLA. We can't go any further until that happens.

googleberg avatar Sep 12 '24 20:09 googleberg

@googleberg I see one merge commit is signed by my corporate git account by mistake. I prefer do not sign any licence with my corporate account. Maybe I will close this PR and I open new one, only with commits signed by my private git account with signed CLA?

michaldo avatar Sep 12 '24 20:09 michaldo

Finally I made force-push on my branch and I removed commits from my corporate account

midovlvn avatar Sep 12 '24 22:09 midovlvn

@michaldo I'm so sorry to realize this late. I can't merge this change because it changes the return type of public methods. That isn't ABI compatible -- it qualifies as a mildly breaking change and we will get complaints. I can put it on the list of breaking changes for PBJ 5.x in 2026 Q1.

googleberg avatar Sep 16 '24 21:09 googleberg

@michaldo I'm so sorry to realize this late. I can't merge this change because it changes the return type of public methods. That isn't ABI compatible -- it qualifies as a mildly breaking change and we will get complaints. I can put it on the list of breaking changes for PBJ 5.x in 2026 Q1.

Go ahead!

michaldo avatar Sep 16 '24 23:09 michaldo