【问题标题】:How to access the api docs with swagger如何使用 swagger 访问 api 文档
【发布时间】:2017-03-22 19:55:16
【问题描述】:

我已按照此文档 http://mikelynchgames.com/software-development/adding-swagger-to-your-dropwizard-application/ 中的完全相同的步骤进行操作

如何访问我为资源编写的文档。这是 yaml 文件

swaggerBasePath: 
  http://localhost:9080

这个网址的后缀是什么?

【问题讨论】:

  • 最好把相关代码分享出来,再分享链接

标签: api swagger dropwizard


【解决方案1】:

我用的是 Smoketurner 包,它运行良好

https://github.com/smoketurner/dropwizard-swagger

当您启动 dropwizard 应用程序时

    INFO  [2017-03-23 04:10:03,931] [main] [DropwizardResourceConfig]: The following paths were found for the configured resources:

    GET     /swagger (io.swagger.jaxrs.listing.ApiListingResource)
    GET     /swagger.{type:json|yaml} (io.swagger.jaxrs.listing.ApiListingResource)

【讨论】:

  • 您使用的是什么版本的 dropwizrd?我在 0.8 上,它遇到了一些问题
  • 谢谢!!我有一个相互冲突的依赖关系,否则效果很好
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-02-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多