From 09ae969489cd6b7aba23361c5c8986cfa0bc26d5 Mon Sep 17 00:00:00 2001 From: tadasant <3900899+tadasant@users.noreply.github.com> Date: Fri, 27 Jun 2025 15:45:42 -0700 Subject: [PATCH] Simplify schema --- docs/server-json/schema.json | 229 ++++++++++++----------------------- 1 file changed, 80 insertions(+), 149 deletions(-) diff --git a/docs/server-json/schema.json b/docs/server-json/schema.json index b8b506d..596c762 100644 --- a/docs/server-json/schema.json +++ b/docs/server-json/schema.json @@ -115,102 +115,7 @@ "type": "array", "description": "Arguments for the runtime command (docker, npx, etc.)", "items": { - "oneOf": [ - { - "type": "object", - "required": [ - "type", - "value_hint" - ], - "properties": { - "type": { - "const": "positional" - }, - "value_hint": { - "type": "string", - "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." - }, - "description": { - "type": "string" - }, - "value": { - "type": "string", - "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." - }, - "default": { - "type": "string" - }, - "is_required": { - "type": "boolean", - "default": false - }, - "is_repeated": { - "type": "boolean", - "default": false - } - } - }, - { - "type": "object", - "required": [ - "type", - "name" - ], - "properties": { - "type": { - "const": "named" - }, - "name": { - "type": "string", - "description": "Flag name including dashes" - }, - "description": { - "type": "string" - }, - "value": { - "type": "string", - "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." - }, - "is_required": { - "type": "boolean", - "default": false - }, - "is_repeated": { - "type": "boolean", - "default": false - }, - "variables": { - "type": "object", - "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.", - "additionalProperties": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "format": { - "type": "string", - "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.", - "enum": [ - "string", - "number", - "boolean", - "filepath" - ], - "default": "string" - }, - "is_required": { - "type": "boolean" - }, - "default": { - "type": "string" - } - } - } - } - } - } - ] + "$ref": "#/$defs/argument" } }, "package_arguments": { @@ -224,30 +129,7 @@ "type": "array", "description": "Environment variables to set", "items": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string", - "description": "Variable name" - }, - "description": { - "type": "string" - }, - "default": { - "type": "string" - }, - "is_required": { - "type": "boolean", - "default": false - }, - "is_secret": { - "type": "boolean", - "default": false - } - } + "$ref": "#/$defs/key_value_input" } } } @@ -282,27 +164,7 @@ "type": "array", "description": "HTTP headers to include", "items": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "value": { - "type": "string" - }, - "description": { - "type": "string" - }, - "is_required": { - "type": "boolean" - }, - "is_secret": { - "type": "boolean" - } - } + "$ref": "#/$defs/key_value_input" } } } @@ -310,6 +172,61 @@ } }, "$defs": { + "variable_map": { + "type": "object", + "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.", + "additionalProperties": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "format": { + "type": "string", + "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.", + "enum": [ + "string", + "number", + "boolean", + "filepath" + ], + "default": "string" + }, + "is_required": { + "type": "boolean" + }, + "default": { + "type": "string" + } + } + } + }, + "key_value_input": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "Variable name" + }, + "description": { + "type": "string" + }, + "default": { + "type": "string" + }, + "is_required": { + "type": "boolean", + "default": false + }, + "is_secret": { + "type": "boolean", + "default": false + } + } + }, "argument": { "oneOf": [ { @@ -323,22 +240,29 @@ "const": "positional" }, "value_hint": { - "type": "string" + "type": "string", + "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." }, "description": { "type": "string" }, "value": { - "type": "string" + "type": "string", + "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." }, "default": { "type": "string" }, "is_required": { - "type": "boolean" + "type": "boolean", + "default": false }, "is_repeated": { - "type": "boolean" + "type": "boolean", + "default": false + }, + "variables": { + "$ref": "#/$defs/variable_map" } } }, @@ -353,19 +277,26 @@ "const": "named" }, "name": { - "type": "string" + "type": "string", + "description": "Flag name including dashes" }, "description": { "type": "string" }, "value": { - "type": "string" + "type": "string", + "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." }, "is_required": { - "type": "boolean" + "type": "boolean", + "default": false }, "is_repeated": { - "type": "boolean" + "type": "boolean", + "default": false + }, + "variables": { + "$ref": "#/$defs/variable_map" } } }