Simplify schema

This commit is contained in:
tadasant 2025-06-27 15:45:42 -07:00 • committed by Toby Padilla
commit 09ae969489

View file

@ -115,102 +115,7 @@
"type": "array", "type": "array",
"description": "Arguments for the runtime command (docker, npx, etc.)", "description": "Arguments for the runtime command (docker, npx, etc.)",
"items": { "items": {
"oneOf": [ "$ref": "#/$defs/argument"
{
"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"
}
}
}
}
}
}
]
} }
}, },
"package_arguments": { "package_arguments": {
@ -224,30 +129,7 @@
"type": "array", "type": "array",
"description": "Environment variables to set", "description": "Environment variables to set",
"items": { "items": {
"type": "object", "$ref": "#/$defs/key_value_input"
"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
}
}
} }
} }
} }
@ -282,27 +164,7 @@
"type": "array", "type": "array",
"description": "HTTP headers to include", "description": "HTTP headers to include",
"items": { "items": {
"type": "object", "$ref": "#/$defs/key_value_input"
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string"
},
"description": {
"type": "string"
},
"is_required": {
"type": "boolean"
},
"is_secret": {
"type": "boolean"
}
}
} }
} }
} }
@ -310,6 +172,61 @@
} }
}, },
"$defs": { "$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": { "argument": {
"oneOf": [ "oneOf": [
{ {
@ -323,22 +240,29 @@
"const": "positional" "const": "positional"
}, },
"value_hint": { "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": { "description": {
"type": "string" "type": "string"
}, },
"value": { "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": { "default": {
"type": "string" "type": "string"
}, },
"is_required": { "is_required": {
"type": "boolean" "type": "boolean",
"default": false
}, },
"is_repeated": { "is_repeated": {
"type": "boolean" "type": "boolean",
"default": false
},
"variables": {
"$ref": "#/$defs/variable_map"
} }
} }
}, },
@ -353,19 +277,26 @@
"const": "named" "const": "named"
}, },
"name": { "name": {
"type": "string" "type": "string",
"description": "Flag name including dashes"
}, },
"description": { "description": {
"type": "string" "type": "string"
}, },
"value": { "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": { "is_required": {
"type": "boolean" "type": "boolean",
"default": false
}, },
"is_repeated": { "is_repeated": {
"type": "boolean" "type": "boolean",
"default": false
},
"variables": {
"$ref": "#/$defs/variable_map"
} }
} }
} }