Is there a form to make loopback automatically check input parameters in a remote method?
Suppose we have the following definition of a remote method:
WebuserModel.remoteMethod('overLogin', { description: "Performs a Webuser login to the system", accepts: [ { arg: 'credentials', type: { "username": { type: "string", required:true }, "password": { type: "string", required: true } }, http: {source: 'body'}, required: true }, ], returns: {arg: 'accesToken', type: "object", root: true}, http: {path: '/login', verb: 'post'} }
I would expect loopback to check the input parameter for each request and raise an error if the passed object does not match a specific scheme (required object with two required properties).
This does not seem to be happening. Any clue?
Aleks source share