Enhanced ObjectConverter to Return JsonObject Instead of JsonElement #4686
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.
This pull request enhances the
ObjectConverter
, resolving a critical issue that users encountered when interacting with JSON objects in specific scenarios.Key changes include:
targetType
is not anobject
.JsonObject
toobject
, we now return theJsonObject
itself rather than aJsonElement
. This change is significant because previously this conversion would produce aJsonElement
value, breaking users' code where they employ JavaScript expressions and use index notation, such asmyValue["Foo"]
. Index notation works withJsonObject
but not withJsonElement
. Now users can use this notation without encountering issues.These enhancements enhance the versatility and robustness of JSON object deserialization, increasing the user-friendliness of our framework, particularly for those using JavaScript expressions. We expect this to significantly aid users in their daily development work and make our codebase more maintainable and straightforward.
=== auto-pr-body ===
Summary:
This pull request updates various portions of the codebase to remove duplicate information, improve readability, and add additional functionality. Changes introduced include the addition of the
TestWorkflow
class and associated objects, modification to theSerializationTest
class, and modification to theWriteLine
activity. Additionally, suggested refactorings are included to address clarity, naming, and code standard compliance.List of Changes:
TestWorkflow
and associated objectsSerializationTests
class and theWriteLine
activitySuggested Refactorings:
Test_Serialization_read
methodFile.ReadAllText($@"...")
withFile.ReadAllText(@$"...")
inTest_Serialization_create_Island
GetContent
,GetExpected
methods to avoid implementation details leaking through the class interface