Skip to content

Commit 1b0c65d

Browse files
Add missing enum serialization configuration.
1 parent b9964e2 commit 1b0c65d

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
1-
namespace ModelContextProtocol.Protocol.Types;
1+
using System.Text.Json.Serialization;
2+
3+
namespace ModelContextProtocol.Protocol.Types;
24

35
/// <summary>
46
/// A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.
57
/// <see href="https://github.com/modelcontextprotocol/specification/blob/main/schema/2024-11-05/schema.json">See the schema for details</see>
68
/// </summary>
9+
[JsonConverter(typeof(JsonStringEnumConverter<ContextInclusion>))]
710
public enum ContextInclusion
811
{
912
/// <summary>
1013
/// No context should be included.
1114
/// </summary>
15+
[JsonStringEnumMemberName("none")]
1216
None,
1317

1418
/// <summary>
1519
/// Include context from the server that sent the request.
1620
/// </summary>
21+
[JsonStringEnumMemberName("thisServer")]
1722
ThisServer,
1823

1924
/// <summary>
2025
/// Include context from all servers that the client is connected to.
2126
/// </summary>
27+
[JsonStringEnumMemberName("allServers")]
2228
AllServers
2329
}

src/ModelContextProtocol/Protocol/Types/LoggingLevel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +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(JsonStringEnumConverter<LoggingLevel>))]
1011
public enum LoggingLevel
1112
{
1213
/// <summary>Detailed debug information, typically only valuable to developers.</summary>

src/ModelContextProtocol/Protocol/Types/Role.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +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/2024-11-05/schema.json">See the schema for details</see>
88
/// </summary>
9+
[JsonConverter(typeof(JsonStringEnumConverter<Role>))]
910
public enum Role
1011
{
1112
/// <summary>

0 commit comments

Comments
 (0)