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.
This commit is contained in:
shubhamgupta2956 2020-04-22 01:14:21 +05:30 committed by Tim Abbott
parent 83f7241606
commit b0c7daf7e5
1 changed files with 12 additions and 24 deletions

View File

@ -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