Hi everybody,
I'm looking for a solution to define the JSON provider depending on the request origin, to serialize a bit differenlty the response for application requests and web front requests.
In fact, the application doesn't need all data to be serialized. Some of data are references. So I successfully customized the json provider to summerise this kind of data.
Exemple:
Project P1 has a user U1 (id 1).
When someone request the project, the json will be:
{
"name":"P1",
"user" : {
"@reference" : "1"
}
}
Everything works well since the software know how to deserialize @reference. But for the web front, it's a bit different, since its need to have the entire data serialized.
So:
{
"name":"P1",
"user" : {
"name" : "U1"
[...] // all other data of the user
}
}
The best approach in my opinion is to define the JSON provider by origin. Is there a way to achieve this with wisdom?
Thank you in advance!
Kevin