java
2023-12-17
2023-12-17
心情愉快是肉体和精神的最佳卫生法。——乔治·桑
原因:自己修改了ByteArrayHttpMessageConverter
的顺序。。。
解决方案:
OpenAPI 3 Library for spring-boot
13.79. Why am i getting an error:
Swagger UI unable to render definition
, when overriding the default spring registeredHttpMessageConverter
?When overriding the default spring-boot registered
HttpMessageConverter
, you should haveByteArrayHttpMessageConverter
registered as well to have properspringdoc-openapi
support.
1
2
converters.add(new ByteArrayHttpMessageConverter());
converters.add(new MappingJackson2HttpMessageConverter(jacksonBuilder.build()));Order is very important, when registering
HttpMessageConverters
.