Handling Optional Fields with Nulls in Struct Decoding with Effect

Hey folks, when decoding a struct with Effect, how can I make it fill up all the optional fields with nulls for the ones that are not present?
import * as S from "@effect/schema/Schema";
export const Supplier = S.struct({
  name: S.optional(S.string),
  location: S.optional(S.string, {
    nullable: true,
    default: null,
  }),
})

const supplier = {
  name: "blublelub"
}

const decodedSupplier = S.decodeUnknownSync(Supplier)(supplier)

console.log(decodedSupplier)

I tried some of the options like nullable: true or default: null here, but I'm still just getting the {name: "blublelub"} back.
Thanks!
Was this page helpful?