Skip to content

Commit 74b95c6

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 596cf0d commit 74b95c6

File tree

4 files changed

+445
-22
lines changed

4 files changed

+445
-22
lines changed

docs/api/schemas/latest/patchwork.yaml

Lines changed: 141 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,18 @@ paths:
319319
- $ref: '#/components/parameters/PageSize'
320320
- $ref: '#/components/parameters/Order'
321321
- $ref: '#/components/parameters/Search'
322+
- in: query
323+
name: type
324+
description: |
325+
Filter comment type. Use 'notes' to show only maintainer notes,
326+
'comments' to show only regular comments, or omit for default behavior
327+
(which only shows regular comments).
328+
schema:
329+
title: ''
330+
type: string
331+
enum:
332+
- notes
333+
- comments
322334
responses:
323335
'200':
324336
description: 'List of comments'
@@ -339,6 +351,43 @@ paths:
339351
$ref: '#/components/schemas/Error'
340352
tags:
341353
- comments
354+
post:
355+
summary: Create a maintainer note in the cover
356+
description: |
357+
Create a maintainer note in the cover
358+
operationId: cover_maintainer_note_create
359+
requestBody:
360+
$ref: '#/components/requestBodies/MaintainerNote'
361+
responses:
362+
'201':
363+
description: 'Created maintainer note'
364+
headers:
365+
Link:
366+
$ref: '#/components/headers/Link'
367+
content:
368+
application/json:
369+
schema:
370+
$ref: '#/components/schemas/Comment'
371+
'400':
372+
description: 'Invalid request'
373+
content:
374+
application/json:
375+
schema:
376+
$ref: '#/components/schemas/ErrorMaintainerNote'
377+
'403':
378+
description: 'Forbidden'
379+
content:
380+
application/json:
381+
schema:
382+
$ref: '#/components/schemas/Error'
383+
'404':
384+
description: 'Not found'
385+
content:
386+
application/json:
387+
schema:
388+
$ref: '#/components/schemas/Error'
389+
tags:
390+
- comments
342391
/api/covers/{cover_id}/comments/{comment_id}:
343392
parameters:
344393
- in: path
@@ -356,7 +405,7 @@ paths:
356405
title: Comment ID
357406
type: integer
358407
get:
359-
summary: Show a cover letter comment.
408+
summary: Show a cover letter comment or maintainer note.
360409
description: |
361410
Retrieve a cover letter comment by its ID.
362411
operationId: cover_comments_read
@@ -376,7 +425,7 @@ paths:
376425
tags:
377426
- comments
378427
patch:
379-
summary: Update a cover letter comment (partial).
428+
summary: Update a cover letter comment or maintainer note (partial).
380429
description:
381430
Partially update an existing cover letter comment.
382431
You must be a maintainer of the project that the cover letter comment belongs to.
@@ -725,6 +774,18 @@ paths:
725774
- $ref: '#/components/parameters/PageSize'
726775
- $ref: '#/components/parameters/Order'
727776
- $ref: '#/components/parameters/Search'
777+
- in: query
778+
name: type
779+
description: |
780+
Filter comment type. Use 'notes' to show only maintainer notes,
781+
'comments' to show only regular comments, or omit for default behavior
782+
(which only shows regular comments).
783+
schema:
784+
title: ''
785+
type: string
786+
enum:
787+
- notes
788+
- comments
728789
responses:
729790
'200':
730791
description: 'List of comments'
@@ -745,6 +806,43 @@ paths:
745806
$ref: '#/components/schemas/Error'
746807
tags:
747808
- comments
809+
post:
810+
summary: Create a maintainer note in the patch
811+
description: |
812+
Create a maintainer note in the patch
813+
operationId: patch_maintainer_note_create
814+
requestBody:
815+
$ref: '#/components/requestBodies/MaintainerNote'
816+
responses:
817+
'201':
818+
description: 'Created maintainer note'
819+
headers:
820+
Link:
821+
$ref: '#/components/headers/Link'
822+
content:
823+
application/json:
824+
schema:
825+
$ref: '#/components/schemas/Comment'
826+
'400':
827+
description: 'Invalid request'
828+
content:
829+
application/json:
830+
schema:
831+
$ref: '#/components/schemas/ErrorMaintainerNote'
832+
'403':
833+
description: 'Forbidden'
834+
content:
835+
application/json:
836+
schema:
837+
$ref: '#/components/schemas/Error'
838+
'404':
839+
description: 'Not found'
840+
content:
841+
application/json:
842+
schema:
843+
$ref: '#/components/schemas/Error'
844+
tags:
845+
- comments
748846
/api/patches/{patch_id}/comments/{comment_id}:
749847
parameters:
750848
- in: path
@@ -762,7 +860,7 @@ paths:
762860
title: Comment ID
763861
type: integer
764862
get:
765-
summary: Show a patch comment.
863+
summary: Show a patch comment or maintainer note.
766864
description: |
767865
Retrieve a patch comment by its ID and the ID of the patch.
768866
operationId: patch_comments_read
@@ -782,7 +880,7 @@ paths:
782880
tags:
783881
- comments
784882
patch:
785-
summary: Update a patch comment (partial).
883+
summary: Update a patch comment or mantainer note (partial).
786884
description:
787885
Partially update an existing patch comment.
788886
You must be a maintainer of the project that the patch comment belongs to.
@@ -1478,6 +1576,14 @@ components:
14781576
application/json:
14791577
schema:
14801578
$ref: '#/components/schemas/CommentUpdate'
1579+
MaintainerNote:
1580+
required: true
1581+
description: |
1582+
A maintainer note for patch or cover letters.
1583+
content:
1584+
application/json:
1585+
schema:
1586+
$ref: '#/components/schemas/MaintainerNote'
14811587
Patch:
14821588
required: true
14831589
description: |
@@ -1770,7 +1876,6 @@ components:
17701876
title: Message ID
17711877
type: string
17721878
readOnly: true
1773-
minLength: 1
17741879
maxLength: 255
17751880
list_archive_url:
17761881
title: List archive URL
@@ -1801,7 +1906,6 @@ components:
18011906
content:
18021907
title: Content
18031908
type: string
1804-
readOnly: true
18051909
minLength: 1
18061910
headers:
18071911
title: Headers
@@ -1831,6 +1935,21 @@ components:
18311935
type:
18321936
- 'null'
18331937
- 'boolean'
1938+
MaintainerNote:
1939+
type: object
1940+
title: Maintainer note
1941+
description: |
1942+
The fields to set on a maintainer note.
1943+
properties:
1944+
content:
1945+
title: Content
1946+
type:
1947+
- 'string'
1948+
addressed:
1949+
title: Addressed
1950+
type:
1951+
- 'null'
1952+
- 'boolean'
18341953
CoverList:
18351954
type: object
18361955
title: Cover letters
@@ -3153,6 +3272,22 @@ components:
31533272
type: array
31543273
items:
31553274
type: string
3275+
ErrorMaintainerNote:
3276+
type: object
3277+
title: A maintainer note create or update error.
3278+
description: |
3279+
A mapping of field names to validation failures.
3280+
properties:
3281+
content:
3282+
title: Content
3283+
type: array
3284+
items:
3285+
type: string
3286+
addressed:
3287+
title: Addressed
3288+
type: array
3289+
items:
3290+
type: string
31563291
ErrorPatchUpdate:
31573292
type: object
31583293
title: A patch update error.

0 commit comments

Comments
 (0)