Align with the Asciidoctor team's preferred file extension, .adoc

Closes gh-45
This commit is contained in:
Andy Wilkinson
2015-04-16 12:31:29 +01:00
parent e00734d693
commit f93981fce2
9 changed files with 125 additions and 130 deletions

View File

@@ -64,12 +64,12 @@ use of HTTP status codes.
Whenever an error response (status code >= 400) is returned, the body will contain a JSON object
that describes the problem. The error object has the following structure:
include::{generated}/error-example/response-fields.asciidoc
include::{generated}/error-example/response-fields.adoc
For example, a request that attempts to apply a non-existent tag to a note will produce a
`400 Bad Request` response:
include::{generated}/error-example/http-response.asciidoc[]
include::{generated}/error-example/http-response.adoc[]
[[overview-hypermedia]]
== Hypermedia
@@ -99,18 +99,18 @@ A `GET` request is used to access the index
==== Response structure
include::{generated}/index-example/response-fields.asciidoc[]
include::{generated}/index-example/response-fields.adoc[]
==== Example response
include::{generated}/index-example/http-response.asciidoc[]
include::{generated}/index-example/http-response.adoc[]
[[resources-index-links]]
==== Links
include::{generated}/index-example/links.asciidoc[]
include::{generated}/index-example/links.adoc[]
@@ -128,15 +128,15 @@ A `GET` request will list all of the service's notes.
==== Response structure
include::{generated}/notes-list-example/response-fields.asciidoc[]
include::{generated}/notes-list-example/response-fields.adoc[]
==== Example request
include::{generated}/notes-list-example/curl-request.asciidoc[]
include::{generated}/notes-list-example/curl-request.adoc[]
==== Example response
include::{generated}/notes-list-example/http-response.asciidoc[]
include::{generated}/notes-list-example/http-response.adoc[]
@@ -147,15 +147,15 @@ A `POST` request is used to create a note
==== Request structure
include::{generated}/notes-create-example/request-fields.asciidoc[]
include::{generated}/notes-create-example/request-fields.adoc[]
==== Example request
include::{generated}/notes-create-example/curl-request.asciidoc[]
include::{generated}/notes-create-example/curl-request.adoc[]
==== Example response
include::{generated}/notes-create-example/http-response.asciidoc[]
include::{generated}/notes-create-example/http-response.adoc[]
@@ -173,15 +173,15 @@ A `GET` request will list all of the service's tags.
==== Response structure
include::{generated}/tags-list-example/response-fields.asciidoc[]
include::{generated}/tags-list-example/response-fields.adoc[]
==== Example request
include::{generated}/tags-list-example/curl-request.asciidoc[]
include::{generated}/tags-list-example/curl-request.adoc[]
==== Example response
include::{generated}/tags-list-example/http-response.asciidoc[]
include::{generated}/tags-list-example/http-response.adoc[]
@@ -192,15 +192,15 @@ A `POST` request is used to create a note
==== Request structure
include::{generated}/tags-create-example/request-fields.asciidoc[]
include::{generated}/tags-create-example/request-fields.adoc[]
==== Example request
include::{generated}/tags-create-example/curl-request.asciidoc[]
include::{generated}/tags-create-example/curl-request.adoc[]
==== Example response
include::{generated}/tags-create-example/http-response.asciidoc[]
include::{generated}/tags-create-example/http-response.adoc[]
@@ -214,7 +214,7 @@ The Note resource is used to retrieve, update, and delete individual notes
[[resources-note-links]]
=== Links
include::{generated}/note-get-example/links.asciidoc[]
include::{generated}/note-get-example/links.adoc[]
@@ -225,15 +225,15 @@ A `GET` request will retrieve the details of a note
==== Response structure
include::{generated}/note-get-example/response-fields.asciidoc[]
include::{generated}/note-get-example/response-fields.adoc[]
==== Example request
include::{generated}/note-get-example/curl-request.asciidoc[]
include::{generated}/note-get-example/curl-request.adoc[]
==== Example response
include::{generated}/note-get-example/http-response.asciidoc[]
include::{generated}/note-get-example/http-response.adoc[]
@@ -244,17 +244,17 @@ A `PATCH` request is used to update a note
==== Request structure
include::{generated}/note-update-example/request-fields.asciidoc[]
include::{generated}/note-update-example/request-fields.adoc[]
To leave an attribute of a note unchanged, any of the above may be omitted from the request.
==== Example request
include::{generated}/note-update-example/curl-request.asciidoc[]
include::{generated}/note-update-example/curl-request.adoc[]
==== Example response
include::{generated}/note-update-example/http-response.asciidoc[]
include::{generated}/note-update-example/http-response.adoc[]
[[resources-tag]]
@@ -267,7 +267,7 @@ The Tag resource is used to retrieve, update, and delete individual tags
[[resources-tag-links]]
=== Links
include::{generated}/tag-get-example/links.asciidoc[]
include::{generated}/tag-get-example/links.adoc[]
@@ -278,15 +278,15 @@ A `GET` request will retrieve the details of a tag
==== Response structure
include::{generated}/tag-get-example/response-fields.asciidoc[]
include::{generated}/tag-get-example/response-fields.adoc[]
==== Example request
include::{generated}/tag-get-example/curl-request.asciidoc[]
include::{generated}/tag-get-example/curl-request.adoc[]
==== Example response
include::{generated}/tag-get-example/http-response.asciidoc[]
include::{generated}/tag-get-example/http-response.adoc[]
@@ -297,12 +297,12 @@ A `PATCH` request is used to update a tag
==== Request structure
include::{generated}/tag-update-example/request-fields.asciidoc[]
include::{generated}/tag-update-example/request-fields.adoc[]
==== Example request
include::{generated}/tag-update-example/curl-request.asciidoc[]
include::{generated}/tag-update-example/curl-request.adoc[]
==== Example response
include::{generated}/tag-update-example/http-response.asciidoc[]
include::{generated}/tag-update-example/http-response.adoc[]

