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

Commit

Permalink
Merge pull request #198 from LinusU/patch-1
Browse files Browse the repository at this point in the history
spec: allow named endpoints
  • Loading branch information
pksunkara committed Jun 8, 2015
2 parents c9e6099 + 57cd495 commit d204824
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 4 deletions.
12 changes: 9 additions & 3 deletions API Blueprint Specification.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---

Author: z@apiary.io
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)
Expand Down Expand Up @@ -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*.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ API Blueprint, its parser, and most of its tools are completely open sourced so

## Format support

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

## Getting started with API Blueprint
Expand Down
1 change: 1 addition & 0 deletions examples/12. Advanced Action.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ A resource action is – in fact – a state transition. This API example demons
## API Blueprint
+ [Previous: Resource Model](11.%20Resource%20Model.md)
+ [This: Raw API Blueprint](https://raw.github.com/apiaryio/api-blueprint/master/examples/12.%20Advanced%20Action.md)
+ [Next: Named Endpoints](13.%20Named%20Endpoints.md)

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

Expand Down
42 changes: 42 additions & 0 deletions examples/13. Named Endpoints.md
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

0 comments on commit d204824

Please sign in to comment.