diff mbox series

[13/17] docs: Document the '/covers/{coverID}/comments' resource

Message ID 20181030111916.7342-14-stephen@that.guru
State Accepted
Headers show
Series Add OpenAPI 3.0.0 REST API spec | expand

Commit Message

Stephen Finucane Oct. 30, 2018, 11:19 a.m. UTC
Our first nested resource. Nothing too weird here though, save for the
raising of a HTTP 404 on a list resource (due to a missing patch).

Signed-off-by: Stephen Finucane <stephen@that.guru>
---
 docs/api/schemas/patchwork.yaml | 75 +++++++++++++++++++++++++++++++++
 1 file changed, 75 insertions(+)
diff mbox series

Patch

diff --git a/docs/api/schemas/patchwork.yaml b/docs/api/schemas/patchwork.yaml
index be5834a3..d9044624 100644
--- a/docs/api/schemas/patchwork.yaml
+++ b/docs/api/schemas/patchwork.yaml
@@ -163,6 +163,40 @@  paths:
                 $ref: '#/components/schemas/Error'
       tags:
       - covers
+  /api/covers/{id}/comments/:
+    get:
+      description: List comments
+      operationId: cover_comments_list
+      parameters:
+      - in: path
+        name: id
+        required: true
+        schema:
+          description: ''
+          title: ''
+          type: string
+      - $ref: '#/components/parameters/Page'
+      - $ref: '#/components/parameters/PageSize'
+      - $ref: '#/components/parameters/Order'
+      - $ref: '#/components/parameters/Search'
+      responses:
+        '200':
+          description: ''
+          headers:
+            Link:
+              $ref: '#/components/headers/Link'
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/CommentList'
+        '404':
+          description: 'Not found'
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/Error'
+      tags:
+      - comments
   /api/patches/:
     get:
       description: List patches.
@@ -882,6 +916,47 @@  components:
           type: string
           format: uri
           readOnly: true
+    CommentList:
+      type: object
+      properties:
+        id:
+          title: ID
+          type: integer
+          readOnly: true
+        web_url:
+          title: Web url
+          type: string
+          format: uri
+          readOnly: true
+        msgid:
+          title: Msgid
+          type: string
+          readOnly: true
+          minLength: 1
+        date:
+          title: Date
+          type: string
+          format: date-time
+          readOnly: true
+        subject:
+          title: Subject
+          type: string
+          readOnly: true
+        submitter:
+          allOf:
+            - $ref: '#/components/schemas/User'
+            - title: Submitter
+        content:
+          title: Content
+          type: string
+          readOnly: true
+          minLength: 1
+        headers:
+          title: Headers
+          type: array
+          items:
+            type: string
+          readOnly: true
     CoverLetterList:
       type: object
       properties: