How do I disable fail_on_empty_beans in Jackson?

前端 未结 12 1267
广开言路
广开言路 2020-12-01 05:44

Using jackson 2.1, how do I disable the fail_on_empty beans that the error message seems to want me to disable?

I\'m assuming this is just the simplest

12条回答
  •  半阙折子戏
    2020-12-01 06:18

    In my case I didnt need to disable it , rather I had to put this code on top of my class : (and this solved my issue)

        @JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class)//this is what was added
        @Value //this was there already
        @Builder//this was there already
    
    public class NameOfClass {
         //some code in here.
    }
    

提交回复
热议问题