Skip to content

Commit

Permalink
Document project comments endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
hellcp-work committed Apr 27, 2023
1 parent 59dbd4b commit 8fa677b
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/api/public/apidocs-new/OBS-v2.10.50.yaml
Expand Up @@ -138,6 +138,8 @@ paths:
$ref: 'paths/comment_comment_id.yaml'
/comments/request/{id}:
$ref: 'paths/comments_request_id.yaml'
/comments/project/{project_name}:
$ref: 'paths/comments_project_project_name.yaml'

/configuration:
$ref: 'paths/configuration.yaml'
Expand Down
@@ -0,0 +1,94 @@
get:
summary: List all the project's comments
description: List all the comments for the project.
security:
- basic_authentication: []
parameters:
- $ref: '../components/parameters/project_name.yaml'
responses:
'200':
description: OK. The request has succeeded.
content:
application/xml; charset=utf-8:
schema:
$ref: '../components/schemas/comments.yaml'
example: |
<comments project="home:Admin">
<comment who="Iggy" when="2021-10-15 13:28:22 UTC" id="1">This is a pretty cool comment!</comment>
</comments>
'401':
$ref: '../components/responses/unauthorized.yaml'
'404':
description: |
Not found.
XML Schema used for body validation: [status.xsd](../schema/status.xsd)
content:
application/xml; charset=utf-8:
schema:
$ref: '../components/schemas/api_response.yaml'
examples:
not_found:
summary: 'Project not found: notaproject'
value:
code: not_found
summary: 'Project not found: notaproject'
tags:
- Comments

post:
summary: Create a project comment
description: Create a comment for the project.
security:
- basic_authentication: []
parameters:
- $ref: '../components/parameters/project_name.yaml'
- in: query
name: parent_id
schema:
type: integer
description: Id of the comment to reply to
example: 10401
requestBody:
description: Content of the comment
required: true
content:
text/plain:
schema:
type: string
example: This is a very valuable comment
responses:
'200':
$ref: '../components/responses/succeeded.yaml'
'400':
description: |
Invalid Comment.
XML Schema used for body validation: [status.xsd](../schema/status.xsd)
content:
application/xml; charset=utf-8:
schema:
$ref: '../components/schemas/api_response.yaml'
examples:
invalid_record:
summary: Parent belongs to different object
value:
code: invalid_record
summary: Parent belongs to different object
'401':
$ref: '../components/responses/unauthorized.yaml'
'404':
description: |
Not found.
XML Schema used for body validation: [status.xsd](../schema/status.xsd)
content:
application/xml; charset=utf-8:
schema:
$ref: '../components/schemas/api_response.yaml'
examples:
not_found:
value:
code: not_found
tags:
- Comments

0 comments on commit 8fa677b

Please sign in to comment.