This document describes the Examples Documentation Asciidoctor Quick Start.
1. Introduction
1.1. Common concept
The Examples Documentation Asciidoctor Quick Start is organized around REST
and built using the RxMicro framework.
The Examples Documentation Asciidoctor Quick Start has predictable resource-oriented URLs, accepts and returns JSON-encoded
requests/responses, and uses standard HTTP response codes, and verbs.
For requests and responses without body the Examples Documentation Asciidoctor Quick Start returns the empty body instead of the empty json object: |
You could use your favorite HTTP/REST library for your programming language to use The Examples Documentation Asciidoctor Quick Start.
1.2. HTTP Verbs
The Examples Documentation Asciidoctor Quick Start uses HTTP verbs appropriate to each action.
Verb | Description |
---|---|
GET |
Retrieving resource(s). |
POST |
Creating resource(s). |
PUT |
Full updating resource(s). |
PATCH |
Partial updating resource(s). |
DELETE |
Deleting resource(s). |
1.3. Error model
The Examples Documentation Asciidoctor Quick Start uses conventional HTTP response codes
to indicate the success or failure of an API request.
In general:
-
Codes in the
2xx
range indicate success. -
Codes in the
4xx
range indicate an error that failed given the information provided (e.g., a required parameter was omitted or has invalid format, etc.). -
Codes in the
5xx
range indicate an internal error with the Examples Documentation Asciidoctor Quick Start servers.
Successes differ from errors in that their body may not be a simple response object with a message. |
If error occurs, the Examples Documentation Asciidoctor Quick Start returns correspond HTTP status code and standard JSON error model:
{
"message": "'name' is required"
}
Message field provides detailed cause of the arisen error.
By default, the Examples Documentation Asciidoctor Quick Start hides the cause of the arisen server error. |
1.4. Default Not Found Handler
If The Examples Documentation Asciidoctor Quick Start does not have a route that matches the current HTTP request, by default it invokes Default Not Found Handler and returns a HTTP/1.1 400 Bad Request
response with default JSON body:
{
"message": "Handler not found"
}
Other REST frameworks typically use a Thus, on the client side, if the server returns |
Default Not Found Handler could be configured.
(If it necessary You could use HTTP/1.1 404 Not Found
response status code instead of HTTP/1.1 400 Bad Request
).
To use custom Default Not Found Handler start REST server with
|
1.5. License
The Examples Documentation Asciidoctor Quick Start is licensed under the Apache License Version 2.0.
1.6. Specification
The Examples Documentation Asciidoctor Quick Start documentation built using Ascii Doctor markup language.
2. Hello World Micro Service
2.1. GET /
2.1.1. Request
2.1.1.1. HTTP Request Example
GET / HTTP/1.1
Accept: application/json
Content-Length: 0
2.1.2. Response 200
2.1.2.1. HTTP Response Example
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 25
Request-Id: 62jJeu8x1310662
{
"message": "string"
}
2.1.2.2. HTTP Response Headers Description
Name |
Type |
Restrictions |
Description |
Request-Id |
|
|
An unique request string identifier. Read more:
|
2.1.2.3. HTTP Response Body Parameters Description
Name |
Type |
Restrictions |
Description |
message |
|
|
2.1.2.4. HTTP Response Body JSON Schema
{
"$schema": "http://json-schema.org/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"examples": [
"string"
]
}
},
"minProperties": 0,
"maxProperties": 1
}
2.1.3. Response 500
If internal server error detected.
2.1.3.1. HTTP Response Example
HTTP/1.1 500 Internal Server Error
Content-Type: application/json
Content-Length: 33
Request-Id: 62jJeu8x1310662
{
"message": "Internal Error"
}
2.1.3.2. HTTP Response Headers Description
Name |
Type |
Restrictions |
Description |
Request-Id |
|
|
An unique request string identifier. Read more:
|
2.1.3.3. HTTP Response Body Parameters Description
Name |
Type |
Restrictions |
Description |
message |
|
|
|