Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 1, 2017. It is now read-only.

Commit6f0706b

Browse files
committed
Clarify the intent of the object media param
It should be about returning all objects in a consistent formatas opposed to the specific use case involving directories.
1 parent1763119 commit6f0706b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

‎content/v3/repos/contents.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ This method returns the contents of a file or directory in a repository.
3636
GET /repos/:owner/:repo/contents/:path
3737

3838
Files and symlinks support[a custom media type](#custom-media-types) for retrieving the raw content or rendered HTML (when supported).
39-
Directories support[a custom media type](#custom-media-types) for retrieving the content as an object rather than an array of its entries.
40-
Submodules do_not_ support custom media types.
39+
All content types support[a custom media type](#custom-media-types) to ensure the content is returned in a consistent object format.
4140

4241
{{#tip}}
4342

@@ -283,12 +282,13 @@ curl -L https://api.github.com/repos/octokit/octokit.rb/tarball > octokit.tar.gz
283282

284283
Use the`.raw` media type to retrieve the contents of the file.
285284

286-
[Directories](#get-contents) supportthefollowing custommedia type:
285+
For markup files such as Markdown or AsciiDoc, you can retrievetherendered HTML using the`.html`media type. Markup languages are rendered to HTML using our open-source[Markup library](https://github.com/github/markup).
287286

288-
application/vnd.github.VERSION.object
287+
[All objects](#get-contents) support the following custom media type:
289288

290-
Use the`.object` media type to retrieve the directory contents as an object rather than an array of its entries.
289+
application/vnd.github.VERSION.object
291290

292-
For markup files such as Markdown or AsciiDoc, you can retrieve the rendered HTML using the`.html` media type. Markup languages are rendered to HTML using our open-source[Markup library](https://github.com/github/markup).
291+
Use the`.object` media type to retrieve the contents in a consistent object format regardless of the content type. For example, instead of an array of objects
292+
for a directory, the response will be an object with an`entries` attribute containing the array of objects.
293293

294294
You can read more about the use of media types in the API[here](/v3/media/).

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp