Skip to content

Commit 7646779

Browse files
committed
refactor(protocol): separate wire validation schema in FunctionDefinition
Define a separate $defs/FunctionCallValidationSchema to explicitly validate client/server function calls on the wire, and compose it in $defs/FunctionDefinition alongside returnType/callableFrom metadata using allOf. This allows reusing validation constraints without leaking metadata parameters onto the wire protocol.
1 parent c0f03df commit 7646779

1 file changed

Lines changed: 46 additions & 2 deletions

File tree

specification/v0_10/json/client_capabilities.json

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,55 @@
2525
},
2626
"required": ["v0.10"],
2727
"$defs": {
28+
"FunctionCallValidationSchema": {
29+
"type": "object",
30+
"description": "JSON Schema structure that validates a wire-level FunctionCall object.",
31+
"properties": {
32+
"type": {
33+
"const": "object"
34+
},
35+
"description": {
36+
"type": "string"
37+
},
38+
"properties": {
39+
"type": "object",
40+
"properties": {
41+
"call": {
42+
"type": "object",
43+
"properties": {
44+
"const": { "type": "string" }
45+
},
46+
"required": ["const"]
47+
},
48+
"args": {
49+
"type": "object",
50+
"description": "A JSON Schema describing the expected arguments (args) for this function.",
51+
"$ref": "https://json-schema.org/draft/2020-12/schema"
52+
}
53+
},
54+
"required": ["call"],
55+
"additionalProperties": false
56+
},
57+
"required": {
58+
"type": "array",
59+
"items": { "type": "string" },
60+
"contains": { "const": "call" }
61+
},
62+
"unevaluatedProperties": {
63+
"type": "boolean"
64+
},
65+
"additionalProperties": {
66+
"type": "boolean"
67+
}
68+
},
69+
"required": ["type", "properties", "required"]
70+
},
2871
"FunctionDefinition": {
2972
"type": "object",
3073
"description": "Describes a function's validation schema and interface metadata.",
3174
"allOf": [
3275
{
33-
"$ref": "https://json-schema.org/draft/2020-12/schema"
76+
"$ref": "#/$defs/FunctionCallValidationSchema"
3477
},
3578
{
3679
"type": "object",
@@ -49,7 +92,8 @@
4992
},
5093
"required": ["returnType"]
5194
}
52-
]
95+
],
96+
"unevaluatedProperties": false
5397
},
5498
"Catalog": {
5599
"type": "object",

0 commit comments

Comments
 (0)