Skip to content
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

Fix JsonArray issues with empty array and GetPath() #52339

Merged
merged 1 commit into from May 7, 2021

Conversation

steveharter
Copy link
Member

Fix issues with the new JsonArray type:

  • On deserialize of an empty JsonArray with "[]" and without touching the array in any way (e.g. calling Count or enumerating) a Debug.Assert failure or NullReferenceException could occur
  • The GetPath from an item in a JsonArray may be "$" in cases after a Parse() instead of the proper value such as "$[0]".

@ghost
Copy link

ghost commented May 5, 2021

Tagging subscribers to this area: @eiriktsarpalis, @layomia
See info in area-owners.md if you want to be subscribed.

Issue Details

Fix issues with the new JsonArray type:

  • On deserialize of an empty JsonArray with "[]" and without touching the array in any way (e.g. calling Count or enumerating) a Debug.Assert failure or NullReferenceException could occur
  • The GetPath from an item in a JsonArray may be "$" in cases after a Parse() instead of the proper value such as "$[0]".
Author: steveharter
Assignees: steveharter
Labels:

area-System.Text.Json

Milestone: -

@steveharter steveharter merged commit 98ac232 into dotnet:main May 7, 2021
@steveharter steveharter deleted the JsonArrayPath branch May 7, 2021 17:16
@karelz karelz added this to the 6.0.0 milestone May 20, 2021
@dotnet dotnet locked as resolved and limited conversation to collaborators Jun 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants