strongloop / strong-remoting

Communicate between objects in servers, mobile apps, and other servers.
www.strongloop.com
Other
105 stars 93 forks source link

TypeError: Cannot read property 'http' of undefined at HttpContext.buildArgs\node_modules\strong-remoting\lib\http-context.js:120:23) #397

Closed barocsi closed 7 years ago

barocsi commented 7 years ago

When testing with Explorer, some remote method gives this error,

curl -X GET --header 'Accept: application/json' 'http://localhost:3000/api/posts/feed?access_token=test_token1'

for (var i = 0, n = accepts.length; i < n; i++) {
    var o = accepts[i];
    var httpFormat = o.http;
    var name = o.name || o.arg;
    var val;
[...]

seems like accepts is empty and the whole thing messes up

[ , { arg: 'filter', type: 'object', required: false } ]

interestingly other methods for this and other model includes the http object

[ { arg: 'filter',
    type: 'object',
    description: 'Filter defining fields, where, include, order, offset, and limit' },
  { http: [Function: createOptionsViaModelMethod],
    type: 'object',
    arg: 'options' } ]
barocsi commented 7 years ago

Misconfigured remote method json.