lib/deimos/schema_backends/avro_validation.rb in deimos-ruby-1.24.2 vs lib/deimos/schema_backends/avro_validation.rb in deimos-ruby-2.0.0.pre.alpha1
- old
+ new
@@ -7,15 +7,15 @@
# Leave Ruby hashes as is but validate them against the schema.
# Useful for unit tests.
class AvroValidation < AvroBase
# @override
def decode_payload(payload, schema: nil)
- payload.with_indifferent_access
+ JSON.parse(payload)
end
# @override
def encode_payload(payload, schema: nil, topic: nil)
- payload.with_indifferent_access
+ payload.to_h.with_indifferent_access.to_json
end
end
end
end