-
Does someone have experiences with using dynamodb-toolbox with another schema validation library like Zod (https://zod.dev/). Our current implementation quite heavily relies on having our data models defined as Zod schemas that we have used for data validation. We are looking to integrate Dynamodb-Toolbox to our software, but I am bit struggling with the requirement of having to define the object schemas in dynamodb-toolbox completely. This is especially problematic for large discriminated unions, where object attributes can vary a lot depending on the type of the item being stored. The only solution I have come up so far would be to copy-paste our schemas from Zod models to dynamodb-toolbox attributes, but especially for those discriminated unions this feels somewhat cumbersome and error prone (If I understand correctly the only way to implement discriminated unions with dynamodb-toolbox would be to have all the attributes listed and marked as optional so a simple example for this would be something like
But syncing more complex discriminated unions to attributes like this is not really feasible. Would there for example be some possibility to allow "any" other attrbitutes to be passed to the entity besides the ones defined in its definition? Currently this seems to throw an error likes this
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hey @severi, this is not something we currently support but will definitely consider adding it to v1 🙏 |
Beta Was this translation helpful? Give feedback.
Hey @severi,
sorry for the huge delay 😢
this is not something we currently support but will definitely consider adding it to v1 🙏