-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Set(object) API from MutableJsonElement #38266
Merged
Merged
Conversation
This file contains 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
API change check API changes are not detected in this pull request. |
annelo-msft
commented
Aug 17, 2023
annelo-msft
changed the title
Remove Set(object) API from MutableJsonDocument
Remove Set(object) API from MutableJsonElement
Aug 17, 2023
annelo-msft
requested review from
JoshLove-msft,
christothes and
KrzysztofCwalina
as code owners
August 17, 2023 21:23
annelo-msft
requested review from
jsquire,
heaths,
AlexanderSher,
m-nash and
nisha-bhatia
August 17, 2023 21:24
eerhardt
reviewed
Aug 18, 2023
heaths
approved these changes
Aug 21, 2023
christothes
reviewed
Aug 22, 2023
christothes
reviewed
Aug 22, 2023
christothes
approved these changes
Aug 22, 2023
5 tasks
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
With the move of MutableJsonDocument and related types into internal shared source, we want to limit what can be done with its APIs to prevent users from making mistakes with it. This PR removes the
Set(object)
method from MutableJsonElement, so people can only assign a specific set of known types to these elements. The group of supported types is essentially the same group that is supported by the JsonElement.Get APIs, with the addition of JsonElement to allow for the assignment of arbitrary JSON values.This PR should have the side benefit of improving performance in a few ways, including removing the allocation of a JsonSerializerOptions on each creation of MutableJsonDocument, and fixing #38215.
What's in this PR
Fixes #38215