Fix diffpatch API endpoint (#35610)

Fix the swagger documentation for the `diffpatch` API endpoint,
and fix the wrong API path caused by a refactoring change.

Closes #35602

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Surya Purohit
2025-10-09 22:09:14 +05:30
committed by GitHub
parent 0bc129481d
commit b8e5e2a93e
5 changed files with 143 additions and 3 deletions

View File

@@ -7844,7 +7844,7 @@
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/UpdateFileOptions"
"$ref": "#/definitions/ApplyDiffPatchFileOptions"
}
}
],
@@ -21645,6 +21645,54 @@
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
"ApplyDiffPatchFileOptions": {
"description": "ApplyDiffPatchFileOptions options for applying a diff patch\nNote: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used)",
"type": "object",
"required": [
"content"
],
"properties": {
"author": {
"$ref": "#/definitions/Identity"
},
"branch": {
"description": "branch (optional) is the base branch for the changes. If not supplied, the default branch is used",
"type": "string",
"x-go-name": "BranchName"
},
"committer": {
"$ref": "#/definitions/Identity"
},
"content": {
"type": "string",
"x-go-name": "Content"
},
"dates": {
"$ref": "#/definitions/CommitDateOptions"
},
"force_push": {
"description": "force_push (optional) will do a force-push if the new branch already exists",
"type": "boolean",
"x-go-name": "ForcePush"
},
"message": {
"description": "message (optional) is the commit message of the changes. If not supplied, a default message will be used",
"type": "string",
"x-go-name": "Message"
},
"new_branch": {
"description": "new_branch (optional) will make a new branch from base branch for the changes. If not supplied, the changes will be committed to the base branch",
"type": "string",
"x-go-name": "NewBranchName"
},
"signoff": {
"description": "Add a Signed-off-by trailer by the committer at the end of the commit log message.",
"type": "boolean",
"x-go-name": "Signoff"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
"Attachment": {
"description": "Attachment a generic attachment",
"type": "object",