From 0d1560729f9774397155b399b0682d5ea45ccd24 Mon Sep 17 00:00:00 2001 From: Connor Peet Date: Sun, 11 May 2025 19:12:31 -0700 Subject: [PATCH] allow template inputs for headers and environment variables --- api/openapi.yaml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/api/openapi.yaml b/api/openapi.yaml index b698c45..e32688c 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -193,12 +193,15 @@ components: environment_variables: type: array items: - $ref: '#/components/schemas/NamedInput' + anyOf: + - $ref: '#/components/schemas/NamedInput' + - $ref: '#/components/schemas/TemplateInput' UserInput: type: object properties: description: + description: A description of the input, which can be used by clients to provide context to the user. type: string is_required: type: boolean @@ -224,6 +227,7 @@ components: description: The default value for the input. choices: type: array + description: A list of possible values for the input. If given, the user must pick one of these values. items: type: string example: [] @@ -271,8 +275,9 @@ components: name: type: string 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: A description of the input, which can be used by clients to provide context to the user. type: string is_required: type: boolean @@ -281,7 +286,7 @@ components: description: Whether the input can be repeated multiple times in the command line. template: 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}" properties: type: object @@ -311,7 +316,9 @@ components: headers: type: array items: - $ref: '#/components/schemas/NamedInput' + anyOf: + - $ref: '#/components/schemas/NamedInput' + - $ref: '#/components/schemas/TemplateInput' ServerDetail: allOf: