From c2a95a1d1339f2b83125a6b2877dd6dc7ace6a74 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 25 Sep 2023 12:01:24 +0200 Subject: [PATCH] Document API --- .../api/controller/TaskgroupController.java | 2 +- openapi.yaml | 213 +++++++++++++++++- 2 files changed, 213 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/core/api/controller/TaskgroupController.java b/backend/src/main/java/core/api/controller/TaskgroupController.java index 8841c8b..d6fedf4 100644 --- a/backend/src/main/java/core/api/controller/TaskgroupController.java +++ b/backend/src/main/java/core/api/controller/TaskgroupController.java @@ -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; diff --git a/openapi.yaml b/openapi.yaml index fd9e9a6..ec92816 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -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: @@ -749,4 +933,31 @@ components: settings: type: array items: - $ref: '#/components/schemas/PropertyInfo' \ No newline at end of file + $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 \ No newline at end of file