-
-
Notifications
You must be signed in to change notification settings - Fork 129
Add nested error paths note to Schema.filter
#1162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add nested error paths note to Schema.filter
#1162
Conversation
|
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).