KeyValueObjectMapping icon indicating copy to clipboard operation
KeyValueObjectMapping copied to clipboard

Handling unexpected json data

Open laptobbe opened this issue 12 years ago • 3 comments

Sometimes the json data type and the type in the model does not match. For example something you expect to be an array is a string. In these cases the parsing should have a error parameter, so that we can get a sensable error if that happens.

laptobbe avatar Aug 31 '12 11:08 laptobbe

Good to know and nice idea, good if I pass the NSError as an attribute? So the "normal" method keep simpler. Btw, going to implement that on the next week, or send me a pull request, would be nice! :)

Also, I might implement something to parse values using blocks, so anyone can implement some different rule. How about?

dchohfi avatar Aug 31 '12 20:08 dchohfi

Blocks seems nice :), I can work on a pull request for the error passing.

Tobias Sundstrand 070-931 07 86

31 aug 2012 kl. 22:47 skrev Diego Chohfi [email protected]:

Good to know and nice idea, good if I pass the NSError as an attribute? So the "normal" method keep simpler. Btw, going to implement that on the next week, or send me a pull request, would be nice! :)

Also, I might implement something to parse values using blocks, so anyone can implement some different rule. How about?

— Reply to this email directly or view it on GitHubhttps://github.com/dchohfi/KeyValueObjectMapping/issues/8#issuecomment-8204557.

laptobbe avatar Aug 31 '12 22:08 laptobbe

I would like to see a pull request :D with tests :P

dchohfi avatar Sep 01 '12 00:09 dchohfi