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

Use relative paths in schema definitions

parent 7f3555eb
No related branches found
No related tags found
1 merge request!25Feature: Use JSON schema
Pipeline #275676 passed
{
"$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"
}
},
......
{
"$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
......
{
"$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
{
"$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
......
{
"$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": {
......
{
"$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": {
......
{
"$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": {
......
{
"$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": {
......
{
"$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"
}
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment