Repository navigation
fix(json): write booleans, guids, symbols and nested objects in additional data - #201
Open
Andrea Peruffo (andreaTP) wants to merge 2 commits into
Open
Andrea Peruffo (andreaTP) wants to merge 2 commits into
Andrea Peruffo (andreaTP) wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Keyed Parsables in additional data lose primitive root values and serialize as empty objects, requiring a serialization fix and a regression test for primitive-backed wrappers.
1 open issue
What changed in this PR
This PR improves Kiota’s Ruby JSON writer so additional data and untyped primitive collections preserve supported values instead of dropping them or writing null.
Changes:
- Adds explicit handling for booleans, GUIDs, symbols, hashes, and Parsable models.
- Uses recursive conversion for collections and nested hashes, and raises on unsupported types.
- Adds regression tests for additional data, collections, and root values.
| File | Description |
|---|---|
components/serialization/json/spec/json_any_value_spec.rb |
Tests supported value types, nested structures, root values, and unsupported-type errors. |
components/serialization/json/lib/microsoft_kiota_serialization_json/json_serialization_writer.rb |
Updates type dispatch and recursive serialization for additional data and collections. |
Review effort: Balanced
This branch has not been deployed
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.

Additional data and untyped primitive collections now keep true, false, GUIDs, symbols, models and nested objects instead of dropping them or writing null, and an unsupported value raises as in the form writer.