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.tags/v1.5.0-dev
- make lint | - make lint | ||||
- make fmt-check | - make fmt-check | ||||
- make swagger-check | - make swagger-check | ||||
- make swagger-validate | |||||
- make misspell-check | - make misspell-check | ||||
- make test-vendor | - make test-vendor | ||||
- make build | - make build |
"operationId": "renderMarkdownRaw", | "operationId": "renderMarkdownRaw", | ||||
"parameters": [ | "parameters": [ | ||||
{ | { | ||||
"type": "string", | |||||
"description": "Request body to render", | |||||
"name": "body", | "name": "body", | ||||
"in": "body" | |||||
"in": "body", | |||||
"required": true, | |||||
"schema": { | |||||
"type": "string" | |||||
} | |||||
} | } | ||||
], | ], | ||||
"responses": { | "responses": { | ||||
], | ], | ||||
"summary": "List an organization's webhooks", | "summary": "List an organization's webhooks", | ||||
"operationId": "orgListHooks", | "operationId": "orgListHooks", | ||||
"parameters": [ | |||||
{ | |||||
"type": "string", | |||||
"description": "name of the organization", | |||||
"name": "org", | |||||
"in": "path", | |||||
"required": true | |||||
} | |||||
], | |||||
"responses": { | "responses": { | ||||
"200": { | "200": { | ||||
"$ref": "#/responses/HookList" | "$ref": "#/responses/HookList" | ||||
], | ], | ||||
"summary": "Create a hook", | "summary": "Create a hook", | ||||
"operationId": "orgCreateHook", | "operationId": "orgCreateHook", | ||||
"parameters": [ | |||||
{ | |||||
"type": "string", | |||||
"description": "name of the organization", | |||||
"name": "org", | |||||
"in": "path", | |||||
"required": true | |||||
} | |||||
], | |||||
"responses": { | "responses": { | ||||
"201": { | "201": { | ||||
"$ref": "#/responses/Hook" | "$ref": "#/responses/Hook" | ||||
], | ], | ||||
"summary": "Get a hook", | "summary": "Get a hook", | ||||
"operationId": "orgGetHook", | "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": { | "responses": { | ||||
"200": { | "200": { | ||||
"$ref": "#/responses/Hook" | "$ref": "#/responses/Hook" | ||||
], | ], | ||||
"summary": "Delete a hook", | "summary": "Delete a hook", | ||||
"operationId": "orgDeleteHook", | "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": { | "responses": { | ||||
"204": { | "204": { | ||||
"$ref": "#/responses/empty" | "$ref": "#/responses/empty" | ||||
], | ], | ||||
"summary": "Update a hook", | "summary": "Update a hook", | ||||
"operationId": "orgEditHook", | "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": { | "responses": { | ||||
"200": { | "200": { | ||||
"$ref": "#/responses/Hook" | "$ref": "#/responses/Hook" | ||||
} | } | ||||
} | } | ||||
}, | }, | ||||
"/repos/{owner}/{repo}/archive/{filepath}": { | |||||
"/repos/{owner}/{repo}/archive/{archive}": { | |||||
"get": { | "get": { | ||||
"produces": [ | "produces": [ | ||||
"application/json" | "application/json" | ||||
} | } | ||||
} | } | ||||
}, | }, | ||||
"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": { | "patch": { | ||||
"produces": [ | "produces": [ | ||||
"application/json" | "application/json" | ||||
"in": "path", | "in": "path", | ||||
"required": true | "required": true | ||||
}, | }, | ||||
{ | |||||
"type": "integer", | |||||
"description": "index of the hook", | |||||
"name": "id", | |||||
"in": "path", | |||||
"required": true | |||||
}, | |||||
{ | { | ||||
"name": "body", | "name": "body", | ||||
"in": "body", | "in": "body", | ||||
} | } | ||||
} | } | ||||
}, | }, | ||||
"/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}": { | "/repos/{owner}/{repo}/issues/{index}": { | ||||
"get": { | "get": { | ||||
"produces": [ | "produces": [ | ||||
{ | { | ||||
"type": "integer", | "type": "integer", | ||||
"description": "index of the issue", | "description": "index of the issue", | ||||
"name": "id", | |||||
"name": "index", | |||||
"in": "path", | "in": "path", | ||||
"required": true | "required": true | ||||
}, | }, | ||||
{ | { | ||||
"type": "integer", | "type": "integer", | ||||
"description": "index of the issue", | "description": "index of the issue", | ||||
"name": "id", | |||||
"name": "index", | |||||
"in": "path", | "in": "path", | ||||
"required": true | "required": true | ||||
}, | }, | ||||
} | } | ||||
} | } | ||||
}, | }, | ||||
"/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": { | "/repos/{owner}/{repo}/keys": { | ||||
"get": { | "get": { | ||||
"produces": [ | "produces": [ | ||||
"issue" | "issue" | ||||
], | ], | ||||
"summary": "Get all of a repository's milestones", | "summary": "Get all of a repository's milestones", | ||||
"operationId": "issueGetMilestones", | |||||
"operationId": "issueGetMilestonesList", | |||||
"parameters": [ | "parameters": [ | ||||
{ | { | ||||
"type": "string", | "type": "string", | ||||
"name": "repo", | "name": "repo", | ||||
"in": "path", | "in": "path", | ||||
"required": true | "required": true | ||||
}, | |||||
{ | |||||
"type": "integer", | |||||
"description": "id of the milestone to get", | |||||
"name": "id", | |||||
"in": "path", | |||||
"required": true | |||||
} | } | ||||
], | ], | ||||
"responses": { | "responses": { | ||||
], | ], | ||||
"summary": "Get a milestone", | "summary": "Get a milestone", | ||||
"operationId": "issueGetMilestone", | "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": { | "responses": { | ||||
"200": { | "200": { | ||||
"$ref": "#/responses/Milestone" | "$ref": "#/responses/Milestone" | ||||
{ | { | ||||
"type": "integer", | "type": "integer", | ||||
"description": "id of the milestone to delete", | "description": "id of the milestone to delete", | ||||
"name": "body", | |||||
"name": "id", | |||||
"in": "path", | "in": "path", | ||||
"required": true | "required": true | ||||
} | } | ||||
"in": "path", | "in": "path", | ||||
"required": true | "required": true | ||||
}, | }, | ||||
{ | |||||
"type": "integer", | |||||
"description": "id of the milestone", | |||||
"name": "id", | |||||
"in": "path", | |||||
"required": true | |||||
}, | |||||
{ | { | ||||
"name": "body", | "name": "body", | ||||
"in": "body", | "in": "body", | ||||
} | } | ||||
} | } | ||||
}, | }, | ||||
"/repos/{owner}/{repo}/times/{tracker}": { | |||||
"/repos/{owner}/{repo}/times/{user}": { | |||||
"get": { | "get": { | ||||
"produces": [ | "produces": [ | ||||
"application/json" | "application/json" | ||||
} | } | ||||
} | } | ||||
}, | }, | ||||
"/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}": { | "/repositories/{id}": { | ||||
"get": { | "get": { | ||||
"produces": [ | "produces": [ | ||||
"organization" | "organization" | ||||
], | ], | ||||
"summary": "Remove a team member", | "summary": "Remove a team member", | ||||
"operationId": "orgAddTeamMember", | |||||
"operationId": "orgRemoveTeamMember", | |||||
"parameters": [ | "parameters": [ | ||||
{ | { | ||||
"type": "integer", | "type": "integer", | ||||
"organization" | "organization" | ||||
], | ], | ||||
"summary": "Add a repository to a team", | "summary": "Add a repository to a team", | ||||
"operationId": "orgAddTeamMember", | |||||
"operationId": "orgAddTeamRepository", | |||||
"parameters": [ | "parameters": [ | ||||
{ | { | ||||
"type": "integer", | "type": "integer", | ||||
"organization" | "organization" | ||||
], | ], | ||||
"summary": "Remove a repository from a team", | "summary": "Remove a repository from a team", | ||||
"operationId": "orgAddTeamMember", | |||||
"operationId": "orgRemoveTeamRepository", | |||||
"parameters": [ | "parameters": [ | ||||
{ | { | ||||
"type": "integer", | "type": "integer", | ||||
"operationId": "topicSearch", | "operationId": "topicSearch", | ||||
"parameters": [ | "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 | "required": true | ||||
} | } | ||||
], | ], | ||||
} | } | ||||
} | } | ||||
}, | }, | ||||
"/user/following/{followee}": { | |||||
"/user/following/{username}": { | |||||
"get": { | "get": { | ||||
"tags": [ | "tags": [ | ||||
"user" | "user" | ||||
{ | { | ||||
"type": "string", | "type": "string", | ||||
"description": "username of followed user", | "description": "username of followed user", | ||||
"name": "followee", | |||||
"name": "username", | |||||
"in": "path", | "in": "path", | ||||
"required": true | "required": true | ||||
} | } | ||||
"$ref": "#/responses/notFound" | "$ref": "#/responses/notFound" | ||||
} | } | ||||
} | } | ||||
} | |||||
}, | |||||
"/user/following/{username}": { | |||||
}, | |||||
"put": { | "put": { | ||||
"tags": [ | "tags": [ | ||||
"user" | "user" | ||||
], | ], | ||||
"summary": "List the authenticated user's access tokens", | "summary": "List the authenticated user's access tokens", | ||||
"operationId": "userGetTokens", | "operationId": "userGetTokens", | ||||
"parameters": [ | |||||
{ | |||||
"type": "string", | |||||
"description": "username of user", | |||||
"name": "username", | |||||
"in": "path", | |||||
"required": true | |||||
} | |||||
], | |||||
"responses": { | "responses": { | ||||
"200": { | "200": { | ||||
"$ref": "#/responses/AccessTokenList" | "$ref": "#/responses/AccessTokenList" | ||||
{ | { | ||||
"type": "string", | "type": "string", | ||||
"x-go-name": "Name", | "x-go-name": "Name", | ||||
"name": "name", | |||||
"in": "query" | |||||
"description": "username of user", | |||||
"name": "username", | |||||
"in": "path", | |||||
"required": true | |||||
} | } | ||||
], | ], | ||||
"responses": { | "responses": { | ||||
"description": "SearchResults", | "description": "SearchResults", | ||||
"schema": { | "schema": { | ||||
"$ref": "#/definitions/SearchResults" | "$ref": "#/definitions/SearchResults" | ||||
}, | |||||
"headers": { | |||||
"body": {} | |||||
} | } | ||||
}, | }, | ||||
"ServerVersion": { | "ServerVersion": { | ||||
"description": "parameterBodies", | "description": "parameterBodies", | ||||
"schema": { | "schema": { | ||||
"$ref": "#/definitions/EditAttachmentOptions" | "$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": { | "redirect": { |
// --- | // --- | ||||
// summary: Render raw markdown as HTML | // summary: Render raw markdown as HTML | ||||
// parameters: | // parameters: | ||||
// - name: body | |||||
// in: body | |||||
// type: string | |||||
// - name: body | |||||
// in: body | |||||
// description: Request body to render | |||||
// required: true | |||||
// schema: | |||||
// type: string | |||||
// consumes: | // consumes: | ||||
// - text/plain | // - text/plain | ||||
// produces: | // produces: |
// summary: List an organization's webhooks | // summary: List an organization's webhooks | ||||
// produces: | // produces: | ||||
// - application/json | // - application/json | ||||
// parameters: | |||||
// - name: org | |||||
// in: path | |||||
// description: name of the organization | |||||
// type: string | |||||
// required: true | |||||
// responses: | // responses: | ||||
// "200": | // "200": | ||||
// "$ref": "#/responses/HookList" | // "$ref": "#/responses/HookList" | ||||
// summary: Get a hook | // summary: Get a hook | ||||
// produces: | // produces: | ||||
// - application/json | // - 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: | // responses: | ||||
// "200": | // "200": | ||||
// "$ref": "#/responses/Hook" | // "$ref": "#/responses/Hook" | ||||
// - application/json | // - application/json | ||||
// produces: | // produces: | ||||
// - application/json | // - application/json | ||||
// parameters: | |||||
// - name: org | |||||
// in: path | |||||
// description: name of the organization | |||||
// type: string | |||||
// required: true | |||||
// responses: | // responses: | ||||
// "201": | // "201": | ||||
// "$ref": "#/responses/Hook" | // "$ref": "#/responses/Hook" | ||||
//TODO in body params | |||||
if !utils.CheckCreateHookOption(ctx, &form) { | if !utils.CheckCreateHookOption(ctx, &form) { | ||||
return | return | ||||
} | } | ||||
// - application/json | // - application/json | ||||
// produces: | // produces: | ||||
// - application/json | // - 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: | // responses: | ||||
// "200": | // "200": | ||||
// "$ref": "#/responses/Hook" | // "$ref": "#/responses/Hook" | ||||
//TODO in body params | |||||
hookID := ctx.ParamsInt64(":id") | hookID := ctx.ParamsInt64(":id") | ||||
utils.EditOrgHook(ctx, &form, hookID) | utils.EditOrgHook(ctx, &form, hookID) | ||||
} | } | ||||
// summary: Delete a hook | // summary: Delete a hook | ||||
// produces: | // produces: | ||||
// - application/json | // - 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: | // responses: | ||||
// "204": | // "204": | ||||
// "$ref": "#/responses/empty" | // "$ref": "#/responses/empty" |
// RemoveTeamMember api for remove one member from a team | // RemoveTeamMember api for remove one member from a team | ||||
func RemoveTeamMember(ctx *context.APIContext) { | 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 | // summary: Remove a team member | ||||
// produces: | // produces: | ||||
// AddTeamRepository api for adding a repository to a team | // AddTeamRepository api for adding a repository to a team | ||||
func AddTeamRepository(ctx *context.APIContext) { | 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 | // summary: Add a repository to a team | ||||
// produces: | // produces: | ||||
// RemoveTeamRepository api for removing a repository from a team | // RemoveTeamRepository api for removing a repository from a team | ||||
func RemoveTeamRepository(ctx *context.APIContext) { | 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 | // summary: Remove a repository from a team | ||||
// description: This does not delete the repository, it only removes the | // description: This does not delete the repository, it only removes the |
// GetArchive get archive of a repository | // GetArchive get archive of a repository | ||||
func GetArchive(ctx *context.APIContext) { | 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 | // summary: Get an archive of a repository | ||||
// produces: | // produces: |
// description: name of the repo | // description: name of the repo | ||||
// type: string | // type: string | ||||
// required: true | // required: true | ||||
// - name: id | |||||
// in: path | |||||
// description: index of the hook | |||||
// type: integer | |||||
// required: true | |||||
// - name: body | // - name: body | ||||
// in: body | // in: body | ||||
// schema: | // schema: | ||||
// DeleteHook delete a hook of a repository | // DeleteHook delete a hook of a repository | ||||
func DeleteHook(ctx *context.APIContext) { | 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 | // summary: Delete a hook in a repository | ||||
// produces: | // produces: |
// description: name of the repo | // description: name of the repo | ||||
// type: string | // type: string | ||||
// required: true | // required: true | ||||
// - name: id | |||||
// - name: index | |||||
// in: path | // in: path | ||||
// description: index of the issue | // description: index of the issue | ||||
// type: integer | // type: integer | ||||
// description: name of the repo | // description: name of the repo | ||||
// type: string | // type: string | ||||
// required: true | // required: true | ||||
// - name: id | |||||
// - name: index | |||||
// in: path | // in: path | ||||
// description: index of the issue | // description: index of the issue | ||||
// type: integer | // type: integer |
// ListTrackedTimes list all the tracked times of an issue | // ListTrackedTimes list all the tracked times of an issue | ||||
func ListTrackedTimes(ctx *context.APIContext) { | 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 | // summary: List an issue's tracked times | ||||
// produces: | // produces: | ||||
// description: name of the repo | // description: name of the repo | ||||
// type: string | // type: string | ||||
// required: true | // required: true | ||||
// - name: repo | |||||
// - name: id | |||||
// in: path | // in: path | ||||
// description: index of the issue | // description: index of the issue | ||||
// type: integer | // type: integer | ||||
// AddTime adds time manual to the given issue | // AddTime adds time manual to the given issue | ||||
func AddTime(ctx *context.APIContext, form api.AddTimeOption) { | 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 | // summary: Add a tracked time to a issue | ||||
// consumes: | // consumes: | ||||
// ListTrackedTimesByUser lists all tracked times of the user | // ListTrackedTimesByUser lists all tracked times of the user | ||||
func ListTrackedTimesByUser(ctx *context.APIContext) { | 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 | // summary: List a user's tracked times in a repo | ||||
// produces: | // produces: |
// ListMilestones list all the milestones for a repository | // ListMilestones list all the milestones for a repository | ||||
func ListMilestones(ctx *context.APIContext) { | func ListMilestones(ctx *context.APIContext) { | ||||
// swagger:operation GET /repos/{owner}/{repo}/milestones/{id} issue issueGetMilestone | |||||
// swagger:operation GET /repos/{owner}/{repo}/milestones issue issueGetMilestonesList | |||||
// --- | // --- | ||||
// summary: Get a milestone | |||||
// summary: Get all of a repository's milestones | |||||
// produces: | // produces: | ||||
// - application/json | // - application/json | ||||
// parameters: | |||||
// - name: owner | |||||
// in: path | |||||
// description: owner of the repo | |||||
// type: string | |||||
// required: true | |||||
// - name: repo | |||||
// in: path | |||||
// description: name of the repo | |||||
// type: string | |||||
// required: true | |||||
// responses: | // responses: | ||||
// "200": | // "200": | ||||
// "$ref": "#/responses/Milestone" | |||||
// "$ref": "#/responses/MilestoneList" | |||||
milestones, err := models.GetMilestonesByRepoID(ctx.Repo.Repository.ID) | milestones, err := models.GetMilestonesByRepoID(ctx.Repo.Repository.ID) | ||||
if err != nil { | if err != nil { | ||||
ctx.Error(500, "GetMilestonesByRepoID", err) | ctx.Error(500, "GetMilestonesByRepoID", err) | ||||
// GetMilestone get a milestone for a repository | // GetMilestone get a milestone for a repository | ||||
func GetMilestone(ctx *context.APIContext) { | func GetMilestone(ctx *context.APIContext) { | ||||
// swagger:operation GET /repos/{owner}/{repo}/milestones issue issueGetMilestones | |||||
// swagger:operation GET /repos/{owner}/{repo}/milestones/{id} issue issueGetMilestone | |||||
// --- | // --- | ||||
// summary: Get all of a repository's milestones | |||||
// summary: Get a milestone | |||||
// produces: | // produces: | ||||
// - application/json | // - application/json | ||||
// parameters: | // parameters: | ||||
// description: name of the repo | // description: name of the repo | ||||
// type: string | // type: string | ||||
// required: true | // required: true | ||||
// parameters: | |||||
// - name: owner | |||||
// in: path | |||||
// description: owner of the repo | |||||
// type: string | |||||
// required: true | |||||
// - name: repo | |||||
// in: path | |||||
// description: name of the repo | |||||
// type: string | |||||
// required: true | |||||
// - name: id | // - name: id | ||||
// in: path | // in: path | ||||
// description: id of the milestone to get | |||||
// description: id of the milestone | |||||
// type: integer | // type: integer | ||||
// required: true | // required: true | ||||
// responses: | // responses: | ||||
// "200": | // "200": | ||||
// "$ref": "#/responses/MilestoneList" | |||||
// "$ref": "#/responses/Milestone" | |||||
milestone, err := models.GetMilestoneByRepoID(ctx.Repo.Repository.ID, ctx.ParamsInt64(":id")) | milestone, err := models.GetMilestoneByRepoID(ctx.Repo.Repository.ID, ctx.ParamsInt64(":id")) | ||||
if err != nil { | if err != nil { | ||||
if models.IsErrMilestoneNotExist(err) { | if models.IsErrMilestoneNotExist(err) { | ||||
// description: name of the repo | // description: name of the repo | ||||
// type: string | // type: string | ||||
// required: true | // required: true | ||||
// - name: id | |||||
// in: path | |||||
// description: id of the milestone | |||||
// type: integer | |||||
// required: true | |||||
// - name: body | // - name: body | ||||
// in: body | // in: body | ||||
// schema: | // schema: | ||||
// description: name of the repo | // description: name of the repo | ||||
// type: string | // type: string | ||||
// required: true | // required: true | ||||
// - name: body | |||||
// - name: id | |||||
// in: path | // in: path | ||||
// description: id of the milestone to delete | // description: id of the milestone to delete | ||||
// type: integer | // type: integer |
// --- | // --- | ||||
// summary: search topics via keyword | // summary: search topics via keyword | ||||
// produces: | // produces: | ||||
// - application/json | |||||
// - application/json | |||||
// parameters: | // 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: | // responses: | ||||
// "200": | // "200": | ||||
// "$ref": "#/responses/Repository" | // "$ref": "#/responses/Repository" |
// parameterBodies | // parameterBodies | ||||
// swagger:response parameterBodies | // swagger:response parameterBodies | ||||
type swaggerParameterBodies struct { | type swaggerParameterBodies struct { | ||||
// in:body | |||||
AddCollaboratorOption api.AddCollaboratorOption | AddCollaboratorOption api.AddCollaboratorOption | ||||
// in:body | |||||
CreateEmailOption api.CreateEmailOption | CreateEmailOption api.CreateEmailOption | ||||
// in:body | |||||
DeleteEmailOption api.DeleteEmailOption | DeleteEmailOption api.DeleteEmailOption | ||||
// in:body | |||||
CreateHookOption api.CreateHookOption | CreateHookOption api.CreateHookOption | ||||
EditHookOption api.EditHookOption | |||||
// in:body | |||||
EditHookOption api.EditHookOption | |||||
// in:body | |||||
CreateIssueOption api.CreateIssueOption | CreateIssueOption api.CreateIssueOption | ||||
EditIssueOption api.EditIssueOption | |||||
// in:body | |||||
EditIssueOption api.EditIssueOption | |||||
// in:body | |||||
CreateIssueCommentOption api.CreateIssueCommentOption | CreateIssueCommentOption api.CreateIssueCommentOption | ||||
EditIssueCommentOption api.EditIssueCommentOption | |||||
// in:body | |||||
EditIssueCommentOption api.EditIssueCommentOption | |||||
// in:body | |||||
IssueLabelsOption api.IssueLabelsOption | IssueLabelsOption api.IssueLabelsOption | ||||
// in:body | |||||
CreateKeyOption api.CreateKeyOption | CreateKeyOption api.CreateKeyOption | ||||
// in:body | |||||
CreateLabelOption api.CreateLabelOption | CreateLabelOption api.CreateLabelOption | ||||
EditLabelOption api.EditLabelOption | |||||
// in:body | |||||
EditLabelOption api.EditLabelOption | |||||
// in:body | |||||
MarkdownOption api.MarkdownOption | MarkdownOption api.MarkdownOption | ||||
// in:body | |||||
CreateMilestoneOption api.CreateMilestoneOption | CreateMilestoneOption api.CreateMilestoneOption | ||||
EditMilestoneOption api.EditMilestoneOption | |||||
// in:body | |||||
EditMilestoneOption api.EditMilestoneOption | |||||
// in:body | |||||
CreateOrgOption api.CreateOrgOption | CreateOrgOption api.CreateOrgOption | ||||
EditOrgOption api.EditOrgOption | |||||
// in:body | |||||
EditOrgOption api.EditOrgOption | |||||
// in:body | |||||
CreatePullRequestOption api.CreatePullRequestOption | CreatePullRequestOption api.CreatePullRequestOption | ||||
EditPullRequestOption api.EditPullRequestOption | |||||
// in:body | |||||
EditPullRequestOption api.EditPullRequestOption | |||||
// in:body | |||||
CreateReleaseOption api.CreateReleaseOption | CreateReleaseOption api.CreateReleaseOption | ||||
EditReleaseOption api.EditReleaseOption | |||||
// in:body | |||||
EditReleaseOption api.EditReleaseOption | |||||
// in:body | |||||
CreateRepoOption api.CreateRepoOption | CreateRepoOption api.CreateRepoOption | ||||
// in:body | |||||
CreateForkOption api.CreateForkOption | CreateForkOption api.CreateForkOption | ||||
// in:body | |||||
CreateStatusOption api.CreateStatusOption | CreateStatusOption api.CreateStatusOption | ||||
// in:body | |||||
CreateTeamOption api.CreateTeamOption | CreateTeamOption api.CreateTeamOption | ||||
EditTeamOption api.EditTeamOption | |||||
// in:body | |||||
EditTeamOption api.EditTeamOption | |||||
// in:body | |||||
AddTimeOption api.AddTimeOption | AddTimeOption api.AddTimeOption | ||||
// in:body | |||||
CreateUserOption api.CreateUserOption | CreateUserOption api.CreateUserOption | ||||
EditUserOption api.EditUserOption | |||||
// in:body | |||||
EditUserOption api.EditUserOption | |||||
// in:body | |||||
MigrateRepoForm auth.MigrateRepoForm | MigrateRepoForm auth.MigrateRepoForm | ||||
// in:body | |||||
EditAttachmentOptions api.EditAttachmentOptions | EditAttachmentOptions api.EditAttachmentOptions | ||||
} | } |
// SearchResults | // SearchResults | ||||
// swagger:response SearchResults | // swagger:response SearchResults | ||||
type swaggerResponseSearchResults struct { | type swaggerResponseSearchResults struct { | ||||
// in:body | |||||
Body api.SearchResults `json:"body"` | Body api.SearchResults `json:"body"` | ||||
} | } | ||||
// summary: List the authenticated user's access tokens | // summary: List the authenticated user's access tokens | ||||
// produces: | // produces: | ||||
// - application/json | // - application/json | ||||
// parameters: | |||||
// - name: username | |||||
// in: path | |||||
// description: username of user | |||||
// type: string | |||||
// required: true | |||||
// responses: | // responses: | ||||
// "200": | // "200": | ||||
// "$ref": "#/responses/AccessTokenList" | // "$ref": "#/responses/AccessTokenList" | ||||
// - application/json | // - application/json | ||||
// produces: | // produces: | ||||
// - application/json | // - application/json | ||||
// parameters: | |||||
// - name: username | |||||
// in: path | |||||
// description: username of user | |||||
// type: string | |||||
// required: true | |||||
// responses: | // responses: | ||||
// "200": | // "200": | ||||
// "$ref": "#/responses/AccessToken" | // "$ref": "#/responses/AccessToken" |
// CheckMyFollowing whether the given user is followed by the authenticated user | // CheckMyFollowing whether the given user is followed by the authenticated user | ||||
func CheckMyFollowing(ctx *context.APIContext) { | 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 | // summary: Check whether a user is followed by the authenticated user | ||||
// parameters: | // parameters: | ||||
// - name: followee | |||||
// - name: username | |||||
// in: path | // in: path | ||||
// description: username of followed user | // description: username of followed user | ||||
// type: string | // type: string |