Reputation: 812
I want to fetch all repos that are templates from my account.
I tried to fetch single repo according to this https://docs.github.com/en/rest/reference/repos#get-a-repository
and then filter the response by "is_template" key as it is described in the docs.
The problem is don't get this field in the response, other values are alright.
This is the request I do: https://api.github.com/repos/my-account/test
I'm authenticated, i'm on my own account, I try to fetch my own repo.
Questions:
Upvotes: 0
Views: 865
Reputation: 2718
I believe you need to opt-in with the preview header to receive the new is_template
field on the response.
This curl request works for me:
$ curl -s -H "Accept: application/vnd.github.baptiste-preview+json" https://api.github.com/repos/octokit/octokit.net | grep "is_template"
"is_template": false,
Whereas this one does not return any output:
curl -s https://api.github.com/repos/octokit/octokit.net | grep "is_template"
Upvotes: 1