Skip to main content

String Parameter [object]

An object defining a parameter which accepts a string typed value.

Properties:

constraints

A JSON Schema v4 [object] defining constraints on the parameters value.

default

A string initializer to use as the value of the parameter when no argument is provided.

isSecret

A boolean indicating if the value of the parameter is secret. This will cause it to be hidden in UI's for example.

Example

This is an example op that uses a string input, with a default value

name: example
description: an example op
inputs:
example-input:
string:
default: "a default value"
run:
container:
image: { ref: 'alpine' }
cmd: ['echo', $(example-input)]

Using the example op:

opctl run example

The expected output is the op running and echoing "a default value".

Using the example op while overriding the default value:

opctl run -a example-input="hello world" example

The expected output is the op running and echoing "hello world".