Effect-TS / schema

Modeling the schema of data structures as first-class values

Home Page:https://effect.website

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

S.partial throws when used with S.optional.withDefault.

jessekelly881 opened this issue · comments

It seems like S.optional().withDefault() can't be used with S.partial. It throws "partial cannot handle transformations". Obviously this example is a bit contrived but it makes total sense to have an Partial while still supplying certain defaults for certain values in A. I'm decoding a very large object and would really really rather rather not wrap every prop in S.optional() when I should be able to use S.partial

const schema = S.struct({
    o: S.optional(S.string).withDefault(() => ""),
}).pipe(S.partial)