Skip to main content

Object Parameter [object]

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

Properties:

constraints

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

default

An object 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

The op uses an object input, and echos the values of the object's keys.

name: object-example-op
inputs:
example-input:
object:
default:
keyA: "valueA"
keyB: ["subValueB1", "subValueB2", "subValueB3"]
keyC:
subKeyC1: "subValueC1"
subKeyC2: "subKeyC2"
run:
container:
image: { ref: 'alpine' }
cmd:
- sh
- -ce
- echo $(example-input.keyA) && echo $(example-input.keyB[0]) && echo $(example-input.keyC.subKeyC1)

The expected output is:

valueA
subValueB1
subValueC1