From 54dbdf28637b1a80b717a7d8916c0429975179ff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Matija=20=C4=8Cupi=C4=87?= <matteeyah@gmail.com>
Date: Wed, 2 May 2018 21:52:57 +0200
Subject: [PATCH] Add Pipeline stage, status and job JSON schemas

---
 spec/fixtures/api/schemas/job.json            | 24 +++++++++++++++++++
 spec/fixtures/api/schemas/pipeline_stage.json | 24 +++++++++++++++++++
 spec/fixtures/api/schemas/status.json         | 24 +++++++++++++++++++
 3 files changed, 72 insertions(+)
 create mode 100644 spec/fixtures/api/schemas/job.json
 create mode 100644 spec/fixtures/api/schemas/pipeline_stage.json
 create mode 100644 spec/fixtures/api/schemas/status.json

diff --git a/spec/fixtures/api/schemas/job.json b/spec/fixtures/api/schemas/job.json
new file mode 100644
index 00000000000..0abee1945cc
--- /dev/null
+++ b/spec/fixtures/api/schemas/job.json
@@ -0,0 +1,24 @@
+{
+  "type": "object",
+  "required": [
+    "id",
+    "name",
+    "started",
+    "build_path",
+    "playable",
+    "created_at",
+    "updated_at",
+    "status"
+  ],
+  "properties": {
+    "id": { "type": "integer" },
+    "name": { "type": "string" },
+    "started": { "type": "boolean" } ,
+    "build_path": { "type": "string" },
+    "playable": { "type": "boolean" },
+    "created_at": { "type": "string" },
+    "updated_at": { "type": "string" },
+    "status": { "$ref": "status.json" }
+  },
+  "additionalProperties": false
+}
diff --git a/spec/fixtures/api/schemas/pipeline_stage.json b/spec/fixtures/api/schemas/pipeline_stage.json
new file mode 100644
index 00000000000..d11c92810dc
--- /dev/null
+++ b/spec/fixtures/api/schemas/pipeline_stage.json
@@ -0,0 +1,24 @@
+{
+  "type": "object",
+  "required" : [
+    "name",
+    "title",
+    "status",
+    "path",
+    "dropdown_path"
+  ],
+  "properties" : {
+    "name": { "type": "string" },
+    "title": { "type": "string" },
+    "groups": { "optional": true },
+    "latest_statuses": {
+      "type": "array",
+      "items": { "$ref": "job.json" },
+      "optional": true
+    },
+    "status": { "$ref": "status.json" },
+    "path": { "type": "string" },
+    "dropdown_path": { "type": "string" }
+  },
+  "additionalProperties": false
+}
diff --git a/spec/fixtures/api/schemas/status.json b/spec/fixtures/api/schemas/status.json
new file mode 100644
index 00000000000..01e34249bf1
--- /dev/null
+++ b/spec/fixtures/api/schemas/status.json
@@ -0,0 +1,24 @@
+{
+  "type": "object",
+  "required" : [
+    "icon",
+    "text",
+    "label",
+    "group",
+    "tooltip",
+    "has_details",
+    "details_path",
+    "favicon"
+  ],
+  "properties": {
+    "icon": { "type": "string" },
+    "text": { "type": "string" },
+    "label": { "type": "string" },
+    "group": { "type": "string" },
+    "tooltip": { "type": "string" },
+    "has_details": { "type": "boolean" },
+    "details_path": { "type": "string" },
+    "favicon": { "type": "string" }
+  },
+  "additionalProperties": false
+}
-- 
2.30.9