Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(server): allow casting var assns #1171

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/docs/08-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,7 @@ have to worry about this in daily LittleHorse usage.
| `format_string` | oneof `source`| [VariableAssignment.FormatString](#variableassignmentformatstring) | Assign a format string |
| `node_output` | oneof `source`| [VariableAssignment.NodeOutputReference](#variableassignmentnodeoutputreference) | Assign the value of a NodeOutput. |
| `expression` | oneof `source`| [VariableAssignment.Expression](#variableassignmentexpression) | Assign the value of an Expression. |
| `type_to_cast_to` | optional| [VariableType](#variabletype) | Allows casting this Variable Assignment to a specific type |
<!-- end Fields -->
<!-- end HasFields -->

Expand All @@ -792,6 +793,7 @@ An Expression allows you to combine multiple values into one.
| `lhs` | | [VariableAssignment](#variableassignment) | The left-hand-side of the expression. |
| `operation` | | [VariableMutationType](#variablemutationtype) | The operator in the expression. |
| `rhs` | | [VariableAssignment](#variableassignment) | The right-hand-side of the expression. |
| `type_to_cast_to` | optional| [VariableType](#variabletype) | Allows casting this expression to a specific type |
<!-- end Fields -->
<!-- end HasFields -->

Expand Down
4 changes: 4 additions & 0 deletions schemas/littlehorse/common_wfspec.proto
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ message VariableAssignment {
VariableMutationType operation = 2;
// The right-hand-side of the expression.
VariableAssignment rhs = 3;
// Allows casting this expression to a specific type
optional VariableType type_to_cast_to = 4;
}

// If you provide a `variable_name` and the specified variable is JSON_OBJ or
Expand All @@ -67,6 +69,8 @@ message VariableAssignment {
// Assign the value of an Expression.
Expression expression = 6;
}
// Allows casting this Variable Assignment to a specific type
optional VariableType type_to_cast_to = 7;
}

// Enumerates the available operations to mutate a variable in a WfRun.
Expand Down
419 changes: 226 additions & 193 deletions sdk-go/lhproto/common_wfspec.pb.go

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading