Last post Aug 03, 2017 11:46 AM by PatriceSc
Aug 03, 2017 10:49 AM|Robby De Laet|LINK
In our asp.net webapi's we use a querystring parameter "returnType" (full or compact) that determines the size of the object that
is returned. For instance a "full" employee object contains all the fields, the "compact" type contains a subset. Consumers of the api choose the returnType mainly to safe bandwidth and memory and improve the response times.
Are Media Types a correct way to implement this behaviour in asp.net core?
[Edit] By this I mean vendor types like "application/vnd.mycompany.employee.full+json" and "application/vnd.mycompany.employee.compact+json"
Or is there another preferred approach to tackle this problem?
Aug 03, 2017 11:46 AM|PatriceSc|LINK
I don't think so. It's rather about the underlying format (png, json, xml etc...).
For now I would keep what you have until futher needs. In particular :
- if you to let the user select each field, you could use something such as:
- if expanding that to other operations maybe using an alternate entity name or an optional "view" component as part of the url ?