- what’s JsonSerializer?
- what’s Module?
- how to work by ObjectMapper?
//参考springfox源码
public class Swagger2JacksonModule extends SimpleModule implements JacksonModuleRegistrar {
public Swagger2JacksonModule() {
}
public void maybeRegisterModule(ObjectMapper objectMapper) {
if (objectMapper.findMixInClassFor(Swagger.class) == null) {
objectMapper.registerModule(this);
objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
}
}
}
//自定义序列化