Add "depth" parameter to contents API endpoint #7939

Open
opened 2025-11-02 07:42:16 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @liquidaty on GitHub (Oct 6, 2021).

Feature Description

Hi,

Would love to be able to do:
/repos/{owner}/{repo}/contents/?depth=n

to return metadata on all repo objects to a depth of n, e.g. if my repo contains:

root.json
dir1/level1.json
dir1/level1a.json
dir1/dir2/level2.json
dir1/dir2/level2a.json

then depth = 1 is the same as the API is today, returning root.json and dir1

depth = 2 returns root.json, dir1/level1.json, dir1/level1a.json, and dir1/dir2

depth = 3 returns all 5 files

Screenshots

No response

Originally created by @liquidaty on GitHub (Oct 6, 2021). ### Feature Description Hi, Would love to be able to do: /repos/{owner}/{repo}/contents/?depth=n to return metadata on all repo objects to a depth of n, e.g. if my repo contains: root.json dir1/level1.json dir1/level1a.json dir1/dir2/level2.json dir1/dir2/level2a.json then depth = 1 is the same as the API is today, returning root.json and dir1 depth = 2 returns root.json, dir1/level1.json, dir1/level1a.json, and dir1/dir2 depth = 3 returns all 5 files ### Screenshots _No response_
GiteaMirror added the type/proposaltype/enhancementmodifies/api labels 2025-11-02 07:42:17 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7939