# Response structure with populated fields

I am working on a backend for an application using a microservice framework with Sequelize and it is populating in the following way (it does based on the table field):

{
"resourceId":{
"name":"Serra Eléctrica",
"unitId":{
"id":2,
"name":"Hora"
},
"resourceTypeId":{
"id":8,
"name":"Patrimoniais"
}
},
"quantity":8,
"price":"9.00",
"vat":"0.00"
}


The frontend developer said that this is bad because the objects are inside fieldId like resourceId.unitId.id instead of resource.unit.id. Is this really bad or is it actually irrelevant?

• It's not really a 'resourceId' is it - It's a 'resource'. – Peilonrayz Jun 7 at 15:27
• You're right, @Peilonrayz – André Jun 7 at 15:46
• This is rather opinionated I guess. I can understand your frontend developer though as the content of all those xxxId fields does not only contain an ID but also a name and other other data. I also wonder about rest as the payload has nothing to do with REST. It does not contain links nor is a plain application/json a good media-type for REST also, as it lacks support for HATEOAS in particular – Roman Vottner Jun 7 at 15:50
• @RomanVottner that payload is just a part of it but it is a RESTful API. Perhaps he is right and I will be changing that, it does not look good itself. – André Jun 7 at 16:21