YAML Filters
YAML filters are used to turn YAML strings into objects.
yaml
This filter, added in kestra 0.16.0, is used to parse a YAML string into an object. That object can then be transformed using the Pebble templating engine.
The filter is useful when working with the TemplatedTask added in #3191.
{{ "foo: bar" | yaml }}
indent
When constructing YAML from multiple objects, this filter can apply indentation to strings, adding amount
number of spaces before each line except for the first line.
The prefix
property defines what is used to indent the lines. By default, prefix is " "
(a space).
The syntax:
indent(amount, prefix=" ")
nindent
Use nindent
to add a new line (hence the n
in nindent
) before the code and then indent all lines by adding amount
number of spaces before each line. The amount
is a required property defining how many times prefix is repeated before each line.
The prefix
property defines what is used to indent the lines. By default, prefix is " "
(a space).
The syntax:
nindent(amount, prefix=" ")
Was this page helpful?