Skip to content

Commit 04ed91b

Browse files
bigmontzgjmwoods
authored andcommitted
testkit-backend: fix TestkitListDeserializer (neo4j#893)
Enabling `list of maps` deserialization by adding a special case for treating this data type. The extras `nextToken` calls were removed because this was making the deserializer leaves the parent object, this way breaking the `map of lists` deserialization.
1 parent d519fb5 commit 04ed91b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/deserializer/TestkitListDeserializer.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@
3232

3333
public class TestkitListDeserializer extends StdDeserializer<List<?>>
3434
{
35+
private final TestkitCypherParamDeserializer mapDeserializer;
3536

3637
public TestkitListDeserializer()
3738
{
3839
super( List.class );
40+
mapDeserializer = new TestkitCypherParamDeserializer();
3941
}
4042

4143
@Override
@@ -88,14 +90,17 @@ public List<?> deserialize( JsonParser p, DeserializationContext ctxt ) throws I
8890
}
8991
else
9092
{
91-
result.add( p.readValueAs( mapValueType ) );
93+
if ( paramType.equals( "CypherMap" ) ) // special recursive case for maps
94+
{
95+
result.add( mapDeserializer.deserialize( p, ctxt ) );
96+
} else {
97+
result.add( p.readValueAs( mapValueType ) );
98+
}
9299
}
93100
}
94101
}
95102
nextToken = p.nextToken();
96103
}
97-
p.nextToken();
98-
p.nextToken();
99104
return result;
100105
}
101106
}

0 commit comments

Comments
 (0)