Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for passing mapping meta data to the request operation & loading state #2472

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

falkobuttler
Copy link

Add support for passing mapping meta data to the request operation
Add support for checking if a paginator currently loads data

Add support for checking if a paginator currently loads data
@falkobuttler
Copy link
Author

Travis failed but it doesn't seem to be related to my changes.

@falkobuttler
Copy link
Author

Anyone? Is this project completely dead?

@@ -325,4 +326,9 @@ - (void)setOffsetNumber:(NSNumber *)offsetNumber
self.offset = [offsetNumber unsignedIntegerValue];
}

- (BOOL)isLoading
{
return self.objectRequestOperation ? YES : NO;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return self.objectRequestOperation.isExecuting;

@valeriomazzeo
Copy link
Member

valeriomazzeo commented Jul 3, 2017

@falkobuttler nope, just been busy :)

I have done something similar in my own project, but I didn't have the time to polish it to integrate it into RestKit.

If you want the metadata to be useful, you need to also do something along the lines of:

    // Expand the path pattern with the path parameters
    NSDictionary *metadata;
    if (pathParameters) {
        NSDictionary *interpolatedParameters;
        RKPathMatcher *pathMatcher = [RKPathMatcher pathMatcherWithPattern:pathPattern];
        path = [pathMatcher pathFromObject:pathParameters addingEscapes:NO interpolatedParameters:&interpolatedParameters];
        
        metadata = @{ @"routing": @{ @"parameters": interpolatedParameters },
                      @"query": @{ @"parameters": queryStringParameters ?: @{} } };
    } else if (queryStringParameters) {
        metadata = @{ @"query": @{ @"parameters": queryStringParameters } };
    }

Also, CI is finally back to business so we can accept new pull requests.
It will need test coverage though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants