Skip to content

Commit 105251c

Browse files
authored
chore(events): RuleTargetInput.fromText() is not for JSON (#18867)
Closes #18695. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent dcdb58a commit 105251c

File tree

1 file changed

+7
-3
lines changed
  • packages/@aws-cdk/aws-events/lib

1 file changed

+7
-3
lines changed

packages/@aws-cdk/aws-events/lib/input.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ export abstract class RuleTargetInput {
1111
/**
1212
* Pass text to the event target
1313
*
14-
* May contain strings returned by EventField.from() to substitute in parts of the
14+
* May contain strings returned by `EventField.from()` to substitute in parts of the
1515
* matched event.
16+
*
17+
* The Rule Target input value will be a single string: the string you pass
18+
* here. Do not use this method to pass a complex value like a JSON object to
19+
* a Rule Target. Use `RuleTargetInput.fromObject()` instead.
1620
*/
1721
public static fromText(text: string): RuleTargetInput {
1822
return new FieldAwareEventInput(text, InputType.Text);
@@ -24,7 +28,7 @@ export abstract class RuleTargetInput {
2428
* This is only useful when passing to a target that does not
2529
* take a single argument.
2630
*
27-
* May contain strings returned by EventField.from() to substitute in parts
31+
* May contain strings returned by `EventField.from()` to substitute in parts
2832
* of the matched event.
2933
*/
3034
public static fromMultilineText(text: string): RuleTargetInput {
@@ -34,7 +38,7 @@ export abstract class RuleTargetInput {
3438
/**
3539
* Pass a JSON object to the event target
3640
*
37-
* May contain strings returned by EventField.from() to substitute in parts of the
41+
* May contain strings returned by `EventField.from()` to substitute in parts of the
3842
* matched event.
3943
*/
4044
public static fromObject(obj: any): RuleTargetInput {

0 commit comments

Comments
 (0)