You need to make a request to this endpoint:
https://developer.github.com/v3/git/trees/#get-a-tree-recursively
So, give this a try:
https://api.github.com/repos/elasticsearch/elasticsearch/git/trees/master?recursive=1
Question
I've been playing around with the github api (V3) recently. I would like to get a list of all files and sub files in the primary repo of the current commit.
I can run
https://api.github.com/repos/elasticsearch/elasticsearch/contents/
and send many more requests to crawl the directories. However the documentation mentions that I could use the tree api to get all the results. But
https://api.github.com/repos/elasticsearch/elasticsearch/contents/?recursive=1
returns the same contents. Can I get all the file paths in a single request?
Solution
You need to make a request to this endpoint:
https://developer.github.com/v3/git/trees/#get-a-tree-recursively
So, give this a try:
https://api.github.com/repos/elasticsearch/elasticsearch/git/trees/master?recursive=1