Skip to content

Commit

Permalink
Affordances
Browse files Browse the repository at this point in the history
  • Loading branch information
kylef committed Oct 1, 2015
1 parent c02a62f commit 6c00362
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions draft/affordances.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
RFC: XXXX
Author: Kyle Fuller
Status: Draft
Created: 2015-09-21
Last Modified: 2015-09-21
---

# API Blueprint RFC XXXX: Affordances

## Table of Contents

- [Abstract](#abstract)
- [Rationale](#rationale)
- [Example](#example)

## Abstract

This RFC proposes that you can define affordances (link relations) that an API
resource or action provides.

## Rationale

This RFC proposes adding an `Affordances` section into API Blueprint that
sits under a resource or action providing the affodances that it provides.

### Example

To describe affordances from a `Question` resource to two other resources, we
can describe them within the affordances section as follows:

```apib
## Question [/question/{id}]

+ Parameters
+ id: 1

+ Affordances
+ `create_comment` (Comments[create])
+ `author` (User)
```

Where `Comment` is a resource named `Comment` that has a `create` relation
identifier and User is another resource.

```apib
## Comments [/comments]
### Create Comment [PUT]
+ Relation: create

## User [/user/{username}]

+ Parameters
+ username
```

0 comments on commit 6c00362

Please sign in to comment.