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: add support for string arrays in rules engine parameters & support for operationContextParams trait #1119

Merged
merged 3 commits into from
Jul 18, 2024

Conversation

0marperez
Copy link
Contributor

@0marperez 0marperez commented Jul 10, 2024

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.

This comment has been minimized.

@0marperez 0marperez marked this pull request as ready for review July 11, 2024 20:11
@0marperez 0marperez requested a review from a team as a code owner July 11, 2024 20:11
Copy link
Contributor

@ianbotsf ianbotsf left a 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!

Comment on lines 46 to 48
is ArrayValue -> values.joinToString(",", "mutableListOf(", ")") { value ->
value.expectStringValue().value.doubleQuote()
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: ","", "

Comment on lines 135 to 141
is ArrayNode -> {
writer.writeInline(
v.elements.joinToString(",", "mutableListOf(", ")") { element ->
element.expectStringNode().value.doubleQuote()
},
)
}
Copy link
Contributor

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

Comment on lines 46 to 48
is ArrayValue -> values.joinToString(",", "mutableListOf(", ")") { value ->
value.expectStringValue().value.doubleQuote()
}
Copy link
Contributor

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?

Copy link
Contributor

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

Comment on lines 46 to 48
is ArrayValue -> values.joinToString(",", "mutableListOf(", ")") { value ->
value.expectStringValue().value.doubleQuote()
}
Copy link
Contributor

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>).

Comment on lines 46 to 48
is ArrayValue -> values.joinToString(",", "mutableListOf(", ")") { value ->
value.expectStringValue().value.doubleQuote()
}
Copy link
Contributor

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.

Copy link

Affected Artifacts

No artifacts changed size

@0marperez 0marperez changed the title feat: add support for string arrays in rules engine parameters feat: add support for string arrays in rules engine parameters & support for operationContextParams trait Jul 18, 2024
@0marperez 0marperez merged commit fa262f5 into main Jul 18, 2024
15 checks passed
@0marperez 0marperez deleted the new-endpoint-rules branch July 18, 2024 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants