-
Notifications
You must be signed in to change notification settings - Fork 26
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: add support for string arrays in rules engine parameters & support for operationContextParams trait #1119
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor feedback. Fix and ship!
is ArrayValue -> values.joinToString(",", "mutableListOf(", ")") { value -> | ||
value.expectStringValue().value.doubleQuote() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: ","
→ ", "
is ArrayNode -> { | ||
writer.writeInline( | ||
v.elements.joinToString(",", "mutableListOf(", ")") { element -> | ||
element.expectStringNode().value.doubleQuote() | ||
}, | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Outer braces are unnecessary for single statement branches
is ArrayValue -> values.joinToString(",", "mutableListOf(", ")") { value -> | ||
value.expectStringValue().value.doubleQuote() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Why a mutable list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, I believe it can be non-mutable
is ArrayValue -> values.joinToString(",", "mutableListOf(", ")") { value -> | ||
value.expectStringValue().value.doubleQuote() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: This general pattern of serializing node values to a string of double-quoted values is repeated multiple times. We should commonize it into a single function (perhaps an extension method on List<Value>
).
is ArrayValue -> values.joinToString(",", "mutableListOf(", ")") { value -> | ||
value.expectStringValue().value.doubleQuote() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, I believe it can be non-mutable
This comment has been minimized.
This comment has been minimized.
Affected ArtifactsNo artifacts changed size |
Issue #
Description of changes
Add support for string arrays in rules engine parameters
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.