diff mbox series

[09/17] docs: Document the '/bundles' resource

Message ID 20181030111916.7342-10-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
This one's a little unusual too, in that we provide the embedded
serializer for resources we haven't defined the end resource for. That's
necessary in general, due to recursive references in the API
(series-patch, patch-series etc.) so might as well embrace it early.

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

Patch

diff --git a/docs/api/schemas/patchwork.yaml b/docs/api/schemas/patchwork.yaml
index 99a15ad4..c5c29b50 100644
--- a/docs/api/schemas/patchwork.yaml
+++ b/docs/api/schemas/patchwork.yaml
@@ -25,6 +25,74 @@  paths:
                 $ref: '#/components/schemas/Index'
       tags:
       - api
+  /api/bundles/:
+    get:
+      description: List bundles.
+      operationId: bundles_list
+      parameters:
+      - $ref: '#/components/parameters/Page'
+      - $ref: '#/components/parameters/PageSize'
+      - $ref: '#/components/parameters/Order'
+      - $ref: '#/components/parameters/Search'
+      - in: query
+        name: project
+        schema:
+          description: ''
+          title: ''
+          type: string
+      - in: query
+        name: owner
+        schema:
+          description: ''
+          title: ''
+          type: string
+      - in: query
+        name: public
+        schema:
+          description: ''
+          title: ''
+          type: string
+      responses:
+        '200':
+          description: ''
+          headers:
+            Link:
+              $ref: '#/components/headers/Link'
+          content:
+            application/json:
+              schema:
+                type: array
+                items:
+                  $ref: '#/components/schemas/Bundle'
+      tags:
+      - bundles
+  /api/bundles/{id}/:
+    get:
+      description: Show a bundle.
+      operationId: bundles_read
+      parameters:
+      - in: path
+        name: id
+        required: true
+        schema:
+          description: ''
+          title: ''
+          type: string
+      responses:
+        '200':
+          description: ''
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/Bundle'
+        '404':
+          description: 'Not found'
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/Error'
+      tags:
+      - bundles
   /api/people/:
     get:
       description: List people.
@@ -442,6 +510,50 @@  components:
           type: string
           format: uri
           readOnly: true
+    Bundle:
+      required:
+        - name
+      type: object
+      properties:
+        id:
+          title: ID
+          type: integer
+          readOnly: true
+        url:
+          title: Url
+          type: string
+          format: uri
+          readOnly: true
+        web_url:
+          title: Web url
+          type: string
+          format: uri
+          readOnly: true
+        project:
+          $ref: '#/components/schemas/ProjectEmbedded'
+        name:
+          title: Name
+          type: string
+          maxLength: 50
+          minLength: 1
+        owner:
+          allOf:
+          - $ref: '#/components/schemas/UserEmbedded'
+          - title: Owner
+        patches:
+          type: array
+          items:
+            $ref: '#/components/schemas/PatchEmbedded'
+          readOnly: true
+          uniqueItems: true
+        public:
+          title: Public
+          type: boolean
+        mbox:
+          title: Mbox
+          type: string
+          format: uri
+          readOnly: true
     Person:
       type: object
       properties:
@@ -566,6 +678,97 @@  components:
           format: email
           readOnly: true
           minLength: 1
+    PatchEmbedded:
+      type: object
+      properties:
+        id:
+          title: ID
+          type: integer
+          readOnly: true
+        url:
+          title: Url
+          type: string
+          format: uri
+          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
+        name:
+          title: Name
+          type: string
+          readOnly: true
+          minLength: 1
+        mbox:
+          title: Mbox
+          type: string
+          format: uri
+          readOnly: true
+    ProjectEmbedded:
+      type: object
+      properties:
+        id:
+          title: ID
+          type: integer
+          readOnly: true
+        url:
+          title: Url
+          type: string
+          format: uri
+          readOnly: true
+        name:
+          title: Name
+          type: string
+          readOnly: true
+          minLength: 1
+        link_name:
+          title: Link name
+          type: string
+          readOnly: true
+          maxLength: 255
+          minLength: 1
+        list_id:
+          title: List id
+          type: string
+          readOnly: true
+          maxLength: 255
+          minLength: 1
+        list_email:
+          title: List email
+          type: string
+          format: email
+          readOnly: true
+          maxLength: 200
+          minLength: 1
+        web_url:
+          title: Web url
+          type: string
+          format: uri
+          readOnly: true
+          maxLength: 2000
+        scm_url:
+          title: Scm url
+          type: string
+          format: uri
+          readOnly: true
+          maxLength: 2000
+        webscm_url:
+          title: Webscm url
+          type: string
+          format: uri
+          readOnly: true
+          maxLength: 2000
     UserEmbedded:
       type: object
       properties: