From 9b79301662745c1bb641c4eec5eb25a567026b20 Mon Sep 17 00:00:00 2001 From: Fabrice Lecomte Date: Tue, 2 Jun 2020 01:01:29 +0200 Subject: [PATCH] update workgroup in OpenApi --- src/main/resources/openapi.yaml | 68 +++++++++++++++------------------ 1 file changed, 31 insertions(+), 37 deletions(-) diff --git a/src/main/resources/openapi.yaml b/src/main/resources/openapi.yaml index a7a6c21..58f4f35 100644 --- a/src/main/resources/openapi.yaml +++ b/src/main/resources/openapi.yaml @@ -1012,23 +1012,14 @@ paths: content: application/json: schema: - type: array - items: - type: object - properties: - id: - type: string - format: uuid - example: 6434f4f9-f570-f22a-c134-8668350651ff + $ref: '#/components/schemas/MembersRequest' responses: 201: description: the list of members content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/CitizenResponse' + $ref: '#/components/schemas/MembersResponse' put: security: - JWTAuth: [] @@ -1038,23 +1029,14 @@ paths: content: application/json: schema: - type: array - items: - type: object - properties: - id: - type: string - format: uuid - example: 6434f4f9-f570-f22a-c134-8668350651ff + $ref: '#/components/schemas/MembersRequest' responses: 201: description: the list of members content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/CitizenResponse' + $ref: '#/components/schemas/MembersResponse' delete: security: - JWTAuth: [] @@ -1064,23 +1046,14 @@ paths: content: application/json: schema: - type: array - items: - type: object - properties: - id: - type: string - format: uuid - example: 6434f4f9-f570-f22a-c134-8668350651ff + $ref: '#/components/schemas/MembersRequest' responses: 200: description: the list of members content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/CitizenResponse' + $ref: '#/components/schemas/MembersResponse' components: responses: @@ -1717,15 +1690,20 @@ components: - type: object properties: members: - $ref: '#/components/schemas/Members' + $ref: '#/components/schemas/MembersResponse' - $ref: '#/components/schemas/CreatedAt' - $ref: '#/components/schemas/UpdatedAt' - Members: + MembersRequest: description: members of workgroup type: array items: - $ref: '#/components/schemas/Member' - Member: + $ref: '#/components/schemas/MemberRequest' + MembersResponse: + description: members of workgroup + type: array + items: + $ref: '#/components/schemas/MemberResponse' + MemberResponse: description: Member of workgroup type: object properties: @@ -1741,6 +1719,22 @@ components: - EDITOR - REPORTER example: MASTER + MemberRequest: + description: Member of workgroup + type: object + properties: + citizen: + $ref: '#/components/schemas/UuidEntity' + roles: + type: array + items: + type: string + enum: + - MASTER + - MANAGER + - EDITOR + - REPORTER + example: MASTER