Skip to content
Discussion options

You must be logged in to vote

Hey

Option A is indeed the preferred way of handling API requests (as per documentation). The issue you are getting with zod schemas is related to the fact that CRUD operation code is leaking outside shared/api into entities layer https://fsd.how/docs/guides/issues/excessive-entities/#3-exclude-crud-operations-from-entities

But this requires moving domain-specific zod schemas into shared, which feels wrong semantically — they belong to a business domain.

This is, in fact, not true. The frontend application has no control over the type or validation rules for the schema. This schema and its respective types describe the payload types, not domain logic. This follows the same pattern of DD…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by bykim-metis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants