Skip to content

fix(swagger): Add dedicated endpoint for contents-ext root directory access #34930

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

Closed
wants to merge 1 commit into from

Conversation

rickyma
Copy link
Contributor

@rickyma rickyma commented Jul 2, 2025

The contents-ext API has two routes - one for root directory and one for
specific paths, but only the path-specific endpoint was documented in Swagger.
This caused validation errors in auto-generated clients and Swagger UI when
trying to access the root directory.

Changes:

  • Add /repos/{owner}/{repo}/contents-ext endpoint for root directory access
  • Keep existing /repos/{owner}/{repo}/contents-ext/{filepath} for path access
  • Both endpoints share the same implementation but have different Swagger docs

Fixes validation errors when using auto-generated API clients and Swagger UI
to access repository root contents via the contents-ext endpoint.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jul 2, 2025
@github-actions github-actions bot added the modifies/api This PR adds API routes or modifies them label Jul 2, 2025
@rickyma rickyma changed the title fix(swagger): make filepath parameter optional in contents-ext API fix(swagger): Add dedicated endpoint for contents-ext root directory access Jul 2, 2025
@rickyma
Copy link
Contributor Author

rickyma commented Jul 2, 2025

@wxiaoguang
I found out the swagger json is auto-generated. We have to add a new endpoint in the backend.
Or maybe we support passing / through filepath?

@wxiaoguang
Copy link
Contributor

Or maybe we support passing / through filepath?

No because there is no / in git path.

@wxiaoguang
Copy link
Contributor

merged into Support getting lastCommitMessage using contents-ext API #34904

@wxiaoguang wxiaoguang closed this Jul 2, 2025
@rickyma
Copy link
Contributor Author

rickyma commented Jul 2, 2025

Thanks. Can't wait to apply the PR #34904 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/api This PR adds API routes or modifies them
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants