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 @@
"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"]
......
{
"$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 @@
"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",
......
......@@ -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"]
}
......
......@@ -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"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment