Swagger2ControllerWebMvc:Unable to find specification for group 1.0

通过yapi自动同步swagger的接口时发现后台不停的报“Swagger2ControllerWebMvc       : Unable to find specification for group 1.0”错误;

 

 


 

同时yapi提示“Error:Request failed with status code 404.”

 

 

 


 

swagger的相应配置如下:

 

 

 


 

根据控制台错误可知错误发生在Swagger2ControllerWebMvc这个类中;

 


 

开始调试

由于document导致的错误,继续debug看是什么原因导致的document没拿到。进入documentationByGroup方法;

 

 从groupName是default,documentationLookup是一个LinkedHashMap,其中只有v1.0一条数据。

将配置类中的groupName改成default后没出现问题,ok了。和version等于v1.0没有关系;

 

 

 

posted @ 2022-03-22 18:14  bwqueen  阅读(2341)  评论(0)    收藏  举报