dsmiley commented on code in PR #4761:
URL: https://github.com/apache/solr/pull/4761#discussion_r3839207742
##########
solr/core/src/java/org/apache/solr/jersey/SolrJacksonMapper.java:
##########
@@ -70,7 +70,8 @@ public NamedListSerializer(Class<NamedList> nlClazz) {
@Override
public void serialize(NamedList value, JsonGenerator gen,
SerializerProvider provider)
throws IOException {
- gen.writeObject(value.asShallowMap());
+ // Not SimpleOrderedMap: it IS a NamedList, so this serializer would
recurse on it.
+ gen.writeObject(value.asMap(0));
Review Comment:
Then it seems there is a lost opportunity here to be more efficient, as
we're creating a new data structure merely to write it out, when Jackson surely
knows how to serialize a Map. I'm not sure if there's a way for us to get
Jackson to write it as a Map, bypassing the NamedList detection (avoid infinite
recursion).
CC @gerlowskija
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]