Skip to content

Conversation

@giuliobracci
Copy link
Contributor

Type

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Adds a new Schema documentation example. It demonstrates using Schema.filter to report errors on nested fields with interdependent validation rules (e.g., conditional discount based on base price).

@vercel
Copy link

vercel bot commented Jun 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
website-content Ready Ready Preview Comment Sep 22, 2025 8:25pm
website-landing Ready Ready Preview Comment Sep 22, 2025 8:25pm
website-proxy Ready Ready Preview Comment Sep 22, 2025 8:25pm

@vercel
Copy link

vercel bot commented Jun 18, 2025

@giuliobracci is attempting to deploy a commit to the Effect Team on Vercel.

A member of the Team first needs to authorize it.

@gcanti
Copy link
Contributor

gcanti commented Jun 19, 2025

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 pricing field, since it only depends on those subfields and would be more portable if you reuse the subschema.

@giuliobracci
Copy link
Contributor Author

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.

@gcanti
Copy link
Contributor

gcanti commented Jun 24, 2025

However, what do you think about adding a note to the specifying-error-paths section, highlighting this possibility?

Yes, you can specify any path. If that's not clear enough, we can add a note (or even just a small clarification in the opening text of the section)

@giuliobracci giuliobracci force-pushed the docs/add-nested-error-paths-section branch from 0c69b2e to 13b21c0 Compare September 22, 2025 20:24
@giuliobracci giuliobracci changed the title docs: add nested error paths section to Schema.filter Add nested error paths note to Schema.filter Sep 22, 2025
@giuliobracci
Copy link
Contributor Author

@gcanti sorry for the delay, I had quite an hectic time. I've updated the PR with the changes requested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants