Okay, I’ve been struggling with what I think may be a bug in the rule_event resource and thought I’d surface it here before I head over to Github and submit it as an issue. I’m still learning my way around the Jets codebase and don’t think I’m quite in a place where I’d be able to submit a PR but if this does indeed look like a bug and you’d like to point me in the right direction I’d be happy to dig in and see if I can submit a PR. In the meantime, here’s what I’m seeing.
My “rule_event” call looks like so:
rule_event(
description: "Checks for orders",
detail_type: ['shopify_order_import']
)
I should note that the last screenshot I shared was when I took a different approach to applying that rule using this pattern format: https://www.dropbox.com/s/ufrhv6pisfkrjs4/Screen%20Shot%202021-03-06%20at%206.40.08%20PM.png?dl=0 but the outcome did result in some formatting that did not match my rules. Any who, I’m going to try a different approach and try to use the full “resource” approach and see if that will at least get me operational but would love any insight you might have @tung.
Please let me know if I can provide any additional information to help troubleshoot. Thanks!
Okay, final update for the evening. I hope you don’t mind all the messages, hopefully they’ll be helpful to someone along the way. I ended up deciding to transform my input before calling put_events to place my payload onto EventBridge.
To do this, I call deep_transform_keys{|k| k.camelize(:lower)} on my input object which transforms my object keys from something like “contact_email” to “contactEmail”. It feels a little hacky but doesn’t seem to cause much problem and I’m getting matches on my event pattern now which is all I was trying to accomplish
Given your attention to detail on all of this, I’m guessing perhaps the decision was intentional but it might be worth calling out somewhere in the documentation if that is indeed the case. I’m happy to chip in there if it helps.