diff options
author | 6543 <6543@obermui.de> | 2020-09-11 00:29:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-10 23:29:19 +0100 |
commit | fd60ebfe14927657ff5cfa4e75f975eaadae65f1 (patch) | |
tree | 38c3d70146920a13c228fed91bc1a55c9be72436 /templates | |
parent | daefdd1385d12bf0c8321f291dbb6ab242b41c99 (diff) | |
download | gitea-fd60ebfe14927657ff5cfa4e75f975eaadae65f1.tar.gz gitea-fd60ebfe14927657ff5cfa4e75f975eaadae65f1.zip |
[API] Migration: Change ServiceType String (#12672)
* use different structs for MigrateRepoOptions on UI and API
* Fix TokenAuth and rename UID to an understandable Name
* fix swagger doc
* simplify & mk redable
* R E F A C T O R:
migration has now internal 3 structs to store its options:
* the Options for WebUI: modules/auth/repo_form.go
* the Options for API: modules/structs/repo.go
* the option struct with after validation for internal prossessing: modules/migrations/base/options.go
* Copyright Header
* Deprecate UID - add RepoOwner
* adopt repo.go -> migrate.go
* add comment about each struct purpose
* lint
Diffstat (limited to 'templates')
-rw-r--r-- | templates/swagger/v1_json.tmpl | 94 |
1 files changed, 91 insertions, 3 deletions
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 661005be24..ac65b3ce17 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -1798,7 +1798,7 @@ "name": "body", "in": "body", "schema": { - "$ref": "#/definitions/MigrateRepoForm" + "$ref": "#/definitions/MigrateRepoOptions" } } ], @@ -13522,7 +13522,7 @@ "x-go-package": "code.gitea.io/gitea/modules/auth" }, "MigrateRepoForm": { - "description": "MigrateRepoForm form for migrating repository", + "description": "MigrateRepoForm form for migrating repository\nthis is used to interact with web ui", "type": "object", "required": [ "clone_addr", @@ -13599,6 +13599,94 @@ }, "x-go-package": "code.gitea.io/gitea/modules/auth" }, + "MigrateRepoOptions": { + "description": "MigrateRepoOptions options for migrating repository's\nthis is used to interact with api v1", + "type": "object", + "required": [ + "clone_addr", + "repo_name" + ], + "properties": { + "auth_password": { + "type": "string", + "x-go-name": "AuthPassword" + }, + "auth_token": { + "type": "string", + "x-go-name": "AuthToken" + }, + "auth_username": { + "type": "string", + "x-go-name": "AuthUsername" + }, + "clone_addr": { + "type": "string", + "x-go-name": "CloneAddr" + }, + "description": { + "type": "string", + "x-go-name": "Description" + }, + "issues": { + "type": "boolean", + "x-go-name": "Issues" + }, + "labels": { + "type": "boolean", + "x-go-name": "Labels" + }, + "milestones": { + "type": "boolean", + "x-go-name": "Milestones" + }, + "mirror": { + "type": "boolean", + "x-go-name": "Mirror" + }, + "private": { + "type": "boolean", + "x-go-name": "Private" + }, + "pull_requests": { + "type": "boolean", + "x-go-name": "PullRequests" + }, + "releases": { + "type": "boolean", + "x-go-name": "Releases" + }, + "repo_name": { + "type": "string", + "x-go-name": "RepoName" + }, + "repo_owner": { + "description": "Name of User or Organisation who will own Repo after migration", + "type": "string", + "x-go-name": "RepoOwner" + }, + "service": { + "type": "string", + "enum": [ + "git", + "github", + "gitea", + "gitlab" + ], + "x-go-name": "Service" + }, + "uid": { + "description": "deprecated (only for backwards compatibility)", + "type": "integer", + "format": "int64", + "x-go-name": "RepoOwnerID" + }, + "wiki": { + "type": "boolean", + "x-go-name": "Wiki" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, "Milestone": { "description": "Milestone milestone is a collection of issues on one repository", "type": "object", @@ -15795,7 +15883,7 @@ "parameterBodies": { "description": "parameterBodies", "schema": { - "$ref": "#/definitions/SubmitPullReviewOptions" + "$ref": "#/definitions/MigrateRepoOptions" } }, "redirect": { |