[DynamicJson] Change delimiter used by changelist #35020
Merged
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.
Before this PR, we used a
.
character as a delimiter, however it is a valid character to use in a JSON property name, and as a result, if properties were present that had dots in the name, it could break serialization.By moving to an unescaped unicode control character as a delimiter, we're now keying changes on property names that are invalid JSON strings and therefore invalid JSON. The benefit is that the BCL JsonReader will validate the JSON for us when we call JsonDocument.Parse() to ensure that we can't be working with JSON strings where our delimiter could appear.
Many thanks to @bterlson for the Unicode/JSON consultation!
Contributes to #33856