Skip to content

Commit 5a62c76

Browse files
committed
go.mod: upgrade to jsonschema v0.4.1
DO NOT SUBMIT Visible changes: - Inference on structs populates PropertyOrder - An empty map for Schema.Properties marshals as "{}"
1 parent 76e6854 commit 5a62c76

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.23.0
55
require (
66
github.com/golang-jwt/jwt/v5 v5.2.2
77
github.com/google/go-cmp v0.7.0
8-
github.com/google/jsonschema-go v0.3.0
8+
github.com/google/jsonschema-go v0.4.1
99
github.com/yosida95/uritemplate/v3 v3.0.2
1010
golang.org/x/oauth2 v0.30.0
1111
golang.org/x/tools v0.34.0

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
44
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
55
github.com/google/jsonschema-go v0.3.0 h1:6AH2TxVNtk3IlvkkhjrtbUc4S8AvO0Xii0DxIygDg+Q=
66
github.com/google/jsonschema-go v0.3.0/go.mod h1:r5quNTdLOYEz95Ru18zA0ydNbBuYoo9tgaYcxEYhJVE=
7+
github.com/google/jsonschema-go v0.4.1 h1:7Cq/xS+ykHvL5xMOjL0ONlOytAvAFcZTqDjXwrc4AtQ=
8+
github.com/google/jsonschema-go v0.4.1/go.mod h1:r5quNTdLOYEz95Ru18zA0ydNbBuYoo9tgaYcxEYhJVE=
79
github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4=
810
github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT040gmv5BQTMR2HP4=
911
golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI=

mcp/server_test.go

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -812,10 +812,30 @@ func TestToolForSchemas(t *testing.T) {
812812

813813
var (
814814
falseSchema = &schema{Not: &schema{}}
815-
inSchema = &schema{Type: "object", AdditionalProperties: falseSchema, Properties: map[string]*schema{"p": {Type: "integer"}}}
816-
inSchema2 = &schema{Type: "object", AdditionalProperties: falseSchema, Properties: map[string]*schema{"p": {Type: "string"}}}
817-
outSchema = &schema{Type: "object", AdditionalProperties: falseSchema, Properties: map[string]*schema{"b": {Type: "boolean"}}}
818-
outSchema2 = &schema{Type: "object", AdditionalProperties: falseSchema, Properties: map[string]*schema{"b": {Type: "integer"}}}
815+
inSchema = &schema{
816+
Type: "object",
817+
AdditionalProperties: falseSchema,
818+
Properties: map[string]*schema{"p": {Type: "integer"}},
819+
PropertyOrder: []string{"p"},
820+
}
821+
inSchema2 = &schema{
822+
Type: "object",
823+
AdditionalProperties: falseSchema,
824+
Properties: map[string]*schema{"p": {Type: "string"}},
825+
PropertyOrder: []string{"p"},
826+
}
827+
outSchema = &schema{
828+
Type: "object",
829+
AdditionalProperties: falseSchema,
830+
Properties: map[string]*schema{"b": {Type: "boolean"}},
831+
PropertyOrder: []string{"b"},
832+
}
833+
outSchema2 = &schema{
834+
Type: "object",
835+
AdditionalProperties: falseSchema,
836+
Properties: map[string]*schema{"b": {Type: "integer"}},
837+
PropertyOrder: []string{"b"},
838+
}
819839
)
820840

821841
// Infer both schemas.
@@ -850,6 +870,7 @@ func TestToolForSchemas(t *testing.T) {
850870
"AsOf": {Type: "string"},
851871
"Source": {Type: "string"},
852872
},
873+
PropertyOrder: []string{"Summary", "AsOf", "Source"},
853874
},
854875
"")
855876
}

0 commit comments

Comments
 (0)