This repository has been archived by the owner on Nov 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #198 from LinusU/patch-1
spec: allow named endpoints
- Loading branch information
Showing
4 changed files
with
53 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
--- | ||
|
||
Author: [email protected] | ||
Version: 1A8 | ||
Version: 1A9 | ||
|
||
--- | ||
|
||
# API Blueprint | ||
#### Format 1A revision 8 | ||
#### Format 1A revision 9 | ||
|
||
## [I. API Blueprint Language](#def-api-blueprint-language) | ||
+ [Introduction](#def-introduction) | ||
|
@@ -534,7 +534,13 @@ Defined by an [HTTP request method][httpmethods] followed by [URI template][urit | |
|
||
# <HTTP request method> <URI template> | ||
|
||
> **NOTE:** In this case the rest of this section represents the [Action section](#def-action-section) including its description and nested sections and **follows the rules of Action section instead**. | ||
**-- or --** | ||
|
||
Defined by a resource [name (identifier)](#def-identifier) followed by an [HTTP request method][httpmethods] and an [URI template][uritemplate] enclosed in square brackets `[]`: | ||
|
||
# <identifier> [<HTTP request method> <URI template>] | ||
|
||
> **NOTE:** In the latter two cases the rest of this section represents the [Action section](#def-action-section) including its description and nested sections and **follows the rules of Action section instead**. | ||
#### Description | ||
An API [resource](http://www.w3.org/TR/di-gloss/#def-resource) as specified by its *URI* or a set of resources (a resource template) matching its *URI template*. | ||
|
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,42 @@ | ||
FORMAT: 1A | ||
|
||
# Named Endpoints API | ||
This API example demonstrates how to define a standalone endpoint with an identifier. | ||
|
||
## API Blueprint | ||
+ [Previous: Advanced Action](12.%20Advanced%20Action.md) | ||
+ [This: Raw API Blueprint](https://raw.github.com/apiaryio/api-blueprint/master/examples/13.%20Named%20Endpoints.md) | ||
|
||
# Group Quick start | ||
|
||
## Create message [POST /messages] | ||
|
||
Start out by creating a message for the world to see. | ||
|
||
+ Request (application/json) | ||
|
||
{ "message": "Hello World!" } | ||
|
||
+ Response 201 | ||
|
||
+ Headers | ||
|
||
Location: /messages/1337 | ||
|
||
## Create a new task [POST /tasks] | ||
|
||
Now create a task that you need to do at a later date. | ||
|
||
+ Request (application/json) | ||
|
||
{ | ||
"name": "Exercise in gym", | ||
"done": false, | ||
"type": "task" | ||
} | ||
|
||
+ Response 201 | ||
|
||
+ Headers | ||
|
||
Location: /tasks/1992 |