0
votes

I'm using RavenDB for my persistence which is giving my objects identifiers like this:

networks/33 users/322

etc where the route to load my network restfully is mydomain.com/networks/33

So I'm wondering if I will have any issues mapping my responseDescriptors in one spot on app initialisation.

Let's say I have this for my Network response descriptor:

[manager addResponseDescriptor:[RKResponseDescriptor
responseDescriptorWithMapping:networkMapping
pathPattern:@":\\identifier"
keyPath:@"Network"

and this for my User response descriptor:

[manager addResponseDescriptor:[RKResponseDescriptor
responseDescriptorWithMapping:networkMapping
pathPattern:@":\\identifier"
keyPath:@"User"

When I request an object at mydomain.com/networks/33 or mydomain.com/users/323 how does the router know which response descriptor to use?

1

1 Answers

1
votes

I assume your base URL is set to mydomain.com.

Your path patterns are wrong, they should be set to:

@"networks/:identifier"
@"users/:identifier"

Now the response descriptors can be distinguished based on the path.