forked from openSUSE/open-build-service
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add openapi docs for comment history api endpoint
- Loading branch information
1 parent
a886a0f
commit be7d2b4
Showing
3 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/api/public/apidocs/components/schemas/comment_history.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
type: object | ||
properties: | ||
comment: | ||
type: array | ||
items: | ||
$ref: 'comment.yaml' | ||
comment: | ||
type: integer | ||
xml: | ||
attribute: true | ||
xml: | ||
name: comment_history |
52 changes: 52 additions & 0 deletions
52
src/api/public/apidocs/paths/comment_comment_id_history.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
get: | ||
summary: List the history of a comment | ||
description: | | ||
List the versions of a edited comment. | ||
**(Beta/Unstable)** This endpoint is currently behind the `content_moderation` beta flag. | ||
security: | ||
- basic_authentication: [] | ||
parameters: | ||
- in: path | ||
name: comment_id | ||
schema: | ||
type: integer | ||
required: true | ||
description: Id of the comment. | ||
example: 5 | ||
responses: | ||
'200': | ||
description: | | ||
OK. The request has succeeded. | ||
XML Schema used for body validation: [comment_history.rng](../schema/comment_history.rng) | ||
content: | ||
application/xml; charset=utf-8: | ||
schema: | ||
$ref: '../components/schemas/comment_history.yaml' | ||
example: | | ||
<comment_history comment="6"> | ||
<comment who="bar" when="2024-02-28 16:12:45 UTC" id="6">First version of comment</comment> | ||
<comment who="bar" when="2024-02-28 16:15:27 UTC" id="6">UHH DONT LIKE MY COMMENT</comment> | ||
</comment_history> | ||
'401': | ||
$ref: '../components/responses/unauthorized.yaml' | ||
'403': | ||
description: 'Forbidden' | ||
content: | ||
application/xml; charset=utf-8: | ||
schema: | ||
$ref: '../components/schemas/api_response.yaml' | ||
example: | ||
code: history_comment_not_authorized | ||
summary: Sorry, you are not authorized to history this comment. | ||
'404': | ||
description: Not Found | ||
content: | ||
application/xml; charset=utf-8: | ||
schema: | ||
$ref: '../components/schemas/api_response.yaml' | ||
example: | ||
code: not_found | ||
summary: Couldn't find Comment with 'id'=67 | ||
tags: | ||
- Comments |