Skip to content

Commit

Permalink
Fix #19
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Aug 11, 2017
1 parent d8dcc0b commit 8ad051a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
import com.fasterxml.jackson.core.*;
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.introspect.AnnotatedMember;
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonArrayFormatVisitor;
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes;
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable;
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper;
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonMapFormatVisitor;
import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
Expand Down Expand Up @@ -385,12 +388,25 @@ public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType t
if (v2 != null) {
v2.keyFormat(_keySerializer, _type.getKeyType());
JsonSerializer<?> valueSer = _valueSerializer;
JavaType vt = _type.getContentType();
final JavaType vt = _type.getContentType();
final SerializerProvider prov = visitor.getProvider();
if (valueSer == null) {
valueSer = _findAndAddDynamic(_dynamicValueSerializers,
vt, visitor.getProvider());
valueSer = _findAndAddDynamic(_dynamicValueSerializers, vt, prov);
}
v2.valueFormat(valueSer, vt);
final JsonSerializer<?> valueSer2 = valueSer;
v2.valueFormat(new JsonFormatVisitable() {
final JavaType arrayType = prov.getTypeFactory().constructArrayType(vt);
@Override
public void acceptJsonFormatVisitor(
JsonFormatVisitorWrapper v3, JavaType hint3)
throws JsonMappingException
{
JsonArrayFormatVisitor v4 = v3.expectArrayFormat(arrayType);
if (v4 != null) {
v4.itemsFormat(valueSer2, vt);
}
}
}, vt);
}
}

Expand Down
4 changes: 4 additions & 0 deletions release-notes/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Modules:
=== Releases ===
------------------------------------------------------------------------

2.8.10 (not yet released)

#19: Multimap serializer produces wrong Schema structure

2.8.9 (12-Jun-2017)

No changes since 2.8.8
Expand Down

0 comments on commit 8ad051a

Please sign in to comment.