Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add API entry for JsonDocument converter
  • Loading branch information
strobelt authored and eiriktsarpalis committed Apr 20, 2022
commit 56b3720f03fc5eb62f871b1da8bd39043e1ae46e
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ private static Dictionary<Type, JsonConverter> GetDefaultSimpleConverters()
Add(JsonMetadataServices.Int32Converter);
Add(JsonMetadataServices.Int64Converter);
Add(new JsonElementConverter());
Add(new JsonDocumentConverter());
Add(JsonMetadataServices.DocumentConverter);
Add(JsonMetadataServices.ObjectConverter);
Add(JsonMetadataServices.SByteConverter);
Add(JsonMetadataServices.SingleConverter);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Collections.Generic;
using System.Text.Json.Nodes;
using System.Text.Json.Serialization.Converters;

Expand Down Expand Up @@ -202,6 +201,13 @@ public static partial class JsonMetadataServices
public static JsonConverter<Version> VersionConverter => s_versionConverter ??= new VersionConverter();
private static JsonConverter<Version>? s_versionConverter;

/// <summary>
/// Returns a <see cref="JsonConverter{T}"/> instance that converts <see cref="JsonDocument"/> values.
/// </summary>
/// <remarks>This API is for use by the output of the System.Text.Json source generator and should not be called directly.</remarks>
public static JsonConverter<JsonDocument> DocumentConverter => s_documentConverter ??= new JsonDocumentConverter();
private static JsonConverter<JsonDocument>? s_documentConverter;

/// <summary>
/// Creates a <see cref="JsonConverter{T}"/> instance that throws <see cref="NotSupportedException"/>.
/// </summary>
Expand Down