Document API

This commit is contained in:
Sebastian 2023-09-25 12:01:24 +02:00
parent 9a67dfb875
commit c2a95a1d13
2 changed files with 213 additions and 2 deletions

View File

@ -18,7 +18,7 @@ import java.util.List;
@CrossOrigin(origins = "*", maxAge = 3600)
@RestController
@RequestMapping("/api/settings")
@RequestMapping("/api")
public class TaskgroupController {
private final TaskgroupService taskgroupService;

View File

@ -564,6 +564,190 @@ paths:
example: "failed"
enum:
- "failed"
/taskgroups:
get:
security:
- API_TOKEN: []
tags:
- taskgroup
summary: list all taskgroups of authorized user
description: list all taskgroups of authorized user
responses:
200:
description: Anfrage erfolgreich
content:
'application/json':
schema:
type: array
items:
$ref: '#/components/schemas/TaskgroupEntityInfo'
put:
security:
- API_TOKEN: []
tags:
- taskgroup
summary: creates taskgroup
description: creates taskgroup
responses:
200:
description: Anfrage erfolgreich
content:
'application/json':
schema:
$ref: '#/components/schemas/TaskgroupEntityInfo'
409:
description: Taskgroup already exists
content:
application/json:
schema:
type: object
required:
- status
properties:
status:
type: string
description: Status
example: "failed"
enum:
- "failed"
/taskgroups/{taskgroupID}:
post:
security:
- API_TOKEN: []
tags:
- taskgroup
summary: edits taskgroup
description: edits taskgroup
parameters:
- name: taskgroupID
in: path
description: internal id of taskgroup
required: true
schema:
type: number
example: 1
responses:
200:
description: Anfrage erfolgreich
content:
'application/json':
schema:
type: object
required:
- status
properties:
status:
type: string
description: Status
example: "success"
enum:
- "success"
403:
description: No permission
content:
'application/json':
schema:
type: object
required:
- status
properties:
status:
type: string
description: Status
example: "failed"
enum:
- "failed"
404:
description: Taskgroup does not exist
content:
'application/json':
schema:
type: object
required:
- status
properties:
status:
type: string
description: Status
example: "failed"
enum:
- "failed"
409:
description: Taskgroup with that new name already exists
content:
'application/json':
schema:
type: object
required:
- status
properties:
status:
type: string
description: Status
example: "failed"
enum:
- "failed"
delete:
security:
- API_TOKEN: []
tags:
- taskgroup
summary: deletes taskgroup
description: deletes taskgroup
parameters:
- name: taskgroupID
in: path
description: internal id of taskgroup
required: true
schema:
type: number
example: 1
responses:
200:
description: Anfrage erfolgreich
content:
'application/json':
schema:
type: object
required:
- status
properties:
status:
type: string
description: Status
example: "success"
enum:
- "success"
403:
description: No permission
content:
'application/json':
schema:
type: object
required:
- status
properties:
status:
type: string
description: Status
example: "failed"
enum:
- "failed"
404:
description: Taskgroup does not exist
content:
'application/json':
schema:
type: object
required:
- status
properties:
status:
type: string
description: Status
example: "failed"
enum:
- "failed"
components:
securitySchemes:
API_TOKEN:
@ -750,3 +934,30 @@ components:
type: array
items:
$ref: '#/components/schemas/PropertyInfo'
TaskgroupEntityInfo:
required:
- taskgroupID
- taskgroupName
additionalProperties: false
properties:
taskgroupID:
type: number
description: internal id of taskgroup
example: 1
taskgroupName:
type: string
description: name of taskgroup
example: Taskgroup 1
maxLength: 255
minLength: 1
TaskgroupFieldInfo:
required:
- name
additionalProperties: false
properties:
name:
type: string
description: name of taskgroup
example: Taskgroup 1
maxLength: 255
minLength: 1