From 86eed5d9bbfabd382e782de59ca2aebf960d88cb Mon Sep 17 00:00:00 2001 From: shubhamgupta2956 Date: Sat, 18 Apr 2020 14:44:08 +0530 Subject: [PATCH] api_docs: Add "Topic" common component. To facilitate re-use of the same parameters in other paths, this commit store the content of the parameter "topic" in components. --- zerver/openapi/zulip.yaml | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yaml index 83112a3cce..38bf84b318 100644 --- a/zerver/openapi/zulip.yaml +++ b/zerver/openapi/zulip.yaml @@ -581,15 +581,7 @@ paths: type: string example: [9, 10] required: true - - name: topic - in: query - description: | - The topic of the message. Only required if `type` is `stream`, ignored - otherwise. Maximum length of 60 characters. - schema: - type: string - default: - example: Castle + - $ref: '#/components/parameters/Topic' - name: content in: query description: | @@ -682,15 +674,7 @@ paths: type: integer example: 42 required: true - - name: topic - in: query - description: | - The topic of the message. Only required for stream messages. Maximum - length of 60 characters. - schema: - type: string - default: - example: Castle + - $ref: '#/components/parameters/Topic' - name: propagate_mode in: query description: | @@ -3734,3 +3718,13 @@ components: type: integer example: 42 required: true + Topic: + name: topic + in: query + description: | + The topic of the message. Only required for stream messages + (`type="stream"`), ignored otherwise. Maximum length of 60 + characters. + schema: + type: string + example: Castle