Skip to content

Commit 79c6193

Browse files
committed
Merge pull request #51 from refractproject/pksunkara/href-variables
Implemented RFC0010
2 parents a652d88 + afd2b20 commit 79c6193

File tree

3 files changed

+47
-4
lines changed

3 files changed

+47
-4
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
# Changelog
22
All notable changes to the Refract project will be documented in this file.
33

4+
## [0.6.0] - 2015-12-15
5+
6+
### Breaking
7+
8+
#### API Description Namespace
9+
- Changed `href` in HTTP Request Message from type `Href` to `Templated Href`
10+
- Added `hrefVariables` as an attribute to HTTP Request Message.
11+
12+
#### Parse Result Namespace
13+
- Added Origin Link Relation
14+
- Added Inferred Link Relation
15+
416
## [0.4.0] - 2015-08-15
517

618
### Breaking
@@ -45,6 +57,7 @@ All notable changes to the Refract project will be documented in this file.
4557
[0.4.0]: https://github.com/refractproject/refract-spec/compare/v0.3.0...v0.4.0
4658
[0.3.0]: https://github.com/refractproject/refract-spec/compare/v0.2.0...v0.3.0
4759
[0.2.0]: https://github.com/refractproject/refract-spec/compare/v0.1.0...v0.2.0
60+
[0.1.0]: https://github.com/refractproject/refract-spec/tree/v0.1.0
4861

4962
[RFC 0004]: https://github.com/refractproject/rfcs/blob/master/text/0004-clarify-api-namespace.md
5063
[RFC 0003]: https://github.com/refractproject/rfcs/blob/master/text/0003-class-rename.md

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Refract is a recursive data structure for expressing complex structures, relatio
1111

1212
## Version
1313

14-
**Current Version**: 0.5.0
14+
**Current Version**: 0.6.0
1515

1616
**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.
1717

namespaces/api-description-namespace.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ Note: At the moment only the HTTP protocol is supported.
163163
- `href` (Templated Href) - The URI template for this transition.
164164

165165
If present, the value of the `href` attribute SHOULD be used to resolve
166-
target URI of the transition.
166+
the target URI of the transition.
167167

168168
If not set, the parent `resource` element `href` attribute SHOULD be
169169
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
370370
"element": "httpRequest",
371371
"attributes": {
372372
"method": "GET",
373-
"href": "https://polls.apiblueprint.org/questions/1"
373+
"href": "/questions/{question_id}",
374+
"hrefVariables": {
375+
"element": "hrefVariables",
376+
"content": [
377+
{
378+
"element": "member",
379+
"content": {
380+
"key": {
381+
"element": "string",
382+
"content": "question_id"
383+
}
384+
}
385+
}
386+
]
387+
}
374388
},
375389
"content": []
376390
},
@@ -458,7 +472,23 @@ HTTP request message.
458472
- `element`: httpRequest (string, fixed)
459473
- `attributes`
460474
- `method` (string) - HTTP request method. The method value SHOULD be inherited from a parent transition if it is unset.
461-
- `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.
475+
- `href` (Templated Href) - URI Template for this HTTP request.
476+
477+
If present, the value of the `href` attribute SHOULD be used to resolve
478+
the target URI of the http request.
479+
480+
If not set, the `href` attribute which was used to resolve the target
481+
URI of the parent transition SHOULD be used to resolve the URI of
482+
the http request.
483+
484+
- `hrefVariables` (Href Variables) - Input parameters
485+
486+
Definition of any input URI path segments or URI query parameters for this transition.
487+
488+
If `href` and `hrefVariables` attributes aren't set, the `hrefVariables` attribute
489+
which was used to resolve the input parameters of the parent transition SHOULD
490+
be used to resolve the http request input parameters.
491+
462492

463493
### HTTP Response Message (HTTP Message Payload)
464494

0 commit comments

Comments
 (0)