Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

openapi: Move `/users/{user_id}` below endpoints with similar regex.

orientorbb405ebc3d93
diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yaml
index ecc58193a7d..2f3d778f237 100644
--- a/zerver/openapi/zulip.yaml
+++ b/zerver/openapi/zulip.yaml
@@ -1569,207 +1569,6 @@ paths:
"result": "error"
}
- /users/{user_id}:
- get:
- operationId: get_user
- tags: ["users"]
- description: |
- Fetch details for a single user in the organization.
-
- `GET {{ api_url }}/v1/users/{user_id}`
-
- You can also fetch details on [all users in the organization](/api/get-users).
-
- *This endpoint is new in Zulip Server 3.0 (feature level 1).*
- parameters:
- - $ref: '#/components/parameters/UserId'
- - $ref: '#/components/parameters/ClientGravatar'
- - $ref: '#/components/parameters/IncludeCustomProfileFields'
- responses:
- '200':
- description: Success.
- content:
- application/json:
- schema:
- allOf:
- - $ref: '#/components/schemas/JsonSuccess'
- - properties:
- user:
- $ref: '#/components/schemas/User'
- - example:
- {
- "msg": "",
- "result": "success",
- "user": {
- "date_joined": "2019-10-20T07:50:53.729659+00:00",
- "full_name": "King Hamlet",
- "is_guest": false,
- "profile_data": {
- "4": {
- "value": "vim"
- },
- "2": {
- "value": "I am:\n* The prince of Denmark\n* Nephew to the usurping Claudius",
- "rendered_value": "<p>I am:</p>\n<ul>\n<li>The prince of Denmark</li>\n<li>Nephew to the usurping Claudius</li>\n</ul>"
- },
- "5": {
- "value": "1900-1-1"
- },
- "7": {
- "value": "[11]"
- },
- "6": {
- "value": "https://blog.zulig.org"
- },
- "1": {
- "value": "+0-11-23-456-7890",
- "rendered_value": "<p>+0-11-23-456-7890</p>"
- },
- "8": {
- "value": "zulipbot"
- },
- "3": {
- "rendered_value": "<p>Dark chocolate</p>",
- "value": "Dark chocolate"
- }
- },
- "user_id": 10,
- "is_bot": false,
- "bot_type": null,
- "timezone": "",
- "is_admin": false,
- "is_owner": false,
- "avatar_url": "https://secure.gravatar.com/avatar/6d8cad0fd00256e7b40691d27ddfd466?d=identicon&version=1",
- "is_active": true,
- "email": "[email protected]"
- }
- }
-
- patch:
- operationId: update_user
- tags: ["users"]
- description: |
- {!api-admin-only.md!}
-
- Administrative endpoint to update the details of another user in the organization.
-
- `PATCH {{ api_url }}/v1/users/{user_id}`
-
- Supports everything an administrator can do to edit details of another
- user's account, including editing full name,
- [role](/help/roles-and-permissions), and [custom profile
- fields](/help/add-custom-profile-fields).
- parameters:
- - $ref: '#/components/parameters/UserId'
- - name: full_name
- in: query
- description: |
- The user's full name.
- content:
- application/json:
- schema:
- type: string
- example: NewName
- required: false
- - name: role
- in: query
- description: |
- New [role](/help/roles-and-permissions) for the user. Roles are encoded as:
-
- * Organization owner: 100
- * Organization administrator: 200
- * Member: 400
- * Guest: 600
-
- Only organization owners can add or remove the owner role.
-
- The owner role cannot be removed from the only organization owner.
-
- **Changes**: New in Zulip 3.0 (feature level 8), replacing the previous
- pair of `is_admin` and `is_guest` boolean parameters.
- schema:
- type: integer
- example: 400
- required: false
- - name: profile_data
- in: query
- description: |
- A dictionary containing the to be updated custom profile field data for the user.
- content:
- application/json:
- schema:
- type: array
- items:
- type: object
- example: [
- {
- "id": 4,
- "value": "vim"
- },
- {
- "id": 5,
- "value": "1909-04-05"
- },
- ]
- required: false
-
- responses:
- '200':
- $ref: '#/components/responses/SimpleSuccess'
-
- '400':
- description: Bad request.
- content:
- application/json:
- schema:
- allOf:
- - $ref: '#/components/schemas/CodedError'
- - example:
- {
- "result": "error",
- "msg": "Guests cannot be organization administrators",
- "code": "BAD_REQUEST"
- }
-
- delete:
- operationId: deactivate_user
- tags: ["users"]
- description: |
- {!api-admin-only.md!}
-
- [Deactivates a
- user](https://zulip.com/help/deactivate-or-reactivate-a-user)
- given their user ID.
-
- `DELETE {{ api_url }}/v1/users/{user_id}`
- parameters:
- - $ref: '#/components/parameters/UserId'
- responses:
- '200':
- description: Success
- content:
- application/json:
- schema:
- allOf:
- - $ref: '#/components/schemas/JsonSuccess'
- - example:
- {
- "msg": "",
- "result": "success",
- }
- '400':
- description: Bad Request
- content:
- application/json:
- schema:
- allOf:
- - $ref: '#/components/schemas/JsonError'
- - example:
- {
- "msg": "Cannot deactivate the only organization administrator",
- "result": "error"
- }
-
/users/{user_id}/reactivate:
post:
operationId: reactivate_user
@@ -3039,6 +2838,205 @@ paths:
"result": "success",
"msg": ""
}
+ /users/{user_id}:
+ get:
+ operationId: get_user
+ tags: ["users"]
+ description: |
+ Fetch details for a single user in the organization.
+
+ `GET {{ api_url }}/v1/users/{user_id}`
+
+ You can also fetch details on [all users in the organization](/api/get-users).
+
+ *This endpoint is new in Zulip Server 3.0 (feature level 1).*
+ parameters:
+ - $ref: '#/components/parameters/UserId'
+ - $ref: '#/components/parameters/ClientGravatar'
+ - $ref: '#/components/parameters/IncludeCustomProfileFields'
+ responses:
+ '200':
+ description: Success.
+ content:
+ application/json:
+ schema:
+ allOf:
+ - $ref: '#/components/schemas/JsonSuccess'
+ - properties:
+ user:
+ $ref: '#/components/schemas/User'
+ - example:
+ {
+ "msg": "",
+ "result": "success",
+ "user": {
+ "date_joined": "2019-10-20T07:50:53.729659+00:00",
+ "full_name": "King Hamlet",
+ "is_guest": false,
+ "profile_data": {
+ "4": {
+ "value": "vim"
+ },
+ "2": {
+ "value": "I am:\n* The prince of Denmark\n* Nephew to the usurping Claudius",
+ "rendered_value": "<p>I am:</p>\n<ul>\n<li>The prince of Denmark</li>\n<li>Nephew to the usurping Claudius</li>\n</ul>"
+ },
+ "5": {
+ "value": "1900-1-1"
+ },
+ "7": {
+ "value": "[11]"
+ },
+ "6": {
+ "value": "https://blog.zulig.org"
+ },
+ "1": {
+ "value": "+0-11-23-456-7890",
+ "rendered_value": "<p>+0-11-23-456-7890</p>"
+ },
+ "8": {
+ "value": "zulipbot"
+ },
+ "3": {
+ "rendered_value": "<p>Dark chocolate</p>",
+ "value": "Dark chocolate"
+ }
+ },
+ "user_id": 10,
+ "is_bot": false,
+ "bot_type": null,
+ "timezone": "",
+ "is_admin": false,
+ "is_owner": false,
+ "avatar_url": "https://secure.gravatar.com/avatar/6d8cad0fd00256e7b40691d27ddfd466?d=identicon&version=1",
+ "is_active": true,
+ "email": "[email protected]"
+ }
+ }
+ patch:
+ operationId: update_user
+ tags: ["users"]
+ description: |
+ {!api-admin-only.md!}
+
+ Administrative endpoint to update the details of another user in the organization.
+
+ `PATCH {{ api_url }}/v1/users/{user_id}`
+
+ Supports everything an administrator can do to edit details of another
+ user's account, including editing full name,
+ [role](/help/roles-and-permissions), and [custom profile
+ fields](/help/add-custom-profile-fields).
+ parameters:
+ - $ref: '#/components/parameters/UserId'
+ - name: full_name
+ in: query
+ description: |
+ The user's full name.
+ content:
+ application/json:
+ schema:
+ type: string
+ example: NewName
+ required: false
+ - name: role
+ in: query
+ description: |
+ New [role](/help/roles-and-permissions) for the user. Roles are encoded as:
+
+ * Organization owner: 100
+ * Organization administrator: 200
+ * Member: 400
+ * Guest: 600
+
+ Only organization owners can add or remove the owner role.
+
+ The owner role cannot be removed from the only organization owner.
+
+ **Changes**: New in Zulip 3.0 (feature level 8), replacing the previous
+ pair of `is_admin` and `is_guest` boolean parameters.
+ schema:
+ type: integer
+ example: 400
+ required: false
+ - name: profile_data
+ in: query
+ description: |
+ A dictionary containing the to be updated custom profile field data for the user.
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ type: object
+ example: [
+ {
+ "id": 4,
+ "value": "vim"
+ },
+ {
+ "id": 5,
+ "value": "1909-04-05"
+ },
+ ]
+ required: false
+
+ responses:
+ '200':
+ $ref: '#/components/responses/SimpleSuccess'
+
+ '400':
+ description: Bad request.
+ content:
+ application/json:
+ schema:
+ allOf:
+ - $ref: '#/components/schemas/CodedError'
+ - example:
+ {
+ "result": "error",
+ "msg": "Guests cannot be organization administrators",
+ "code": "BAD_REQUEST"
+ }
+
+ delete:
+ operationId: deactivate_user
+ tags: ["users"]
+ description: |
+ {!api-admin-only.md!}
+
+ [Deactivates a
+ user](https://zulip.com/help/deactivate-or-reactivate-a-user)
+ given their user ID.
+
+ `DELETE {{ api_url }}/v1/users/{user_id}`
+ parameters:
+ - $ref: '#/components/parameters/UserId'
+ responses:
+ '200':
+ description: Success
+ content:
+ application/json:
+ schema:
+ allOf:
+ - $ref: '#/components/schemas/JsonSuccess'
+ - example:
+ {
+ "msg": "",
+ "result": "success",
+ }
+ '400':
+ description: Bad Request
+ content:
+ application/json:
+ schema:
+ allOf:
+ - $ref: '#/components/schemas/JsonError'
+ - example:
+ {
+ "msg": "Cannot deactivate the only organization administrator",
+ "result": "error"
+ }
/realm/filters:
get:
operationId: get_linkifiers