From 5e5405e5f982023a8bb4b338c0584f3a7be7f342 Mon Sep 17 00:00:00 2001 From: Fabrice Lecomte Date: Fri, 30 Aug 2019 15:40:17 +0200 Subject: [PATCH] feature #8: Add definition in openApi for Vote Article --- src/main/resources/openApi.yaml | 44 ++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/src/main/resources/openApi.yaml b/src/main/resources/openApi.yaml index 0eda2fb..bb0ee1c 100644 --- a/src/main/resources/openApi.yaml +++ b/src/main/resources/openApi.yaml @@ -379,7 +379,30 @@ paths: responses: 204: description: Return only http status 204 on success - + /articles/{article}/vote: + parameters: + - name: article + in: path + description: The ID of article + example: e74be8e4-6823-47c4-bd1b-789725b2fa8e + required: true + schema: + type: string + format: uuid + put: + security: + - JWTAuth: [] + summary: Vote for one article + tags: + - vote + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/VoteRequest' + responses: + 201: + description: Return only http status 201 on success components: parameters: @@ -725,6 +748,25 @@ components: - $ref: '#/components/schemas/FollowBase' + VoteBase: + allOf: + - type: object + properties: + note: + type: integer + minimum: -1 + maximum: 1 + required: true + VoteRequest: + allOf: + - $ref: '#/components/schemas/VoteBase' + VoteResponse: + allOf: + - $ref: '#/components/schemas/VoteBase' + - $ref: '#/components/schemas/Extra' + + + requestBodies: RegisterRequest: content: