Partial JSON Response for REST webservices

Mar 23, 2012 at 2:15 PM

I'am trying to implement a REST webservice  supporting partial responses for resources something like Google does with their APIs (http://code.google.com/apis/gdata/docs/2.0/reference.html#PartialResponse).

The  API  client will issue requests in which he will specify specific resource properties that he wishes in response:

/nokiola/friends?fields=id,name:group(media:pictures)

The fields parameter is optional and is used to specify the list of fields from the resource which you want returned. For the API, I plan to use only JSON representations and I was thinking to use JSON.NET for serialization.

Is it possible to control which fields JSON.NET library serializes in JSON format based on a list? Currently I am evaluating the implementation of the APIs either using ASP.NET MVC or Web API.