From bc8d18791484be660cf74ed7bf090b2b8599494b Mon Sep 17 00:00:00 2001 From: Fabrice Lecomte Date: Fri, 4 Oct 2019 00:06:53 +0200 Subject: [PATCH] OpenApi: move constitution path parameter to generic type --- src/main/resources/openApi.yaml | 47 +++++++++++---------------------- 1 file changed, 15 insertions(+), 32 deletions(-) diff --git a/src/main/resources/openApi.yaml b/src/main/resources/openApi.yaml index 38ef50f..da637b2 100644 --- a/src/main/resources/openApi.yaml +++ b/src/main/resources/openApi.yaml @@ -267,19 +267,13 @@ paths: schema: $ref: '#/components/schemas/ConstitutionResponse' /constitutions/{constitution}: + parameters: + - $ref: '#/components/parameters/constitution' get: summary: Get all constitutions tags: - constitution operationId: getConstitutions - parameters: - - name: constitution - in: query - required: true - description: the ID of constitution - schema: - type: string - format: uuid responses: 200: description: The Constitution objects @@ -390,14 +384,7 @@ paths: $ref: '#/components/schemas/CommentResponse' /constitutions/{constitution}/comments: parameters: - - name: constitution - in: path - description: The ID of constitution - example: e74be8e4-6823-47c4-bd1b-789725b2fa8e - required: true - schema: - type: string - format: uuid + - $ref: '#/components/parameters/constitution' get: summary: Get comment and children of one constitution tags: @@ -450,14 +437,7 @@ paths: description: Return only http status 204 on success /constitutions/{constitution}/follows: parameters: - - name: constitution - in: path - description: The ID of constitution - example: e74be8e4-6823-47c4-bd1b-789725b2fa8e - required: true - schema: - type: string - format: uuid + - $ref: '#/components/parameters/constitution' post: security: - JWTAuth: [] @@ -500,14 +480,7 @@ paths: $ref: '#/components/schemas/VoteAggregation' /constitutions/{constitution}/vote: parameters: - - name: constitution - in: path - description: The ID of constitution - example: e74be8e4-6823-47c4-bd1b-789725b2fa8e - required: true - schema: - type: string - format: uuid + - $ref: '#/components/parameters/constitution' put: security: - JWTAuth: [] @@ -616,6 +589,16 @@ components: type: string format: uuid + constitution: + name: constitution + in: path + required: true + description: the ID of constitution + example: e74be8e4-6823-47c4-bd1b-789725b2fa8e + schema: + type: string + format: uuid + securitySchemes: JWTAuth: type: http