-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Closed
Copy link
Labels
area-System.Text.Jsonneeds-author-actionAn issue or pull request that requires more info or actions from the author.An issue or pull request that requires more info or actions from the author.
Description
Description
I was trying to parse json with null fields via jsonpath, but got empty array. I checked source code of library methods and didn't find there any option where I can set null handling.
Reproduction Steps
- Use this json:
const string featuresJson =
@"{
""files"": [
{
""id"": ""90d1aeae-481b-4c82-821b-a034f9aa77cd"",
""document_type"": null
}
]
}";- Try to use json.SelectElements("$.files[*].document_type").Select(e => e.HasValue ? (object) e.Value : null);
- It will return empty array.
Expected behavior
We have option to include nulls in filter.
Actual behavior
We can't set excepted behaviour.
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-System.Text.Jsonneeds-author-actionAn issue or pull request that requires more info or actions from the author.An issue or pull request that requires more info or actions from the author.