Skip to content

Commit d0ee6a0

Browse files
Bump the other-testing group with 1 update (#1101)
Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Eirik Tsarpalis <[email protected]>
1 parent a78008c commit d0ee6a0

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,6 @@
9090
<PackageVersion Include="xunit.v3" Version="3.2.1" />
9191
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
9292
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
93-
<PackageVersion Include="JsonSchema.Net" Version="7.4.0" />
93+
<PackageVersion Include="JsonSchema.Net" Version="8.0.3" />
9494
</ItemGroup>
9595
</Project>

tests/ModelContextProtocol.Tests/Server/McpServerToolTests.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -658,11 +658,11 @@ private static void AssertMatchesJsonSchema(JsonElement schemaDoc, JsonNode? val
658658
{
659659
JsonSchema schema = JsonSerializer.Deserialize(schemaDoc, JsonContext2.Default.JsonSchema)!;
660660
EvaluationOptions options = new() { OutputFormat = OutputFormat.List };
661-
EvaluationResults results = schema.Evaluate(value, options);
661+
EvaluationResults results = schema.Evaluate(JsonSerializer.SerializeToElement(value, JsonContext2.Default.JsonNode), options);
662662
if (!results.IsValid)
663663
{
664-
IEnumerable<string> errors = results.Details
665-
.Where(d => d.HasErrors)
664+
IEnumerable<string> errors = (results.Details ?? [])
665+
.Where(d => d.Errors?.Count > 0)
666666
.SelectMany(d => d.Errors!.Select(error => $"Path:${d.InstanceLocation} {error.Key}:{error.Value}"));
667667

668668
throw new XunitException($"""
@@ -826,6 +826,7 @@ public void ReturnDescription_StructuredOutputEnabled_WithExplicitDescription_No
826826
private static string ToolWithoutReturnDescription() => "result";
827827

828828
[JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase)]
829+
[JsonSerializable(typeof(JsonNode))]
829830
[JsonSerializable(typeof(DisposableToolType))]
830831
[JsonSerializable(typeof(AsyncDisposableToolType))]
831832
[JsonSerializable(typeof(AsyncDisposableAndDisposableToolType))]

0 commit comments

Comments
 (0)