strongloop / strong-remoting

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

Fix handling of anonymous object types #472

Closed bajtos closed 5 years ago

bajtos commented 5 years ago

In LoopBack, the method PersistedModel.updateAll describes the return type using an inline (anonymous) definition:

{
  returns: {
    arg: 'info',
    type: {
      count: {
        type: 'number',
        description: 'The number of instances updated',
      },
    },
    root: true,
  },
}

Before this change, remote invocation of updateAll was crashing the process with the following error:

AssertionError: type must be either an array or a string.

This patch fixes the problem as follows:

Related issues

Fixes https://github.com/strongloop/loopback/issues/3717

/cc @angfal @ewrayjohnson

Checklist