mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 22:11:36 -05:00
fix(eventbridge): apply InputPath when delivering events to targets (#335)
This commit is contained in:
1 parent
f98abd6e0e
commit
68311a5b47
2 files changed
+35
No files matched your search
@@ -43,6 +43,8 @@ public class EventBridgeInvoker {
|
||||
String payload;
|
||||
if (target.getInput() != null) {
|
||||
payload = target.getInput();
|
||||
} else if (target.getInputPath() != null) {
|
||||
payload = applyInputPath(target.getInputPath(), eventJson);
|
||||
} else if (target.getInputTransformer() != null) {
|
||||
payload = applyInputTransformer(target.getInputTransformer(), eventJson);
|
||||
} else {
|
||||
@@ -71,6 +73,14 @@ public class EventBridgeInvoker {
|
||||
}
|
||||
}
|
||||
|
||||
String applyInputPath(String inputPath, String eventJson) {
|
||||
if (inputPath == null || "$".equals(inputPath)) {
|
||||
return eventJson;
|
||||
}
|
||||
String extracted = extractJsonPath(inputPath, eventJson);
|
||||
return extracted != null ? extracted : eventJson;
|
||||
}
|
||||
|
||||
String applyInputTransformer(InputTransformer transformer, String eventJson) {
|
||||
String template = transformer.getInputTemplate();
|
||||
if (template == null) {
|
||||
|
||||
Reference in new issue
Block a user