diff --git a/static_common/common/schemas/ak.schema.json b/static_common/common/schemas/ak.schema.json index c2356010864c632a4084ca975c52d06a3bcd7737..f8b6711c63ee67121a89e48ec43984f89a736eab 100644 --- a/static_common/common/schemas/ak.schema.json +++ b/static_common/common/schemas/ak.schema.json @@ -5,9 +5,8 @@ "type": "object", "properties": { "id": { - "description": "The unique identifier of a room", - "type": "integer", - "minimum": 0 + "$ref": "/schema/common/id.schema.json", + "description": "The unique identifier of an AK" }, "duration": { "description": "The number of consecutive slot units", @@ -15,31 +14,23 @@ "exclusiveMinimum": 0 }, "room_constraints": { - "description": "Room constraints required by this AK", - "type": "array", - "items": {"type": "string"}, - "uniqueItems": true + "$ref": "/schema/common/constraints.schema.json", + "description": "Room constraints required by this AK" }, "time_constraints": { - "description": "Time constraints required by this AK", - "type": "array", - "items": {"type": "string"}, - "uniqueItems": true + "$ref": "/schema/common/constraints.schema.json", + "description": "Time constraints required by this AK" }, "properties": { "type": "object", "properties": { "conflicts": { - "description": "IDs of all AKs that are in conflict with this AK", - "type": "array", - "items": {"type": "integer"}, - "uniqueItems": true + "$ref": "/schema/common/id_array.schema.json", + "description": "IDs of all AKs that are in conflict with this AK" }, "dependencies": { - "description": "IDs of all AKs that should be scheduled before this AK", - "type": "array", - "items": {"type": "integer"}, - "uniqueItems": true + "$ref": "/schema/common/id_array.schema.json", + "description": "IDs of all AKs that should be scheduled before this AK" } }, "required": ["conflicts", "dependencies"] diff --git a/static_common/common/schemas/common/constraints.schema.json b/static_common/common/schemas/common/constraints.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..7d3fce56e26ba2403538583c20a0d211b56c2774 --- /dev/null +++ b/static_common/common/schemas/common/constraints.schema.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "/schema/common/constraints.schema.json", + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true +} \ No newline at end of file diff --git a/static_common/common/schemas/common/id.schema.json b/static_common/common/schemas/common/id.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..4dd06e349a9ec29caf5cf051d9044a9e47a2924d --- /dev/null +++ b/static_common/common/schemas/common/id.schema.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "/schema/common/id.schema.json", + "type": "integer", + "minimum": 0 +} \ No newline at end of file diff --git a/static_common/common/schemas/common/id_array.schema.json b/static_common/common/schemas/common/id_array.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..622e692ac617ed4fc5ce8261b9da135a0ab1e79d --- /dev/null +++ b/static_common/common/schemas/common/id_array.schema.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "/schema/common/id_array.schema.json", + "type": "array", + "items": {"type": "integer"}, + "uniqueItems": true +} \ No newline at end of file diff --git a/static_common/common/schemas/participant.schema.json b/static_common/common/schemas/participant.schema.json index 09775329e207a03e8615ea84a97cd03b5aa8a11e..1a7d66569b4f7ff23ad88e5db9cd18bc59800472 100644 --- a/static_common/common/schemas/participant.schema.json +++ b/static_common/common/schemas/participant.schema.json @@ -5,9 +5,8 @@ "type": "object", "properties": { "id": { - "description": "The unique identifier of a participant", - "type": "integer", - "minimum": 0 + "$ref": "/schema/common/id.schema.json", + "description": "The unique identifier of a participant" }, "preferences": { "description": "AK preferences of the participant", @@ -16,9 +15,8 @@ "type": "object", "properties": { "ak_id": { - "type": "integer", - "description": "The unique identifier of the AK", - "minimum": 0 + "$ref": "/schema/common/id.schema.json", + "description": "The unique identifier of the AK" }, "required": { "type": "boolean", @@ -40,16 +38,12 @@ "uniqueItems": true }, "room_constraints": { - "description": "Room constraints required by this participant", - "type": "array", - "items": {"type": "string"}, - "uniqueItems": true + "$ref": "/schema/common/constraints.schema.json", + "description": "Room constraints required by this participant" }, "time_constraints": { - "description": "Time constraints required by this participant", - "type": "array", - "items": {"type": "string"}, - "uniqueItems": true + "$ref": "/schema/common/constraints.schema.json", + "description": "Time constraints required by this participant" }, "info": { "type": "object", diff --git a/static_common/common/schemas/room.schema.json b/static_common/common/schemas/room.schema.json index da192a0e5bc0cc98c35f5df745e0d0938b7ce434..80b149e03c4a0fc3fada3c9ceb92d06652dba435 100644 --- a/static_common/common/schemas/room.schema.json +++ b/static_common/common/schemas/room.schema.json @@ -5,9 +5,8 @@ "type": "object", "properties": { "id": { - "description": "The unique identifier of a room", - "type": "integer", - "minimum": 0 + "$ref": "/schema/common/id.schema.json", + "description": "The unique identifier of a room" }, "capacity": { "description": "The maximum number of total participants. Unbounded capacity is represented by -1", @@ -15,24 +14,17 @@ "minimum": -1 }, "fulfilled_room_constraints": { - "description": "Constraints fulfilled by this room", - "type": "array", - "items": {"type": "string"}, - "uniqueItems": true + "$ref": "/schema/common/constraints.schema.json", + "description": "Constraints fulfilled by this room" }, "time_constraints": { - "description": "Time constraints required by this room", - "type": "array", - "items": {"type": "string"}, - "uniqueItems": true + "$ref": "/schema/common/constraints.schema.json", + "description": "Time constraints required by this room" }, "info": { "type": "object", "properties": { - "name": { - "description": "Name of the room", - "type": "string" - } + "name": {"description": "Name of the room", "type": "string"} }, "required": ["name"] } diff --git a/static_common/common/schemas/timeslot.schema.json b/static_common/common/schemas/timeslot.schema.json index 6f8333e982090f7e950ffd4a34d13617b968c422..a77d8d0885185c2ff6431f82a67cec10be1d3368 100644 --- a/static_common/common/schemas/timeslot.schema.json +++ b/static_common/common/schemas/timeslot.schema.json @@ -32,9 +32,8 @@ "description": "A single timeslot", "properties": { "id": { - "description": "The unique identifier of the single timeslot. Accross all blocks, the ids must be sorted chronologically.", - "type": "integer", - "minimum": 0 + "$ref": "/schema/common/id.schema.json", + "description": "The unique identifier of the single timeslot. Accross all blocks, the ids must be sorted chronologically." }, "info": { "type": "object", @@ -45,10 +44,8 @@ "required": ["start", "end"] }, "fulfilled_time_constraints": { - "description": "Time constraints fulfilled by this timeslot", - "type": "array", - "items": {"type": "string"}, - "uniqueItems": true + "$ref": "/schema/common/constraints.schema.json", + "description": "Time constraints fulfilled by this timeslot" } }, "required": ["id", "info", "fulfilled_time_constraints"]