Skip to content

Conversation

mschielmann
Copy link
Contributor

Regarding #551 - bugfix - use preconfigured printer rather than default JsonFormat.printer();

What was changed

Bugfix - In JavaSDK, ProtobufJsonPayloadConverter allows you to configure both printer and parser. Yet, the preconfigured printer has not been used to convert Object to data. Default JsonFormat printer has been used instead.

Why?

Bugfix to allow configurable printer to be used (as designed, it can be passed as constructor param).

Checklist

  1. Closes ProtobufJsonPayloadConverter not using custom printer #551

  2. How was this tested:
    Passed custom JsonFormat.Printer to constructor and see it being used.

bugfix - use preconfigured printer rather than default JsonFormat.printer();
@CLAassistant
Copy link

CLAassistant commented Jun 23, 2021

CLA assistant check
All committers have signed the CLA.

@vkoby vkoby requested a review from Spikhalskiy as a code owner July 2, 2021 17:49
Copy link
Contributor

@Spikhalskiy Spikhalskiy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution!
While this change totally makes sense and looks compatible, it will change the way we serialize photo field names. We use JsonFormat.printer() now and we will use JsonFormat.printer().preservingProtoFieldNames() if this PR applied as it is. Could you please edit the constructor to preserve the current behavior?

Make JsonFormat.printer() a default printer to preserve the current behaviour while using the default constructor.
@mschielmann
Copy link
Contributor Author

hi @Spikhalskiy thank you for your review - good catch, I've made a change you've requested (I hope that's what you've meant).

@mschielmann mschielmann requested a review from Spikhalskiy July 2, 2021 18:58
@Spikhalskiy Spikhalskiy merged commit 02d37a5 into temporalio:master Jul 2, 2021
@vkoby vkoby mentioned this pull request Aug 5, 2021
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.

ProtobufJsonPayloadConverter not using custom printer

4 participants