I decided to use Mantle to consume some JSON endpoints, but the structure of the JSON is different depending on whether you're GETing or POSTing an object. Take the users endpoint for instance:
When requesting a user you get a response similar to this:
{
"random_meta_data": "whatever",
"etc.": "etc.",
"payload": {
"username": "username",
"email": "username@email.com",
"etc.": "etc."
}
}
When creating a user you need to send something like this:
{
"username": "username",
"email": "username@email.com",
"etc.": "etc."
}
It's not a difficult problem to solve, but it seems like a common enough problem that Mantle should be able to solve it for you.
I know I could simply initialize the mantle model with dictionary[@"payload"], but Overcoat is doing the mapping for me automatically and if I'm going to do that manually I'm not taking advantage of Overcoat anymore.
So I'm wondering if there is a standard way of solving this with Mantle and/or Overcoat?