parent
9a244f5770
commit
7ccdeb20eb
3 changed files with 46 additions and 21 deletions
|
|
@ -9,7 +9,7 @@ namespace McpDotNet.Utils.Json;
|
|||
/// </summary>
|
||||
public class ContentJsonConverter : JsonConverter<IContent>
|
||||
{
|
||||
/// </inheritdoc>
|
||||
/// <inheritdoc/>
|
||||
public override IContent? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
if (reader.TokenType != JsonTokenType.StartObject)
|
||||
|
|
@ -34,7 +34,7 @@ public class ContentJsonConverter : JsonConverter<IContent>
|
|||
};
|
||||
}
|
||||
|
||||
/// </inheritdoc>
|
||||
/// <inheritdoc/>
|
||||
public override void Write(Utf8JsonWriter writer, IContent value, JsonSerializerOptions options)
|
||||
{
|
||||
switch (value)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace McpDotNet.Utils.Json;
|
|||
/// </summary>
|
||||
public class JsonRpcMessageConverter : JsonConverter<IJsonRpcMessage>
|
||||
{
|
||||
/// </inheritdoc>
|
||||
/// <inheritdoc/>
|
||||
public override IJsonRpcMessage? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
if (reader.TokenType != JsonTokenType.StartObject)
|
||||
|
|
@ -63,7 +63,7 @@ public class JsonRpcMessageConverter : JsonConverter<IJsonRpcMessage>
|
|||
throw new JsonException("Invalid JSON-RPC message format");
|
||||
}
|
||||
|
||||
/// </inheritdoc>
|
||||
/// <inheritdoc/>
|
||||
public override void Write(Utf8JsonWriter writer, IJsonRpcMessage value, JsonSerializerOptions options)
|
||||
{
|
||||
switch (value)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace McpDotNet.Utils.Json;
|
|||
/// </summary>
|
||||
public class ResourceContentsJsonConverter : JsonConverter<IResourceContents>
|
||||
{
|
||||
/// </inheritdoc>
|
||||
/// <inheritdoc/>
|
||||
public override IResourceContents? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
if (reader.TokenType != JsonTokenType.StartObject)
|
||||
|
|
@ -33,7 +33,7 @@ public class ResourceContentsJsonConverter : JsonConverter<IResourceContents>
|
|||
throw new JsonException("Resource contents must have either 'text' or 'blob' property");
|
||||
}
|
||||
|
||||
/// </inheritdoc>
|
||||
/// <inheritdoc/>
|
||||
public override void Write(Utf8JsonWriter writer, IResourceContents value, JsonSerializerOptions options)
|
||||
{
|
||||
switch (value)
|
||||
|
|
|
|||
Loading…
Reference in a new issue