From c814afd4a7bbdc1e28e2fbdec60fbf03f1f6d85e Mon Sep 17 00:00:00 2001 From: shubhamgupta2956 Date: Sun, 19 Apr 2020 14:00:30 +0530 Subject: [PATCH] api_docs: Add "StreamIdInPath" common component. To facilitate re-use of the same parameters in other paths, this commit store the content of the parameter "stream_id" (in path) in components. --- zerver/openapi/zulip.yaml | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yaml index 7e542baa8a..ac8582ec5f 100644 --- a/zerver/openapi/zulip.yaml +++ b/zerver/openapi/zulip.yaml @@ -1666,14 +1666,7 @@ paths: description: | Get all the topics in a specific stream. parameters: - - name: stream_id - in: path - description: | - The unique ID of the stream. - schema: - type: integer - example: 42 - required: true + - $ref: '#/components/parameters/StreamIdInPath' responses: '200': description: Success. @@ -2969,14 +2962,7 @@ paths: Delete the stream with the given ID. operationId: zerver.views.streams.deactivate_stream_backend parameters: - - name: stream_id - in: path - description: | - The ID of the stream to be deleted. - schema: - type: integer - example: 42 - required: true + - $ref: '#/components/parameters/StreamIdInPath' responses: '200': description: Success. @@ -3011,14 +2997,7 @@ paths: Update the stream with the given ID. operationId: zerver.views.streams.update_stream_backend parameters: - - name: stream_id - in: path - description: | - The ID of the stream to be updated. - schema: - type: integer - example: 42 - required: true + - $ref: '#/components/parameters/StreamIdInPath' - name: description in: query description: | @@ -3703,3 +3682,12 @@ components: schema: type: integer example: 42 + StreamIdInPath: + name: stream_id + in: path + description: | + The ID of the stream to access. + schema: + type: integer + example: 42 + required: true