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 [nfc]: Give user / cross-realm bot properties a better ordering

Chris Bobbe9df0f1433e7c
diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yaml
index 40b368fd6d6..4b79fb14039 100644
--- a/zerver/openapi/zulip.yaml
+++ b/zerver/openapi/zulip.yaml
@@ -12182,27 +12182,24 @@ paths:
- $ref: "#/components/schemas/UserBase"
- additionalProperties: false
properties:
+ user_id: {}
+ delivery_email: {}
email: {}
- is_bot: {}
- avatar_url:
- nullable: true
- avatar_version: {}
full_name: {}
- is_admin: {}
- is_owner: {}
- is_billing_admin: {}
- role: {}
- bot_type:
- nullable: true
- user_id: {}
- bot_owner_id:
- nullable: true
+ date_joined: {}
is_active: {}
+ is_owner: {}
+ is_admin: {}
is_guest: {}
- timezone: {}
- date_joined: {}
- delivery_email: {}
- profile_data: {}
+ is_billing_admin: {}
+ is_bot: {}
+ # Referenced schema properties are rendered before any
+ # non-referenced properties in the API documentation, so
+ # `is_system_bot` appears last instead of in this order.
+ # General practice should be to define properties in the
+ # same order that they are rendered in the API documentation.
+ # TODO: See if we can match the order of properties as
+ # listed here when rendered in the API documentation.
is_system_bot:
type: boolean
description: |
@@ -12212,6 +12209,16 @@ paths:
**Changes**: This field was called `is_cross_realm_bot`
before Zulip 5.0 (feature level 83).
+ bot_type:
+ nullable: true
+ bot_owner_id:
+ nullable: true
+ role: {}
+ timezone: {}
+ avatar_url:
+ nullable: true
+ avatar_version: {}
+ profile_data: {}
example:
{
"last_event_id": -1,
@@ -15626,32 +15633,43 @@ components:
- $ref: "#/components/schemas/UserBase"
- additionalProperties: false
properties:
+ user_id: {}
+ delivery_email: {}
email: {}
- is_bot: {}
- avatar_url:
- nullable: true
- avatar_version: {}
full_name: {}
- is_admin: {}
+ date_joined: {}
+ is_active: {}
is_owner: {}
+ is_admin: {}
+ is_guest: {}
is_billing_admin: {}
- role: {}
+ is_bot: {}
bot_type:
nullable: true
- user_id: {}
bot_owner_id:
nullable: true
- is_active: {}
- is_guest: {}
+ role: {}
timezone: {}
- date_joined: {}
- delivery_email: {}
+ avatar_url:
+ nullable: true
+ avatar_version: {}
profile_data: {}
UserBase:
type: object
description: |
A dictionary containing basic data on a given Zulip user.
properties:
+ user_id:
+ type: integer
+ description: |
+ The unique ID of the user.
+ delivery_email:
+ type: string
+ description: |
+ The user's real email address. This field is present only if
+ [email address visibility](/help/restrict-visibility-of-email-addresses) is
+ limited and you are an administrator with access to real email addresses
+ under the configured policy.
email:
type: string
description: |
@@ -15659,35 +15677,18 @@ components:
If you do not have permission to view the email address of the target user,
this will be a fake email address that is usable for the Zulip API but nothing else.
- is_bot:
- type: boolean
- description: |
- A boolean specifying whether the user is a bot or full account.
- avatar_url:
- type: string
- nullable: true
- description: |
- URL for the user's avatar. Will be `null` if the `client_gravatar`
- query parameter was set to `True` and the user's avatar is hosted by
- the Gravatar provider (i.e. the user has never uploaded an avatar).
-
- **Changes**: In Zulip 3.0 (feature level 18), if the client has the
- `user_avatar_url_field_optional` capability, this will be missing at
- the server's sole discretion.
- avatar_version:
- type: integer
- description: |
- Version for the user's avatar. Used for cache-busting requests
- for the user's avatar. Clients generally shouldn't need to use this;
- most avatar URLs sent by Zulip will already end with `?v={avatar_version}`.
full_name:
type: string
description: |
Full name of the user or bot, used for all display purposes.
- is_admin:
+ date_joined:
+ type: string
+ description: |
+ The time the user account was created.
+ is_active:
type: boolean
description: |
- A boolean specifying whether the user is an organization administrator.
+ A boolean specifying whether the user account has been deactivated.
is_owner:
type: boolean
description: |
@@ -15695,31 +15696,24 @@ components:
If true, `is_admin` will also be true.
**Changes**: New in Zulip 3.0 (feature level 8).
+ is_admin:
+ type: boolean
+ description: |
+ A boolean specifying whether the user is an organization administrator.
+ is_guest:
+ type: boolean
+ description: |
+ A boolean specifying whether the user is a guest user.
is_billing_admin:
type: boolean
description: |
A boolean specifying whether the user is a billing administrator.
**Changes**: New in Zulip 5.0 (feature level 73).
- role:
- type: integer
- enum:
- - 100
- - 200
- - 300
- - 400
- - 600
+ is_bot:
+ type: boolean
description: |
- [Organization-level role](/api/roles-and-permissions) of the user.
- Possible values are:
-
- - Organization owner => 100
- - Organization administrator => 200
- - Organization moderator => 300
- - Member => 400
- - Guest => 600
-
- **Changes**: New in Zulip 4.0 (feature level 59).
+ A boolean specifying whether the user is a bot or full account.
bot_type:
type: integer
nullable: true
@@ -15731,10 +15725,6 @@ components:
- `2` for an `Incoming webhook` bot.
- `3` for an `Outgoing webhook` bot.
- `4` for an `Embedded` bot.
- user_id:
- type: integer
- description: |
- The unique ID of the user.
bot_owner_id:
type: integer
nullable: true
@@ -15748,29 +15738,46 @@ components:
**Changes**: New in Zulip 3.0 (feature level
1). In previous versions, there was a `bot_owner` field
containing the email address of the bot's owner.
- is_active:
- type: boolean
- description: |
- A boolean specifying whether the user account has been deactivated.
- is_guest:
- type: boolean
+ role:
+ type: integer
+ enum:
+ - 100
+ - 200
+ - 300
+ - 400
+ - 600
description: |
- A boolean specifying whether the user is a guest user.
+ [Organization-level role](/api/roles-and-permissions) of the user.
+ Possible values are:
+
+ - Organization owner => 100
+ - Organization administrator => 200
+ - Organization moderator => 300
+ - Member => 400
+ - Guest => 600
+
+ **Changes**: New in Zulip 4.0 (feature level 59).
timezone:
type: string
description: |
The time zone of the user.
- date_joined:
+ avatar_url:
type: string
+ nullable: true
description: |
- The time the user account was created.
- delivery_email:
- type: string
+ URL for the user's avatar. Will be `null` if the `client_gravatar`
+ query parameter was set to `True` and the user's avatar is hosted by
+ the Gravatar provider (i.e. the user has never uploaded an avatar).
+
+ **Changes**: In Zulip 3.0 (feature level 18), if the client has the
+ `user_avatar_url_field_optional` capability, this will be missing at
+ the server's sole discretion.
+ avatar_version:
+ type: integer
description: |
- The user's real email address. This field is present only if
- [email address visibility](/help/restrict-visibility-of-email-addresses) is
- limited and you are an administrator with access to real email addresses
- under the configured policy.
+ Version for the user's avatar. Used for cache-busting requests
+ for the user's avatar. Clients generally shouldn't need to use this;
+ most avatar URLs sent by Zulip will already end with `?v={avatar_version}`.
profile_data:
$ref: "#/components/schemas/profile_data"
profile_data: