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 6990991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:25:57+00:00 2026-05-27T19:25:57+00:00

I am using RESTKIT to map the JSON returned from server. The JSON result

  • 0

I am using RESTKIT to map the JSON returned from server.

The JSON result obtained from server is as follows

{"term":"Zh","results":{"users":[{"id":{"$oid":"4ebe59970a614e0019000055"},"term":"some text","score":1}]}

How can I convert the above JSON result to the below:

{"results":{"users":[{"uid":"4ebe59970a614e0019000055","text":"some text"}]}

Also, where can I do this so that the RESTKIT mapping will use the converted JSON instead of the initial one?

Below is the loader class that I am using to manage the JSON and mappings

-(void)getObjects
{
    RKObjectManager *sharedManager = [RKObjectManager sharedManager];
    [sharedManager loadObjectsAtResourcePath:self.resourcePath delegate:self];
}

- (void)request:(RKRequest*)request didLoadResponse:(RKResponse*)response {
    NSLog(@"Loaded PAYLOAD successfully for %@, with response %@", self.resourcePath , [response bodyAsString]  );
}


- (void)objectLoader:(RKObjectLoader*)objectLoader didLoadObjects:(NSArray*)objects 
{
}


+ (void)setManagerAndMappings
{
    RKObjectManager* manager = [RKObjectManager objectManagerWithBaseURL:SERVER_URL];
    RKObjectMappingProvider* provider = [[RKObjectMappingProvider new] autorelease];

    //User Object Mapping
    RKObjectMapping* userMapping = [RKObjectMapping mappingForClass:[User class]];
    [userMapping mapKeyPath:@"_id" toAttribute:@"uid"];

    [userMapping mapAttributes:@"avatar_url",@"created_at",@"email",@"name",@"nickname",@"follower_count",@"following_count",@"answer_count",@"new_notification_count",@"new_questions_count",@"is_following",@"facebook_configured",@"twitter_configured",@"description",@"approved",@"type", nil];
    [provider setMapping:userMapping forKeyPath:@"user"];

}
  • 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-05-27T19:25:58+00:00Added an answer on May 27, 2026 at 7:25 pm

    For me the only solution is to modify the returned object at the server level.
    If you can’t,just map that returns the server.

    • 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'm using the RestKit library to load json from my REST services, and then
I'm using RestKit to grab objects from my RoR service and using CoreData to
I am using RestKit, GData and Facebook API. All of them has a JSON
I'm using the RestKit iOS package to allow a user to pull info from
i am using: from restkit import Resource, SimplePool, BasicAuth, request environment: Python 2.7.2+ (default,
I need to send a JSON request to a REST service. I'm using Restkit
I have a small app using RestKit with a Sinatra-backed server. When I post
I am having trouble mapping a JSON response to objects using RestKit and Objective-C.

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.