Spring Rest Doc - 生成的文档的网址

时间:2017-07-27 12:41:30

标签: spring rest spring-boot spring-restdocs

我正在使用Spring Rest Doc,我可以看到我的.adoc文件是在我指定的路径中正确生成的

public JUnitRestDocumentation restDocumentation =
        new JUnitRestDocumentation("target/generated-snippets");

现在我想在启动服务器时看到它正在运行。

我的MockMvc看起来像这样

this.mockMvc = MockMvcBuilders.standaloneSetup(testController)
            .apply(documentationConfiguration(this.restDocumentation))
            .alwaysDo(document("{method-name}/{step}/"))
            .build();

我正在尝试获取文档的路径,例如localhost:8080 / target / generated-snippet或localhost:8080 / retrivedocumentation,但我看不到它。 我在网上找到的文档没有说明。有谁知道怎么回头呢?

谢谢

1 个答案:

答案 0 :(得分:1)

假设您已按照用户指南说明操作:packaging the documentation,那么您将找到文档以及其他静态网络资源:

http://localhost:8080/docs/index.html