0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-24 18:12:53 +01:00

fix wrong issue endpoints in swagger doc (#3914)

This commit is contained in:
David Schneiderbauer 2018-05-08 08:05:18 +02:00 committed by Bo-Yi Wu
parent 773530c917
commit ea01decb6b
3 changed files with 230 additions and 234 deletions

454
public/swagger.v1.json vendored
View file

@ -1605,235 +1605,6 @@
}
}
},
"/repos/{owner}/{repo}/issue/{index}/comments": {
"get": {
"produces": [
"application/json"
],
"tags": [
"issue"
],
"summary": "List all comments on an issue",
"operationId": "issueGetComments",
"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
},
{
"type": "string",
"description": "if provided, only comments updated since the specified time are returned.",
"name": "string",
"in": "query"
}
],
"responses": {
"200": {
"$ref": "#/responses/CommentList"
}
}
}
},
"/repos/{owner}/{repo}/issue/{index}/labels": {
"put": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"issue"
],
"summary": "Replace an issue's labels",
"operationId": "issueReplaceLabels",
"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": "index",
"in": "path",
"required": true
},
{
"name": "body",
"in": "body",
"schema": {
"$ref": "#/definitions/IssueLabelsOption"
}
}
],
"responses": {
"200": {
"$ref": "#/responses/LabelList"
}
}
},
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"issue"
],
"summary": "Add a label to an issue",
"operationId": "issueAddLabel",
"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": "index",
"in": "path",
"required": true
},
{
"name": "body",
"in": "body",
"schema": {
"$ref": "#/definitions/IssueLabelsOption"
}
}
],
"responses": {
"200": {
"$ref": "#/responses/LabelList"
}
}
},
"delete": {
"produces": [
"application/json"
],
"tags": [
"issue"
],
"summary": "Remove all labels from an issue",
"operationId": "issueClearLabels",
"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": "index",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"$ref": "#/responses/empty"
}
}
}
},
"/repos/{owner}/{repo}/issue/{index}/labels/{id}": {
"delete": {
"produces": [
"application/json"
],
"tags": [
"issue"
],
"summary": "Remove a label from an issue",
"operationId": "issueRemoveLabel",
"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": "index",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "id of the label to remove",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"$ref": "#/responses/empty"
}
}
}
},
"/repos/{owner}/{repo}/issues": {
"get": {
"produces": [
@ -2139,6 +1910,50 @@
}
},
"/repos/{owner}/{repo}/issues/{index}/comments": {
"get": {
"produces": [
"application/json"
],
"tags": [
"issue"
],
"summary": "List all comments on an issue",
"operationId": "issueGetComments",
"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
},
{
"type": "string",
"description": "if provided, only comments updated since the specified time are returned.",
"name": "string",
"in": "query"
}
],
"responses": {
"200": {
"$ref": "#/responses/CommentList"
}
}
},
"post": {
"consumes": [
"application/json"
@ -2330,6 +2145,187 @@
"$ref": "#/responses/notFound"
}
}
},
"put": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"issue"
],
"summary": "Replace an issue's labels",
"operationId": "issueReplaceLabels",
"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": "index",
"in": "path",
"required": true
},
{
"name": "body",
"in": "body",
"schema": {
"$ref": "#/definitions/IssueLabelsOption"
}
}
],
"responses": {
"200": {
"$ref": "#/responses/LabelList"
}
}
},
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"issue"
],
"summary": "Add a label to an issue",
"operationId": "issueAddLabel",
"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": "index",
"in": "path",
"required": true
},
{
"name": "body",
"in": "body",
"schema": {
"$ref": "#/definitions/IssueLabelsOption"
}
}
],
"responses": {
"200": {
"$ref": "#/responses/LabelList"
}
}
},
"delete": {
"produces": [
"application/json"
],
"tags": [
"issue"
],
"summary": "Remove all labels from an issue",
"operationId": "issueClearLabels",
"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": "index",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"$ref": "#/responses/empty"
}
}
}
},
"/repos/{owner}/{repo}/issues/{index}/labels/{id}": {
"delete": {
"produces": [
"application/json"
],
"tags": [
"issue"
],
"summary": "Remove a label from an issue",
"operationId": "issueRemoveLabel",
"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": "index",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "id of the label to remove",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"$ref": "#/responses/empty"
}
}
}
},
"/repos/{owner}/{repo}/issues/{index}/times": {

View file

@ -15,7 +15,7 @@ import (
// ListIssueComments list all the comments of an issue
func ListIssueComments(ctx *context.APIContext) {
// swagger:operation GET /repos/{owner}/{repo}/issue/{index}/comments issue issueGetComments
// swagger:operation GET /repos/{owner}/{repo}/issues/{index}/comments issue issueGetComments
// ---
// summary: List all comments on an issue
// produces:

View file

@ -58,7 +58,7 @@ func ListIssueLabels(ctx *context.APIContext) {
// AddIssueLabels add labels for an issue
func AddIssueLabels(ctx *context.APIContext, form api.IssueLabelsOption) {
// swagger:operation POST /repos/{owner}/{repo}/issue/{index}/labels issue issueAddLabel
// swagger:operation POST /repos/{owner}/{repo}/issues/{index}/labels issue issueAddLabel
// ---
// summary: Add a label to an issue
// consumes:
@ -129,7 +129,7 @@ func AddIssueLabels(ctx *context.APIContext, form api.IssueLabelsOption) {
// DeleteIssueLabel delete a label for an issue
func DeleteIssueLabel(ctx *context.APIContext) {
// swagger:operation DELETE /repos/{owner}/{repo}/issue/{index}/labels/{id} issue issueRemoveLabel
// swagger:operation DELETE /repos/{owner}/{repo}/issues/{index}/labels/{id} issue issueRemoveLabel
// ---
// summary: Remove a label from an issue
// produces:
@ -193,7 +193,7 @@ func DeleteIssueLabel(ctx *context.APIContext) {
// ReplaceIssueLabels replace labels for an issue
func ReplaceIssueLabels(ctx *context.APIContext, form api.IssueLabelsOption) {
// swagger:operation PUT /repos/{owner}/{repo}/issue/{index}/labels issue issueReplaceLabels
// swagger:operation PUT /repos/{owner}/{repo}/issues/{index}/labels issue issueReplaceLabels
// ---
// summary: Replace an issue's labels
// consumes:
@ -264,7 +264,7 @@ func ReplaceIssueLabels(ctx *context.APIContext, form api.IssueLabelsOption) {
// ClearIssueLabels delete all the labels for an issue
func ClearIssueLabels(ctx *context.APIContext) {
// swagger:operation DELETE /repos/{owner}/{repo}/issue/{index}/labels issue issueClearLabels
// swagger:operation DELETE /repos/{owner}/{repo}/issues/{index}/labels issue issueClearLabels
// ---
// summary: Remove all labels from an issue
// produces: