effect icon indicating copy to clipboard operation
effect copied to clipboard

From Discord: Schema Partial with Nullable Option

Open effect-bot opened this issue 7 months ago • 1 comments

Summary

The conversation revolves around the need to simplify the process of making schema properties optional and nullable in the Effect-TS ecosystem. Jesse Kelly mentions using Schema.partial(_, { nullable: true, as: "Option" }) to avoid manually writing Schema.optional(x, { nullable: true, as: "Optional" }) for each property, which can be cumbersome. Tylor agrees and mentions that he often uses a helper for the optional variant. Jesse Kelly further elaborates that being able to define the Struct.optional configuration for every property at once would reduce boilerplate, especially for entirely partial structures or when dealing with separate RequiredProps and OptionalProps structs.

Key Takeaways:

  1. There is a need to simplify making schema properties optional and nullable.
  2. Manually writing optional and nullable configurations for each property is cumbersome.
  3. Helpers or utilities to handle this configuration can reduce boilerplate.
  4. Defining the optional configuration for all properties at once is desirable for efficiency.

Discord thread

https://discord.com/channels/795981131316985866/1255872346267451402

effect-bot avatar Jun 28 '24 13:06 effect-bot