From 0256432f61cbe692c75ad2a62537cb2bdebdcd0d Mon Sep 17 00:00:00 2001 From: ben8t <46634684+Ben8t@users.noreply.github.com> Date: Thu, 28 Nov 2024 07:57:50 +0100 Subject: [PATCH] Add examples with expression and trimmed values --- .../java/io/kestra/plugin/core/debug/Return.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/io/kestra/plugin/core/debug/Return.java b/core/src/main/java/io/kestra/plugin/core/debug/Return.java index 0951cd10f1d..3fa44c35cff 100644 --- a/core/src/main/java/io/kestra/plugin/core/debug/Return.java +++ b/core/src/main/java/io/kestra/plugin/core/debug/Return.java @@ -25,7 +25,7 @@ @Schema( title = "Return a value for debugging purposes.", description = "This task is mostly useful for troubleshooting.\n\n" + - "It allows you to return some templated functions, inputs or outputs." + "It allows you to return some templated functions, inputs or outputs. In some cases you might want to trim all white spaces from the rendered values so downstream tasks can use them properly" ) @Plugin( examples = { @@ -39,6 +39,18 @@ type: io.kestra.plugin.core.debug.Return format: "{{ task.id }} > {{ taskrun.startDate }}" """ + ), + @Example( + code = """ + id: compute_header + type: io.kestra.plugin.core.debug.Return + format: >- + {%- if inputs.token is not empty -%} + Bearer {{ inputs.token }} + {%- elseif inputs.username is not empty and inputs.password is not empty -%} + Basic {{ (inputs.username + ':' + inputs.password) | base64encode }} + {%- endif -%} + """ ) }, metrics = {