Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
api-docs: Standardize on lowercase true, false and null.
Lauryn Menard4fcb243769c6
diff --git a/tools/linter_lib/custom_check.py b/tools/linter_lib/custom_check.pyindex 71da71d5871..e834b8ca41a 100644--- a/tools/linter_lib/custom_check.py+++ b/tools/linter_lib/custom_check.py@@ -904,6 +904,18 @@ puppet_rules = RuleList(],)+openapi_rules = RuleList(+ langs=["yaml"],+ rules=[+ *whitespace_rules,+ {+ "pattern": "True|TRUE|False|FALSE|Null|NULL",+ "include_only": {"zerver/openapi/"},+ "description": "Use lowercase for true, false and null in API documentation.",+ },+ ],+)+txt_rules = RuleList(langs=["txt", "text", "yaml", "rst", "yml"],rules=whitespace_rules,@@ -919,4 +931,5 @@ non_py_rules = [bash_rules,txt_rules,puppet_rules,+ openapi_rules,]diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yamlindex cdf30a810e6..490bb4d31ae 100644--- a/zerver/openapi/zulip.yaml+++ b/zerver/openapi/zulip.yaml@@ -567,7 +567,7 @@ paths:using the same CSS and client-side security protectionsas are used for message content.- type: object- additionalProperties: False+ additionalProperties: falsedescription: |When the Zulip display email address of a user changes,either due to the user's email address changing, or@@ -1275,8 +1275,8 @@ paths:Whether the history of the stream is public to its subscribers.- Currently always true for public streams (i.e. invite_only=False implies- history_public_to_subscribers=True), but clients should not make that+ Currently always true for public streams (i.e. `"invite_only": false` implies+ `"history_public_to_subscribers": true`), but clients should not make thatassumption, as we may change that behavior in the future.is_web_public:type: boolean@@ -2136,7 +2136,7 @@ paths:description: |The ID of the user who sent the message.- Null when event is for a rendering update of the original message,+ Is `null` when event is for a rendering update of the original message,such as for an [inline URL preview][inline-url-previews].**Changes**: As of Zulip 5.0 (feature level 114), this field@@ -2151,7 +2151,7 @@ paths:This field should be used by clients to determine if the eventonly provides a rendering update to the message content,such as for an [inline URL preview][inline-url-previews].- When `True`, the event does not reflect a user-generated edit+ When `true`, the event does not reflect a user-generated editand does not modify the message history.**Changes**: New in Zulip 5.0 (feature level 114). Clients can@@ -3777,7 +3777,7 @@ paths:example:{"id": 0,- "immediate": True,+ "immediate": true,"server_generation": 1619334181,"type": "restart","zulip_feature_level": 57,@@ -3899,7 +3899,7 @@ paths:nullable: truedescription: |The default pygments language code to be used for a code blocks- in this organization. Null if no default has been set.+ in this organization. If `null`, no default has been set.default_language:type: stringdescription: |@@ -5039,7 +5039,7 @@ paths:type: integerdescription: |The ID of the draft to be edited.- required: True+ required: trueexample: 2- name: draftin: query@@ -5057,7 +5057,7 @@ paths:}description: |A JSON-encoded object containing a replacement draft object for this ID.- required: True+ required: trueresponses:"200":$ref: "#/components/responses/SimpleSuccess"@@ -5085,7 +5085,7 @@ paths:type: integerdescription: |The ID of the draft you want to delete.- required: True+ required: trueexample: 1responses:"200":@@ -5316,7 +5316,7 @@ paths:This is different from the unique ID that a message would haveafter it was sent.- required: True+ required: trueexample: 1responses:"200":@@ -6147,7 +6147,7 @@ paths:<tr><td><code>historical</code></td><td>- True for messages that the user did not receive+ Is `true` for messages that the user did not receiveat the time they were sent but later was added tothe user's history (E.g. because they starred orreacted to a message sent to a public stream@@ -8338,8 +8338,8 @@ paths:description: |A boolean specifying whether authorization errors (such as when therequesting user is not authorized to access a private stream) should be- considered fatal or not. When `True`, an authorization error is reported- as such. When set to `False`, the response will be a 200 and any streams+ considered fatal or not. When `true`, an authorization error is reported+ as such. When set to `false`, the response will be a 200 and any streamswhere the request encountered an authorization error will be listedin the `unauthorized` key.schema:@@ -8426,7 +8426,7 @@ paths:}description: |A typical response for when the requesting user does not have access to- a private stream and `authorization_errors_fatal` is `True`:+ a private stream and `"authorization_errors_fatal": true`:- allOf:- $ref: "#/components/schemas/AddSubscriptionsResponse"- example:@@ -8439,7 +8439,7 @@ paths:}description: |A typical response for when the requesting user does not have access to- a private stream and `authorization_errors_fatal` is `False`:+ a private stream and `"authorization_errors_fatal": false`:patch:operationId: update-subscriptionssummary: Update subscriptions@@ -11200,7 +11200,7 @@ paths:The average number of messages sent to the stream in recent weeks,rounded to the nearest integer.- Null means the stream was recently created and there is+ If `null`, the stream was recently created and there isinsufficient data to estimate the average traffic.subscribers:type: array@@ -11346,10 +11346,10 @@ paths:old_unreads_missing:type: booleandescription: |- True if this data set was truncated because the user has too many+ Whether this data set was truncated because the user has too manyunread messages. When truncation occurs, only the most recent`MAX_UNREAD_MESSAGES` (currently 50000) messages will be considered- when forming this response. When true, we recommend that clients+ when forming this response. When `true`, we recommend that clientsdisplay a warning, as they are likely to produce erroneous resultsuntil reloaded with the user having fewer than `MAX_UNREAD_MESSAGES`unread messages.@@ -12844,7 +12844,7 @@ paths:Present if `realm` is present in `fetch_event_types`.The default pygments language code to be used for a code blocks- in this organization. Null if no default has been set.+ in this organization. If `null`, no default has been set.realm_message_content_delete_limit_seconds:type: integernullable: true@@ -13147,7 +13147,7 @@ paths:Clients are not responsible for checking this quota; it is includedin the API only for display purposes.- Null if there is no limit.+ If `null`, there is no limit.**Changes**: New in Zulip 5.0 (feature level 72). Previously,this was called `realm_upload_quota`.@@ -13367,7 +13367,7 @@ paths:The value of the `WEB_PUBLIC_STREAMS_ENABLED` Zulip server levelsetting. A server that has disabled this setting intends to not offer [webpublic streams](/help/public-access-option) to realms it hosts. (Zulip Cloud- defaults to `True`; self-hosted servers default to `False`).+ defaults to `true`; self-hosted servers default to `false`).Clients should use this to determine whether to offer UI for therealm-level setting for enabling web-public streams@@ -15206,10 +15206,10 @@ paths:{"description": "A Scandinavian country","first_message_id": 1,- "history_public_to_subscribers": True,- "invite_only": False,- "is_announcement_only": False,- "is_web_public": False,+ "history_public_to_subscribers": true,+ "invite_only": false,+ "is_announcement_only": false,+ "is_web_public": false,"message_retention_days": null,"name": "Denmark","rendered_description": "<p>A Scandinavian country</p>",@@ -16425,8 +16425,8 @@ components:description: |Whether the history of the stream is public to its subscribers.- Currently always true for public streams (i.e. invite_only=False implies- history_public_to_subscribers=True), but clients should not make that+ Currently always true for public streams (i.e. `"invite_only": false` implies+ `"history_public_to_subscribers": true`), but clients should not make thatassumption, as we may change that behavior in the future.first_message_id:type: integer@@ -16438,7 +16438,7 @@ components:UI like the "more topics" widget that would suggest the streamhas older history that can be accessed.- Null is used for streams with no message history.+ Is `null` for streams with no message history.is_announcement_only:type: booleandeprecated: true@@ -16490,14 +16490,14 @@ components:type: stringnullable: truedescription: |- The default sending stream of the bot. Null if the bot doesn't+ The default sending stream of the bot. If `null`, the bot doesn'thave a default sending stream.default_events_register_stream:type: stringnullable: truedescription: |- The default stream for which the bot receives events/register data. Null if- the bot doesn't have such a default stream.+ The default stream for which the bot receives events/register data.+ If `null`, the bot doesn't have such a default stream.default_all_public_streams:type: booleandescription: |@@ -16512,7 +16512,7 @@ components:description: |The user ID of the bot's owner.- Null if the bot has no owner.+ If `null`, the bot has no owner.services:type: arraydescription: |@@ -16810,13 +16810,13 @@ components:nullable: truedescription: |The timestamp of when the export was deleted.- Null if it wasn't.+ If `null`, it wasn't deleted.failed_timestamp:type: numbernullable: truedescription: |The timestamp of when the export failed.- Null if it didn't.+ If `null`, it didn't fail.export_url:type: stringnullable: true@@ -17057,8 +17057,8 @@ components:description: |Whether the history of the stream is public to its subscribers.- Currently always true for public streams (i.e. invite_only=False implies- history_public_to_subscribers=True), but clients should not make that+ Currently always true for public streams (i.e. `"invite_only": false` implies+ `"history_public_to_subscribers": true`), but clients should not make thatassumption, as we may change that behavior in the future.first_message_id:type: integer@@ -17070,7 +17070,7 @@ components:UI like the "more topics" widget that would suggest the streamhas older history that can be accessed.- Null is used for streams with no message history.+ Is `null` for streams with no message history.stream_weekly_traffic:type: integernullable: true@@ -17078,7 +17078,7 @@ components:The average number of messages sent to the stream in recent weeks,rounded to the nearest integer.- Null means the stream was recently created and there is+ If `null`, the stream was recently created and there isinsufficient data to estimate the average traffic.can_remove_subscribers_group_id:type: integer@@ -17820,7 +17820,7 @@ components:nullable: truedescription: |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+ query parameter was set to `true` and the user's avatar is hosted bythe Gravatar provider (i.e. the user has never uploaded an avatar).**Changes**: In Zulip 3.0 (feature level 18), if the client has the@@ -18653,7 +18653,7 @@ components:in: querydescription: |Whether to consider only the direct members of user group and not members- of its subgroups. Default is `False`.+ of its subgroups. Default is `false`.schema:type: booleanexample: false