@EnableWebMvc And OpenApi Issue#
Notes#
- Don't use annotation
@EnableWebMvc
if you are not using advance features ofWebMvcConfigurer
, in stead let extend directly fromWebMvcConfigurationSupport
. Because when you use@EnableWebMvc
some default bean ofSpring Boot
will be overridden and it will cause of some issue that you won't expect. - For example, if you are using OpenApi generator and in some configuration file you use annotation
@EnableWebMvc
then you can see format datetime of openapi will response numbers asEpoch
(Ex: 1702629738) not the type that human can read as2011-12-03T10:15:30
. It is because the defaultObjectMapper
of Spring Boot has been overridden and it is hard for you to reconfigure it again.