0
votes

I recently updated RestKit from 0.20.3 to version 0.22. I updated the date formatters etc and everything works fine except with two URLs.

Now two of my POST requests fail to find a response descriptor. I have a "No response descriptors match the response loaded" error that list each of my response descriptors on my RKObjectManager. And in particular the following line:

<RKResponseDescriptor: 0x1edf4f00 baseURL=https://mybaseurl/ pathPattern=transfer/execute statusCodes=200-299> failed to match: response path 'transfer/execute' did not match the path pattern 'transfer/execute'.  

Can someone guide me to a migration guide that I could have missed? If I debug putting breakpoints where it tries to find response descriptors and I go down to - (BOOL)gatherParameterValues:(NSArray**)pValues fromString:(NSString *)string I get a YES for transfer/execute so I really don't know where it breaks.

It also seems like mappingsDictionary on RKMapperOperation is empty in main methods...

EDIT

// POST Requests
#pragma mark [POST] transfer/execute
    {
        // execute transfer
        NSString *pathPattern = @"transfer/execute";

        // route
        [manager.router.routeSet
         addRoute:[RKRoute routeWithClass:[Transfer class]
                              pathPattern:pathPattern
                                   method:RKRequestMethodPOST]];

        // request
        RKMapping *requestMapping = [self.mappingProvider transferMapping];
        RKRequestDescriptor *requestDescriptor = [RKRequestDescriptor
                                                  requestDescriptorWithMapping:requestMapping
                                                  objectClass:[Transfer class]
                                                  rootKeyPath:nil
                                                  method:RKRequestMethodPOST];
        [manager addRequestDescriptor:requestDescriptor];

        // response
        RKMapping *responseMapping = [self.mappingProvider transferResultMapping];
        RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor
                                                    responseDescriptorWithMapping:responseMapping
                                                    method:RKRequestMethodGET
                                                    pathPattern:pathPattern
                                                    keyPath:nil
                                                    statusCodes:statusCodesSuccess];
        [manager addResponseDescriptor:responseDescriptor];
    }
1
Can you show the code for your response descriptors. Did you update for deprecated methods? - Wain
And yes I have no warning about deprecated method I changed the code to use value transformers. - florian

1 Answers

1
votes

Your response descriptor has method:RKRequestMethodGET so it won't be considered when you make a POST request. Change it to RKRequestMethodPOST or RKRequestMethodAny.