-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This update brings Spring REST Doc to the mix: A simple way to bind your API documentation to your Tests. I really like it.
- Loading branch information
1 parent
837deea
commit 56f7868
Showing
9 changed files
with
500 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
= biking.michael-simons.eu Guide and API | ||
Michael Simons; | ||
:doctype: book | ||
:icons: font | ||
:source-highlighter: highlightjs | ||
:toc: left | ||
:toclevels: 3 | ||
:sectlinks: | ||
|
||
[[introduction]] | ||
== Introduction | ||
|
||
http://biking.michael-simons.eu[biking.michael-simons.eu] is a project for | ||
|
||
* tracking my bike activities | ||
* evaluating technology | ||
* learn stuff | ||
* showcasing my skills | ||
|
||
For my information see http://info.michael-simons.eu/2014/02/20/developing-a-web-application-with-spring-boot-angularjs-and-java-8/[this blog post] as a starting point. | ||
|
||
I'd like to thank all the people working at the Spring Eco System for doing their amazing work. | ||
|
||
[[api]] | ||
== Api | ||
|
||
[[bikes]] | ||
=== Bikes | ||
|
||
[[listing-bikes]] | ||
|
||
==== Listing bikes | ||
|
||
A `GET` request will list all of the service's bikes. | ||
|
||
===== Request Parameter | ||
|
||
include::{snippets}/api/bikes/get/request-parameters.adoc[] | ||
|
||
[[bike-structure]] | ||
===== Response structure | ||
|
||
include::{snippets}/api/bikes/get/response-fields.adoc[] | ||
|
||
===== Example request | ||
|
||
include::{snippets}/api/bikes/get/curl-request.adoc[] | ||
|
||
===== Example response | ||
|
||
include::{snippets}/api/bikes/get/http-response.adoc[] | ||
|
||
==== Creating a bike | ||
|
||
A `POST` request is used to create a new bike | ||
|
||
===== Request structure | ||
|
||
include::{snippets}/api/bikes/post/request-fields.adoc[] | ||
|
||
===== Example request | ||
|
||
include::{snippets}/api/bikes/post/curl-request.adoc[] | ||
|
||
===== Example response | ||
|
||
include::{snippets}/api/bikes/post/http-response.adoc[] | ||
|
||
==== Adding milages to bikes | ||
|
||
A bike manages its total milage at a given date. To make it easy for the user, no difference needs to be calculated, the user can enter the milage of is bike as stated on the odometer or whatever. | ||
|
||
A `POST` request will add a new milage to a given bike. | ||
|
||
===== Path Parameters | ||
|
||
include::{snippets}/api/bikes/milages/post/path-parameters.adoc[] | ||
|
||
===== Request structure | ||
|
||
include::{snippets}/api/bikes/milages/post/request-fields.adoc[] | ||
|
||
===== Example request | ||
|
||
include::{snippets}/api/bikes/milages/post/curl-request.adoc[] | ||
|
||
===== Example response | ||
|
||
include::{snippets}/api/bikes/milages/post/http-response.adoc[] | ||
|
||
==== Adding a story to a bike | ||
|
||
Bikes can have an associated story, how they were build or whatever. | ||
|
||
A `PUT` request will update a given bike with a new story. | ||
|
||
===== Path Parameters | ||
|
||
include::{snippets}/api/bikes/story/put/path-parameters.adoc[] | ||
|
||
===== Request structure | ||
|
||
include::{snippets}/api/bikes/story/put/request-fields.adoc[] | ||
|
||
===== Example request | ||
|
||
include::{snippets}/api/bikes/story/put/curl-request.adoc[] | ||
|
||
===== Example response | ||
|
||
The reponse is an updated <<bike-structure,bike>>. | ||
|
||
include::{snippets}/api/bikes/story/put/http-response.adoc[] | ||
|
||
===== Deleting a story | ||
|
||
An empty `PUT` request deletes a bikes story: | ||
|
||
include::{snippets}/api/bikes/story/put-empty/curl-request.adoc[] | ||
|
||
include::{snippets}/api/bikes/story/put-empty/http-response.adoc[] | ||
|
||
[[trips]] | ||
=== Trips | ||
|
||
To keep track of all milage including time not spent on persistent bikes, the user can store assorted trips. A trip is a distance covered at a certain date. | ||
|
||
==== Creating a trip | ||
|
||
A `POST` request is used to create a new trip | ||
|
||
===== Request structure | ||
|
||
include::{snippets}/api/trips/post/request-fields.adoc[] | ||
|
||
===== Example request | ||
|
||
include::{snippets}/api/trips/post/curl-request.adoc[] | ||
|
||
===== Response structure | ||
|
||
include::{snippets}/api/trips/post/response-fields.adoc[] | ||
|
||
===== Example response | ||
|
||
include::{snippets}/api/trips/post/http-response.adoc[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.