View File

@@ -42,11 +42,11 @@ $ java -jar build/libs/*.jar
You can check that the service is up and running by executing a simple request using
cURL:
include::{generated}/index/1/curl-request.asciidoc[]
include::{generated}/index/1/curl-request.adoc[]
This request should yield the following response:
include::{generated}/index/1/http-response.asciidoc[]
include::{generated}/index/1/http-response.adoc[]
Note the `_links` in the JSON response. They are key to navigating the API.
@@ -58,26 +58,26 @@ Now that you've started the service and verified that it works, the next step is
it to create a new note. As you saw above, the URI for working with notes is included as
a link when you perform a `GET` request against the root of the service:
include::{generated}/index/1/http-response.asciidoc[]
include::{generated}/index/1/http-response.adoc[]
To create a note you need to execute a `POST` request to this URI, including a JSON
payload containing the title and body of the note:
include::{generated}/creating-a-note/1/curl-request.asciidoc[]
include::{generated}/creating-a-note/1/curl-request.adoc[]
The response from this request should have a status code of `201 Created` and contain a
`Location` header whose value is the URI of the newly created note:
include::{generated}/creating-a-note/1/http-response.asciidoc[]
include::{generated}/creating-a-note/1/http-response.adoc[]
To work with the newly created note you use the URI in the `Location` header. For example
you can access the note's details by performing a `GET` request:
include::{generated}/creating-a-note/2/curl-request.asciidoc[]
include::{generated}/creating-a-note/2/curl-request.adoc[]
This request will produce a response with the note's details in its body:
include::{generated}/creating-a-note/2/http-response.asciidoc[]
include::{generated}/creating-a-note/2/http-response.adoc[]
Note the `note-tags` link which we'll make use of later.
@@ -91,26 +91,26 @@ to tag a note, you must first create the tag.
Referring back to the response for the service's index, the URI for working with tags is
include as a link:
include::{generated}/index/1/http-response.asciidoc[]
include::{generated}/index/1/http-response.adoc[]
To create a tag you need to execute a `POST` request to this URI, including a JSON
payload containing the name of the tag:
include::{generated}/creating-a-note/3/curl-request.asciidoc[]
include::{generated}/creating-a-note/3/curl-request.adoc[]
The response from this request should have a status code of `201 Created` and contain a
`Location` header whose value is the URI of the newly created tag:
include::{generated}/creating-a-note/3/http-response.asciidoc[]
include::{generated}/creating-a-note/3/http-response.adoc[]
To work with the newly created tag you use the URI in the `Location` header. For example
you can access the tag's details by performing a `GET` request:
include::{generated}/creating-a-note/4/curl-request.asciidoc[]
include::{generated}/creating-a-note/4/curl-request.adoc[]
This request will produce a response with the tag's details in its body:
include::{generated}/creating-a-note/4/http-response.asciidoc[]
include::{generated}/creating-a-note/4/http-response.adoc[]
@@ -131,25 +131,25 @@ with it.
Once again we execute a `POST` request, but this time, in an array named tags, we include
the URI of the tag we just created:
include::{generated}/creating-a-note/5/curl-request.asciidoc[]
include::{generated}/creating-a-note/5/curl-request.adoc[]
Once again, the response's `Location` header tells use the URI of the newly created note:
include::{generated}/creating-a-note/5/http-response.asciidoc[]
include::{generated}/creating-a-note/5/http-response.adoc[]
As before, a `GET` request executed against this URI will retrieve the note's details:
include::{generated}/creating-a-note/6/curl-request.asciidoc[]
include::{generated}/creating-a-note/6/http-response.asciidoc[]
include::{generated}/creating-a-note/6/curl-request.adoc[]
include::{generated}/creating-a-note/6/http-response.adoc[]
To see the note's tags, execute a `GET` request against the URI of the note's
`note-tags` link:
include::{generated}/creating-a-note/7/curl-request.asciidoc[]
include::{generated}/creating-a-note/7/curl-request.adoc[]
The response shows that, as expected, the note has a single tag:
include::{generated}/creating-a-note/7/http-response.asciidoc[]
include::{generated}/creating-a-note/7/http-response.adoc[]
@@ -159,18 +159,18 @@ An existing note can be tagged by executing a `PATCH` request against the note's
a body that contains the array of tags to be associated with the note. We'll use the
URI of the untagged note that we created earlier:
include::{generated}/creating-a-note/8/curl-request.asciidoc[]
include::{generated}/creating-a-note/8/curl-request.adoc[]
This request should produce a `204 No Content` response:
include::{generated}/creating-a-note/8/http-response.asciidoc[]
include::{generated}/creating-a-note/8/http-response.adoc[]
When we first created this note, we noted the `note-tags` link included in its details:
include::{generated}/creating-a-note/2/http-response.asciidoc[]
include::{generated}/creating-a-note/2/http-response.adoc[]
We can use that link now and execute a `GET` request to see that the note now has a
single tag:
include::{generated}/creating-a-note/9/curl-request.asciidoc[]
include::{generated}/creating-a-note/9/http-response.asciidoc[]
include::{generated}/creating-a-note/9/curl-request.adoc[]
include::{generated}/creating-a-note/9/http-response.adoc[]