ループバックでリモートメソッドの入力パラメータを自動的に検証するフォームはありますか?ループバックリモートメソッド:パラメータの検証
のは、私たちは、リモートメソッドの次の定義を持っていると仮定しましょう:
WebuserModel.remoteMethod('overLogin', {
description: "Performs a Webuser's 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'}
}
渡されたオブジェクトがない場合、私はここに、各要求に入力パラメータの検証を実行すると、エラーを発生させるために、ループバックから期待定義されたスキーマ(2つの必須プロパティを持つ必須オブジェクト)に従います。
明らかに起こりません。 手掛かりはありますか?
良い質問ですが、ネストされたオブジェクトではわかりません。いくつかの説明が必要です[ここ](https://github.com/strongloop/strong-remoting/issues/387) – Overdrivr