Suggested model property validation additions and/or a different way (see below)#95
Suggested model property validation additions and/or a different way (see below)#95drj-io wants to merge 2 commits into
Conversation
… model schema validations are throwing things off. In our opinion, any model property validation prevents extending the system with dynamic capabilities. There may be a security reason for validating model properties, but if there's not, we recommend removing the model property validation all together (line 237-241 in /lib/waterline-schema/schema.js). Another option is to allow us to register our own model property types that the validator can validate against. Thank you for considering our ideas as a feature request and a way to make great software, quickly. -- David
… model schema validations are throwing things off. In our opinion, any model property validation prevents extending the system with dynamic capabilities. There may be a security reason for validating model properties, but if there's not, we recommend removing the model property validation all together (line 237-241 in /lib/waterline-schema/schema.js). Another option is to allow us to register our own model property types that the validator can validate against. Thank you for considering our ideas as a feature request and a way to make great software, quickly. -- David
|
Howdy @drj-io! We've gone back and forth on this a bit, and we ended up using That said, having been down the road it seems you're on, I think I understand why you need
|
|
Also just to give you an answer re:
It's not as much security as it is to prevent common errors (we were seeing sooooo many issues-- from the community and in practice on our own projects. Particularly where one attr def accidentally gets nested inside another) |
|
Hey @mikermcneil, great ideas. I think what you propose will work quite well. I didn't realize that Thanks a lot! I'm starting to head into the sea building my own generator. Here's hoping there are no icebergs on the way. 💨⛵ |
There are a number of valid attribute properties that are not currently included in the documentation. Add them. References: 1. Explanation: balderdashy/waterline-schema#95 (comment)
|
Just a note to other that come across this PR, I've added this to the documentation here balderdashy/sails-docs#1308. |
Hi there, Mike. We are working on building a CRUD model generator for SAILSJS and the model schema validations are throwing things off. In our opinion, any model property validation prevents extending the system with dynamic capabilities. There may be a security reason for validating model properties, but if there's not, we recommend removing the model property validation all together (line 237-241 in /lib/waterline-schema/schema.js). Another option is to allow us to register our own model property types that the validator can validate against. Thank you for considering our ideas as a feature request and a way to make great software, quickly. -- David
p.s. hope you guys are doing well!