How to customize the json returned from a json_api?

I am implementing a json_api, but the return is the default defined by my resource, I know that I can define which attributes I will return, but as we are migrating a system, we need, at first, to maintain the return structures so as not to harm the connected systems in our application. Question: How do I customize the json return so that it looks something like this example?

{
“user”:
{
“id”: “62b98343”,
“name”: “name test”
}
}

Seria possível isso? Ou implemento as chamadas e os retornos no Phoenix?

1 Like

Right now ash_json_api doesn’t support that. You will need to write your own controllers that call your resource actions and render the json that is required. ash_json_api currently only produces a JSON:API specification compliant api as defined here: https://jsonapi.org/

2 Likes