Skip to content

Custom JsonConverter for Dictionary<string. object> #97481

Answered by WenningQiu
WenningQiu asked this question in General
Discussion options

You must be logged in to vote

Hmm, this code seems to work:

        public override void Write(Utf8JsonWriter writer, IAmbientData ambientData, JsonSerializerOptions options)
        {
            JsonSerializer.Serialize(writer, ambientData, typeof(IDictionary<string, object>), options);
        }

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by eiriktsarpalis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Text.Json untriaged New issue has not been triaged by the area owner
1 participant
Converted from issue

This discussion was converted from issue #97478 on January 24, 2024 22:33.