Damien MATHIEU
Damien MATHIEU

Reputation: 32629

RestKit: Nested data but no relationship

I'm trying to parse the GitHub API with RestKit, and specifically the commits of a repository.
You can see in their documentation that there are nested attributes, like the "commit" hash. There attributes, though, are part of the main object and I wouldn't want adding a new model and a relationship for this.

How can I add a mapping to the commit message there ?

Upvotes: 0

Views: 255

Answers (1)

Vincent Tourraine
Vincent Tourraine

Reputation: 801

It depends on the kind of Core Data model you're trying to get, but from what I understand maybe you could just flatten the API resource and set the message as a direct attribute of your commit object.

Something like this:

[commitMapping mapKeyPath:@"commit.message" toAttribute:@"commitMessage"];

Upvotes: 2

Related Questions