Configuring ObjectMapper in Spring

前端 未结 12 1722
迷失自我
迷失自我 2020-11-22 10:46

my goal is to configure the objectMapper in the way that it only serialises element which are annotated with @JsonProperty.

In order to do

12条回答
  •  悲哀的现实
    2020-11-22 11:11

    I found the solution now based on https://github.com/FasterXML/jackson-module-hibernate

    I extended the object mapper and added the attributes in the inherited constructor.

    Then the new object mapper is registered as a bean.

    
    
        
            
                
                    
                        
                    
                
            
        
       
    

提交回复
热议问题