Skip to content

Commit

Permalink
Add transform_keys with underscord to ensure event can be processed
Browse files Browse the repository at this point in the history
  • Loading branch information
elct9620 committed Jan 5, 2024
1 parent e0b28e2 commit 62eeb31
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
13 changes: 13 additions & 0 deletions lib/hanami/lambda/events/base.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

module Hanami
module Lambda
module Events
class Base < Dry::Struct
transform_keys do |key|
key.gsub("-", "_").to_sym
end
end
end
end
end
4 changes: 1 addition & 3 deletions lib/hanami/lambda/events/event_bridge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
module Hanami
module Lambda
module Events
class EventBridge < Dry::Struct
transform_keys(&:to_sym)

class EventBridge < Base
attribute :version, Types::Integer
attribute :id, Types::String
attribute :detail_type, Types::String
Expand Down

0 comments on commit 62eeb31

Please sign in to comment.