2016-11-30 72 views
0

我正在運行grails 3.2.1並希望爲我的REST端點創建Swagger文檔。我通過添加加SwaggyDoc,插件在我的build.gradle腳本的依賴關係:Swaggydoc插件grails 3.2.1

compile "org.grails.plugins:swaggydoc-grails3:0.28.0" 

而且通過https://rahulsom.github.io/swaggydoc/配置。

在IntelliJ中,我看到添加到我的庫列表中的Swaggydoc依賴項。

通過grails run-app命令啓動我的Grails應用程序並輸入http://localhost:8080/api/打開我的應用程序後,我得到一個swagger-ui index.html,但在控制檯日誌(請參閱圖像)中發現錯誤。

console log errors

而這個例外在Grails中。

ERROR org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/].[grailsDispatcherServlet] - Servlet.service() for servlet [grailsDispatcherServlet] in context with path [] threw exception 
org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object '[Digest Input Stream] MD5 Message Digest from SUN 
+0

你看過[springfox](https://github.com/springfox/springfox-grails-integration)嗎?如果不是,將很樂意獲得您的反饋意見。 –

回答

1

回答 當我們創建Grails應用程序內的IntelliJ我們進去application.yaml文件以下依賴。

runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.11.6" 

我們需要用下面的替換此:

runtime "org.grails.plugins:asset-pipeline" 

此錯誤將得到解決。