Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GetRawValue() to return raw JSON in JsonSerializedField. (#9)
<!-- Provide a general summary of your changes in the Title above --> <!-- Apply the label "bug" or "enhacement" as applicable. --> ## Description This pull request introduces an `GetRawValue()` method in the `JsonSerializedField` class to directly return the raw JSON string. This enhancement provides a more straightforward and efficient way to access the underlying JSON without the need for additional deserialization. ## Motivation The primary motivation for this change is to simplify the process of working with JSON data, particularly in scenarios where the JSON is deserialized, modified, and then re-serialized. In my case, I needed to deserialize JSON into a `SitecoreLayoutResponseContent` object, apply modifications, and then serialize it back to JSON. Previously, this required a custom `JsonConverter` that accessed the `_json` field via reflection. With this improvement, such workarounds are no longer necessary, making the code cleaner and more maintainable.
- Loading branch information