RestKit/RestKit — Issue #570: Eliminate rootKeyPath on RKObjectMapping
Author: blakewatters
Created: 2012-02-25 19:36:34+00:00
State: open
Labels: Bug, Object Mapping

The rootKeyPath attribute was originally added to RKObjectMapping to support the very specific use-case of serialization onto a keyPath a la Rails expectation that a Post object's attributes will come in nested under post[] within the parameters array. From there its role grew to include specifying that object data is nested underneath a keyPath within a given payload. The rootKeyPath becomes ambiguous when a mapping has been used within another mapping by keyPath, as you now have ambiguous keyPath definitions.

Root key path should be removed from RKObjectMapping and instead specified when a mapping is registered on the mapping provider. This will remove the ambiguity completely and make the behavior of mappings easier to reason about.