Skip to content

fix: Move @JsonCreator inside LiveRequest Builder#1281

Open
hemasekhar-p wants to merge 1 commit into
google:mainfrom
hemasekhar-p:liverequest-json-issue-fix
Open

fix: Move @JsonCreator inside LiveRequest Builder#1281
hemasekhar-p wants to merge 1 commit into
google:mainfrom
hemasekhar-p:liverequest-json-issue-fix

Conversation

@hemasekhar-p

Copy link
Copy Markdown
Contributor

Link to Issue or Description of Change

1. Link to an existing issue (if applicable):

Problem:
LiveRequest.fromJsonString() throws a Jackson InvalidDefinitionException for all valid JSON inputs, completely preventing deserialization. This occurs because the @JsonCreator method was declared in the outer LiveRequest.Builder class. Jackson requires the creator method to be located strictly inside the builder class to properly instantiate the AutoValue builder.

Solution:
Moved the @JsonCreator method inside the LiveRequest.Builder class to instantiate properly.

Testing Plan

Please describe the tests that you ran to verify your changes. This is required
for all PRs that are not small documentation or typo fixes.

Unit Tests:

  • All unit tests pass locally.

Please include a summary of passed java test results.

Manual End-to-End (E2E) Tests:

  1. Instantiated a LiveRequest using LiveRequest.builder().content(content).close(false).build();
  2. Serialized it via toJson().
  3. Passed the resulting JSON string directly back into LiveRequest.fromJsonString().
    Before the fix, this sequence immediately threw InvalidDefinitionException. After the fix, the object is correctly reconstructed and evaluated perfectly.

Checklist

  • I have read the CONTRIBUTING.md document.
  • My pull request contains a single commit.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end.
  • Any dependent changes have been merged and published in downstream modules.

@hemasekhar-p hemasekhar-p force-pushed the liverequest-json-issue-fix branch from 8d2ed4c to 5233d54 Compare June 17, 2026 07:11
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.

[BUG] LiveRequest.fromJsonString cannot deserialize any LiveRequest (@JsonCreator declared outside Builder)

1 participant