Skip to content
This repository has been archived by the owner on Jan 22, 2019. It is now read-only.

Similar to issue #6, MapWriteContext.createChildObjectContext() should call _schema.getValueType() #23

Closed
shoeree opened this issue Oct 2, 2015 · 1 comment

Comments

@shoeree
Copy link

shoeree commented Oct 2, 2015

Hello!

I was attempting to serialize an Avro record containing a "map" with record-type values, and encountered this error:

JsonMappingException: Not an array: <redacted>

... I see that in Issue #6, deserializing the "map" type appears to call getElementType(). In MapWriteContext.java, getElementType() is also called, like so:

@Override
public final AvroWriteContext createChildObjectContext() throws JsonMappingException
{
    _verifyValueWrite();
    AvroWriteContext child = _createObjectContext(_schema.getElementType());
    _data.put(_currentName, child.rawValue());
    return child;
}

Shouldn't this instead use _schema.getValueType()?

@cowtowncoder
Copy link
Member

Yes, quite probably it should.

Any possibility of a simple unit test? :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants