File tree Expand file tree Collapse file tree 4 files changed +7
-5
lines changed
Expand file tree Collapse file tree 4 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ namespace ModelContextProtocol.Protocol.Types;
66/// A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.
77/// <see href="https://github.com/modelcontextprotocol/specification/blob/main/schema/">See the schema for details</see>
88/// </summary>
9- [ JsonConverter ( typeof ( JsonStringEnumConverterWithEnumMemberAttrSupport < ContextInclusion > ) ) ]
9+ [ JsonConverter ( typeof ( CustomizableJsonStringEnumConverter < ContextInclusion > ) ) ]
1010public enum ContextInclusion
1111{
1212 /// <summary>
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ namespace ModelContextProtocol.Protocol.Types;
77/// These map to syslog message severities, as specified in RFC-5424:
88/// https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1
99/// </summary>
10- [ JsonConverter ( typeof ( JsonStringEnumConverterWithEnumMemberAttrSupport < LoggingLevel > ) ) ]
10+ [ JsonConverter ( typeof ( CustomizableJsonStringEnumConverter < LoggingLevel > ) ) ]
1111public enum LoggingLevel
1212{
1313 /// <summary>Detailed debug information, typically only valuable to developers.</summary>
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ namespace ModelContextProtocol.Protocol.Types;
66/// Represents the type of role in the conversation.
77/// <see href="https://github.com/modelcontextprotocol/specification/blob/main/schema/">See the schema for details</see>
88/// </summary>
9- [ JsonConverter ( typeof ( JsonStringEnumConverterWithEnumMemberAttrSupport < Role > ) ) ]
9+ [ JsonConverter ( typeof ( CustomizableJsonStringEnumConverter < Role > ) ) ]
1010public enum Role
1111{
1212 /// <summary>
Original file line number Diff line number Diff line change 1111
1212namespace System . Text . Json . Serialization ;
1313
14- internal sealed class JsonStringEnumConverterWithEnumMemberAttrSupport < [ DynamicallyAccessedMembers ( DynamicallyAccessedMemberTypes . PublicFields ) ] TEnum > :
14+ internal sealed class CustomizableJsonStringEnumConverter < [ DynamicallyAccessedMembers ( DynamicallyAccessedMemberTypes . PublicFields ) ] TEnum > :
1515 JsonStringEnumConverter < TEnum > where TEnum : struct , Enum
1616{
17- public JsonStringEnumConverterWithEnumMemberAttrSupport ( ) :
17+ #if ! NET9_0_OR_GREATER
18+ public CustomizableJsonStringEnumConverter ( ) :
1819 base ( namingPolicy : ResolveNamingPolicy ( ) )
1920 {
2021 }
@@ -36,6 +37,7 @@ public override string ConvertName(string name) =>
3637 newName :
3738 name ;
3839 }
40+ #endif
3941}
4042
4143#if ! NET9_0_OR_GREATER
You can’t perform that action at this time.
0 commit comments