Skip to content

Commit b182df2

Browse files
committed
Merge pull request github#188 from github/introduce-v3-media-type
Document v3 media type, emails response
2 parents d352545 + 8441801 commit b182df2

File tree

4 files changed

+40
-12
lines changed

4 files changed

+40
-12
lines changed

content/index.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ to the actual date.
2424
We consider the "beta" API unchangeable. [File a support issue](https://github.com/contact)
2525
if you have problems.
2626

27-
#### Expected Changes <a name="changes"></a>
27+
#### Expected Changes
2828

2929
These changes are _not_ implemented, just planned for the next major API version.
3030

@@ -42,19 +42,10 @@ objects.
4242
* `[ ]` Use the `private` attribute when creating a private repository,
4343
instead of setting `public` to false.
4444
* `[ ]` Use JSON to POST to the "repos/:owner/:repo/forks" endpoint, instead of a query string.
45-
* `[ ]` User Emails come back as a hash instead of a string.
46-
47-
{"email": "email@whatev.com", "state": "verified"}
45+
* `[✓]` <del>User Emails come back [as a hash][v3-email] instead of a string.</del>
4846

4947
### Breaking Beta Changes
5048

51-
##### August 30, 2012
52-
* Added `repo:status` scope
53-
* Added Status API
54-
55-
##### August 7, 2012
56-
* Clarified watching/stargazing
57-
5849
##### June 12, 2012:
5950
* Removed API v1 support
6051
* Removed API v2 support
@@ -77,3 +68,5 @@ objects.
7768
returned in the Link header instead.
7869
* JSON-P response has completely changed to a more consistent format.
7970
* Starring gists now uses PUT verb (instead of POST) and returns 204.
71+
72+
[v3-email]: /v3/users/emails/#future-response

content/v3/media.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,19 @@ for the `X-GitHub-Media-Type` header:
4747
HTTP/1.1 200 OK
4848
X-GitHub-Media-Type: github.v3; param=full; format=json
4949

50-
For specifics on versions, check the [API changelog](/v3/changelog).
50+
51+
## API v3 media type and the future
52+
53+
Ultimately, we aim for a version-less, [Hypermedia][hypermedia]-driven API.
54+
Before we get there, we [expect a few changes][expected-changes]. As we roll
55+
out these changes, certain methods will support the API v3 media type:
56+
57+
application/vnd.github.v3
58+
59+
We'll clearly mark those methods that publicly support the v3 media type.
60+
61+
**NOTE:** _Using the v3 media type for methods other than those marked may yield
62+
unexpected results._
5163

5264
## Comment Body Properties
5365

@@ -118,3 +130,5 @@ The Commit, Commit Comparison, and Pull Request resources support
118130
[gfm]:http://github.github.com/github-flavored-markdown/
119131
[git-diff]: http://git-scm.com/docs/git-diff
120132
[git-patch]: http://git-scm.com/docs/git-format-patch
133+
[hypermedia]: /v3/#hypermedia
134+
[expected-changes]: /#expected-changes

content/v3/users/emails.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,19 @@ authenticated.
1818

1919
<%= headers 200 %>
2020
<%= json ["octocat@github.com", "support@github.com"] %>
21+
<br>
22+
23+
#### Future response
24+
25+
In the final version of the API, this method will return an array of hashes
26+
with extended information for each email address indicating if the address has
27+
been verified and if it's the user's primary email address for GitHub.
28+
29+
Until API v3 is finalized, use the `application/vnd.github.v3`
30+
[mediatype][media-types] to get this response format.
31+
32+
<%= headers 200 %>
33+
<%= json(:user_email) {|e| [e]} %>
2134

2235
## Add email address(es)
2336

@@ -48,3 +61,5 @@ You can include a single email address or an array of addresses:
4861

4962
<%= headers 204 %>
5063

64+
65+
[media-types]: /v3/media

lib/resources.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,6 +1014,12 @@ def text_html(response, status, head = {})
10141014
"C",
10151015
"C++"
10161016
]
1017+
1018+
USER_EMAIL = {
1019+
:email => "octocat@github.com",
1020+
:verified => true,
1021+
:primary => true
1022+
}
10171023
end
10181024
end
10191025

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy