Skip to content

Commit 9e21d3e

Browse files
Remove TODOs related to AllowOutOfOrderMetadataProperty workarounds. (#977)
1 parent 1bef31f commit 9e21d3e

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/ModelContextProtocol.Core/Protocol/ContentBlock.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace ModelContextProtocol.Protocol;
2525
/// See the <see href="https://github.com/modelcontextprotocol/specification/blob/main/schema/">schema</see> for more details.
2626
/// </para>
2727
/// </remarks>
28-
[JsonConverter(typeof(Converter))] // TODO: This converter exists due to the lack of downlevel support for AllowOutOfOrderMetadataProperties.
28+
[JsonConverter(typeof(Converter))]
2929
public abstract class ContentBlock
3030
{
3131
/// <summary>Prevent external derivations.</summary>
@@ -55,6 +55,8 @@ private protected ContentBlock()
5555
/// <summary>
5656
/// Provides a <see cref="JsonConverter"/> for <see cref="ContentBlock"/>.
5757
/// </summary>
58+
/// Provides a polymorphic converter for the <see cref="ContentBlock"/> class that doesn't require
59+
/// setting <see cref="JsonSerializerOptions.AllowOutOfOrderMetadataProperties"/> explicitly.
5860
[EditorBrowsable(EditorBrowsableState.Never)]
5961
public class Converter : JsonConverter<ContentBlock>
6062
{

src/ModelContextProtocol.Core/Protocol/ElicitRequestParams.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public IDictionary<string, PrimitiveSchemaDefinition> Properties
6161
/// Represents restricted subset of JSON Schema:
6262
/// <see cref="StringSchema"/>, <see cref="NumberSchema"/>, <see cref="BooleanSchema"/>, or <see cref="EnumSchema"/>.
6363
/// </summary>
64-
[JsonConverter(typeof(Converter))] // TODO: This converter exists due to the lack of downlevel support for AllowOutOfOrderMetadataProperties.
64+
[JsonConverter(typeof(Converter))]
6565
public abstract class PrimitiveSchemaDefinition
6666
{
6767
/// <summary>Prevent external derivations.</summary>
@@ -84,6 +84,8 @@ protected private PrimitiveSchemaDefinition()
8484
/// <summary>
8585
/// Provides a <see cref="JsonConverter"/> for <see cref="ResourceContents"/>.
8686
/// </summary>
87+
/// Provides a polymorphic converter for the <see cref="PrimitiveSchemaDefinition"/> class that doesn't require
88+
/// setting <see cref="JsonSerializerOptions.AllowOutOfOrderMetadataProperties"/> explicitly.
8789
[EditorBrowsable(EditorBrowsableState.Never)]
8890
public class Converter : JsonConverter<PrimitiveSchemaDefinition>
8991
{

src/ModelContextProtocol.Core/Protocol/Reference.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ private protected Reference()
3939
/// <summary>
4040
/// Provides a <see cref="JsonConverter"/> for <see cref="Reference"/>.
4141
/// </summary>
42+
/// <remarks>
43+
/// Provides a polymorphic converter for the <see cref="Reference"/> class that doesn't require
44+
/// setting <see cref="JsonSerializerOptions.AllowOutOfOrderMetadataProperties"/> explicitly.
45+
/// </remarks>
4246
[EditorBrowsable(EditorBrowsableState.Never)]
4347
public sealed class Converter : JsonConverter<Reference>
4448
{
@@ -95,8 +99,6 @@ public sealed class Converter : JsonConverter<Reference>
9599
}
96100
}
97101

98-
// TODO: This converter exists due to the lack of downlevel support for AllowOutOfOrderMetadataProperties.
99-
100102
switch (type)
101103
{
102104
case "ref/prompt":

0 commit comments

Comments
 (0)