Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/meistermeier/spring-rest-docs-sample
- Owner: meistermeier
- Created: 2016-09-30T14:17:36.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-02T17:48:15.000Z (about 8 years ago)
- Last Synced: 2024-10-08T05:41:45.713Z (about 1 month ago)
- Language: Java
- Homepage:
- Size: 82 KB
- Stars: 0
- Watchers: 1
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
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.