From b2e9e3e0487e85d227ab414ab8acd2ce76c85c52 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 27 Oct 2020 10:20:58 -0400 Subject: [PATCH] fix(writeapi): more tweaks to schema files --- .../openapi/write/admin/settings/setting.yaml | 18 +++++++++++++++++ public/openapi/write/files.yaml | 3 +-- public/openapi/write/posts/pid/bookmark.yaml | 4 ++-- public/openapi/write/posts/pid/state.yaml | 20 +++++++++---------- public/openapi/write/posts/pid/vote.yaml | 13 +++++++++--- public/openapi/write/topics/tid.yaml | 2 +- 6 files changed, 42 insertions(+), 18 deletions(-) diff --git a/public/openapi/write/admin/settings/setting.yaml b/public/openapi/write/admin/settings/setting.yaml index a0de3e06440d..dcd85aed5673 100644 --- a/public/openapi/write/admin/settings/setting.yaml +++ b/public/openapi/write/admin/settings/setting.yaml @@ -11,6 +11,24 @@ put: required: true description: backend id of the setting to update example: maximumRelatedTopics + - in: path + name: value + schema: + type: string + required: true + description: the value of the new setting + example: 2 + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + value: + type: string + description: the value of the new setting + example: 2 responses: '200': description: Admin setting updated diff --git a/public/openapi/write/files.yaml b/public/openapi/write/files.yaml index b4cbaabbaf56..23c497db3814 100644 --- a/public/openapi/write/files.yaml +++ b/public/openapi/write/files.yaml @@ -13,10 +13,9 @@ delete: path: type: string description: Path to the file (relative to the configured `upload_path`) + example: files/test.txt required: - path - example: - path: files/uploaded_file.jpg responses: '200': description: File deleted diff --git a/public/openapi/write/posts/pid/bookmark.yaml b/public/openapi/write/posts/pid/bookmark.yaml index fe57ccf89b08..2ebce0e2ff82 100644 --- a/public/openapi/write/posts/pid/bookmark.yaml +++ b/public/openapi/write/posts/pid/bookmark.yaml @@ -10,7 +10,7 @@ put: type: string required: true description: a valid post id - example: 1 + example: 2 responses: '200': description: Post successfully bookmarked @@ -36,7 +36,7 @@ delete: type: string required: true description: a valid post id - example: 1 + example: 2 responses: '200': description: Post successfully unbookmarked diff --git a/public/openapi/write/posts/pid/state.yaml b/public/openapi/write/posts/pid/state.yaml index f9e9ce8c124a..6403b748604a 100644 --- a/public/openapi/write/posts/pid/state.yaml +++ b/public/openapi/write/posts/pid/state.yaml @@ -1,8 +1,8 @@ -put: +delete: tags: - posts - summary: restore a post - description: This operation restores a post. + summary: deletes a post + description: This operation soft deletes a post. parameters: - in: path name: pid @@ -10,10 +10,10 @@ put: type: string required: true description: a valid post id - example: 1 + example: 2 responses: '200': - description: Topic successfully restored + description: Post successfully deleted content: application/json: schema: @@ -24,11 +24,11 @@ put: response: type: object properties: {} -delete: +put: tags: - posts - summary: deletes a post - description: This operation soft deletes a post. + summary: restore a post + description: This operation restores a post. parameters: - in: path name: pid @@ -36,10 +36,10 @@ delete: type: string required: true description: a valid post id - example: 1 + example: 2 responses: '200': - description: Post successfully deleted + description: Topic successfully restored content: application/json: schema: diff --git a/public/openapi/write/posts/pid/vote.yaml b/public/openapi/write/posts/pid/vote.yaml index 5d2fd6c2f3fb..0cdb895a81b7 100644 --- a/public/openapi/write/posts/pid/vote.yaml +++ b/public/openapi/write/posts/pid/vote.yaml @@ -10,7 +10,7 @@ put: type: string required: true description: a valid post id - example: 1 + example: 2 requestBody: required: true content: @@ -21,8 +21,7 @@ put: delta: type: number description: Positive integer for upvote, negative integer for downvote (0 to unvote.) - example: - delta: 1 + example: 1 responses: '200': description: Post successfully upvoted @@ -41,6 +40,14 @@ delete: - posts summary: unvote a post description: This operation removes a pre-cast vote on a post. + parameters: + - in: path + name: pid + schema: + type: string + required: true + description: a valid post id + example: 2 responses: '200': description: Post successfully unvoted diff --git a/public/openapi/write/topics/tid.yaml b/public/openapi/write/topics/tid.yaml index adc5e02fe02a..04a5e98aee9f 100644 --- a/public/openapi/write/topics/tid.yaml +++ b/public/openapi/write/topics/tid.yaml @@ -51,7 +51,7 @@ delete: type: string required: true description: a valid topic id - example: 2 + example: 3 responses: '200': description: Topic successfully purged