From e363a9151b276343c01ad5ce45238acd37434aa9 Mon Sep 17 00:00:00 2001 From: Wlad Date: Tue, 3 Nov 2020 10:33:39 +0100 Subject: [PATCH] WIP: group management --- TODO.md | 8 +++--- openapi/openapi.yaml | 7 +++++ openapi/paths/access/groups/{key}-delete.yaml | 24 +++++++++++++++++ openapi/paths/access/groups/{key}-get.yaml | 19 +++++++++++++ openapi/paths/access/groups/{key}-put.yaml | 27 +++++++++++++++++++ 5 files changed, 81 insertions(+), 4 deletions(-) create mode 100644 openapi/paths/access/groups/{key}-delete.yaml create mode 100644 openapi/paths/access/groups/{key}-get.yaml create mode 100644 openapi/paths/access/groups/{key}-put.yaml diff --git a/TODO.md b/TODO.md index 6359f3e..e9921b0 100644 --- a/TODO.md +++ b/TODO.md @@ -95,10 +95,10 @@ Groups - [x] Get group list - - [ ] Add a new group - - [ ] Retrieve a group - - [ ] Update a group - - [ ] Delete a group + - [x] Add a new group + - [x] Retrieve a group + - [x] Update a group + - [x] Delete a group Users diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index ad92086..ada58ee 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -96,3 +96,10 @@ paths: $ref: paths/access/groups/get.yaml post: $ref: paths/access/groups/post.yaml + /access/groups/{key}: + get: + $ref: paths/access/groups/{key}-get.yaml + put: + $ref: paths/access/groups/{key}-put.yaml + delete: + $ref: paths/access/groups/{key}-delete.yaml diff --git a/openapi/paths/access/groups/{key}-delete.yaml b/openapi/paths/access/groups/{key}-delete.yaml new file mode 100644 index 0000000..aaf259c --- /dev/null +++ b/openapi/paths/access/groups/{key}-delete.yaml @@ -0,0 +1,24 @@ +summary: Delete a group +operationId: deleteGroup +description: >- + Deletes a group by its identifier. +parameters: + - in: path + name: key + description: >- + The group’s identifier + schema: + type: string +requestBody: + content: + application/json: + schema: + $ref: ../../../components/schemas/access/GroupUpdate.yaml +responses: + "200": + description: >- + Group was deleted. A list of all available groups will be returned. + content: + application/json: + schema: + $ref: ../../../components/schemas/access/GroupList.yaml diff --git a/openapi/paths/access/groups/{key}-get.yaml b/openapi/paths/access/groups/{key}-get.yaml new file mode 100644 index 0000000..d6ccbf7 --- /dev/null +++ b/openapi/paths/access/groups/{key}-get.yaml @@ -0,0 +1,19 @@ +summary: Retrieve a group +operationId: getGroup +description: >- + Retrieves an individual group record. +parameters: + - in: path + name: key + description: >- + The group’s identifier + schema: + type: string +responses: + "200": + description: >- + Group record + content: + application/json: + schema: + $ref: ../../../components/schemas/access/GroupRecord.yaml diff --git a/openapi/paths/access/groups/{key}-put.yaml b/openapi/paths/access/groups/{key}-put.yaml new file mode 100644 index 0000000..b86c048 --- /dev/null +++ b/openapi/paths/access/groups/{key}-put.yaml @@ -0,0 +1,27 @@ +summary: Update a group +operationId: updateGroup +description: >- + Updates an existing group. +parameters: + - in: path + name: key + description: >- + The group’s identifier + schema: + type: string +requestBody: + content: + application/json: + schema: + $ref: ../../../components/schemas/access/GroupUpdate.yaml +responses: + "200": + description: >- + Group records + content: + application/json: + schema: + $ref: ../../../components/schemas/access/GroupList.yaml + "400": + description: >- + If any of the mandatory fields is missing or the request is otherwise invalid