objective c - How to config RestKit errorMapping to accept more complex response? -


the errormapping defined as:

[[[[rkobjectmanager sharedmanager] mappingprovider] errormapping] setrootkeypath:@"error"]; 

it works simple error message string:

render status: :unprocessable_entity, json: { :error => 'cannot create topic' } 

however, fails hash response:

render status: :unprocessable_entity, json: { :error => @topic.errors } 

and gives:

w restkit.object_mapping:rkobjectmappingoperation.m:239:-[rkobjectmappingoperation transformvalue:atkeypath:totype:] failed transformation of value @ keypath ''. no strategy transforming 'jkdictionary' 'nsstring'

is there way configure restkit errormapping accept hash response (and stores in nsdictionary)?

i assume using default error mapping? maps error keypath rkerrormessage class. class expects nsstring, have nsdictionary (jkdictionary because using jsonkit, still...).

if don't want modify server code, can create own error class on iphone , replace default mapping. example can see rkerrormessage.m , [rkobjectmanager init] default map created.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -