This project shows how to generate asciidoctor snippets to be included in a documentation using Spring Rest Docs. Have a look at BeerRepositoryTest.java that creates the documentation snippets if the tests pass.
You can find the generated snippets after running mvn package
in the target/generated-snippets folder. The documentation will be placed in the target/classes/static/documentation folder to be served as static content from the spring boot application.
Just run mvn package spring-boot:run
to get the sample application running at http://localhost:8888.
The package
phase is important to create the snippets, compile the documentation and place it at a static path for spring boot to pick up.
If you call this address in the browser you will be redirected to the embedded HAL browser (http://localhost:8888/browser/index.html#/).
The compiled documentation is available at http://localhost:8888/documentation/beerapi.html.