Hello, I have a serious problem with Mongoose. Is there a way to use JSON-Shema with Mongoose schemas? Let's say I want to define my API data schema using a standard such as JSON-Schema, because it is good. It seems I need to define it again when I want to use Mongoose / MongoDB! This is a pretty ugly duplication that I like to avoid. Ideally, changing the JSON-Schema definition would also change the MongoDB schema. A similar problem would occur if I used the JOI.JS validation library. Has anyone found a solution? Or is there an alternative approach?
thanks
source share