Closed Narretz closed 3 years ago
Hey @Narretz, thanks for submitting the issue!
I investigated and it seems that the way you defined the Buffer type differs slightly from the Mongoose docs, which is why I missed adding a check to handle this.
I will add support for your format, but if you want to continue using the tool in the meantime you can define your Buffer using the format described here. Let me know if this solves the issue! 😊
Fixed in 8.0.2 🚀
Thanks, this is great. It does make sense to use just Buffer same as other built ins ...
Hi, frist of all, thanks for this package. This is exactly what I wanted since I don't want to touch my existing schema defs. :)
I think I found a bug related to Buffer in a schema:
Consider this
For me. this throws an error during gen:
TypeError: Cannot read property 'required' of null
coming from here: https://github.com/francescov1/mongoose-tsgen/blob/854a1f9289bb07107622914bf8e76dbde202d2e5/src/helpers/parser.ts#L468Now I don't know 100% if Buffer types even can have a default value null?