Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/meistermeier/spring-rest-docs-sample

Example to show API documentation with Spring REST Docs
https://github.com/meistermeier/spring-rest-docs-sample

Last synced: 17 days ago
JSON representation

Example to show API documentation with Spring REST Docs

Awesome Lists containing this project

README

        

= Spring Rest Docs sample

image:https://travis-ci.org/meistermeier/spring-rest-docs-sample.svg?branch=master["Build Status", link="https://travis-ci.org/meistermeier/spring-rest-docs-sample"]

== Summary
This project shows how to generate asciidoctor snippets to be included in a documentation using http://projects.spring.io/spring-restdocs/[Spring Rest Docs].
Have a look at https://github.com/meistermeier/spring-rest-docs-sample/blob/master/src/test/java/com/meistermeier/BeerRepositoryTest.java[_BeerRepositoryTest.java_] that creates the documentation snippets if the tests pass.

== Compiled documentation paths
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.

== Compile and run
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.