Skip to content

Instantly share code, notes, and snippets.

@n3dst4
Created March 6, 2014 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save n3dst4/9390621 to your computer and use it in GitHub Desktop.
Save n3dst4/9390621 to your computer and use it in GitHub Desktop.
API Blueprint Language notes

API Blueprint

Start with:

FORMAT: 1A

Apart from that the whole document is basically Markdown, but given special meaning to describe HTTP request/response interactions.

Rule of thumb: a markdown heading, of any level, introduces an interaction.

Markdown list formatting (lines beginning +, *, - etc.) are used for providing data relevant to an interaction.

Minimal Interaction:

# GET /
+ response 200

This puts the verb and the path in the header.

The minimal information to provide for this interaction is a response with no body, given as a list item starting with the word "response" and a status code.

We can nest all the verbs for a given path by using subheadings

# /
## GET
+ response 200

## POST
+ response 200

We can group related path enties together

# Group widgets
## /widgets
### GET
+ response 200

### POST
+ response 200

## /widgets/{id}
### GET
+ response 200

### POST
+ response 200

We can name the path and the method by using the markdown heading as Gruber intended, and putting the path or method in square brackets:

# Root [/]
## Root request [GET]
+ response 200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment