Add nested error paths note to Schema.filter#1162
Add nested error paths note to Schema.filter#1162giuliobracci wants to merge 1 commit intoEffect-TS:mainfrom
Schema.filter#1162Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@giuliobracci is attempting to deploy a commit to the Effect Team on Vercel. A member of the Team first needs to authorize it. |
|
Not sure this example adds much to the one above https://effect.website/docs/schema/filters/#specifying-error-paths. Also, IMO the filter should be defined on the struct related to the |
|
I agree with your point @gcanti. However, what do you think about adding a note to the specifying-error-paths section, highlighting this possibility? I've encountered situations in practice where properties in the root object needed to report a nested error. Porting the subschema isn't straightforward in such cases, as it was generated dynamically by a function. |
Yes, you can specify any |
…` error paths section
0c69b2e to
13b21c0
Compare
Schema.filterSchema.filter
|
@gcanti sorry for the delay, I had quite an hectic time. I've updated the PR with the changes requested. |
Type
Description
Adds a new
Schemadocumentation example. It demonstrates using Schema.filter to report errors on nested fields with interdependent validation rules (e.g., conditional discount based on base price).