{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://otranspo.ca/schemas/public-api/v1/corrections","type":"object","properties":{"schema":{"const":"https://otranspo.ca/schemas/public-api/v1/corrections"},"schemaVersion":{"const":"1.0.0"},"records":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"revision":{"type":"string"},"title":{"type":"object","properties":{"en":{"type":"string"},"fr":{"type":"string"}},"required":["en","fr"],"additionalProperties":true},"occurredAt":{"type":"string","format":"date-time"},"publishedAt":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["propagated","branch_complete_production_pending","reverted"]},"subject":{"type":"object","properties":{"type":{"type":"string","enum":["metric","method","content"]},"id":{"type":"string"}},"required":["type","id"],"additionalProperties":true},"previous":{"type":"object","properties":{"method":{"type":"string"},"value":{"anyOf":[{"type":["number","string"]},{"type":"null"}]},"valueTranslations":{"type":"object","properties":{"en":{"type":"string"},"fr":{"type":"string"}},"required":["en","fr"],"additionalProperties":true}},"required":["method","value"],"additionalProperties":true},"corrected":{"type":"object","properties":{"method":{"type":"string"},"value":{"anyOf":[{"type":["number","string"]},{"type":"null"}]},"valueTranslations":{"type":"object","properties":{"en":{"type":"string"},"fr":{"type":"string"}},"required":["en","fr"],"additionalProperties":true}},"required":["method","value"],"additionalProperties":true},"reason":{"type":"string"},"detectionSource":{"type":"string"},"reasonTranslations":{"type":"object","properties":{"en":{"type":"string"},"fr":{"type":"string"}},"required":["en","fr"],"additionalProperties":true},"detectionSourceTranslations":{"type":"object","properties":{"en":{"type":"string"},"fr":{"type":"string"}},"required":["en","fr"],"additionalProperties":true},"affectedPublications":{"type":"array","items":{"type":"string"}},"controlledFactIds":{"type":"array","items":{"type":"string"}},"approval":{"type":"object","properties":{"required":{"const":true},"state":{"type":"string","enum":["attested","pending_named_approver"]},"approverRole":{"type":"string"},"approverEvidence":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["required","state","approverRole","approverEvidence"],"additionalProperties":true},"propagation":{"type":"array","items":{"type":"object","properties":{"surface":{"type":"string","enum":["screen","api","download","method","marketing","grant","archive"]},"state":{"type":"string","enum":["complete","production_pending"]}},"required":["surface","state"],"additionalProperties":true}},"propagationEvidence":{"type":"array","items":{"type":"object","properties":{"surface":{"type":"string","enum":["screen","api","download","method","marketing","grant","archive"]},"state":{"type":"string","enum":["complete","production_pending"]},"artifact":{"type":"string"},"revision":{"type":"string"},"verifiedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["surface","state","artifact","revision","verifiedAt"],"additionalProperties":true}},"productionDeployment":{"type":"object","properties":{"state":{"type":"string","enum":["complete","pending"]},"releaseSha":{"anyOf":[{"type":"string"},{"type":"null"}]},"verifiedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["state","releaseSha","verifiedAt"],"additionalProperties":true},"publicStatus":{"type":"object","properties":{"applicationSource":{"type":"string","enum":["corrected_current","correction_reverted"]},"productionVerification":{"type":"string","enum":["verified_current","unverified"]},"currentMethod":{"anyOf":[{"type":"string"},{"type":"null"}]},"currentValue":{"anyOf":[{"type":["number","string"]},{"type":"null"}]},"supersededMethod":{"anyOf":[{"type":"string"},{"type":"null"}]},"supersededValue":{"anyOf":[{"type":["number","string"]},{"type":"null"}]}},"required":["applicationSource","productionVerification","currentMethod","currentValue","supersededMethod","supersededValue"],"additionalProperties":true}},"required":["id","revision","title","occurredAt","publishedAt","status","subject","previous","corrected","reason","detectionSource","reasonTranslations","detectionSourceTranslations","affectedPublications","controlledFactIds","approval","propagation","propagationEvidence","productionDeployment","publicStatus"],"additionalProperties":true}},"recordCount":{"type":"integer","minimum":0},"drill":{"type":"object","properties":{"requiredSurfaces":{"type":"array","items":{"type":"string","enum":["screen","api","download","method","marketing","grant","archive"]}},"recordCount":{"type":"integer","minimum":0},"duplicateIds":{"type":"array","items":{"type":"string"}},"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"revision":{"type":"string"},"failures":{"type":"array","items":{"type":"string"}}},"required":["id","revision","failures"],"additionalProperties":true}},"branchPropagationComplete":{"type":"boolean"},"humanApprovalComplete":{"type":"boolean"},"acceptedPropagationComplete":{"type":"boolean"},"productionDeploymentComplete":{"type":"boolean"}},"required":["requiredSurfaces","recordCount","duplicateIds","results","branchPropagationComplete","humanApprovalComplete","acceptedPropagationComplete","productionDeploymentComplete"],"additionalProperties":true}},"required":["schema","schemaVersion","records","recordCount","drill"],"additionalProperties":true,"title":"corrections response schema","x-api-version":"1.0.0"}