Creating a Partial Schema with Required ID in Effect Typescript
What is the best way to do the equivalent of
something like this works but now I don't have a
something like this works but now I don't have a
Struct anymoreStructconst requiredExceptId = z
.object({
id: z.string(),
name: z.string(),
})
.partial()
.required({ id: true })const MySchema = Schema.Struct({
id: Schema.String,
name: Schema.String,
email: Schema.String,
age: Schema.Number,
})
const PartialExceptId = MySchema.pipe(
Schema.omit('id'),
Schema.partial,
Schema.extend(MySchema.pipe(Schema.pick('id'))),
)