diff --git a/src/api/public/apidocs/OBS-v2.10.50.yaml b/src/api/public/apidocs/OBS-v2.10.50.yaml index b71c254969a..5a2db5f3016 100644 --- a/src/api/public/apidocs/OBS-v2.10.50.yaml +++ b/src/api/public/apidocs/OBS-v2.10.50.yaml @@ -72,7 +72,7 @@ info: For command-line users, we recommend using [osc](https://github.com/openSUSE/osc) with its _api_ command to interact with the API. It's as simple as this example: `osc api /about` (_about_ is one of the endpoints documented below) - In order to make sure that the XML that is send in a requests body is in the expected format, the API validates it. + In order to make sure that the XML that is send in a requests body is in the expected format, the API validates it. Either against a XML Schema Definition (`.xsd`) or a RELAX NG Schema (`.rng`). The schemas are mentioned in the endpoint documentation. If there is no schema file mentioned, no validation of the XML is done. In case the XML is not valid, a validation error is reported. @@ -154,6 +154,8 @@ paths: /comment/{comment_id}: $ref: 'paths/comment_comment_id.yaml' + /comment/{comment_id}/history: + $ref: 'paths/comment_comment_id_history.yaml' /comments/user: $ref: 'paths/comments_user.yaml' /comments/request/{id}: diff --git a/src/api/public/apidocs/components/schemas/comment_history.yaml b/src/api/public/apidocs/components/schemas/comment_history.yaml new file mode 100644 index 00000000000..9f50a140557 --- /dev/null +++ b/src/api/public/apidocs/components/schemas/comment_history.yaml @@ -0,0 +1,12 @@ +type: object +properties: + comment: + type: array + items: + $ref: 'comment.yaml' + comment: + type: integer + xml: + attribute: true +xml: + name: comment_history diff --git a/src/api/public/apidocs/paths/comment_comment_id_history.yaml b/src/api/public/apidocs/paths/comment_comment_id_history.yaml new file mode 100644 index 00000000000..6d09d8a91c8 --- /dev/null +++ b/src/api/public/apidocs/paths/comment_comment_id_history.yaml @@ -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: | + + First version of comment + UHH DONT LIKE MY COMMENT + + '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