You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the Client only validates against createEntrySchema when creating a new Entry. Here, values is a pretty generic array of unions that can be any possible Value.
Inside Core we are going a step further by validating each given Value by it's definition. This is done by finding the definition by ID and then calling the getValueContentSchemaFromDefinition() method of @elek-io/shared with it. This method generates the schema based on given definition which is then used to validate the Value with.
Because we are not doing the same thing on the Client, we only display a generic notification for the user if the schema validation fails inside Core. Ideally we can do the same we do in Core also in Client, to highlight the fields on errors and display the correct message next to it.
The text was updated successfully, but these errors were encountered:
Nils-Kolvenbach
changed the title
Add client side zod validation when creating an Entry
Add full client side zod validation when creating an Entry - including it's Values
Apr 27, 2024
Currently the Client only validates against
createEntrySchema
when creating a new Entry. Here,values
is a pretty generic array of unions that can be any possible Value.Inside Core we are going a step further by validating each given Value by it's definition. This is done by finding the definition by ID and then calling the
getValueContentSchemaFromDefinition()
method of @elek-io/shared with it. This method generates the schema based on given definition which is then used to validate the Value with.Because we are not doing the same thing on the Client, we only display a generic notification for the user if the schema validation fails inside Core. Ideally we can do the same we do in Core also in Client, to highlight the fields on errors and display the correct message next to it.
The text was updated successfully, but these errors were encountered: