diff options
author | zeripath <art27@cantab.net> | 2021-08-01 21:44:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-01 16:44:15 -0400 |
commit | 48c7c880b8fcf8e5d8495e66392e787bd7209b8c (patch) | |
tree | 8db19b925c3e1b6925688a77a40cd450715fc18f /templates/swagger | |
parent | e51c73ae5c03c83256d48cdcd0ca9cbdbf7a5222 (diff) | |
download | gitea-48c7c880b8fcf8e5d8495e66392e787bd7209b8c.tar.gz gitea-48c7c880b8fcf8e5d8495e66392e787bd7209b8c.zip |
Swagger AccessToken fixes (#16574)
There is a subtle problem with the Swagger definition for AccessTokens which causes
autogeneration of APIs for these endpoints to fail.
This PR corrects these errors.
Ref: https://github.com/zeripath/java-gitea-api/issues/4
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'templates/swagger')
-rw-r--r-- | templates/swagger/v1_json.tmpl | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index d97ec5ff2d..a1d92abec7 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -11917,18 +11917,10 @@ "required": true }, { - "name": "accessToken", + "name": "userCreateToken", "in": "body", "schema": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - } - } + "$ref": "#/definitions/CreateAccessTokenOption" } } ], @@ -12654,6 +12646,17 @@ }, "x-go-package": "code.gitea.io/gitea/modules/structs" }, + "CreateAccessTokenOption": { + "description": "CreateAccessTokenOption options when create access token", + "type": "object", + "properties": { + "name": { + "type": "string", + "x-go-name": "Name" + } + }, + "x-go-package": "code.gitea.io/gitea/modules/structs" + }, "CreateBranchProtectionOption": { "description": "CreateBranchProtectionOption options for creating a branch protection", "type": "object", @@ -17045,20 +17048,8 @@ "responses": { "AccessToken": { "description": "AccessToken represents an API access token.", - "headers": { - "id": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - }, - "sha1": { - "type": "string" - }, - "token_last_eight": { - "type": "string" - } + "schema": { + "$ref": "#/definitions/AccessToken" } }, "AccessTokenList": { |