Skip to content

Fixed the @return type for Repo::readme() #627

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 13, 2017

Conversation

brandonkelly
Copy link
Contributor

No description provided.

@acrobat
Copy link
Collaborator

acrobat commented Sep 21, 2017

Doesn't it return an array? https://developer.github.com/v3/repos/contents/#response

@brandonkelly
Copy link
Contributor Author

By default, the API request will be sent with an Accept: application/vnd.github.raw header, which tells GitHub to return only the raw README contents.

See for yourself:

curl https://api.github.com/repos/craftcms/cms/readme -H "Accept: application/vnd.github.raw"

The only way to get an array returned is to set the $format argument to one of the supported json content types, e.g. v3+json.

I’ve just updated the PR to document both string and array return types, as well as included v3+json in the documented allowed $format values.

Copy link
Collaborator

@acrobat acrobat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you're right! Thanks!

@acrobat acrobat merged commit 13003af into KnpLabs:master Oct 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants