TypeNameExtractor could not be found

TypeNameExtractor could not be foundException

一、注意:

如果项目中使用了 knif4j或swagger

(knif4j内核中就使用了swagger)

项目启动时可能就会出现下边的异常

DynamicResponseModelReader required a bean of type 'springfox.documentation.schema.TypeNameExtractor' that could not be found.

浅析:

大概在说TypeNameExtractor类缺失(应该用@ComponentScan去扫描这些类)

解决办法:

可以给主启动类上添加下边的注解(用于扫描缺失的这些类)

@ComponentScan({"springfox.documentation.schema"})



posted @ 2022-09-28 19:29  牧之丨  阅读(355)  评论(0编辑  收藏  举报