Skip to content

Commit d85a869

Browse files
docs: update comments endpoint schemas
- Add create maintainer note requests - Update Comment to allow empty msgid Signed-off-by: Victor Accarini <[email protected]>
1 parent f9719ba commit d85a869

File tree

4 files changed

+448
-22
lines changed

4 files changed

+448
-22
lines changed

docs/api/schemas/latest/patchwork.yaml

Lines changed: 142 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,19 @@ paths:
319319
- $ref: '#/components/parameters/PageSize'
320320
- $ref: '#/components/parameters/Order'
321321
- $ref: '#/components/parameters/Search'
322+
- in: query
323+
name: type
324+
required: false
325+
description: |
326+
Filter comment type. Use 'notes' to show only maintainer notes,
327+
'comments' to show only regular comments, or omit for default behavior
328+
(which only shows regular comments).
329+
schema:
330+
title: 'Comment type'
331+
type: string
332+
enum:
333+
- notes
334+
- comments
322335
responses:
323336
'200':
324337
description: 'List of comments'
@@ -339,6 +352,43 @@ paths:
339352
$ref: '#/components/schemas/Error'
340353
tags:
341354
- comments
355+
post:
356+
summary: Create a maintainer note in the cover
357+
description: |
358+
Create a maintainer note in the cover
359+
operationId: cover_maintainer_note_create
360+
requestBody:
361+
$ref: '#/components/requestBodies/MaintainerNote'
362+
responses:
363+
'201':
364+
description: 'Created maintainer note'
365+
headers:
366+
Link:
367+
$ref: '#/components/headers/Link'
368+
content:
369+
application/json:
370+
schema:
371+
$ref: '#/components/schemas/Comment'
372+
'400':
373+
description: 'Invalid request'
374+
content:
375+
application/json:
376+
schema:
377+
$ref: '#/components/schemas/ErrorMaintainerNote'
378+
'403':
379+
description: 'Forbidden'
380+
content:
381+
application/json:
382+
schema:
383+
$ref: '#/components/schemas/Error'
384+
'404':
385+
description: 'Not found'
386+
content:
387+
application/json:
388+
schema:
389+
$ref: '#/components/schemas/Error'
390+
tags:
391+
- comments
342392
/api/covers/{cover_id}/comments/{comment_id}:
343393
parameters:
344394
- in: path
@@ -356,7 +406,7 @@ paths:
356406
title: Comment ID
357407
type: integer
358408
get:
359-
summary: Show a cover letter comment.
409+
summary: Show a cover letter comment or maintainer note.
360410
description: |
361411
Retrieve a cover letter comment by its ID.
362412
operationId: cover_comments_read
@@ -376,7 +426,7 @@ paths:
376426
tags:
377427
- comments
378428
patch:
379-
summary: Update a cover letter comment (partial).
429+
summary: Update a cover letter comment or maintainer note (partial).
380430
description:
381431
Partially update an existing cover letter comment.
382432
You must be a maintainer of the project that the cover letter comment belongs to.
@@ -725,6 +775,19 @@ paths:
725775
- $ref: '#/components/parameters/PageSize'
726776
- $ref: '#/components/parameters/Order'
727777
- $ref: '#/components/parameters/Search'
778+
- in: query
779+
name: type
780+
required: false
781+
description: |
782+
Filter comment type. Use 'notes' to show only maintainer notes,
783+
'comments' to show only regular comments, or omit for default behavior
784+
(which only shows regular comments).
785+
schema:
786+
title: 'Comment type'
787+
type: string
788+
enum:
789+
- notes
790+
- comments
728791
responses:
729792
'200':
730793
description: 'List of comments'
@@ -745,6 +808,43 @@ paths:
745808
$ref: '#/components/schemas/Error'
746809
tags:
747810
- comments
811+
post:
812+
summary: Create a maintainer note in the patch
813+
description: |
814+
Create a maintainer note in the patch
815+
operationId: patch_maintainer_note_create
816+
requestBody:
817+
$ref: '#/components/requestBodies/MaintainerNote'
818+
responses:
819+
'201':
820+
description: 'Created maintainer note'
821+
headers:
822+
Link:
823+
$ref: '#/components/headers/Link'
824+
content:
825+
application/json:
826+
schema:
827+
$ref: '#/components/schemas/Comment'
828+
'400':
829+
description: 'Invalid request'
830+
content:
831+
application/json:
832+
schema:
833+
$ref: '#/components/schemas/ErrorMaintainerNote'
834+
'403':
835+
description: 'Forbidden'
836+
content:
837+
application/json:
838+
schema:
839+
$ref: '#/components/schemas/Error'
840+
'404':
841+
description: 'Not found'
842+
content:
843+
application/json:
844+
schema:
845+
$ref: '#/components/schemas/Error'
846+
tags:
847+
- comments
748848
/api/patches/{patch_id}/comments/{comment_id}:
749849
parameters:
750850
- in: path
@@ -762,7 +862,7 @@ paths:
762862
title: Comment ID
763863
type: integer
764864
get:
765-
summary: Show a patch comment.
865+
summary: Show a patch comment or maintainer note.
766866
description: |
767867
Retrieve a patch comment by its ID and the ID of the patch.
768868
operationId: patch_comments_read
@@ -782,7 +882,7 @@ paths:
782882
tags:
783883
- comments
784884
patch:
785-
summary: Update a patch comment (partial).
885+
summary: Update a patch comment or mantainer note (partial).
786886
description:
787887
Partially update an existing patch comment.
788888
You must be a maintainer of the project that the patch comment belongs to.
@@ -1478,6 +1578,14 @@ components:
14781578
application/json:
14791579
schema:
14801580
$ref: '#/components/schemas/CommentUpdate'
1581+
MaintainerNote:
1582+
required: true
1583+
description: |
1584+
A maintainer note for patch or cover letters.
1585+
content:
1586+
application/json:
1587+
schema:
1588+
$ref: '#/components/schemas/MaintainerNote'
14811589
Patch:
14821590
required: true
14831591
description: |
@@ -1770,7 +1878,6 @@ components:
17701878
title: Message ID
17711879
type: string
17721880
readOnly: true
1773-
minLength: 1
17741881
maxLength: 255
17751882
list_archive_url:
17761883
title: List archive URL
@@ -1801,7 +1908,6 @@ components:
18011908
content:
18021909
title: Content
18031910
type: string
1804-
readOnly: true
18051911
minLength: 1
18061912
headers:
18071913
title: Headers
@@ -1831,6 +1937,20 @@ components:
18311937
type:
18321938
- 'null'
18331939
- 'boolean'
1940+
MaintainerNote:
1941+
type: object
1942+
title: Maintainer note
1943+
description: |
1944+
The fields to set on a maintainer note.
1945+
properties:
1946+
content:
1947+
title: Content
1948+
type: string
1949+
addressed:
1950+
title: Addressed
1951+
type:
1952+
- 'null'
1953+
- 'boolean'
18341954
CoverList:
18351955
type: object
18361956
title: Cover letters
@@ -3153,6 +3273,22 @@ components:
31533273
type: array
31543274
items:
31553275
type: string
3276+
ErrorMaintainerNote:
3277+
type: object
3278+
title: A maintainer note create or update error.
3279+
description: |
3280+
A mapping of field names to validation failures.
3281+
properties:
3282+
content:
3283+
title: Content
3284+
type: array
3285+
items:
3286+
type: string
3287+
addressed:
3288+
title: Addressed
3289+
type: array
3290+
items:
3291+
type: string
31563292
ErrorPatchUpdate:
31573293
type: object
31583294
title: A patch update error.

0 commit comments

Comments
 (0)