{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://otranspo.ca/schemas/public-api/v1/historical-explicit-cancellations","type":"object","properties":{"schema":{"const":"https://otranspo.ca/schemas/public-api/v1/historical-explicit-cancellations"},"schemaVersion":{"const":"1.0.0"},"evidenceState":{"type":"string","enum":["records_observed","capture_unverified"]},"window":{"type":"string","enum":["day","week","28d","month"]},"windowStart":{"type":"string","format":"date"},"windowEnd":{"type":"string","format":"date"},"period":{"type":"object","properties":{"window":{"type":"string","enum":["day","week","28d","month"]},"serviceDateStart":{"type":"string","format":"date"},"serviceDateEnd":{"type":"string","format":"date"}},"required":["window","serviceDateStart","serviceDateEnd"],"additionalProperties":true},"source":{"const":"retained_explicit_trip_cancellations"},"captureCoverage":{"const":"unverified"},"scheduleMatch":{"type":"string","enum":["trip_level","not_assessed"]},"assessmentMode":{"const":"none"},"recordCount":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"byOperator":{"type":"object","properties":{"oc_transpo":{"type":"object","properties":{"evidenceState":{"type":"string","enum":["records_observed","capture_unverified"]},"retainedNoticeRecords":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"distinctServiceTrips":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"cancelledScheduledTrips":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"withdrawnTripOperated":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"outsideTimetable":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"timetableUnavailable":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]}},"required":["evidenceState","retainedNoticeRecords","distinctServiceTrips"],"additionalProperties":true},"sto":{"type":"object","properties":{"evidenceState":{"type":"string","enum":["records_observed","capture_unverified"]},"retainedNoticeRecords":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"distinctServiceTrips":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"cancelledScheduledTrips":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"withdrawnTripOperated":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"outsideTimetable":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"timetableUnavailable":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]}},"required":["evidenceState","retainedNoticeRecords","distinctServiceTrips"],"additionalProperties":true}},"required":["oc_transpo","sto"],"additionalProperties":true},"noticeObservationWindow":{"anyOf":[{"type":"object","properties":{"firstObservedAt":{"type":"string","format":"date-time"},"lastObservedAt":{"type":"string","format":"date-time"},"basis":{"const":"retained_notice_first_last_observed_at"}},"required":["firstObservedAt","lastObservedAt","basis"],"additionalProperties":true},{"type":"null"}]},"coverage":{"type":"object","properties":{"status":{"const":"unknown"},"basis":{"const":"historical_poll_completeness_not_joined"},"currentSnapshotIncluded":{"const":false}},"required":["status","basis","currentSnapshotIncluded"],"additionalProperties":true},"provenance":{"type":"object","properties":{"source":{"const":"retained_explicit_trip_cancellations"},"relationships":{"type":"array","prefixItems":[{"const":"CANCELED"},{"const":"DELETED"}],"minItems":2,"maxItems":2},"recordKey":{"const":"operator_service_date_trip_relationship"},"tripKey":{"const":"operator_service_date_trip"},"currentSnapshotIncluded":{"const":false}},"required":["source","relationships","recordKey","tripKey","currentSnapshotIncluded"],"additionalProperties":true},"records":{"type":"array","items":{"type":"object","properties":{"tripId":{"type":"string"},"routeId":{"type":"string"},"vehicleId":{"anyOf":[{"type":"string"},{"type":"null"}]},"relationship":{"type":"string","enum":["CANCELED","DELETED"]},"observedAt":{"type":"string","format":"date-time"},"serviceDate":{"type":"string","format":"date"},"operatorId":{"type":"string","enum":["oc_transpo","sto"]},"firstObservedAt":{"type":"string","format":"date-time"},"lastObservedAt":{"type":"string","format":"date-time"},"scheduleMatch":{"type":"string","enum":["scheduled","not_scheduled_on_date","not_in_timetable","timetable_unavailable"]},"operatedAfterNotice":{"type":"boolean"}},"additionalProperties":true}},"limitation":{"type":"string"}},"required":["schema","schemaVersion","evidenceState","window","windowStart","windowEnd","period","source","captureCoverage","scheduleMatch","recordCount","byOperator","noticeObservationWindow","coverage","provenance","records","limitation"],"additionalProperties":true,"title":"historical-explicit-cancellations response schema","x-api-version":"1.0.0"}