Details
Description
When serializing a record with a field that isn't specified in the schema, there should be some sort of warning or error. Otherwise, a simple typo in a field name can lead to silent loss of that field's data.
Test case that should pass but currently fails:
{ my $schema = Avro::Schema->parse(<<EOJ); { "type": "record", "name": "test", "fields" : [ {"name": "a", "type": "long"} ] } EOJ my $enc = ''; eval { Avro::BinaryEncoder->encode( schema => $schema, data => { a => 27, b => 'foo' }, emit_cb => sub { $enc .= ${ $_[0] } }, ); }; isa_ok $@, 'Avro::BinaryEncoder::Error'; }