The project really needs an configuration to decide whether to apply transformation or not and to what part of the data.
For example, Problem Details RFC https://tools.ietf.org/html/rfc7807 tells that all errors should be returned wrapped inside of Problem Details object.
Another example is data containers, if an endpoint returns Companies the data for collection the data will be likely wrapped inside some object:
{
paging: {
....
},
items: [
....
],
other_metadata: {
}
}
The project really needs an configuration to decide whether to apply transformation or not and to what part of the data.
For example, Problem Details RFC https://tools.ietf.org/html/rfc7807 tells that all errors should be returned wrapped inside of Problem Details object.
Another example is data containers, if an endpoint returns Companies the data for collection the data will be likely wrapped inside some object: