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

Split schema into general and export schema

parent 55dc275f
Branches
No related tags found
1 merge request!268Merge fork for interoperability of KoMa solver
......@@ -38,7 +38,7 @@ class JSONExportTest(TestCase):
)
cls.json_export_validator = construct_schema_validator(
"solver-input.schema.json"
"solver-input-export.schema.json"
)
def setUp(self):
......
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "schemas/ak-export.schema.json",
"allOf": [{ "$ref": "ak.schema.json" }],
"properties": {
"info": {"unevaluatedProperties": false}
}
}
......@@ -53,8 +53,7 @@
"description": "Types of this AK"
}
},
"required": ["name", "head", "description", "reso", "duration_in_hours", "django_ak_id", "types"],
"additionalProperties": false
"required": ["name", "head", "description", "reso", "duration_in_hours", "django_ak_id", "types"]
}
},
"required": ["id", "duration", "room_constraints", "time_constraints", "properties", "info"],
......
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "schemas/participant-export.schema.json",
"allOf": [{ "$ref": "participant.schema.json" }],
"properties": {
"preferences": {
"items": {
"properties": {
"preference_score": {
"anyOf": [
{"const": -1}, {"const": 1}, {"const": 2}
]
}
}
}
},
"info": {"unevaluatedProperties": false}
}
}
......@@ -27,10 +27,7 @@
"description": "The prefeference score for this AK",
"default": 0,
"minimum": -1,
"maximum": 2,
"anyOf": [
{"const": -1}, {"const": 1}, {"const": 2}
]
"maximum": 2
}
},
"required": ["ak_id", "required", "preference_score"],
......@@ -49,8 +46,7 @@
"info": {
"type": "object",
"properties": {"name": {"description": "Name of the person", "type": "string"}},
"required": ["name"],
"additionalProperties": false
"required": ["name"]
}
},
"required": ["id", "room_constraints", "time_constraints", "info"],
......
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "schemas/room-export.schema.json",
"allOf": [{ "$ref": "room.schema.json" }],
"properties": {
"info": {"unevaluatedProperties": false}
}
}
......@@ -28,8 +28,7 @@
"properties": {
"name": {"description": "Name of the room", "type": "string"}
},
"required": ["name"],
"additionalProperties": false
"required": ["name"]
}
},
"required": ["id", "capacity", "fulfilled_room_constraints", "time_constraints", "info"],
......
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "schemas/solver-input-export.schema.json",
"allOf": [{ "$ref": "solver-input.schema.json"}],
"properties": {
"participants": {"items": {"$ref": "participant-export.schema.json"}},
"rooms": {"items": {"$ref": "room-export.schema.json"}},
"timeslots": {"items": {"$ref": "timeslot-export.schema.json"}},
"aks": {"items": {"$ref": "ak-export.schema.json"}},
"info": {"unevaluatedProperties": false}
}
}
\ No newline at end of file
......@@ -14,8 +14,7 @@
"slug": {"type": "string"},
"place": {"type": "string"},
"contact_email": {"type": "string"}
},
"additionalProperties": false
}
}
},
"required": ["aks", "rooms", "participants", "timeslots", "info"],
......
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "schemas/timeslot-export.schema.json",
"allOf": [{ "$ref": "timeslot.schema.json" }],
"properties": {
"info": {"unevaluatedProperties": false},
"blocks": {
"items": {
"items": {
"info": {"unevaluatedProperties": false}
}
}
}
}
}
......@@ -20,8 +20,7 @@
}
}
},
"required": ["duration"],
"additionalProperties": false
"required": ["duration"]
},
"blocks": {
"type": "array",
......@@ -43,8 +42,7 @@
"start": {"description": "Start datetime of the timeslot", "type": "string"},
"end": {"description": "End datetime of the timeslot", "type": "string"}
},
"required": ["start", "end"],
"additionalProperties": false
"required": ["start", "end"]
},
"fulfilled_time_constraints": {
"$ref": "common/constraints.schema.json",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment