Improving how the @context property is serialized #176
Labels
enhancement
Issues describing an enhancement or pull requests adding an enhancement.
help wanted
Help wanted from the community.
Describe the feature
Currently the
@context
property is always serialized. Using ourSchemaSerializer
class, we keep the outer@context
property but we replace all inner@context
properties by aStringBuilder.Replace
call which means we allocate the whole JSON output as a string twice.Ideally, we need a way to conditionally serialize the
@context
property only if it is the root object of serialization.How to actually implement this (especially in a future
System.Text.Json
world) remains unknown however it should still be considered. Potentially if we can provide a custom converter for the root-level object that can output that property and for any nested properties, simply not pass that converter down - this may give us our desired effect.The text was updated successfully, but these errors were encountered: