Add samples for System.Text.Json writable DOM
dodyg opened this issue · 13 comments
dodyg commented
lohithgn commented
Whats your idea on this ? I mean - if we were to showcase this i.e. System.Text.Json writable dom - in ASP.NET Core - what sample idea works ?
dodyg commented
One of the primary usage for this writable DOM is the ability to modify an existing JSON document without deserializing them into objects and then serializing it again.
For example https://gist.github.com/keeguon/2310008. How would you add "wakanda" into this list of countries?
dodyg commented
We can make the following samples
- Find a simple node and update its value
- Find a nested object node and update one of its value
- Find a nested object node and replace it
- Append an item at the end an array.
- Insert an item an n position in an array
- Replace an item in an array.
- Find an object within an array and replace one of its value
- Replace a property of number and change it to a string value
There are probably more granular examples we can create.
dodyg commented
This is a slightly more complex node LINQ search on a string property and an array