loopback icon indicating copy to clipboard operation
loopback copied to clipboard

Server side validation and isModified() method

Open g3k0 opened this issue 10 years ago • 1 comments

Hi, I use Loopback for the development of a web application for my client. The framework is very rich and it has a very good documentation. Anyway, after few months using Loopback in my professional activity, I noticed the lack of 2 functionalities that could be very useful in my case and perhaps in general:

  1. Server side validation for complex instances: my data structure is quite denormalized (I use MongoDB), so I use complex models where each property is an object containing other objects, arrays and so on. I had to use external modules such as Ajv JSON schema validation to define custom schemas and validation of my models.

  2. I use before save hook methods to implement logic that should run when a certain property in the model has been modified. It would be great if Loopback could offer an isModified() method for a property in the current instance during update operations.

Regards,

Christian

g3k0 avatar Apr 26 '16 18:04 g3k0

Thanks for the comment. Could you create two new issues for each of the feature requests you're asking for? We can track them independently in the new issues. I will close this issue for now and add feature labels to the new ones you create. https://github.com/strongloop/loopback/wiki/Reporting-issues#feature-requests

superkhau avatar Apr 26 '16 20:04 superkhau