Skip to content

Commit e140573

Browse files
committed
Deployments API is no longer an encoded JSON string
1 parent 2aeb083 commit e140573

2 files changed

Lines changed: 23 additions & 2 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
kind: change
3+
title: New Payload format for Deployments
4+
created_at: 2014-03-03
5+
author_name: atmos
6+
---
7+
8+
As we [iterate on the preview][january-deployment-api-post] for the new Deployment API, we're making sure that it's friendly to work with for the apps built on top of it.
9+
10+
## Deserialize Deployment Payloads
11+
12+
To make the API even easier to use, we'll now return your custom payload as a JSON object along with the rest of the Deployment resource. No need to parse it as JSON again.
13+
14+
## Code you need to update
15+
16+
You should only need to remove the JSON parsing if you're taking advantage of the custom payloads. The formats for creating Deployments remain unchanged.
17+
18+
As always, if you have any questions or feedback, please [get in touch][contact].
19+
20+
[january-deployment-api-post]: /changes/2014-01-09-preview-the-new-deployments-api/
21+
[contact]: https://github.com/contact?form[subject]=Deployments+API

lib/resources.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1567,7 +1567,7 @@ def text_html(response, status, head = {})
15671567
"sha" => "a84d88e7554fc1fa21bcbc4efae3c782a70d2b9d",
15681568
"url" => "https://api.github.com/repos/octocat/example/deployments/1",
15691569
"creator" => USER,
1570-
"payload" => JSON.dump({:environment => 'production'}),
1570+
"payload" => {:environment => 'production'},
15711571
"created_at" => "2012-07-20T01:19:13Z",
15721572
"updated_at" => "2012-07-20T01:19:13Z",
15731573
"description" => "Deploy request from hubot",
@@ -1579,7 +1579,7 @@ def text_html(response, status, head = {})
15791579
"url" => "https://api.github.com/repos/octocat/example/deployments/1/statuses/42",
15801580
"state" => "success",
15811581
"creator" => USER,
1582-
"payload" => JSON.dump({:environment => 'production'}),
1582+
"payload" => {:environment => 'production'},
15831583
"target_url" => "https://gist.github.com/628b2736d379f",
15841584
"created_at" => "2012-07-20T01:19:13Z",
15851585
"updated_at" => "2012-07-20T01:19:13Z",

0 commit comments

Comments
 (0)