80 lines
1.8 KiB
YAML
80 lines
1.8 KiB
YAML
|
definitions:
|
||
|
errors.ErrResponse:
|
||
|
properties:
|
||
|
code:
|
||
|
description: application-specific error code
|
||
|
type: integer
|
||
|
error:
|
||
|
description: application-level error message, for debugging
|
||
|
type: string
|
||
|
status:
|
||
|
description: user-level status message
|
||
|
type: string
|
||
|
type: object
|
||
|
models.TaskStatus:
|
||
|
enum:
|
||
|
- 0
|
||
|
- 1
|
||
|
- 2
|
||
|
- 3
|
||
|
- 4
|
||
|
type: integer
|
||
|
x-enum-comments:
|
||
|
StatusCancelled: "4"
|
||
|
StatusCompleted: "2"
|
||
|
StatusFailed: "3"
|
||
|
StatusInProgress: "1"
|
||
|
StatusPending: "0"
|
||
|
x-enum-varnames:
|
||
|
- StatusPending
|
||
|
- StatusInProgress
|
||
|
- StatusCompleted
|
||
|
- StatusFailed
|
||
|
- StatusCancelled
|
||
|
taskcontroller.CreateTaskDTO:
|
||
|
properties:
|
||
|
repo:
|
||
|
type: string
|
||
|
type: object
|
||
|
taskcontroller.CreateTaskResponse:
|
||
|
properties:
|
||
|
status:
|
||
|
$ref: '#/definitions/models.TaskStatus'
|
||
|
taskID:
|
||
|
type: integer
|
||
|
type: object
|
||
|
info:
|
||
|
contact: {}
|
||
|
paths:
|
||
|
/tasks:
|
||
|
post:
|
||
|
consumes:
|
||
|
- application/json
|
||
|
description: Create a new task for a specific repository
|
||
|
parameters:
|
||
|
- description: Request body to create a task
|
||
|
in: body
|
||
|
name: body
|
||
|
required: true
|
||
|
schema:
|
||
|
$ref: '#/definitions/taskcontroller.CreateTaskDTO'
|
||
|
produces:
|
||
|
- application/json
|
||
|
responses:
|
||
|
"201":
|
||
|
description: Created
|
||
|
schema:
|
||
|
$ref: '#/definitions/taskcontroller.CreateTaskResponse'
|
||
|
"400":
|
||
|
description: Invalid JSON or missing required fields
|
||
|
schema:
|
||
|
$ref: '#/definitions/errors.ErrResponse'
|
||
|
"500":
|
||
|
description: Internal server error
|
||
|
schema:
|
||
|
$ref: '#/definitions/errors.ErrResponse'
|
||
|
summary: Create a new task
|
||
|
tags:
|
||
|
- Tasks
|
||
|
swagger: "2.0"
|