renatoh commented on code in PR #4329:
URL: https://github.com/apache/solr/pull/4329#discussion_r3756359729
##########
solr/core/src/java/org/apache/solr/jersey/SolrJacksonMapper.java:
##########
@@ -49,12 +52,20 @@ private static ObjectMapper createObjectMapper() {
final SimpleModule customTypeModule = new SimpleModule();
customTypeModule.addSerializer(new NamedListSerializer(NamedList.class));
- return new ObjectMapper()
- // TODO Should failOnUnknown=false be made available on a "permissive"
object mapper instead
- // of the "main" one?
- .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
- .setSerializationInclusion(JsonInclude.Include.NON_NULL)
- .registerModule(customTypeModule);
+ final ObjectMapper mapper =
+ new ObjectMapper()
+ // TODO Should failOnUnknown=false be made available on a
"permissive" object mapper
+ // instead of the "main" one?
+ .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,
false)
+ .setSerializationInclusion(JsonInclude.Include.NON_NULL)
+ .registerModule(customTypeModule);
+
+ mapper
+ .coercionConfigFor(LogicalType.Textual)
Review Comment:
Hi @malliaridis
I think we have covered all the case you mention, have a look at the tests.
I managed to change the error message, you pass in "name": 123 you get now:
"Invalid value for field 'name': expected String.
--
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]