ObjectMapper mapper = new ObjectMapper(); //设置false;反序列化时,遇到未知属性(那些没有对应的属性来映射的属性,并且没有任何setter或handler来处理这样的属性)时是否引起 //结果失败(通过抛JsonMappingException异常) mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
User user = mapper.convertValue(pickingJobDto, User.class);