Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8675329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:55:25+00:00 2026-06-12T19:55:25+00:00

Using RestKit 0.10.1, I have objects served similar to this json format: {objects: [

  • 0

Using RestKit 0.10.1, I have objects served similar to this json format:

{"objects": [
    {"owner": 1, 
     "_id": 823, 
     "data": {
         "diam": 5.0, 
         "plant_date": "10/02/2008"}
    }, 
     ...   ] }

on the client side, I do not need to have sub objects or relationships, so I flatten to attributes of my object:

[myMapping mapKeyPathsToAttibutes: 
    @"_id", @"id", 
    @"owner", @"owner", 
    @"data.diam", @"diam", //here is what I mean by flatten; notice data.diam -> diam
    @"data.plant_date", @"plant_date", nil];

I have no problem reading this data, but when I want to serialize it, only the top-level attributes get sent to the server. When I serialize, here is what the server gets:

{"_id":0,"owner":1}

Note that I have correctly (I think) registered the Serialization mapping with an inverseMapping of the above:

[objectManager.mappingProvider setSerializationMapping:[myMapping inverseMapping] forClass:[MyClass class]];

When I post the object like so:

myObject = [MyClass object];
myObject.diam = [NSNumber numberWithInt:5];
myObject.plant_date = myDate;

[[RKObjectManager sharedManager] postObject:myObject delegate:self];

I would like to have the complete, unflattened structure:

{"_id":0,"owner":1, "data": {"diam": 5.0, "plant_date": "10/02/2008"} }

How can I achieve posting a keypath (i.e. “data.diam”) mapping registered object to server using RestKit?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T19:55:26+00:00Added an answer on June 12, 2026 at 7:55 pm

    Note that this bug has been fixed in RestKit on the development for release in 0.20. See the changeset @ https://github.com/RestKit/RestKit/commit/64e9c7cb6d04dd8750e9f663fc998bbe738945e9

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am using coredata and restkit to map data. here is the json response
Im using Restkit OM2 to take in a json and map to objects on
I have used many hours on how to solve this issue. Im using Restkit
I am successfully retrieving JSON data from a web service with GET using Restkit's
I am having trouble mapping a JSON response to objects using RestKit and Objective-C.
I have been trying to post using RestKit after I have successfully used it
Im using restkit and push notifications and I have also built the interface, so
I'm using RestKit to load a gzipped JSON with RKRequest: RKRequest* request = [[RKClient
I have a small app using RestKit with a Sinatra-backed server. When I post
I am using the great RestKit Framework for an iPhone Application. I have got

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.