I want to wrap all my data in "data" when returning objects(something like http://jsonapi.org/ but not exactly as I don't want all the features), so there's some place for metadata like pagination. Of course there are many ways to do this but I'd like to know your opinion what would be better.
There are 3 possible solutions I can think of:
- Custom output formatter (https://docs.microsoft.com/en-us/aspnet/core/web-api/advanced/formatting?view=aspnetcore-2.1)
- Models to wrap data
- Middleware
What do you think is the best way to achieve this?