diff --git a/schemas/notableDonations.json b/schemas/notableDonations.json index 75a6fe04..764fc75b 100644 --- a/schemas/notableDonations.json +++ b/schemas/notableDonations.json @@ -1,6 +1,7 @@ { "$schema": "http://json-schema.org/draft-07/schema", "type": "array", + "$comment": "Some of this schema is actually wrong, and was modified due to another application sending incorrect data!", "items": { "type": "object", "additionalProperties": false, @@ -21,7 +22,14 @@ "type": "string" }, "comment": { - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "time_received": { "type": "string" @@ -32,9 +40,7 @@ "_id", "donor_visiblename", "amount", - "comment_state", - "comment", - "time_received" + "comment" ] }, "default": [] diff --git a/src/types/schemas/notableDonations.d.ts b/src/types/schemas/notableDonations.d.ts index ce9fe8cd..3ea6fe03 100644 --- a/src/types/schemas/notableDonations.d.ts +++ b/src/types/schemas/notableDonations.d.ts @@ -10,7 +10,7 @@ export type NotableDonations = { _id: number; donor_visiblename: string; amount: number; - comment_state: string; - comment: string; - time_received: string; + comment_state?: string; + comment: string | null; + time_received?: string; }[];