Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/temporal/client/serializer/payload.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def to_proto
payloads: [
Temporal::Api::Common::V1::Payload.new(
metadata: { 'encoding' => JSON_ENCODING },
data: JSON.serialize(object)
data: JSON.serialize(object).b
)
]
)
Expand Down
13 changes: 13 additions & 0 deletions spec/unit/lib/temporal/client/serializer/payload_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require 'temporal/client/serializer/payload'

describe Temporal::Client::Serializer::Payload do
let(:hash) { { 'one' => 'one', two: :two, ':three' => '☻' } }

describe 'round trip' do
it 'safely handles non-ASCII encodable UTF characters' do
expect(
described_class.from_proto(described_class.new(hash).to_proto)
).to eq(hash)
end
end
end