From afd2b209b57437d78c2d92df44710db251208fcd Mon Sep 17 00:00:00 2001 From: Pavan Kumar Sunkara Date: Mon, 14 Dec 2015 16:12:37 +0530 Subject: [PATCH] Implemented RFC0010 --- CHANGELOG.md | 13 +++++++++ README.md | 2 +- namespaces/api-description-namespace.md | 36 ++++++++++++++++++++++--- 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5832bb3..7bf61a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,18 @@ # Changelog All notable changes to the Refract project will be documented in this file. +## [0.6.0] - 2015-12-15 + +### Breaking + +#### API Description Namespace +- Changed `href` in HTTP Request Message from type `Href` to `Templated Href` +- Added `hrefVariables` as an attribute to HTTP Request Message. + +#### Parse Result Namespace +- Added Origin Link Relation +- Added Inferred Link Relation + ## [0.4.0] - 2015-08-15 ### Breaking @@ -45,6 +57,7 @@ All notable changes to the Refract project will be documented in this file. [0.4.0]: https://github.com/refractproject/refract-spec/compare/v0.3.0...v0.4.0 [0.3.0]: https://github.com/refractproject/refract-spec/compare/v0.2.0...v0.3.0 [0.2.0]: https://github.com/refractproject/refract-spec/compare/v0.1.0...v0.2.0 +[0.1.0]: https://github.com/refractproject/refract-spec/tree/v0.1.0 [RFC 0004]: https://github.com/refractproject/rfcs/blob/master/text/0004-clarify-api-namespace.md [RFC 0003]: https://github.com/refractproject/rfcs/blob/master/text/0003-class-rename.md diff --git a/README.md b/README.md index 012561d..162966a 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Refract is a recursive data structure for expressing complex structures, relatio ## Version -**Current Version**: 0.5.0 +**Current Version**: 0.6.0 **Note**: This specification is currently in development and may change before getting to a more stable 1.0 version. Please be mindful of this if using this production environments. diff --git a/namespaces/api-description-namespace.md b/namespaces/api-description-namespace.md index 7508d37..6052d3b 100644 --- a/namespaces/api-description-namespace.md +++ b/namespaces/api-description-namespace.md @@ -163,7 +163,7 @@ Note: At the moment only the HTTP protocol is supported. - `href` (Templated Href) - The URI template for this transition. If present, the value of the `href` attribute SHOULD be used to resolve - target URI of the transition. + the target URI of the transition. If not set, the parent `resource` element `href` attribute SHOULD be used to resolve the target URI of the transition. @@ -370,7 +370,21 @@ message pair. A transaction example MUST contain exactly one HTTP request and on "element": "httpRequest", "attributes": { "method": "GET", - "href": "https://polls.apiblueprint.org/questions/1" + "href": "/questions/{question_id}", + "hrefVariables": { + "element": "hrefVariables", + "content": [ + { + "element": "member", + "content": { + "key": { + "element": "string", + "content": "question_id" + } + } + } + ] + } }, "content": [] }, @@ -458,7 +472,23 @@ HTTP request message. - `element`: httpRequest (string, fixed) - `attributes` - `method` (string) - HTTP request method. The method value SHOULD be inherited from a parent transition if it is unset. - - `href` (Href) - A concrete URI for the request. The href SHOULD be inherited from a parent transition by expanding the href and hrefVariables if unset. + - `href` (Templated Href) - URI Template for this HTTP request. + + If present, the value of the `href` attribute SHOULD be used to resolve + the target URI of the http request. + + If not set, the `href` attribute which was used to resolve the target + URI of the parent transition SHOULD be used to resolve the URI of + the http request. + + - `hrefVariables` (Href Variables) - Input parameters + + Definition of any input URI path segments or URI query parameters for this transition. + + If `href` and `hrefVariables` attributes aren't set, the `hrefVariables` attribute + which was used to resolve the input parameters of the parent transition SHOULD + be used to resolve the http request input parameters. + ### HTTP Response Message (HTTP Message Payload)