Compare commits

...

3 Commits

Author SHA1 Message Date
AJ Emerich
d69fe49961 Merge branch 'develop' into docs/return-example 2025-11-17 04:52:32 -06:00
AJ Emerich
f33a6e5f16 Merge branch 'develop' into docs/return-example 2025-11-17 04:05:30 -06:00
AJ Emerich
840ef10b54 docs(return): fix example 2025-11-14 12:51:18 +01:00

View File

@@ -44,15 +44,33 @@ import java.util.Optional;
"""
),
@Example(
full = true,
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 -%}
id: return
namespace: company.team
inputs:
- id: token
type: STRING
displayName: "API Token"
- id: username
type: STRING
displayName: "Username"
- id: password
type: STRING
displayName: "Password"
tasks:
- 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 -%}
"""
)
},