grails - Swaggydoc插件grails 3.2.1

标签 grails intellij-idea swagger swagger-ui

我正在运行grails 3.2.1,并想为我的REST端点创建Swagger文档。我通过添加以下内容将SwaggyDoc插件添加到build.gradle脚本的依赖项中:

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中是异常(exception)。
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

最佳答案

回答
当我们在intellij中创建grails应用程序时,我们将在application.yaml文件中获得以下依赖关系。

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

我们需要将其替换为以下内容:
runtime "org.grails.plugins:asset-pipeline"

该错误将得到解决。

关于grails - Swaggydoc插件grails 3.2.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40891543/

相关文章:

linux - sbt.librarymanagement.ResolveException : unresolved dependency: com. github.mpeltonen#sbt-idea;1.6.0: 未找到

java - 如何让 IntelliJ 解决自定义源集的 Gradle 依赖项?

inheritance - 域到域的继承

hibernate - Grails无法解析namedQuery内部的createAlias

Grails GORM 方法无法被 IntelliJ 识别

c# - Swagger UI 显示带有点符号的 asp.net webapi 参数名称

symfony - 如何在生产中禁用 Nelmio UI?

Grails 3.2 JSON View 中的 Java 8 LocalDate

hibernate - 许多域=大量的内存使用?

spring-boot - spring boot 不支持同组名的多个 Docket