allow template inputs for headers and environment variables

This commit is contained in:
Connor Peet 2025-05-11 19:12:31 -07:00
commit 0d1560729f

View file

@ -193,12 +193,15 @@ components:
environment_variables: environment_variables:
type: array type: array
items: items:
$ref: '#/components/schemas/NamedInput' anyOf:
- $ref: '#/components/schemas/NamedInput'
- $ref: '#/components/schemas/TemplateInput'
UserInput: UserInput:
type: object type: object
properties: properties:
description: description:
description: A description of the input, which can be used by clients to provide context to the user.
type: string type: string
is_required: is_required:
type: boolean type: boolean
@ -224,6 +227,7 @@ components:
description: The default value for the input. description: The default value for the input.
choices: choices:
type: array type: array
description: A list of possible values for the input. If given, the user must pick one of these values.
items: items:
type: string type: string
example: [] example: []
@ -271,8 +275,9 @@ components:
name: name:
type: string type: string
example: mount_config example: mount_config
description: The name of the input, which can be used by clients as an identifier to reference the input. It is not present in the generated command line. description: The name of the input, which can be used by clients as an identifier to reference the input. For environment variables and headers, this is the environment variable or header names. For arguments, this is solely for reference and not part of the command line.
description: description:
description: A description of the input, which can be used by clients to provide context to the user.
type: string type: string
is_required: is_required:
type: boolean type: boolean
@ -281,7 +286,7 @@ components:
description: Whether the input can be repeated multiple times in the command line. description: Whether the input can be repeated multiple times in the command line.
template: template:
type: string type: string
description: The template string that will be used to generate the value. Values wrapped in `{curly_braces}` will be replaced with the corresponding properties. description: The template string that will be used to generate the value. Values wrapped in `{curly_braces}` will be replaced with the corresponding properties. Input which is not `is_required` is replaced with its `default` value, or otherwise an empty string.
example: "--mount=type=bind,src={host_path},dst={container_path}" example: "--mount=type=bind,src={host_path},dst={container_path}"
properties: properties:
type: object type: object
@ -311,7 +316,9 @@ components:
headers: headers:
type: array type: array
items: items:
$ref: '#/components/schemas/NamedInput' anyOf:
- $ref: '#/components/schemas/NamedInput'
- $ref: '#/components/schemas/TemplateInput'
ServerDetail: ServerDetail:
allOf: allOf: