1
私はremoteMethodsでループバックエクスプローラのデフォルトを表示していません。 JSONオブジェクトを入力するとポストが作成されますが、通常はサンプルのlabled "モデルスキーマ"があります。ここにはインラインモデルだけがあります。ループバックエクスプローラのインラインモデルが必要ですモデルスキーマ
アイデア?
モデル定義:
{
"name": "PicklistModel",
"plural": "PicklistModels",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {
"picklistId": {
"type": "string",
"id": true,
"generated": true
},
"key": {
"type": "string",
"required": false
},
"value": {
"type": "string",
"required": false
}
},
"validations": [],
"relations": {},
"acls": [],
"methods": {}
}
リモートメソッド定義:パラメータの
Picklist.remoteMethod('create', {
description: 'Create an PICKLIST',
http: {
path: '/',
verb: 'POST'
},
accepts : [{
description : 'The request to create an PICKLIST',
arg : 'request',
type : 'object',
required : true,
http : {
source : 'body'
},
default: {
key: '',
value: ''
}
}
],
returns: RESTResponseStatic.loopbackAdapterCommonRestResponseDefinition()
});
魅力的に働いた!素晴らしいです、ありがとう。 – Jim