Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 3 additions & 1 deletion src/ModelContextProtocol.Core/Protocol/ContentBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace ModelContextProtocol.Protocol;
/// See the <see href="https://github.com/modelcontextprotocol/specification/blob/main/schema/">schema</see> for more details.
/// </para>
/// </remarks>
[JsonConverter(typeof(Converter))] // TODO: This converter exists due to the lack of downlevel support for AllowOutOfOrderMetadataProperties.
[JsonConverter(typeof(Converter))]
public abstract class ContentBlock
{
/// <summary>Prevent external derivations.</summary>
Expand Down Expand Up @@ -55,6 +55,8 @@ private protected ContentBlock()
/// <summary>
/// Provides a <see cref="JsonConverter"/> for <see cref="ContentBlock"/>.
/// </summary>
/// Provides a polymorphic converter for the <see cref="ContentBlock"/> class that doesn't require
/// setting <see cref="JsonSerializerOptions.AllowOutOfOrderMetadataProperties"/> explicitly.
[EditorBrowsable(EditorBrowsableState.Never)]
public class Converter : JsonConverter<ContentBlock>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public IDictionary<string, PrimitiveSchemaDefinition> Properties
/// Represents restricted subset of JSON Schema:
/// <see cref="StringSchema"/>, <see cref="NumberSchema"/>, <see cref="BooleanSchema"/>, or <see cref="EnumSchema"/>.
/// </summary>
[JsonConverter(typeof(Converter))] // TODO: This converter exists due to the lack of downlevel support for AllowOutOfOrderMetadataProperties.
[JsonConverter(typeof(Converter))]
public abstract class PrimitiveSchemaDefinition
{
/// <summary>Prevent external derivations.</summary>
Expand All @@ -84,6 +84,8 @@ protected private PrimitiveSchemaDefinition()
/// <summary>
/// Provides a <see cref="JsonConverter"/> for <see cref="ResourceContents"/>.
/// </summary>
/// Provides a polymorphic converter for the <see cref="PrimitiveSchemaDefinition"/> class that doesn't require
/// setting <see cref="JsonSerializerOptions.AllowOutOfOrderMetadataProperties"/> explicitly.
[EditorBrowsable(EditorBrowsableState.Never)]
public class Converter : JsonConverter<PrimitiveSchemaDefinition>
{
Expand Down
6 changes: 4 additions & 2 deletions src/ModelContextProtocol.Core/Protocol/Reference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ private protected Reference()
/// <summary>
/// Provides a <see cref="JsonConverter"/> for <see cref="Reference"/>.
/// </summary>
/// <remarks>
/// Provides a polymorphic converter for the <see cref="Reference"/> class that doesn't require
/// setting <see cref="JsonSerializerOptions.AllowOutOfOrderMetadataProperties"/> explicitly.
/// </remarks>
[EditorBrowsable(EditorBrowsableState.Never)]
public sealed class Converter : JsonConverter<Reference>
{
Expand Down Expand Up @@ -95,8 +99,6 @@ public sealed class Converter : JsonConverter<Reference>
}
}

// TODO: This converter exists due to the lack of downlevel support for AllowOutOfOrderMetadataProperties.

switch (type)
{
case "ref/prompt":
Expand Down
Loading