From bb0ea05801e44308e1161c54c81254ec8538ae26 Mon Sep 17 00:00:00 2001
From: Felix Blanke <info@fblanke.de>
Date: Tue, 4 Mar 2025 15:51:58 +0100
Subject: [PATCH] Use relative paths in schema definitions

---
 schemas/ak.schema.json                 | 16 ++++++++--------
 schemas/common/constraints.schema.json |  2 +-
 schemas/common/id.schema.json          |  2 +-
 schemas/common/id_array.schema.json    |  2 +-
 schemas/participant.schema.json        | 10 +++++-----
 schemas/room.schema.json               |  8 ++++----
 schemas/solver-input.schema.json       | 10 +++++-----
 schemas/solver-output.schema.json      |  4 ++--
 schemas/timeslot.schema.json           |  6 +++---
 9 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/schemas/ak.schema.json b/schemas/ak.schema.json
index a7428a3..2439511 100644
--- a/schemas/ak.schema.json
+++ b/schemas/ak.schema.json
@@ -1,11 +1,11 @@
 {
   "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "$id": "/schema/ak.schema.json",
+  "$id": "schemas/ak.schema.json",
   "title": "AK",
   "type": "object",
   "properties": {
     "id": {
-      "$ref": "/schema/common/id.schema.json",
+      "$ref": "common/id.schema.json",
       "description": "The unique identifier of an AK"
     },
     "duration": {
@@ -14,22 +14,22 @@
       "exclusiveMinimum": 0
     },
     "room_constraints": {
-      "$ref": "/schema/common/constraints.schema.json",
+      "$ref": "common/constraints.schema.json",
       "description": "Room constraints required by this AK"
     },
     "time_constraints": {
-      "$ref": "/schema/common/constraints.schema.json",
+      "$ref": "common/constraints.schema.json",
       "description": "Time constraints required by this AK"
     },
     "properties": {
       "type": "object",
       "properties": {
         "conflicts": {
-          "$ref": "/schema/common/id_array.schema.json",
+          "$ref": "common/id_array.schema.json",
           "description": "IDs of all AKs that are in conflict with this AK"
         },
         "dependencies": {
-          "$ref": "/schema/common/id_array.schema.json",
+          "$ref": "common/id_array.schema.json",
           "description": "IDs of all AKs that should be scheduled before this AK"
         }
       },
@@ -45,11 +45,11 @@
         "reso": {"description": "Whether this AK intends to introduce a resolution", "type": "boolean"},
         "duration_in_hours": {"description": "AK duration in hours", "type": "number"},
         "django_ak_id": {
-          "$ref": "/schema/common/id.schema.json",
+          "$ref": "common/id.schema.json",
           "description": "Unique identifier of the AK object in the django database"
         },
         "types": {
-          "$ref": "/schema/common/constraints.schema.json",
+          "$ref": "common/constraints.schema.json",
           "description": "Types of this AK"
         }
       },
diff --git a/schemas/common/constraints.schema.json b/schemas/common/constraints.schema.json
index 7d3fce5..21c0dcd 100644
--- a/schemas/common/constraints.schema.json
+++ b/schemas/common/constraints.schema.json
@@ -1,6 +1,6 @@
 {
   "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "$id": "/schema/common/constraints.schema.json",
+  "$id": "schemas/common/constraints.schema.json",
   "type": "array",
   "items": {"type": "string"},
   "uniqueItems": true
diff --git a/schemas/common/id.schema.json b/schemas/common/id.schema.json
index 4dd06e3..636d6c7 100644
--- a/schemas/common/id.schema.json
+++ b/schemas/common/id.schema.json
@@ -1,6 +1,6 @@
 {
   "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "$id": "/schema/common/id.schema.json",
+  "$id": "schemas/common/id.schema.json",
   "type": "integer",
   "minimum": 0
 }
\ No newline at end of file
diff --git a/schemas/common/id_array.schema.json b/schemas/common/id_array.schema.json
index 622e692..322fcb6 100644
--- a/schemas/common/id_array.schema.json
+++ b/schemas/common/id_array.schema.json
@@ -1,6 +1,6 @@
 {
   "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "$id": "/schema/common/id_array.schema.json",
+  "$id": "schemas/common/id_array.schema.json",
   "type": "array",
   "items": {"type": "integer"},
   "uniqueItems": true
diff --git a/schemas/participant.schema.json b/schemas/participant.schema.json
index a7eff8e..249944f 100644
--- a/schemas/participant.schema.json
+++ b/schemas/participant.schema.json
@@ -1,11 +1,11 @@
 {
   "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "$id": "/schema/participant.schema.json",
+  "$id": "schemas/participant.schema.json",
   "title": "Participant",
   "type": "object",
   "properties": {
     "id": {
-      "$ref": "/schema/common/id.schema.json",
+      "$ref": "common/id.schema.json",
       "description": "The unique identifier of a participant"
     },
     "preferences": {
@@ -15,7 +15,7 @@
           "type": "object",
           "properties": {
             "ak_id": {
-              "$ref": "/schema/common/id.schema.json",
+              "$ref": "common/id.schema.json",
               "description": "The unique identifier of the AK"
             },
             "required": {
@@ -39,11 +39,11 @@
         "uniqueItems": true
     },
     "room_constraints": {
-      "$ref": "/schema/common/constraints.schema.json",
+      "$ref": "common/constraints.schema.json",
       "description": "Room constraints required by this participant"
     },
     "time_constraints": {
-      "$ref": "/schema/common/constraints.schema.json",
+      "$ref": "common/constraints.schema.json",
       "description": "Time constraints required by this participant"
     },
     "info": {
diff --git a/schemas/room.schema.json b/schemas/room.schema.json
index a4ab82d..f77d8fd 100644
--- a/schemas/room.schema.json
+++ b/schemas/room.schema.json
@@ -1,11 +1,11 @@
 {
   "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "$id": "/schema/room.schema.json",
+  "$id": "schemas/room.schema.json",
   "title": "Room",
   "type": "object",
   "properties": {
     "id": {
-      "$ref": "/schema/common/id.schema.json",
+      "$ref": "common/id.schema.json",
       "description": "The unique identifier of a room"
     },
     "capacity": {
@@ -16,11 +16,11 @@
       ]
     },
     "fulfilled_room_constraints": {
-      "$ref": "/schema/common/constraints.schema.json",
+      "$ref": "common/constraints.schema.json",
       "description": "Constraints fulfilled by this room"
     },
     "time_constraints": {
-      "$ref": "/schema/common/constraints.schema.json",
+      "$ref": "common/constraints.schema.json",
       "description": "Time constraints required by this room"
     },
     "info": {
diff --git a/schemas/solver-input.schema.json b/schemas/solver-input.schema.json
index a55057d..95952d7 100644
--- a/schemas/solver-input.schema.json
+++ b/schemas/solver-input.schema.json
@@ -1,12 +1,12 @@
 {
   "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "$id": "/schema/solver-input.schema.json",
+  "$id": "schemas/solver-input.schema.json",
   "type": "object",
   "properties": {
-      "aks": {"type": "array", "items": {"$ref": "/schema/ak.schema.json"}, "uniqueItems": true},
-      "rooms": {"type": "array", "items": {"$ref": "/schema/room.schema.json"}, "uniqueItems": true},
-      "participants": {"type": "array", "items": {"$ref": "/schema/participant.schema.json"}, "uniqueItems": true},
-      "timeslots": {"$ref": "/schema/timeslot.schema.json"},
+      "aks": {"type": "array", "items": {"$ref": "ak.schema.json"}, "uniqueItems": true},
+      "rooms": {"type": "array", "items": {"$ref": "room.schema.json"}, "uniqueItems": true},
+      "participants": {"type": "array", "items": {"$ref": "participant.schema.json"}, "uniqueItems": true},
+      "timeslots": {"$ref": "timeslot.schema.json"},
       "info": {
         "type": "object",
         "properties": {
diff --git a/schemas/solver-output.schema.json b/schemas/solver-output.schema.json
index 2a15247..c4a8868 100644
--- a/schemas/solver-output.schema.json
+++ b/schemas/solver-output.schema.json
@@ -1,11 +1,11 @@
 {
   "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "$id": "/schema/solver-output.schema.json",
+  "$id": "schemas/solver-output.schema.json",
   "type": "object",
   "additionalProperties": false,
   "required": ["input", "scheduled_aks"],
   "properties": {
-    "input": {"$ref": "/schema/solver-input.schema.json"},
+    "input": {"$ref": "solver-input.schema.json"},
     "scheduled_aks": {
       "type": "array",
       "items": {
diff --git a/schemas/timeslot.schema.json b/schemas/timeslot.schema.json
index 0240c49..e6d5b82 100644
--- a/schemas/timeslot.schema.json
+++ b/schemas/timeslot.schema.json
@@ -1,6 +1,6 @@
  {
   "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "$id": "/schema/timeslot.schema.json",
+  "$id": "schemas/timeslot.schema.json",
   "title": "Timeslot",
   "type": "object",
   "required": ["info", "blocks"],
@@ -34,7 +34,7 @@
           "description": "A single timeslot",
           "properties": {
             "id": {
-              "$ref": "/schema/common/id.schema.json",
+              "$ref": "common/id.schema.json",
               "description": "The unique identifier of the single timeslot. Accross all blocks, the ids must be sorted chronologically."
             },
             "info": {
@@ -47,7 +47,7 @@
               "additionalProperties": false
             },
             "fulfilled_time_constraints": {
-              "$ref": "/schema/common/constraints.schema.json",
+              "$ref": "common/constraints.schema.json",
               "description": "Time constraints fulfilled by this timeslot"
             }
           },
-- 
GitLab