Skip to content

Commit 09ae969

Browse files
tadasanttoby
authored andcommitted
Simplify schema
1 parent 01b818f commit 09ae969

File tree

1 file changed

+80
-149
lines changed

1 file changed

+80
-149
lines changed

docs/server-json/schema.json

Lines changed: 80 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -115,102 +115,7 @@
115115
"type": "array",
116116
"description": "Arguments for the runtime command (docker, npx, etc.)",
117117
"items": {
118-
"oneOf": [
119-
{
120-
"type": "object",
121-
"required": [
122-
"type",
123-
"value_hint"
124-
],
125-
"properties": {
126-
"type": {
127-
"const": "positional"
128-
},
129-
"value_hint": {
130-
"type": "string",
131-
"description": "An identifier-like hint for the value. This is not part of the command line, but can be used by client configuration and to provide hints to users."
132-
},
133-
"description": {
134-
"type": "string"
135-
},
136-
"value": {
137-
"type": "string",
138-
"description": "The default value for the input. If this is not set, the user may be prompted to provide a value.\n\nIdentifiers wrapped in `{curly_braces}` will be replaced with the corresponding properties from the input `variables` map. If an identifier in braces is not found in `variables`, or if `variables` is not provided, the `{curly_braces}` substring should remain unchanged."
139-
},
140-
"default": {
141-
"type": "string"
142-
},
143-
"is_required": {
144-
"type": "boolean",
145-
"default": false
146-
},
147-
"is_repeated": {
148-
"type": "boolean",
149-
"default": false
150-
}
151-
}
152-
},
153-
{
154-
"type": "object",
155-
"required": [
156-
"type",
157-
"name"
158-
],
159-
"properties": {
160-
"type": {
161-
"const": "named"
162-
},
163-
"name": {
164-
"type": "string",
165-
"description": "Flag name including dashes"
166-
},
167-
"description": {
168-
"type": "string"
169-
},
170-
"value": {
171-
"type": "string",
172-
"description": "The default value for the input. If this is not set, the user may be prompted to provide a value.\n\nIdentifiers wrapped in `{curly_braces}` will be replaced with the corresponding properties from the input `variables` map. If an identifier in braces is not found in `variables`, or if `variables` is not provided, the `{curly_braces}` substring should remain unchanged."
173-
},
174-
"is_required": {
175-
"type": "boolean",
176-
"default": false
177-
},
178-
"is_repeated": {
179-
"type": "boolean",
180-
"default": false
181-
},
182-
"variables": {
183-
"type": "object",
184-
"description": "A map of variable names to their values. Keys in the input `value` that are wrapped in `{curly_braces}` will be replaced with the corresponding variable values.",
185-
"additionalProperties": {
186-
"type": "object",
187-
"properties": {
188-
"description": {
189-
"type": "string"
190-
},
191-
"format": {
192-
"type": "string",
193-
"description": "Specifies the input format. Supported values include `filepath`, which should be interpreted as a file on the user's filesystem.\n\nWhen the input is converted to a string, booleans should be represented by the strings \"true\" and \"false\", and numbers should be represented as decimal values.",
194-
"enum": [
195-
"string",
196-
"number",
197-
"boolean",
198-
"filepath"
199-
],
200-
"default": "string"
201-
},
202-
"is_required": {
203-
"type": "boolean"
204-
},
205-
"default": {
206-
"type": "string"
207-
}
208-
}
209-
}
210-
}
211-
}
212-
}
213-
]
118+
"$ref": "#/$defs/argument"
214119
}
215120
},
216121
"package_arguments": {
@@ -224,30 +129,7 @@
224129
"type": "array",
225130
"description": "Environment variables to set",
226131
"items": {
227-
"type": "object",
228-
"required": [
229-
"name"
230-
],
231-
"properties": {
232-
"name": {
233-
"type": "string",
234-
"description": "Variable name"
235-
},
236-
"description": {
237-
"type": "string"
238-
},
239-
"default": {
240-
"type": "string"
241-
},
242-
"is_required": {
243-
"type": "boolean",
244-
"default": false
245-
},
246-
"is_secret": {
247-
"type": "boolean",
248-
"default": false
249-
}
250-
}
132+
"$ref": "#/$defs/key_value_input"
251133
}
252134
}
253135
}
@@ -282,34 +164,69 @@
282164
"type": "array",
283165
"description": "HTTP headers to include",
284166
"items": {
285-
"type": "object",
286-
"required": [
287-
"name"
288-
],
289-
"properties": {
290-
"name": {
291-
"type": "string"
292-
},
293-
"value": {
294-
"type": "string"
295-
},
296-
"description": {
297-
"type": "string"
298-
},
299-
"is_required": {
300-
"type": "boolean"
301-
},
302-
"is_secret": {
303-
"type": "boolean"
304-
}
305-
}
167+
"$ref": "#/$defs/key_value_input"
306168
}
307169
}
308170
}
309171
}
310172
}
311173
},
312174
"$defs": {
175+
"variable_map": {
176+
"type": "object",
177+
"description": "A map of variable names to their values. Keys in the input `value` that are wrapped in `{curly_braces}` will be replaced with the corresponding variable values.",
178+
"additionalProperties": {
179+
"type": "object",
180+
"properties": {
181+
"description": {
182+
"type": "string"
183+
},
184+
"format": {
185+
"type": "string",
186+
"description": "Specifies the input format. Supported values include `filepath`, which should be interpreted as a file on the user's filesystem.\n\nWhen the input is converted to a string, booleans should be represented by the strings \"true\" and \"false\", and numbers should be represented as decimal values.",
187+
"enum": [
188+
"string",
189+
"number",
190+
"boolean",
191+
"filepath"
192+
],
193+
"default": "string"
194+
},
195+
"is_required": {
196+
"type": "boolean"
197+
},
198+
"default": {
199+
"type": "string"
200+
}
201+
}
202+
}
203+
},
204+
"key_value_input": {
205+
"type": "object",
206+
"required": [
207+
"name"
208+
],
209+
"properties": {
210+
"name": {
211+
"type": "string",
212+
"description": "Variable name"
213+
},
214+
"description": {
215+
"type": "string"
216+
},
217+
"default": {
218+
"type": "string"
219+
},
220+
"is_required": {
221+
"type": "boolean",
222+
"default": false
223+
},
224+
"is_secret": {
225+
"type": "boolean",
226+
"default": false
227+
}
228+
}
229+
},
313230
"argument": {
314231
"oneOf": [
315232
{
@@ -323,22 +240,29 @@
323240
"const": "positional"
324241
},
325242
"value_hint": {
326-
"type": "string"
243+
"type": "string",
244+
"description": "An identifier-like hint for the value. This is not part of the command line, but can be used by client configuration and to provide hints to users."
327245
},
328246
"description": {
329247
"type": "string"
330248
},
331249
"value": {
332-
"type": "string"
250+
"type": "string",
251+
"description": "The default value for the input. If this is not set, the user may be prompted to provide a value.\n\nIdentifiers wrapped in `{curly_braces}` will be replaced with the corresponding properties from the input `variables` map. If an identifier in braces is not found in `variables`, or if `variables` is not provided, the `{curly_braces}` substring should remain unchanged."
333252
},
334253
"default": {
335254
"type": "string"
336255
},
337256
"is_required": {
338-
"type": "boolean"
257+
"type": "boolean",
258+
"default": false
339259
},
340260
"is_repeated": {
341-
"type": "boolean"
261+
"type": "boolean",
262+
"default": false
263+
},
264+
"variables": {
265+
"$ref": "#/$defs/variable_map"
342266
}
343267
}
344268
},
@@ -353,19 +277,26 @@
353277
"const": "named"
354278
},
355279
"name": {
356-
"type": "string"
280+
"type": "string",
281+
"description": "Flag name including dashes"
357282
},
358283
"description": {
359284
"type": "string"
360285
},
361286
"value": {
362-
"type": "string"
287+
"type": "string",
288+
"description": "The default value for the input. If this is not set, the user may be prompted to provide a value.\n\nIdentifiers wrapped in `{curly_braces}` will be replaced with the corresponding properties from the input `variables` map. If an identifier in braces is not found in `variables`, or if `variables` is not provided, the `{curly_braces}` substring should remain unchanged."
363289
},
364290
"is_required": {
365-
"type": "boolean"
291+
"type": "boolean",
292+
"default": false
366293
},
367294
"is_repeated": {
368-
"type": "boolean"
295+
"type": "boolean",
296+
"default": false
297+
},
298+
"variables": {
299+
"$ref": "#/$defs/variable_map"
369300
}
370301
}
371302
}

0 commit comments

Comments
 (0)