I'm building a custom rest API endpoint.
This is code which I have written in my custom model class.
return [
['success' => false,
'status-title' => 'Refund Failed',]
];
Following response I'm getting in Postman while my testing the end point.
[
{
"success": false,
"status-title": "Refund Failed"
}
]
I want to JSON response like following example
{
"success": false,
"status-title": "Refund Failed"
}
How Can I set JSON response
{
"success": false,
"status-title": "Refund Failed"
}
Instead of following JSON format
[
{
"success": false,
"status-title": "Refund Failed"
}
]