Repository navigation
Fix metadata parsing for JSON object strings - #122
Merged
Merged
Conversation
Decode JSON object strings in the shared response reader so metadata is not replaced by an empty map. Preserve normal object and invalid-value behavior. Add regression coverage for Allocate, Item, and ItemPrice metadata.
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
cb-alish
approved these changes
Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Preserve metadata when an API response contains a string that holds a JSON object. In v4.17.0,
JsonUtil.getJsonObject()rejects this form, and generated model parsers return an empty metadata map.Decode string values once in the shared object reader. Keep support for normal JSON objects and preserve existing behavior for missing, null, malformed, and non-object values. This covers GrantBlock, Item, and ItemPrice without changes to generated models or public signatures.
Related Issues
No linked GitHub issue.
Additional Information
Updated
JsonUtil.getJsonObjectto parse string-encoded JSON objects while preserving existing handling of invalid and non-object values. Added unit and metadata parser tests forGrantBlock,Item, andItemPrice, including synchronous and asynchronous Allocate requests.