Skip to content

Commit

Permalink
chore: rename expr to expression
Browse files Browse the repository at this point in the history
  • Loading branch information
fhussonnois committed Aug 5, 2024
1 parent c03c860 commit bb8dcfb
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public interface JSONataInterface {
@PluginProperty(dynamic = true)
@Schema(title = "The JSONata expression to apply on the JSON object.")
@NotNull
String getExpr();
String getExpression();

@PluginProperty(dynamic = true)
@Schema(title = "The maximum number of recursive calls allowed for the JSONata transformation.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public abstract class Transform extends Task implements JSONataInterface, Runnab

private static final ObjectMapper ION_OBJECT_MAPPER = JacksonMapper.ofIon();

private String expr;
private String expression;

@Builder.Default
private Integer maxDepth = 1000;
Expand All @@ -55,7 +55,7 @@ protected JsonNode evaluateExpression(JsonNode jsonNode) {

private Expressions parseExpression(RunContext runContext) throws IllegalVariableEvaluationException {
try {
return Expressions.parse(runContext.render(this.expr));
return Expressions.parse(runContext.render(this.expression));
} catch (ParseException | IOException e) {
throw new IllegalArgumentException("Invalid JSONata expression. Error: " + e.getMessage(), e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
- id: transformJson
type: io.kestra.plugin.transform.jsonata.TransformItems
from: {{ previousTask.outputs.uri }}
expr: |
expression: |
{
"order_id": order_id,
"customer_name": customer_name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
}
]
}
expr: |
expression: |
{
"order_id": order_id,
"customer_name": customer_name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void shouldGetOutputForValidExprReturningStringForFromURI() throws Exception {

TransformItems task = TransformItems.builder()
.from(uri.toString())
.expr(Features.DATASET_ACCOUNT_ORDER_EXPR)
.expression(Features.DATASET_ACCOUNT_ORDER_EXPR)
.build();

// When
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void shouldGetOutputForValidExprReturningStringForFromJSON() throws Exception {
RunContext runContext = runContextFactory.of();
TransformValue task = TransformValue.builder()
.from(Features.DATASET_ACCOUNT_ORDER_JSON)
.expr(Features.DATASET_ACCOUNT_ORDER_EXPR)
.expression(Features.DATASET_ACCOUNT_ORDER_EXPR)
.build();

// When
Expand Down Expand Up @@ -62,7 +62,7 @@ void shouldGetOutputForValidExprReturningObjectForFromJSON() throws Exception {
]
}
""")
.expr("""
.expression("""
{
"order_id": order_id,
"customer_name": customer_name,
Expand Down

0 comments on commit bb8dcfb

Please sign in to comment.