Add JsonPath support to JsonDocument/JsonElement
Hi, I'd like to request JsonPath support for querying the JsonDocument/JsonElement classes. JsonPath provides similar capability to XPath (and even Sql) in that it allows queries to be performed against Json documents. This currently represents a major gap for us shifting from Newtonsoft to system.text.json, as we provide JsonPath values as an input parameter to a data load process which can't be worked around via code. The JsonPath syntax is described [here](https://goessner.net/articles/JsonPath/). The equivalent functionality in the Newtonsoft library is: ```csharp var jsonPath = "$.my.path"; var json = JToken.Parse(jsonString); var token = json.SelectToken(jsonPath); ``` The following proposed syntax would work well in the JsonDocument structure: ```csharp var jsonPath = "$.my.path"; var jsonDoc = JsonDocument.Parse(json); var element = jsonDoc.SelectElement(jsonPath); //returns JsonElement var elements = jsonDoc.SelectElements(jsonPath); //returns JsonElement.ArrayEnumerator ``` Thanks.
Posted by gary-holland on Oct 4, 2019, 6:09 AM
Tags
Related issues
- some bike vendor told me that the biggest problem with regular to ebike conversion was that regular bike frames were not strong enough to...
- I think of this as the kiosk economy.
- What a goofy comment.
- There's lots of evidence for positive influences of Caffeine on the body (some negative as well), especially the brain.
- Compose support in WSLc
- [RFC] Roadmap to v2.0
Raise real-world problems, find people facing the same issue, and discuss solutions.3,500 issues0 comments
support (Other)
some bike vendor told me that the biggest problem with regular to ebike conversion was that regular bike frames were not strong enough to...
I think of this as the kiosk economy.
What a goofy comment.
There's lots of evidence for positive influences of Caffeine on the body (some negative as well), especially the brain.
Compose support in WSLc
[RFC] Roadmap to v2.0
[Feature]: Add TurboQuant Support for KV Cache Quantization
Support for AGENTS.md and .agents/skills/, the community has been asking since August 2025
Add JsonPath support to JsonDocument/JsonElement
Hi, I'd like to request JsonPath support for querying the JsonDocument/JsonElement classes. JsonPath provides similar capability to XPath (and even Sql) in that it allows queries to be performed against Json documents. This currently represents a major gap for us shifting from Newtonsoft to system.text.json, as we provide JsonPath values as an input parameter to a data load process which can't be worked around via code. The JsonPath syntax is described [here](https://goessner.net/articles/JsonPath/). The equivalent functionality in the Newtonsoft library is: ```csharp var jsonPath = "$.my.path"; var json = JToken.Parse(jsonString); var token = json.SelectToken(jsonPath); ``` The following proposed syntax would work well in the JsonDocument structure: ```csharp var jsonPath = "$.my.path"; var jsonDoc = JsonDocument.Parse(json); var element = jsonDoc.SelectElement(jsonPath); //returns JsonElement var elements = jsonDoc.SelectElements(jsonPath); //returns JsonElement.ArrayEnumerator ``` Thanks.
Comments (0)
No comments yet. Start the discussion.