环回资源pipe理器内联模型需要模型模式

我坚持我的remoteMethods不显示在Loopback Explorer中的默认值。 如果我input一个JSON对象,这个post将会创build,但是通常会有一个示例“Model Schema”。 这里只是说内联模型。

有任何想法吗?

模型定义:

{ "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() }); 

环回资源管理器

使用参数types来代替对象的types,参见下面的例子

  accepts: [{ description : 'The request to create an PICKLIST', arg: 'request', type: 'Picklist', // *** give model reference here required : true, http: { source : 'body' }, default: { key: '', value: '' } }]