mirror of
https://github.com/go-gitea/gitea
synced 2024-12-22 07:54:13 +01:00
Fix swagger errors (#4220)
Fix all the resting errors to have a valid swagger file. They are still some warnings but nothing blocking. Doing so I found that some request still misses son parameters for some POST/PUT/PATCH request. This means the a client generated from the swagger file will not work completely. Fix #4088 by activating validation in drone Should fix #4010.
This commit is contained in:
parent
0ba165e2ea
commit
908e8942cc
15 changed files with 440 additions and 262 deletions
|
@ -75,6 +75,7 @@ pipeline:
|
|||
- make lint
|
||||
- make fmt-check
|
||||
- make swagger-check
|
||||
- make swagger-validate
|
||||
- make misspell-check
|
||||
- make test-vendor
|
||||
- make build
|
||||
|
|
476
public/swagger.v1.json
vendored
476
public/swagger.v1.json
vendored
|
@ -321,9 +321,13 @@
|
|||
"operationId": "renderMarkdownRaw",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Request body to render",
|
||||
"name": "body",
|
||||
"in": "body"
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
|
@ -448,6 +452,15 @@
|
|||
],
|
||||
"summary": "List an organization's webhooks",
|
||||
"operationId": "orgListHooks",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "name of the organization",
|
||||
"name": "org",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"$ref": "#/responses/HookList"
|
||||
|
@ -468,6 +481,15 @@
|
|||
],
|
||||
"summary": "Create a hook",
|
||||
"operationId": "orgCreateHook",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "name of the organization",
|
||||
"name": "org",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"201": {
|
||||
"$ref": "#/responses/Hook"
|
||||
|
@ -485,6 +507,22 @@
|
|||
],
|
||||
"summary": "Get a hook",
|
||||
"operationId": "orgGetHook",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "name of the organization",
|
||||
"name": "org",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "id of the hook to get",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"$ref": "#/responses/Hook"
|
||||
|
@ -500,6 +538,22 @@
|
|||
],
|
||||
"summary": "Delete a hook",
|
||||
"operationId": "orgDeleteHook",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "name of the organization",
|
||||
"name": "org",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "id of the hook to delete",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"204": {
|
||||
"$ref": "#/responses/empty"
|
||||
|
@ -518,6 +572,22 @@
|
|||
],
|
||||
"summary": "Update a hook",
|
||||
"operationId": "orgEditHook",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "name of the organization",
|
||||
"name": "org",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "id of the hook to update",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"$ref": "#/responses/Hook"
|
||||
|
@ -994,7 +1064,7 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"/repos/{owner}/{repo}/archive/{filepath}": {
|
||||
"/repos/{owner}/{repo}/archive/{archive}": {
|
||||
"get": {
|
||||
"produces": [
|
||||
"application/json"
|
||||
|
@ -1530,6 +1600,47 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"delete": {
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"repository"
|
||||
],
|
||||
"summary": "Delete a hook in a repository",
|
||||
"operationId": "repoDeleteHook",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "owner of the repo",
|
||||
"name": "owner",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "name of the repo",
|
||||
"name": "repo",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "id of the hook to delete",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"204": {
|
||||
"$ref": "#/responses/empty"
|
||||
},
|
||||
"404": {
|
||||
"$ref": "#/responses/notFound"
|
||||
}
|
||||
}
|
||||
},
|
||||
"patch": {
|
||||
"produces": [
|
||||
"application/json"
|
||||
|
@ -1554,6 +1665,13 @@
|
|||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "index of the hook",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
|
@ -1825,6 +1943,100 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"/repos/{owner}/{repo}/issues/{id}/times": {
|
||||
"get": {
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"issue"
|
||||
],
|
||||
"summary": "List an issue's tracked times",
|
||||
"operationId": "issueTrackedTimes",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "owner of the repo",
|
||||
"name": "owner",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "name of the repo",
|
||||
"name": "repo",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "index of the issue",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"$ref": "#/responses/TrackedTimeList"
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"issue"
|
||||
],
|
||||
"summary": "Add a tracked time to a issue",
|
||||
"operationId": "issueAddTime",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "owner of the repo",
|
||||
"name": "owner",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "name of the repo",
|
||||
"name": "repo",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "index of the issue to add tracked time to",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/AddTimeOption"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"$ref": "#/responses/TrackedTime"
|
||||
},
|
||||
"400": {
|
||||
"$ref": "#/responses/error"
|
||||
},
|
||||
"403": {
|
||||
"$ref": "#/responses/error"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/repos/{owner}/{repo}/issues/{index}": {
|
||||
"get": {
|
||||
"produces": [
|
||||
|
@ -1941,7 +2153,7 @@
|
|||
{
|
||||
"type": "integer",
|
||||
"description": "index of the issue",
|
||||
"name": "id",
|
||||
"name": "index",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
|
@ -1988,7 +2200,7 @@
|
|||
{
|
||||
"type": "integer",
|
||||
"description": "index of the issue",
|
||||
"name": "id",
|
||||
"name": "index",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
|
@ -2332,100 +2544,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"/repos/{owner}/{repo}/issues/{index}/times": {
|
||||
"get": {
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"issue"
|
||||
],
|
||||
"summary": "List an issue's tracked times",
|
||||
"operationId": "issueTrackedTimes",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "owner of the repo",
|
||||
"name": "owner",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "name of the repo",
|
||||
"name": "repo",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "index of the issue",
|
||||
"name": "repo",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"$ref": "#/responses/TrackedTimeList"
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"issue"
|
||||
],
|
||||
"summary": "Add a tracked time to a issue",
|
||||
"operationId": "issueAddTime",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "owner of the repo",
|
||||
"name": "owner",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "name of the repo",
|
||||
"name": "repo",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "index of the issue to add tracked time to",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/AddTimeOption"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"$ref": "#/responses/TrackedTime"
|
||||
},
|
||||
"400": {
|
||||
"$ref": "#/responses/error"
|
||||
},
|
||||
"403": {
|
||||
"$ref": "#/responses/error"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/repos/{owner}/{repo}/keys": {
|
||||
"get": {
|
||||
"produces": [
|
||||
|
@ -2781,7 +2899,7 @@
|
|||
"issue"
|
||||
],
|
||||
"summary": "Get all of a repository's milestones",
|
||||
"operationId": "issueGetMilestones",
|
||||
"operationId": "issueGetMilestonesList",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
|
@ -2796,13 +2914,6 @@
|
|||
"name": "repo",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "id of the milestone to get",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
|
@ -2863,6 +2974,29 @@
|
|||
],
|
||||
"summary": "Get a milestone",
|
||||
"operationId": "issueGetMilestone",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "owner of the repo",
|
||||
"name": "owner",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "name of the repo",
|
||||
"name": "repo",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "id of the milestone",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"$ref": "#/responses/Milestone"
|
||||
|
@ -2893,7 +3027,7 @@
|
|||
{
|
||||
"type": "integer",
|
||||
"description": "id of the milestone to delete",
|
||||
"name": "body",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
|
@ -2931,6 +3065,13 @@
|
|||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "id of the milestone",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
|
@ -3979,7 +4120,7 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"/repos/{owner}/{repo}/times/{tracker}": {
|
||||
"/repos/{owner}/{repo}/times/{user}": {
|
||||
"get": {
|
||||
"produces": [
|
||||
"application/json"
|
||||
|
@ -4019,49 +4160,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"/repos/{user}/{repo}/hooks/{id}": {
|
||||
"delete": {
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"repository"
|
||||
],
|
||||
"summary": "Delete a hook in a repository",
|
||||
"operationId": "repoDeleteHook",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "owner of the repo",
|
||||
"name": "owner",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "name of the repo",
|
||||
"name": "repo",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "id of the hook to delete",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"204": {
|
||||
"$ref": "#/responses/empty"
|
||||
},
|
||||
"404": {
|
||||
"$ref": "#/responses/notFound"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/repositories/{id}": {
|
||||
"get": {
|
||||
"produces": [
|
||||
|
@ -4238,7 +4336,7 @@
|
|||
"organization"
|
||||
],
|
||||
"summary": "Remove a team member",
|
||||
"operationId": "orgAddTeamMember",
|
||||
"operationId": "orgRemoveTeamMember",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
|
@ -4297,7 +4395,7 @@
|
|||
"organization"
|
||||
],
|
||||
"summary": "Add a repository to a team",
|
||||
"operationId": "orgAddTeamMember",
|
||||
"operationId": "orgAddTeamRepository",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
|
@ -4336,7 +4434,7 @@
|
|||
"organization"
|
||||
],
|
||||
"summary": "Remove a repository from a team",
|
||||
"operationId": "orgAddTeamMember",
|
||||
"operationId": "orgRemoveTeamRepository",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
|
@ -4379,10 +4477,10 @@
|
|||
"operationId": "topicSearch",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "id of the repo to get",
|
||||
"name": "keyword",
|
||||
"in": "path",
|
||||
"type": "string",
|
||||
"description": "keywords to search",
|
||||
"name": "q",
|
||||
"in": "query",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
|
@ -4509,7 +4607,7 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"/user/following/{followee}": {
|
||||
"/user/following/{username}": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"user"
|
||||
|
@ -4520,7 +4618,7 @@
|
|||
{
|
||||
"type": "string",
|
||||
"description": "username of followed user",
|
||||
"name": "followee",
|
||||
"name": "username",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
|
@ -4533,9 +4631,7 @@
|
|||
"$ref": "#/responses/notFound"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/user/following/{username}": {
|
||||
},
|
||||
"put": {
|
||||
"tags": [
|
||||
"user"
|
||||
|
@ -5301,6 +5397,15 @@
|
|||
],
|
||||
"summary": "List the authenticated user's access tokens",
|
||||
"operationId": "userGetTokens",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "username of user",
|
||||
"name": "username",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"$ref": "#/responses/AccessTokenList"
|
||||
|
@ -5323,8 +5428,10 @@
|
|||
{
|
||||
"type": "string",
|
||||
"x-go-name": "Name",
|
||||
"name": "name",
|
||||
"in": "query"
|
||||
"description": "username of user",
|
||||
"name": "username",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
|
@ -7612,9 +7719,6 @@
|
|||
"description": "SearchResults",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/SearchResults"
|
||||
},
|
||||
"headers": {
|
||||
"body": {}
|
||||
}
|
||||
},
|
||||
"ServerVersion": {
|
||||
|
@ -7721,40 +7825,6 @@
|
|||
"description": "parameterBodies",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/EditAttachmentOptions"
|
||||
},
|
||||
"headers": {
|
||||
"AddCollaboratorOption": {},
|
||||
"AddTimeOption": {},
|
||||
"CreateEmailOption": {},
|
||||
"CreateForkOption": {},
|
||||
"CreateHookOption": {},
|
||||
"CreateIssueCommentOption": {},
|
||||
"CreateIssueOption": {},
|
||||
"CreateKeyOption": {},
|
||||
"CreateLabelOption": {},
|
||||
"CreateMilestoneOption": {},
|
||||
"CreateOrgOption": {},
|
||||
"CreatePullRequestOption": {},
|
||||
"CreateReleaseOption": {},
|
||||
"CreateRepoOption": {},
|
||||
"CreateStatusOption": {},
|
||||
"CreateTeamOption": {},
|
||||
"CreateUserOption": {},
|
||||
"DeleteEmailOption": {},
|
||||
"EditAttachmentOptions": {},
|
||||
"EditHookOption": {},
|
||||
"EditIssueCommentOption": {},
|
||||
"EditIssueOption": {},
|
||||
"EditLabelOption": {},
|
||||
"EditMilestoneOption": {},
|
||||
"EditOrgOption": {},
|
||||
"EditPullRequestOption": {},
|
||||
"EditReleaseOption": {},
|
||||
"EditTeamOption": {},
|
||||
"EditUserOption": {},
|
||||
"IssueLabelsOption": {},
|
||||
"MarkdownOption": {},
|
||||
"MigrateRepoForm": {}
|
||||
}
|
||||
},
|
||||
"redirect": {
|
||||
|
|
|
@ -62,9 +62,12 @@ func MarkdownRaw(ctx *context.APIContext) {
|
|||
// ---
|
||||
// summary: Render raw markdown as HTML
|
||||
// parameters:
|
||||
// - name: body
|
||||
// in: body
|
||||
// type: string
|
||||
// - name: body
|
||||
// in: body
|
||||
// description: Request body to render
|
||||
// required: true
|
||||
// schema:
|
||||
// type: string
|
||||
// consumes:
|
||||
// - text/plain
|
||||
// produces:
|
||||
|
|
|
@ -20,6 +20,12 @@ func ListHooks(ctx *context.APIContext) {
|
|||
// summary: List an organization's webhooks
|
||||
// produces:
|
||||
// - application/json
|
||||
// parameters:
|
||||
// - name: org
|
||||
// in: path
|
||||
// description: name of the organization
|
||||
// type: string
|
||||
// required: true
|
||||
// responses:
|
||||
// "200":
|
||||
// "$ref": "#/responses/HookList"
|
||||
|
@ -43,6 +49,17 @@ func GetHook(ctx *context.APIContext) {
|
|||
// summary: Get a hook
|
||||
// produces:
|
||||
// - application/json
|
||||
// parameters:
|
||||
// - name: org
|
||||
// in: path
|
||||
// description: name of the organization
|
||||
// type: string
|
||||
// required: true
|
||||
// - name: id
|
||||
// in: path
|
||||
// description: id of the hook to get
|
||||
// type: integer
|
||||
// required: true
|
||||
// responses:
|
||||
// "200":
|
||||
// "$ref": "#/responses/Hook"
|
||||
|
@ -64,9 +81,17 @@ func CreateHook(ctx *context.APIContext, form api.CreateHookOption) {
|
|||
// - application/json
|
||||
// produces:
|
||||
// - application/json
|
||||
// parameters:
|
||||
// - name: org
|
||||
// in: path
|
||||
// description: name of the organization
|
||||
// type: string
|
||||
// required: true
|
||||
// responses:
|
||||
// "201":
|
||||
// "$ref": "#/responses/Hook"
|
||||
|
||||
//TODO in body params
|
||||
if !utils.CheckCreateHookOption(ctx, &form) {
|
||||
return
|
||||
}
|
||||
|
@ -82,9 +107,22 @@ func EditHook(ctx *context.APIContext, form api.EditHookOption) {
|
|||
// - application/json
|
||||
// produces:
|
||||
// - application/json
|
||||
// parameters:
|
||||
// - name: org
|
||||
// in: path
|
||||
// description: name of the organization
|
||||
// type: string
|
||||
// required: true
|
||||
// - name: id
|
||||
// in: path
|
||||
// description: id of the hook to update
|
||||
// type: integer
|
||||
// required: true
|
||||
// responses:
|
||||
// "200":
|
||||
// "$ref": "#/responses/Hook"
|
||||
|
||||
//TODO in body params
|
||||
hookID := ctx.ParamsInt64(":id")
|
||||
utils.EditOrgHook(ctx, &form, hookID)
|
||||
}
|
||||
|
@ -96,6 +134,17 @@ func DeleteHook(ctx *context.APIContext) {
|
|||
// summary: Delete a hook
|
||||
// produces:
|
||||
// - application/json
|
||||
// parameters:
|
||||
// - name: org
|
||||
// in: path
|
||||
// description: name of the organization
|
||||
// type: string
|
||||
// required: true
|
||||
// - name: id
|
||||
// in: path
|
||||
// description: id of the hook to delete
|
||||
// type: integer
|
||||
// required: true
|
||||
// responses:
|
||||
// "204":
|
||||
// "$ref": "#/responses/empty"
|
||||
|
|
|
@ -227,7 +227,7 @@ func AddTeamMember(ctx *context.APIContext) {
|
|||
|
||||
// RemoveTeamMember api for remove one member from a team
|
||||
func RemoveTeamMember(ctx *context.APIContext) {
|
||||
// swagger:operation DELETE /teams/{id}/members/{username} organization orgAddTeamMember
|
||||
// swagger:operation DELETE /teams/{id}/members/{username} organization orgRemoveTeamMember
|
||||
// ---
|
||||
// summary: Remove a team member
|
||||
// produces:
|
||||
|
@ -306,7 +306,7 @@ func getRepositoryByParams(ctx *context.APIContext) *models.Repository {
|
|||
|
||||
// AddTeamRepository api for adding a repository to a team
|
||||
func AddTeamRepository(ctx *context.APIContext) {
|
||||
// swagger:operation PUT /teams/{id}/repos/{org}/{repo} organization orgAddTeamMember
|
||||
// swagger:operation PUT /teams/{id}/repos/{org}/{repo} organization orgAddTeamRepository
|
||||
// ---
|
||||
// summary: Add a repository to a team
|
||||
// produces:
|
||||
|
@ -350,7 +350,7 @@ func AddTeamRepository(ctx *context.APIContext) {
|
|||
|
||||
// RemoveTeamRepository api for removing a repository from a team
|
||||
func RemoveTeamRepository(ctx *context.APIContext) {
|
||||
// swagger:operation DELETE /teams/{id}/repos/{org}/{repo} organization orgAddTeamMember
|
||||
// swagger:operation DELETE /teams/{id}/repos/{org}/{repo} organization orgRemoveTeamRepository
|
||||
// ---
|
||||
// summary: Remove a repository from a team
|
||||
// description: This does not delete the repository, it only removes the
|
||||
|
|
|
@ -64,7 +64,7 @@ func GetRawFile(ctx *context.APIContext) {
|
|||
|
||||
// GetArchive get archive of a repository
|
||||
func GetArchive(ctx *context.APIContext) {
|
||||
// swagger:operation GET /repos/{owner}/{repo}/archive/{filepath} repository repoGetArchive
|
||||
// swagger:operation GET /repos/{owner}/{repo}/archive/{archive} repository repoGetArchive
|
||||
// ---
|
||||
// summary: Get an archive of a repository
|
||||
// produces:
|
||||
|
|
|
@ -189,6 +189,11 @@ func EditHook(ctx *context.APIContext, form api.EditHookOption) {
|
|||
// description: name of the repo
|
||||
// type: string
|
||||
// required: true
|
||||
// - name: id
|
||||
// in: path
|
||||
// description: index of the hook
|
||||
// type: integer
|
||||
// required: true
|
||||
// - name: body
|
||||
// in: body
|
||||
// schema:
|
||||
|
@ -202,7 +207,7 @@ func EditHook(ctx *context.APIContext, form api.EditHookOption) {
|
|||
|
||||
// DeleteHook delete a hook of a repository
|
||||
func DeleteHook(ctx *context.APIContext) {
|
||||
// swagger:operation DELETE /repos/{user}/{repo}/hooks/{id} repository repoDeleteHook
|
||||
// swagger:operation DELETE /repos/{owner}/{repo}/hooks/{id} repository repoDeleteHook
|
||||
// ---
|
||||
// summary: Delete a hook in a repository
|
||||
// produces:
|
||||
|
|
|
@ -31,7 +31,7 @@ func ListIssueComments(ctx *context.APIContext) {
|
|||
// description: name of the repo
|
||||
// type: string
|
||||
// required: true
|
||||
// - name: id
|
||||
// - name: index
|
||||
// in: path
|
||||
// description: index of the issue
|
||||
// type: integer
|
||||
|
@ -139,7 +139,7 @@ func CreateIssueComment(ctx *context.APIContext, form api.CreateIssueCommentOpti
|
|||
// description: name of the repo
|
||||
// type: string
|
||||
// required: true
|
||||
// - name: id
|
||||
// - name: index
|
||||
// in: path
|
||||
// description: index of the issue
|
||||
// type: integer
|
||||
|
|
|
@ -21,7 +21,7 @@ func trackedTimesToAPIFormat(trackedTimes []*models.TrackedTime) []*api.TrackedT
|
|||
|
||||
// ListTrackedTimes list all the tracked times of an issue
|
||||
func ListTrackedTimes(ctx *context.APIContext) {
|
||||
// swagger:operation GET /repos/{owner}/{repo}/issues/{index}/times issue issueTrackedTimes
|
||||
// swagger:operation GET /repos/{owner}/{repo}/issues/{id}/times issue issueTrackedTimes
|
||||
// ---
|
||||
// summary: List an issue's tracked times
|
||||
// produces:
|
||||
|
@ -37,7 +37,7 @@ func ListTrackedTimes(ctx *context.APIContext) {
|
|||
// description: name of the repo
|
||||
// type: string
|
||||
// required: true
|
||||
// - name: repo
|
||||
// - name: id
|
||||
// in: path
|
||||
// description: index of the issue
|
||||
// type: integer
|
||||
|
@ -70,7 +70,7 @@ func ListTrackedTimes(ctx *context.APIContext) {
|
|||
|
||||
// AddTime adds time manual to the given issue
|
||||
func AddTime(ctx *context.APIContext, form api.AddTimeOption) {
|
||||
// swagger:operation Post /repos/{owner}/{repo}/issues/{index}/times issue issueAddTime
|
||||
// swagger:operation Post /repos/{owner}/{repo}/issues/{id}/times issue issueAddTime
|
||||
// ---
|
||||
// summary: Add a tracked time to a issue
|
||||
// consumes:
|
||||
|
@ -132,7 +132,7 @@ func AddTime(ctx *context.APIContext, form api.AddTimeOption) {
|
|||
|
||||
// ListTrackedTimesByUser lists all tracked times of the user
|
||||
func ListTrackedTimesByUser(ctx *context.APIContext) {
|
||||
// swagger:operation GET /repos/{owner}/{repo}/times/{tracker} user userTrackedTimes
|
||||
// swagger:operation GET /repos/{owner}/{repo}/times/{user} user userTrackedTimes
|
||||
// ---
|
||||
// summary: List a user's tracked times in a repo
|
||||
// produces:
|
||||
|
|
|
@ -16,30 +16,7 @@ import (
|
|||
|
||||
// ListMilestones list all the milestones for a repository
|
||||
func ListMilestones(ctx *context.APIContext) {
|
||||
// swagger:operation GET /repos/{owner}/{repo}/milestones/{id} issue issueGetMilestone
|
||||
// ---
|
||||
// summary: Get a milestone
|
||||
// produces:
|
||||
// - application/json
|
||||
// responses:
|
||||
// "200":
|
||||
// "$ref": "#/responses/Milestone"
|
||||
milestones, err := models.GetMilestonesByRepoID(ctx.Repo.Repository.ID)
|
||||
if err != nil {
|
||||
ctx.Error(500, "GetMilestonesByRepoID", err)
|
||||
return
|
||||
}
|
||||
|
||||
apiMilestones := make([]*api.Milestone, len(milestones))
|
||||
for i := range milestones {
|
||||
apiMilestones[i] = milestones[i].APIFormat()
|
||||
}
|
||||
ctx.JSON(200, &apiMilestones)
|
||||
}
|
||||
|
||||
// GetMilestone get a milestone for a repository
|
||||
func GetMilestone(ctx *context.APIContext) {
|
||||
// swagger:operation GET /repos/{owner}/{repo}/milestones issue issueGetMilestones
|
||||
// swagger:operation GET /repos/{owner}/{repo}/milestones issue issueGetMilestonesList
|
||||
// ---
|
||||
// summary: Get all of a repository's milestones
|
||||
// produces:
|
||||
|
@ -55,6 +32,29 @@ func GetMilestone(ctx *context.APIContext) {
|
|||
// description: name of the repo
|
||||
// type: string
|
||||
// required: true
|
||||
// responses:
|
||||
// "200":
|
||||
// "$ref": "#/responses/MilestoneList"
|
||||
milestones, err := models.GetMilestonesByRepoID(ctx.Repo.Repository.ID)
|
||||
if err != nil {
|
||||
ctx.Error(500, "GetMilestonesByRepoID", err)
|
||||
return
|
||||
}
|
||||
|
||||
apiMilestones := make([]*api.Milestone, len(milestones))
|
||||
for i := range milestones {
|
||||
apiMilestones[i] = milestones[i].APIFormat()
|
||||
}
|
||||
ctx.JSON(200, &apiMilestones)
|
||||
}
|
||||
|
||||
// GetMilestone get a milestone for a repository
|
||||
func GetMilestone(ctx *context.APIContext) {
|
||||
// swagger:operation GET /repos/{owner}/{repo}/milestones/{id} issue issueGetMilestone
|
||||
// ---
|
||||
// summary: Get a milestone
|
||||
// produces:
|
||||
// - application/json
|
||||
// parameters:
|
||||
// - name: owner
|
||||
// in: path
|
||||
|
@ -68,12 +68,12 @@ func GetMilestone(ctx *context.APIContext) {
|
|||
// required: true
|
||||
// - name: id
|
||||
// in: path
|
||||
// description: id of the milestone to get
|
||||
// description: id of the milestone
|
||||
// type: integer
|
||||
// required: true
|
||||
// responses:
|
||||
// "200":
|
||||
// "$ref": "#/responses/MilestoneList"
|
||||
// "$ref": "#/responses/Milestone"
|
||||
milestone, err := models.GetMilestoneByRepoID(ctx.Repo.Repository.ID, ctx.ParamsInt64(":id"))
|
||||
if err != nil {
|
||||
if models.IsErrMilestoneNotExist(err) {
|
||||
|
@ -152,6 +152,11 @@ func EditMilestone(ctx *context.APIContext, form api.EditMilestoneOption) {
|
|||
// description: name of the repo
|
||||
// type: string
|
||||
// required: true
|
||||
// - name: id
|
||||
// in: path
|
||||
// description: id of the milestone
|
||||
// type: integer
|
||||
// required: true
|
||||
// - name: body
|
||||
// in: body
|
||||
// schema:
|
||||
|
@ -202,7 +207,7 @@ func DeleteMilestone(ctx *context.APIContext) {
|
|||
// description: name of the repo
|
||||
// type: string
|
||||
// required: true
|
||||
// - name: body
|
||||
// - name: id
|
||||
// in: path
|
||||
// description: id of the milestone to delete
|
||||
// type: integer
|
||||
|
|
|
@ -508,13 +508,13 @@ func TopicSearch(ctx *context.Context) {
|
|||
// ---
|
||||
// summary: search topics via keyword
|
||||
// produces:
|
||||
// - application/json
|
||||
// - application/json
|
||||
// parameters:
|
||||
// - name: keyword
|
||||
// in: path
|
||||
// description: id of the repo to get
|
||||
// type: integer
|
||||
// required: true
|
||||
// - name: q
|
||||
// in: query
|
||||
// description: keywords to search
|
||||
// required: true
|
||||
// type: string
|
||||
// responses:
|
||||
// "200":
|
||||
// "$ref": "#/responses/Repository"
|
||||
|
|
|
@ -15,55 +15,87 @@ import (
|
|||
// parameterBodies
|
||||
// swagger:response parameterBodies
|
||||
type swaggerParameterBodies struct {
|
||||
// in:body
|
||||
AddCollaboratorOption api.AddCollaboratorOption
|
||||
|
||||
// in:body
|
||||
CreateEmailOption api.CreateEmailOption
|
||||
// in:body
|
||||
DeleteEmailOption api.DeleteEmailOption
|
||||
|
||||
// in:body
|
||||
CreateHookOption api.CreateHookOption
|
||||
EditHookOption api.EditHookOption
|
||||
// in:body
|
||||
EditHookOption api.EditHookOption
|
||||
|
||||
// in:body
|
||||
CreateIssueOption api.CreateIssueOption
|
||||
EditIssueOption api.EditIssueOption
|
||||
// in:body
|
||||
EditIssueOption api.EditIssueOption
|
||||
|
||||
// in:body
|
||||
CreateIssueCommentOption api.CreateIssueCommentOption
|
||||
EditIssueCommentOption api.EditIssueCommentOption
|
||||
// in:body
|
||||
EditIssueCommentOption api.EditIssueCommentOption
|
||||
|
||||
// in:body
|
||||
IssueLabelsOption api.IssueLabelsOption
|
||||
|
||||
// in:body
|
||||
CreateKeyOption api.CreateKeyOption
|
||||
|
||||
// in:body
|
||||
CreateLabelOption api.CreateLabelOption
|
||||
EditLabelOption api.EditLabelOption
|
||||
// in:body
|
||||
EditLabelOption api.EditLabelOption
|
||||
|
||||
// in:body
|
||||
MarkdownOption api.MarkdownOption
|
||||
|
||||
// in:body
|
||||
CreateMilestoneOption api.CreateMilestoneOption
|
||||
EditMilestoneOption api.EditMilestoneOption
|
||||
// in:body
|
||||
EditMilestoneOption api.EditMilestoneOption
|
||||
|
||||
// in:body
|
||||
CreateOrgOption api.CreateOrgOption
|
||||
EditOrgOption api.EditOrgOption
|
||||
// in:body
|
||||
EditOrgOption api.EditOrgOption
|
||||
|
||||
// in:body
|
||||
CreatePullRequestOption api.CreatePullRequestOption
|
||||
EditPullRequestOption api.EditPullRequestOption
|
||||
// in:body
|
||||
EditPullRequestOption api.EditPullRequestOption
|
||||
|
||||
// in:body
|
||||
CreateReleaseOption api.CreateReleaseOption
|
||||
EditReleaseOption api.EditReleaseOption
|
||||
// in:body
|
||||
EditReleaseOption api.EditReleaseOption
|
||||
|
||||
// in:body
|
||||
CreateRepoOption api.CreateRepoOption
|
||||
// in:body
|
||||
CreateForkOption api.CreateForkOption
|
||||
|
||||
// in:body
|
||||
CreateStatusOption api.CreateStatusOption
|
||||
|
||||
// in:body
|
||||
CreateTeamOption api.CreateTeamOption
|
||||
EditTeamOption api.EditTeamOption
|
||||
// in:body
|
||||
EditTeamOption api.EditTeamOption
|
||||
|
||||
// in:body
|
||||
AddTimeOption api.AddTimeOption
|
||||
|
||||
// in:body
|
||||
CreateUserOption api.CreateUserOption
|
||||
EditUserOption api.EditUserOption
|
||||
// in:body
|
||||
EditUserOption api.EditUserOption
|
||||
|
||||
// in:body
|
||||
MigrateRepoForm auth.MigrateRepoForm
|
||||
|
||||
// in:body
|
||||
EditAttachmentOptions api.EditAttachmentOptions
|
||||
}
|
||||
|
|
|
@ -102,6 +102,7 @@ type swaggerResponseWatchInfo struct {
|
|||
// SearchResults
|
||||
// swagger:response SearchResults
|
||||
type swaggerResponseSearchResults struct {
|
||||
// in:body
|
||||
Body api.SearchResults `json:"body"`
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,12 @@ func ListAccessTokens(ctx *context.APIContext) {
|
|||
// summary: List the authenticated user's access tokens
|
||||
// produces:
|
||||
// - application/json
|
||||
// parameters:
|
||||
// - name: username
|
||||
// in: path
|
||||
// description: username of user
|
||||
// type: string
|
||||
// required: true
|
||||
// responses:
|
||||
// "200":
|
||||
// "$ref": "#/responses/AccessTokenList"
|
||||
|
@ -46,6 +52,12 @@ func CreateAccessToken(ctx *context.APIContext, form api.CreateAccessTokenOption
|
|||
// - application/json
|
||||
// produces:
|
||||
// - application/json
|
||||
// parameters:
|
||||
// - name: username
|
||||
// in: path
|
||||
// description: username of user
|
||||
// type: string
|
||||
// required: true
|
||||
// responses:
|
||||
// "200":
|
||||
// "$ref": "#/responses/AccessToken"
|
||||
|
|
|
@ -119,11 +119,11 @@ func checkUserFollowing(ctx *context.APIContext, u *models.User, followID int64)
|
|||
|
||||
// CheckMyFollowing whether the given user is followed by the authenticated user
|
||||
func CheckMyFollowing(ctx *context.APIContext) {
|
||||
// swagger:operation GET /user/following/{followee} user userCurrentCheckFollowing
|
||||
// swagger:operation GET /user/following/{username} user userCurrentCheckFollowing
|
||||
// ---
|
||||
// summary: Check whether a user is followed by the authenticated user
|
||||
// parameters:
|
||||
// - name: followee
|
||||
// - name: username
|
||||
// in: path
|
||||
// description: username of followed user
|
||||
// type: string
|
||||
|
|
Loading…
Reference in a new issue