Search code examples
springrestspring-bootspring-restdocs

Spring Rest Doc - url of the documentation generated


I am using Spring Rest Doc, and I can see my .adoc files are generated properly in the path I have specified inside

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

now I would like to see it in action when I am starting the server.

my MockMvc look like this

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

I am trying to get the path for the documentation like localhost:8080/target/generated-snippet or localhost:8080/retrivedocumentation but I can't see it. The documentation I found on line does not specify it. Does anyone knows how to retrive it?

Thank you


Solution

  • Assuming you've followed the user guide instructions: packaging the documentation then you'll find the docs along with the other static web resources:

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