I'm newbie on Strongloop and I can't find information for how to customize my response class (model schema for a object I built) and I don't know how to show on the API explorer the object with custom data.
For example, I have a custom remote method called score
POST /Challenges/score
I want to show for the parameter data
a custom model schema instead of single parameters, not the Model Schema for Challenge, the data on the body have all the parameters and show to the user on the Data Type: Model Schema, is this possible?
{
"id": "string",
"limit": 0,
"order": "string",
"userId": "string"
}
On the other side, in Response Class I want to show the schema for the response object. Something like this:
{
"id":"string",
"userId":"string",
"user": {},
"totalScore":0,
"tags": []
}
I looked different questions (this and this), but can not find something to solve this issues.
Update
Here is the definition of the remote method
Challenge.remoteMethod('score', {
accepts: { arg: 'data', type: 'object', http: { source: 'body' } },
returns: {arg: 'scores', type: 'array'},
http: {path: '/score', verb: 'post'}
});