From 8ed6d1a4a66ac0eace84d19b02e07b01d63ee353 Mon Sep 17 00:00:00 2001 From: Pavan Kumar Sunkara Date: Mon, 13 Oct 2014 12:34:09 +0200 Subject: [PATCH 1/2] Resource models can now be referenced before they are defined --- API Blueprint Specification.md | 4 ++-- Tutorial.md | 4 ++-- examples/8. Resource Model.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/API Blueprint Specification.md b/API Blueprint Specification.md index 262432a..4ed593b 100644 --- a/API Blueprint Specification.md +++ b/API Blueprint Specification.md @@ -366,7 +366,7 @@ This section **should** include at least one following nested sections: If there is no nested section the content of the payload section is considered as content of the [Body section](#def-body-section). #### Referencing -Instead of providing a payload section content a previously defined [model payload section](#def-model-section) can be referenced using the Markdown implicit [reference syntax][]: +Instead of providing a payload section content a [model payload section](#def-model-section) can be referenced using the Markdown implicit [reference syntax][]: [][] @@ -613,7 +613,7 @@ Defined by the `Model` keyword followed by an optional media type: A [resource manifestation](http://www.w3.org/TR/di-gloss/#def-resource-manifestation) - one exemplar representation of the resource in the form of a [payload](#def-payload-section). #### Referencing -The payload defined in this section **may** be referenced later using parent section's identifier. You can refer to this payload in any of the following [Request](#def-request-section) or [Response](#def-response-section) payload sections using the Markdown implicit [reference syntax][]. +The payload defined in this section **may** be referenced in any response or request section in the document using parent section's identifier. You can refer to this payload in any of the following [Request](#def-request-section) or [Response](#def-response-section) payload sections using the Markdown implicit [reference syntax][]. #### Example diff --git a/Tutorial.md b/Tutorial.md index 80fae5b..b01512d 100644 --- a/Tutorial.md +++ b/Tutorial.md @@ -246,7 +246,7 @@ The *"id"* variable of the URI template is a parameter to every action on this r "content": "String contents" } -Resource Model is an example representation of the Gist resource. It can be referenced later at any point where a response (or request) payload is expected. A resource model has *exactly* the same structure as a response payload. In this case it also includes additional description. A Resource Model may not include a response status code. +Resource Model is an example representation of the Gist resource. It can be referenced elsewhere at any point where a response (or request) payload is expected. A resource model has *exactly* the same structure as a response payload. In this case it also includes additional description. A Resource Model may not include a response status code. #### Referring the Resource Model @@ -258,7 +258,7 @@ Resource Model is an example representation of the Gist resource. It can be refe With Gist Resource Model in place it is super easy to define an action that retrieves a single gist. -> **NOTE:** The syntax for referencing a resource model is `[][]`. You can only refer to *already defined models*. The model must be referred as "whole" - you can't reuse just a model's body or headers. +> **NOTE:** The syntax for referencing a resource model is `[][]`. The model must be referred as "whole" - you can't reuse just a model's body or headers. ## Modifying a Resource Let's add an action to our Gist Resource that will allow us to modify its state and another action that deletes a Gist Resource as whole. diff --git a/examples/8. Resource Model.md b/examples/8. Resource Model.md index 3309f8b..bd394d1 100644 --- a/examples/8. Resource Model.md +++ b/examples/8. Resource Model.md @@ -3,7 +3,7 @@ FORMAT: 1A # Resource Model API Resource model is a [resource manifestation](http://www.w3.org/TR/di-gloss/#def-resource-manifestation). One particular representation of your resource. -Furthermore, in API Blueprint, any `resource model` you have defined can be referenced later saving you lots of time maintaining your API blueprint. You simply define a resource model as any payload (e. g. [request](https://github.com/apiaryio/api-blueprint/blob/master/examples/6.%20Requests.md) or [response](https://github.com/apiaryio/api-blueprint/blob/master/examples/5.%20Responses.md)) and then reference it later where you would normally write a `request` or `response`. +Furthermore, in API Blueprint, any `resource model` you have defined can be referenced in a request or response section, saving you lots of time maintaining your API blueprint. You simply define a resource model as any payload (e. g. [request](https://github.com/apiaryio/api-blueprint/blob/master/examples/6.%20Requests.md) or [response](https://github.com/apiaryio/api-blueprint/blob/master/examples/5.%20Responses.md)) and then reference it later where you would normally write a `request` or `response`. ## API Blueprint + [Previous: Parameters](7.%20Parameters.md) From cd2e957a9b19f442ae84891232babaffe7014712 Mon Sep 17 00:00:00 2001 From: Pavan Kumar Sunkara Date: Mon, 13 Oct 2014 12:35:05 +0200 Subject: [PATCH 2/2] Increment API Blueprint version to 1A7 --- API Blueprint Specification.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/API Blueprint Specification.md b/API Blueprint Specification.md index 4ed593b..48f487c 100644 --- a/API Blueprint Specification.md +++ b/API Blueprint Specification.md @@ -1,12 +1,12 @@ --- Author: z@apiary.io -Version: 1A6 +Version: 1A7 --- # API Blueprint -#### Format 1A revision 6 +#### Format 1A revision 7 ## [I. API Blueprint Language](#def-api-blueprint-language) 1. [Introduction](#def-introduction)