{ "$id": "https://raw.githubusercontent.com/bcgov/nr-pies/refs/heads/main/docs/spec/element/data/event.schema.json", "$schema": "http://json-schema.org/draft-07/schema#", "title": "Event", "description": "Represents an event concept. It allows either a date or a datetime, but not a mix of both. One of the start properties is required, but the end properties are optional.", "type": "object", "properties": { "start_date": { "type": "string", "description": "The start date of the event in RFC 3339 format (e.g., `2024-12-01`).", "format": "date" }, "start_datetime": { "type": "string", "description": "The start datetime of the event in RFC 3339 format (e.g., `2024-12-01T10:00:00.0000000Z`). Only UTC time is allowed.", "format": "date-time", "pattern": "^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])(\\.\\d{1,7})?Z$" }, "end_date": { "type": "string", "description": "The end date of the event in RFC 3339 format (e.g., `2024-12-01`). This is optional if `start_date` is used.", "format": "date" }, "end_datetime": { "type": "string", "description": "The end datetime of the event in RFC 3339 format (e.g., `2024-12-01T10:00:00.0000000Z`). Only UTC time is allowed. This is optional if `start_datetime` is used.", "format": "date-time", "pattern": "^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])(\\.\\d{1,7})?Z$" } }, "oneOf": [ { "title": "Date", "description": "This schema is used when the event starts with a date (`start_date`), and optionally, an end date (`end_date`) can be specified. Mixing a start date with a datetime is not allowed.", "properties": { "start_date": { "type": "string", "format": "date" }, "end_date": { "type": "string", "format": "date" } }, "required": ["start_date"], "not": { "required": ["start_datetime", "end_datetime"] } }, { "title": "DateTime", "description": "This schema is used when the event starts with a datetime (`start_datetime`), and optionally, an end datetime (`end_datetime`) can be specified. Mixing a start datetime with a date is not allowed.", "properties": { "start_datetime": { "type": "string", "format": "date-time" }, "end_datetime": { "type": "string", "format": "date-time" } }, "required": ["start_datetime"], "not": { "required": ["start_date", "end_date"] } } ] }