Allow JsonSerializerOptions parameters for user-defined and inputs and hardcode everything else to the source generator. (#182)
* Allow user-defined JsonSerializerOptions for user-defined and inputs and hardcode everything else to the source generator. * Add validation for user-defined JsonSerializerOptions. * Remove out of date comment. * Address feedback and add tests
This commit is contained in:
parent
4b38d3e71b
commit
f1af251c32
1 changed files with 632 additions and 372 deletions
|
|
@ -8,6 +8,7 @@ using ModelContextProtocol.Utils.Json;
|
|||
using System.IO.Pipelines;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Nodes;
|
||||
|
||||
namespace ModelContextProtocol.Tests.Transport;
|
||||
|
||||
|
|
@ -153,10 +154,10 @@ public class StdioServerTransportTests : LoggedTest
|
|||
{
|
||||
Method = "test",
|
||||
Id = new RequestId(44),
|
||||
Params = new Dictionary<string, JsonElement>
|
||||
Params = new JsonObject
|
||||
{
|
||||
["text"] = JsonSerializer.SerializeToElement(chineseText)
|
||||
}
|
||||
["text"] = chineseText
|
||||
},
|
||||
};
|
||||
|
||||
// Clear output and send message
|
||||
|
|
@ -175,10 +176,10 @@ public class StdioServerTransportTests : LoggedTest
|
|||
{
|
||||
Method = "test",
|
||||
Id = new RequestId(45),
|
||||
Params = new Dictionary<string, JsonElement>
|
||||
Params = new JsonObject
|
||||
{
|
||||
["text"] = JsonSerializer.SerializeToElement(emojiText)
|
||||
}
|
||||
["text"] = emojiText
|
||||
},
|
||||
};
|
||||
|
||||
// Clear output and send message
|
||||
|
|
|
|||
Loading…
Reference in a new issue