C
C#2y ago
Doombox

❔ ✅ System.Text.Json paths

Does STJ support paths in some way? In NSJ I would use a ContractResolver and a custom attribute to handle this Essentially I want to access this (pointlessly) nested property
Time: {
"time": "1:27.452"
},
Time: {
"time": "1:27.452"
},
in NSJ I could define this attribute[JsonPathProperty("Time.time")] and use a ContractResolver to drag the value back up, preventing needless object bloat.
6 Replies
cumslvt13
cumslvt132y ago
+1for the problem. I didn't find any solution on docs for that. So I had to create intermediate objects
cumslvt13
cumslvt132y ago
GitHub
Add JsonPath support to JsonDocument/JsonElement · Issue #31068 · d...
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 perf...
Doombox
DoomboxOP2y ago
Yeah I found a couple issues that reference this problem in some way, it basically makes STJ unusable for me having to deal with badly formatted JSON that is nested beyond belief bloats my codebase massively having to create all the intermediates as long as I'm not alone and there are no reasonable workarounds guess I'll stick with Newtonsoft for now, cheers !solved what was the command again pepetense
Accord
Accord2y ago
Closed!
Doombox
DoomboxOP2y ago
oh it's /close bigthonk
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server