使用loopback-connector-remote在另一个回送服务中调用自定义方法不会创build正确的URL

我试图连接2回送服务,让我们说AB ,使用loopback连接器远程数据源。

B我有这个自定义的远程方法:

/api/B/myModel/myMethod/{id} 

如果我访问B服务的API资源pipe理器,此方法工作正常。

然后在一个服务上,我想访问这个方法,所以我在远程模型对象上创build了以下configuration(在B上也是这样):

 myModel.remoteMethod( 'myMethod', { http: {path: '/myMethod/:id', verb: 'get'}, accepts: [ {arg: 'id', type: 'number', required: true} ], returns: {type: 'object', root: true} } ); 

A我可以做任何调用B,如find,findById等,但是当我调用这个自定义的方法,我得到这个错误在A

strong-remoting:rest-adapter GET / myModel / myMethod / 1231错误:错误:id必须是一个数字

看看B中的日志,我看到A正在调用这样的服务:

strong-remoting:rest-adapter GET / myModel / myMethod /中的错误:id?id = 1231:错误:id必须是数字

为什么强远程loopback-connector-remote在创buildURL时不能正确replaceid? 我错过了什么configuration?

需要将源path添加到A服务模型对象中的远程方法configuration:

 { arg: 'id', type: 'number', required: true, http: { source: 'path' }}