Skip to content
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

Merge the create a file in a repository API and the update a file in a repository API #19008

Open
lchrennew opened this issue Mar 5, 2022 · 3 comments
Labels
modifies/api This PR adds API routes or modifies them type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@lchrennew
Copy link

Feature Description

The update a file in a repostory API should compatible with the corresponding Github API:
https://docs.github.com/en/rest/reference/repos#create-or-update-file-contents

Creates a new file or replaces an existing file in a repository.

PUT /repos/{owner}/{repo}/contents/{path}

Screenshots

image

@lunny lunny added type/proposal The new feature has not been accepted yet but needs to be discussed first. modifies/api This PR adds API routes or modifies them labels Mar 5, 2022
smallfish06 added a commit to smallfish06/gitea that referenced this issue Feb 26, 2024
@smallfish06
Copy link

smallfish06 commented Feb 26, 2024

I wrote a preview pr as #29419 (test and swagger are not well prepared)

While using popular repository https://github.com/google/go-github. I found create/upsert file API is yet different with Github API

Since I don't know history of this feature, but also curious that creating contents is quite important API when using git with code. (https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md#github-api-compatibility)

Can somebody tell me about this?

As @lunny mentioned, this is breaking change of API

@lunny
Copy link
Member

lunny commented Feb 26, 2024

I think you can mark one as deprecated first but not remove it.

@smallfish06
Copy link

Thank you for replying. That would be nice.
I'll open pr with POST Create marked as deprecated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
modifies/api This PR adds API routes or modifies them type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

3 participants