You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kibble.apache.org by hu...@apache.org on 2018/09/13 15:13:10 UTC

[kibble] 01/03: Add examples for adding sources via API

This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kibble.git

commit 90038d105ecf9604cc8a9f7ae476ea3d3461176d
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Thu Sep 13 17:12:07 2018 +0200

    Add examples for adding sources via API
---
 api/pages/sources.py                               |  3 +-
 .../openapi/components/schemas/SourceListAdd.yaml  | 36 ++++++++++++++++++++++
 2 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/api/pages/sources.py b/api/pages/sources.py
index 786d8e6..3424528 100644
--- a/api/pages/sources.py
+++ b/api/pages/sources.py
@@ -96,8 +96,7 @@
 #     content:
 #       application/json:
 #         schema:
-#           $ref: '#/components/schemas/SourceList'
-#     description: New source data to add
+#           $ref: '#/components/schemas/SourceListAdd'
 #     required: true
 #   responses:
 #     '200':
diff --git a/api/yaml/openapi/components/schemas/SourceListAdd.yaml b/api/yaml/openapi/components/schemas/SourceListAdd.yaml
new file mode 100644
index 0000000..8d82be0
--- /dev/null
+++ b/api/yaml/openapi/components/schemas/SourceListAdd.yaml
@@ -0,0 +1,36 @@
+########################################################################
+# SourceList                                                           #
+########################################################################
+properties:
+  okay:
+    type: boolean
+  organisation:
+    description: The organisation these sources belong to
+    type: string
+  sources:
+    description: The sources to add
+    items:
+      $ref: '#/components/schemas/Source'
+    type: array
+    example:
+            {"sources": [
+              {
+               "sourceURL": "https://github.com/apache/kibble.git",
+               "type": "github",
+               "optauth": {
+                    "username": "githubuser",
+                    "password": "githubpass"
+                   }
+               },
+               {
+               "sourceURL": "https://lists.apache.org/list.html?dev@httpd.apache.org",
+               "type": "ponymail",
+               "optauth": {
+                    "cookie": "ponycookie"
+                   }
+               }
+    
+              ]
+            }
+required:
+- sources