From 4cf550d2c6ad3c9541d804e4c8aca8b20b49303c Mon Sep 17 00:00:00 2001 From: Jasper Zonneveld Date: Wed, 13 Mar 2024 12:19:52 +0100 Subject: [PATCH] WIP: update schema --- tests/_files/situations-schema.json | 481 ++++++++++++++++++++++++---- 1 file changed, 422 insertions(+), 59 deletions(-) diff --git a/tests/_files/situations-schema.json b/tests/_files/situations-schema.json index 18c81c2..ced430a 100644 --- a/tests/_files/situations-schema.json +++ b/tests/_files/situations-schema.json @@ -99,14 +99,35 @@ "type": "object", "additionalProperties": false, "properties": { - "workObject": { - "$ref": "#/definitions/WorkObject" + "permitId": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, - "impact": { - "$ref": "#/definitions/Impact" + "workObject": { + "anyOf": [ + { + "$ref": "#/definitions/WorkObject" + }, + { + "type": "null" + } + ] }, "situationId": { - "type": "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "project": { "type": "boolean" @@ -114,6 +135,16 @@ "source": { "$ref": "#/definitions/Source" }, + "impact": { + "anyOf": [ + { + "$ref": "#/definitions/Impact" + }, + { + "type": "null" + } + ] + }, "published": { "type": "boolean" }, @@ -133,7 +164,14 @@ "$ref": "#/definitions/Person" }, "workType": { - "$ref": "#/definitions/WorkType" + "anyOf": [ + { + "$ref": "#/definitions/WorkType" + }, + { + "type": "null" + } + ] }, "periods": { "type": "array", @@ -154,7 +192,14 @@ "$ref": "#/definitions/RoadAuthority" }, "situationRecordId": { - "type": "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "addition": { "type": "string" @@ -163,7 +208,7 @@ "$ref": "#/definitions/SituationStatus" }, "eventType": { - "type": "string" + "$ref": "#/definitions/EventType" }, "eventName": { "type": "string" @@ -175,15 +220,36 @@ } }, "urlDescription": { - "type": "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "lastChangeAt": { - "type": "string", - "format": "date-time" + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] }, "createdAt": { - "type": "string", - "format": "date-time" + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] }, "name": { "type": "string" @@ -192,7 +258,14 @@ "$ref": "#/definitions/RestrictionType" }, "transportMode": { - "$ref": "#/definitions/TransportMode" + "anyOf": [ + { + "$ref": "#/definitions/TransportMode" + }, + { + "type": "null" + } + ] }, "vehicles": { "type": "array", @@ -201,13 +274,27 @@ } }, "emergency": { - "$ref": "#/definitions/RestrictionExtraInfo" + "anyOf": [ + { + "$ref": "#/definitions/RestrictionExtraInfo" + }, + { + "type": "null" + } + ] }, "direction": { "$ref": "#/definitions/Direction" }, "publicTransport": { - "$ref": "#/definitions/RestrictionExtraInfo" + "anyOf": [ + { + "$ref": "#/definitions/RestrictionExtraInfo" + }, + { + "type": "null" + } + ] }, "maximumSpeed": { "type": "integer" @@ -222,7 +309,7 @@ } }, "emergencyServices": { - "$ref": "#/definitions/EmergencyServices" + "$ref": "#/definitions/RestrictionExtraInfo" }, "roadManagementTypes": { "type": "array", @@ -234,13 +321,42 @@ "$ref": "#/definitions/RoadManagementType" }, "laneInformation": { - "$ref": "#/definitions/LaneInformation" + "anyOf": [ + { + "$ref": "#/definitions/LaneInformation" + }, + { + "type": "null" + } + ] }, "boatTypes": { "type": "array", "items": { "$ref": "#/definitions/BoatType" } + }, + "referenceId": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "remarks": { + "type": "array", + "items": { + "type": "string" + } + }, + "contacts": { + "type": "array", + "items": { + "$ref": "#/definitions/Contact" + } } }, "required": [ @@ -269,6 +385,80 @@ ], "title": "Attachment" }, + "Contact": { + "type": "object", + "additionalProperties": false, + "properties": { + "firstName": { + "type": "string" + }, + "prefix": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "email": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "organisation": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "parentSituationId": { + "type": "integer" + }, + "contactId": { + "type": "integer" + }, + "organization": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "function": { + "type": "string" + }, + "publicPhone": { + "type": "string" + }, + "active": { + "type": "boolean" + }, + "createdById": { + "type": "integer" + } + }, + "required": [ + "active", + "contactId", + "createdById", + "email", + "firstName", + "function", + "lastName", + "organisation", + "parentSituationId", + "phone", + "prefix", + "publicPhone" + ], + "title": "Contact" + }, "Person": { "type": "object", "additionalProperties": false, @@ -286,12 +476,26 @@ "$ref": "#/definitions/PersonType" }, "createdAt": { - "type": "string", - "format": "date-time" + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] }, "lastChangeAt": { - "type": "string", - "format": "date-time" + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] } }, "required": [ @@ -310,31 +514,32 @@ "$ref": "#/definitions/PassageAllowed" }, "description": { - "type": "string" - } - }, - "required": [ - "description", - "passageAllowed" - ], - "title": "RestrictionExtraInfo" - }, - "EmergencyServices": { - "type": "object", - "additionalProperties": false, - "properties": { - "passageAllowed": { - "$ref": "#/definitions/PassageAllowed" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "type": { - "$ref": "#/definitions/EmergencyServicesType" + "anyOf": [ + { + "$ref": "#/definitions/EmergencyServicesType" + }, + { + "type": "null" + } + ] } }, "required": [ + "description", "passageAllowed", "type" ], - "title": "EmergencyServices" + "title": "RestrictionExtraInfo" }, "LaneInformation": { "type": "object", @@ -371,7 +576,14 @@ "type": "string" }, "comment": { - "type": "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] } }, "required": [ @@ -386,47 +598,124 @@ "additionalProperties": false, "properties": { "name": { - "type": "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "startDate": { "type": "string", "format": "date-time" }, "endDate": { - "type": "string", - "format": "date-time" + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] }, "startDateActual": { - "type": "string", - "format": "date-time" + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] }, "status": { - "$ref": "#/definitions/PeriodStatus" + "anyOf": [ + { + "$ref": "#/definitions/PeriodStatus" + }, + { + "type": "null" + } + ] }, "overrunning": { - "type": "boolean" + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] }, "order": { - "type": "integer" + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] }, "id": { - "type": "integer" + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] }, "endDateActual": { - "type": "string", - "format": "date-time" + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] }, "repeating": { - "$ref": "#/definitions/Repeating" + "anyOf": [ + { + "$ref": "#/definitions/Repeating" + }, + { + "type": "null" + } + ] }, "repeatingAt": { - "type": "array", - "items": { - "type": "boolean" - } + "anyOf": [ + { + "type": "array", + "items": { + "type": "boolean" + } + }, + { + "type": "null" + } + ] }, "parentId": { - "type": "integer" + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] } }, "required": [ @@ -446,7 +735,14 @@ "$ref": "#/definitions/RoadAuthorityType" }, "id": { - "type": "integer" + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] } }, "required": [ @@ -459,6 +755,48 @@ "VehicleInformation": { "type": "object", "additionalProperties": false, + "properties": { + "heightCharacteristic": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "lengthCharacteristic": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "widthCharacteristic": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "grossWeightCharacteristic": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + } + }, "title": "VehicleInformation" }, "URLUnion": { @@ -469,6 +807,12 @@ { "type": "string", "format": "uri" + }, + { + "type": "string" + }, + { + "type": "null" } ], "title": "URLUnion" @@ -628,7 +972,8 @@ "POLDER_AUTHORITY", "PROVINCE", "MISCELLANEOUS", - "UNKNOWN" + "UNKNOWN", + "EMPTY" ], "title": "RoadAuthorityType" }, @@ -770,6 +1115,24 @@ "Feature" ], "title": "FeatureType" + }, + "EventType": { + "type": "string", + "enum": [ + "UNKNOWN", + "FAIR", + "CONCERT", + "FESTIVAL", + "FUNFAIR", + "MARKET", + "MARATHON", + "SPORTSMEETING", + "FOOTBALLMATCH", + "BICYCLERACE", + "WATERSPORTSMEETING", + "OTHER" + ], + "title": "EventType" } } }