Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Commit d204824

Browse files
committed
Merge pull request #198 from LinusU/patch-1
spec: allow named endpoints
2 parents c9e6099 + 57cd495 commit d204824

File tree

4 files changed

+53
-4
lines changed

4 files changed

+53
-4
lines changed

API Blueprint Specification.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22

33
4-
Version: 1A8
4+
Version: 1A9
55

66
---
77

88
# API Blueprint
9-
#### Format 1A revision 8
9+
#### Format 1A revision 9
1010

1111
## [I. API Blueprint Language](#def-api-blueprint-language)
1212
+ [Introduction](#def-introduction)
@@ -534,7 +534,13 @@ Defined by an [HTTP request method][httpmethods] followed by [URI template][urit
534534

535535
# <HTTP request method> <URI template>
536536

537-
> **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**.
537+
**-- or --**
538+
539+
Defined by a resource [name (identifier)](#def-identifier) followed by an [HTTP request method][httpmethods] and an [URI template][uritemplate] enclosed in square brackets `[]`:
540+
541+
# <identifier> [<HTTP request method> <URI template>]
542+
543+
> **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**.
538544
539545
#### Description
540546
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*.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ API Blueprint, its parser, and most of its tools are completely open sourced so
2020

2121
## Format support
2222

23-
* Current format: [1A8](https://github.com/apiaryio/api-blueprint/releases/tag/format-1A8)
23+
* Current format: [1A9](https://github.com/apiaryio/api-blueprint/releases/tag/format-1A9)
2424
* Format supported by Apiary: [1A8](https://github.com/apiaryio/api-blueprint/releases/tag/format-1A8)
2525

2626
## Getting started with API Blueprint

examples/12. Advanced Action.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ A resource action is – in fact – a state transition. This API example demons
66
## API Blueprint
77
+ [Previous: Resource Model](11.%20Resource%20Model.md)
88
+ [This: Raw API Blueprint](https://raw.github.com/apiaryio/api-blueprint/master/examples/12.%20Advanced%20Action.md)
9+
+ [Next: Named Endpoints](13.%20Named%20Endpoints.md)
910

1011
# Tasks [/tasks/tasks{?status,priority}]
1112

examples/13. Named Endpoints.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
FORMAT: 1A
2+
3+
# Named Endpoints API
4+
This API example demonstrates how to define a standalone endpoint with an identifier.
5+
6+
## API Blueprint
7+
+ [Previous: Advanced Action](12.%20Advanced%20Action.md)
8+
+ [This: Raw API Blueprint](https://raw.github.com/apiaryio/api-blueprint/master/examples/13.%20Named%20Endpoints.md)
9+
10+
# Group Quick start
11+
12+
## Create message [POST /messages]
13+
14+
Start out by creating a message for the world to see.
15+
16+
+ Request (application/json)
17+
18+
{ "message": "Hello World!" }
19+
20+
+ Response 201
21+
22+
+ Headers
23+
24+
Location: /messages/1337
25+
26+
## Create a new task [POST /tasks]
27+
28+
Now create a task that you need to do at a later date.
29+
30+
+ Request (application/json)
31+
32+
{
33+
"name": "Exercise in gym",
34+
"done": false,
35+
"type": "task"
36+
}
37+
38+
+ Response 201
39+
40+
+ Headers
41+
42+
Location: /tasks/1992

0 commit comments

Comments
 (0)