Skip to content
Snippets Groups Projects
Commit 4a449918 authored by Felix Blanke's avatar Felix Blanke
Browse files

Reuse common subschema

parent be044682
No related branches found
No related tags found
1 merge request!25Feature: Use JSON schema
...@@ -5,9 +5,8 @@ ...@@ -5,9 +5,8 @@
"type": "object", "type": "object",
"properties": { "properties": {
"id": { "id": {
"description": "The unique identifier of a room", "$ref": "/schema/common/id.schema.json",
"type": "integer", "description": "The unique identifier of an AK"
"minimum": 0
}, },
"duration": { "duration": {
"description": "The number of consecutive slot units", "description": "The number of consecutive slot units",
...@@ -15,31 +14,23 @@ ...@@ -15,31 +14,23 @@
"exclusiveMinimum": 0 "exclusiveMinimum": 0
}, },
"room_constraints": { "room_constraints": {
"description": "Room constraints required by this AK", "$ref": "/schema/common/constraints.schema.json",
"type": "array", "description": "Room constraints required by this AK"
"items": {"type": "string"},
"uniqueItems": true
}, },
"time_constraints": { "time_constraints": {
"description": "Time constraints required by this AK", "$ref": "/schema/common/constraints.schema.json",
"type": "array", "description": "Time constraints required by this AK"
"items": {"type": "string"},
"uniqueItems": true
}, },
"properties": { "properties": {
"type": "object", "type": "object",
"properties": { "properties": {
"conflicts": { "conflicts": {
"description": "IDs of all AKs that are in conflict with this AK", "$ref": "/schema/common/id_array.schema.json",
"type": "array", "description": "IDs of all AKs that are in conflict with this AK"
"items": {"type": "integer"},
"uniqueItems": true
}, },
"dependencies": { "dependencies": {
"description": "IDs of all AKs that should be scheduled before this AK", "$ref": "/schema/common/id_array.schema.json",
"type": "array", "description": "IDs of all AKs that should be scheduled before this AK"
"items": {"type": "integer"},
"uniqueItems": true
} }
}, },
"required": ["conflicts", "dependencies"] "required": ["conflicts", "dependencies"]
......
{
"$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
{
"$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
{
"$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
...@@ -5,9 +5,8 @@ ...@@ -5,9 +5,8 @@
"type": "object", "type": "object",
"properties": { "properties": {
"id": { "id": {
"description": "The unique identifier of a participant", "$ref": "/schema/common/id.schema.json",
"type": "integer", "description": "The unique identifier of a participant"
"minimum": 0
}, },
"preferences": { "preferences": {
"description": "AK preferences of the participant", "description": "AK preferences of the participant",
...@@ -16,9 +15,8 @@ ...@@ -16,9 +15,8 @@
"type": "object", "type": "object",
"properties": { "properties": {
"ak_id": { "ak_id": {
"type": "integer", "$ref": "/schema/common/id.schema.json",
"description": "The unique identifier of the AK", "description": "The unique identifier of the AK"
"minimum": 0
}, },
"required": { "required": {
"type": "boolean", "type": "boolean",
...@@ -40,16 +38,12 @@ ...@@ -40,16 +38,12 @@
"uniqueItems": true "uniqueItems": true
}, },
"room_constraints": { "room_constraints": {
"description": "Room constraints required by this participant", "$ref": "/schema/common/constraints.schema.json",
"type": "array", "description": "Room constraints required by this participant"
"items": {"type": "string"},
"uniqueItems": true
}, },
"time_constraints": { "time_constraints": {
"description": "Time constraints required by this participant", "$ref": "/schema/common/constraints.schema.json",
"type": "array", "description": "Time constraints required by this participant"
"items": {"type": "string"},
"uniqueItems": true
}, },
"info": { "info": {
"type": "object", "type": "object",
......
...@@ -5,9 +5,8 @@ ...@@ -5,9 +5,8 @@
"type": "object", "type": "object",
"properties": { "properties": {
"id": { "id": {
"description": "The unique identifier of a room", "$ref": "/schema/common/id.schema.json",
"type": "integer", "description": "The unique identifier of a room"
"minimum": 0
}, },
"capacity": { "capacity": {
"description": "The maximum number of total participants. Unbounded capacity is represented by -1", "description": "The maximum number of total participants. Unbounded capacity is represented by -1",
...@@ -15,24 +14,17 @@ ...@@ -15,24 +14,17 @@
"minimum": -1 "minimum": -1
}, },
"fulfilled_room_constraints": { "fulfilled_room_constraints": {
"description": "Constraints fulfilled by this room", "$ref": "/schema/common/constraints.schema.json",
"type": "array", "description": "Constraints fulfilled by this room"
"items": {"type": "string"},
"uniqueItems": true
}, },
"time_constraints": { "time_constraints": {
"description": "Time constraints required by this room", "$ref": "/schema/common/constraints.schema.json",
"type": "array", "description": "Time constraints required by this room"
"items": {"type": "string"},
"uniqueItems": true
}, },
"info": { "info": {
"type": "object", "type": "object",
"properties": { "properties": {
"name": { "name": {"description": "Name of the room", "type": "string"}
"description": "Name of the room",
"type": "string"
}
}, },
"required": ["name"] "required": ["name"]
} }
......
...@@ -32,9 +32,8 @@ ...@@ -32,9 +32,8 @@
"description": "A single timeslot", "description": "A single timeslot",
"properties": { "properties": {
"id": { "id": {
"description": "The unique identifier of the single timeslot. Accross all blocks, the ids must be sorted chronologically.", "$ref": "/schema/common/id.schema.json",
"type": "integer", "description": "The unique identifier of the single timeslot. Accross all blocks, the ids must be sorted chronologically."
"minimum": 0
}, },
"info": { "info": {
"type": "object", "type": "object",
...@@ -45,10 +44,8 @@ ...@@ -45,10 +44,8 @@
"required": ["start", "end"] "required": ["start", "end"]
}, },
"fulfilled_time_constraints": { "fulfilled_time_constraints": {
"description": "Time constraints fulfilled by this timeslot", "$ref": "/schema/common/constraints.schema.json",
"type": "array", "description": "Time constraints fulfilled by this timeslot"
"items": {"type": "string"},
"uniqueItems": true
} }
}, },
"required": ["id", "info", "fulfilled_time_constraints"] "required": ["id", "info", "fulfilled_time_constraints"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment