When using `Schema.NullishOr`, the schema expects the fields to be present but allows them to be ...

When using NullishOr, is there any way to not pass the attribute to the object literal when using Schema.decode? As an example, I have the following schema:

export class Sync extends Schema.Class<Sync>("core.domain.Sync")({
  id: SyncId,
  tenantId: TenantId,
  kind: SyncKind,
  status: SyncStatus,
  snapshot: Schema.NullishOr(Schema.parseJson(Schema.Object)),
  aggregate: Schema.NullishOr(Schema.parseJson(Schema.Object)),
  startedAt: Schema.fromBrand(Timestamp)(Schema.Int),
  finishedAt: Schema.NullishOr(Schema.fromBrand(Timestamp)(Schema.Int)),
}) { }


I initially thought, I can just use:

Schema.decode(Sync)({
  id: "...",
  tenantId: "...",
  kind: "...",
  status: "...",
  startedAt: myTimestamp
});


but this isn't the case, as TypeScript still complains that all NullishOr attributes need to be defined as well. Is there any way to circumvent passing undefined for the respective fields?
Was this page helpful?