Our resources include dozens of fields (features). Some of our customers do not need the properties of all the resources to network payloads To protect we have implemented a query string parameter to limit processing properties. For example, the next URL will return the collection of resources with all its areas:
But when the customer only needs specific areas, then he can do so by calling :
Our architect argues that this approach is not calm.
What do you think?
If you implement it as the new media type (representation) of the same resource then it is dangerous It will be an imperfect representation, but still, a representation. Assume that you have this resource:
/ myapp / myresources
which is a collection of complete presentations of any kind of resources, of a different representation of the same collection For this it is absolutely fine. However, if you want it to be consistent so far, then you should implement it as a new media type (format).
Then, you can accept the header set on your desired media type, or you can use "Media Type in Extension Style" - for example /myapp/myresources.f1_f2_f3.
Your situation is a bit difficult, because your media types will be invented on the fly, but I think it is not impossible.
Comments
Post a Comment