From b0c7daf7e5fe4bfbbc9488f4bb254348fe73ec7d Mon Sep 17 00:00:00 2001 From: shubhamgupta2956 Date: Wed, 22 Apr 2020 01:14:21 +0530 Subject: [PATCH] api_docs: Add "UserId" common component. To facilitate re-use of the same parameters in other paths, this commit store the content of the parameter "user_id" in components. --- zerver/openapi/zulip.yaml | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yaml index 142a77ee95..b3536e2896 100644 --- a/zerver/openapi/zulip.yaml +++ b/zerver/openapi/zulip.yaml @@ -1310,14 +1310,7 @@ paths: *This endpoint is new in Zulip Server 2.2.* parameters: - - name: user_id - in: path - description: | - The user id of the user. - schema: - type: integer - example: 11 - required: true + - $ref: '#/components/parameters/UserId' - $ref: '#/components/parameters/ClientGravatar' - name: include_custom_profile_fields in: query @@ -1401,14 +1394,7 @@ paths: [role](/help/roles-and-permissions), and [custom profile fields](/help/add-custom-profile-fields). parameters: - - name: user_id - in: path - description: | - The user id of the user. - schema: - type: integer - example: 12 - required: true + - $ref: '#/components/parameters/UserId' - name: full_name in: query description: | @@ -1481,14 +1467,7 @@ paths: `DELETE {{ api_url }}/v1/users/{user_id}` parameters: - - name: user_id - in: path - description: | - The user id of the user. - schema: - type: integer - example: 11 - required: true + - $ref: '#/components/parameters/UserId' responses: '200': description: Success @@ -3883,3 +3862,12 @@ components: type: integer example: 42 required: true + UserId: + name: user_id + in: path + description: | + The user id of the user. + schema: + type: integer + example: 11 + required: true