Fix: Disallow $ref in tool input schemas
This commit is contained in:
parent
bae35facf6
commit
8dee60cfc2
2 changed files with 27 additions and 1 deletions
|
|
@ -61,6 +61,18 @@ module MCP
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
test "rejects schemas with $ref references" do
|
||||
assert_raises(ArgumentError) do
|
||||
InputSchema.new(properties: { foo: { "$ref" => "#/definitions/bar" } }, required: [:foo])
|
||||
end
|
||||
end
|
||||
|
||||
test "rejects schemas with symbol $ref references" do
|
||||
assert_raises(ArgumentError) do
|
||||
InputSchema.new(properties: { foo: { :$ref => "#/definitions/bar" } }, required: [:foo])
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -249,7 +249,7 @@ module MCP
|
|||
properties: {
|
||||
foo: { "$ref" => "#/definitions/bar" },
|
||||
},
|
||||
required: [],
|
||||
required: ["foo"],
|
||||
definitions: {
|
||||
bar: { type: "string" },
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue