Skip to content
This repository was archived by the owner on Nov 1, 2017. It is now read-only.

Commit d9b855c

Browse files
author
Hubot
committed
Sync changes from upstream repository
1 parent fec818e commit d9b855c

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: Reactions API Preview now includes user information
3+
author_name: kneemer
4+
---
5+
6+
To avoid making extra API calls, we've updated the [Reactions API preview][initial-reaction-api-post] to include additional user information when listing Reactions.
7+
8+
**This is a breaking change for Reaction payloads**. If you're trying out this new API during its preview period, you'll need to update your code to continue working with it.
9+
10+
## JSON Payload Changes
11+
12+
We're replacing the `user_id` attribute with `user` and changing the schema type from a number to a JSON object.
13+
14+
## Example Reaction JSON
15+
```json
16+
[
17+
{
18+
"id": 1,
19+
"user": {
20+
"login": "octocat",
21+
"id": 1,
22+
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
23+
"gravatar_id": "",
24+
"url": "https://api.github.com/users/octocat",
25+
"html_url": "https://github.com/octocat",
26+
"followers_url": "https://api.github.com/users/octocat/followers",
27+
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
28+
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
29+
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
30+
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
31+
"organizations_url": "https://api.github.com/users/octocat/orgs",
32+
"repos_url": "https://api.github.com/users/octocat/repos",
33+
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
34+
"received_events_url": "https://api.github.com/users/octocat/received_events",
35+
"type": "User",
36+
"site_admin": false
37+
},
38+
"content": "heart"
39+
}
40+
]
41+
```
42+
43+
As always, if you have any questions or feedback, please [get in touch][contact].
44+
45+
[initial-reaction-api-post]: /changes/2016-05-12-reactions-api-preview
46+
[contact]: https://github.com/contact?form%5Bsubject%5D=Reactions+API+Preview

lib/responses/reactions.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
require_relative 'user'
2+
13
module GitHub
24
module Resources
35
module Responses
46
REACTION ||= {
57
"id": 1,
6-
"user_id": 1,
8+
"user" => USER,
79
"content": "heart"
810
}
911

0 commit comments

Comments
 (0)