【问题标题】:Accessing Swagger Documentation with JHipster使用 JHipster 访问 Swagger 文档
【发布时间】:2017-06-06 13:14:04
【问题描述】:

我只通过 jhipster 使用 only 生成了一个应用服务器。

yo jhipster --skip-client

它已经生成了我在访问时需要的所有必要的 api 调用

http://localhost:8080/swagger-ui/index.html

我以 404 结束。我的印象是包含 swagger,但似乎无法访问它,尽管 swagger api 端点可用。

【问题讨论】:

    标签: jhipster


    【解决方案1】:

    您不能,因为您只生成其余的 api。如果您想查看 api-docs,请按照提到的说明进行操作 here

    一旦你成功克隆了上述repository

    打开 dist/index.html 并简单地将源粘贴到那里

    http://localhost:8080/v2/api-docs

    它应该看起来像这样

    【讨论】:

    • 我认为第一个链接已经过时,因此答案变得不连贯,因为第一个是在谈论 swagger-editor 和第二个是 swagger-ui。你能在这里解释一下我们需要做什么吗?
    【解决方案2】:

    只需添加以下依赖项。您在这里缺少依赖项。

    <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-swagger-ui</artifactId>
        <version>2.5.0</version>
    </dependency>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多