Spring, Jackson and Customization (e.g. CustomDeserializer)

前端 未结 6 1663
情深已故
情深已故 2020-11-30 02:42

Being still a little unfamiliar with Spring, I have encountered a problem that makes it necessary implementing my a custom deserialzer for Jackson. The procedure is describe

6条回答
  •  青春惊慌失措
    2020-11-30 03:14

    The spring docs for MappingJacksonHttpMessageConverter state:

    2.4.5 MappingJacksonHttpMessageConverter

    An HttpMessageConverter implementation that can read and write JSON using Jackson JSON Processor's ObjectMapper. JSON mapping can be customized as needed through the use of Jackson's provided annotations. When further control is needed, a custom ObjectMapper can be injected through the ObjectMapper property for cases where custom JSON serializers/deserializers need to be provided for specific types. By default this converter supports (application/json).

    Couldn't you just autowire access to the ObjectMapper in order to modify it's behaviour?

提交回复
热议问题