From 6c003621b19dc70e8dd9427e4b3af5f542117865 Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Mon, 21 Sep 2015 21:17:16 -0700 Subject: [PATCH] Affordances --- draft/affordances.md | 56 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 draft/affordances.md diff --git a/draft/affordances.md b/draft/affordances.md new file mode 100644 index 0000000..8646703 --- /dev/null +++ b/draft/affordances.md @@ -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 +``` +