Description
From the article:
System.Text.Json.JsonDocument
provides the ability to build a read-only Document Object Model (DOM)
Suggestion: explain what I am supposed to do if I want to have a non-read-only DOM.
Example use case: as input I have multiple objects, and json strings. I want to represent all the strings and objects as structured jsons (like JsonDocument
), to compose them into one bigger json, and convert it to json string.
For example, imagine I have multiple json configuration files which I want to compose into one bigger json configuration file, where the input configuration files will be nested as json property values into the output json config file. I do not want to introduce any types to represent the constituent config files. Instead, I want to keep the composition logic generic.
Related items:
- Suggestion: document how to deserialize json or object into a a dynamic json object (JsonDocument) #24251 Suggestion: document how to deserialize json or object into a a dynamic json object (JsonDocument)
- Writable Json DOM runtime#30436 Writable Json DOM
- Support "dynamic" and writable DOM runtime#29690 Support "dynamic" and writable DOM
- PR Add JsonNode feature runtime#51025 Add JsonNode feature
Related Stack Overflow question:
https://stackoverflow.com/questions/58694837/system-text-json-merge-two-objects
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 2df71565-f8a6-91d5-aede-8d25b8d87b06
- Version Independent ID: 32582d93-7530-1d68-12a9-d57f96412763
- Content: How to write custom serializers and deserializers with System.Text.Json
- Content Source: docs/standard/serialization/write-custom-serializer-deserializer.md
- Product: dotnet-fundamentals
- GitHub Login: @tdykstra
- Microsoft Alias: tdykstra