Anviking / Decodable

[Probably deprecated] Swift 2/3 JSON unmarshalling done (more) right
MIT License
1.04k stars 73 forks source link

[WIP] Error formatter #124

Open Anviking opened 7 years ago

Anviking commented 7 years ago

The implementation is hideous, but it appears to work.

object: 
 | repo: 
 |  | owner:  <<<<---- MissingKey: oops
 |  |  | id: 1
 |  |  | login: "anviking"

ATM, | characters appear in the parent nodes of the error to make it easier to locate.

This is probably ready when

Anviking commented 7 years ago

Also, out of scope for this but if operators are discarded for global functions decode(json, keys...) tracking function name, filename etc. the possibilities just become so ridiculous that I'm not even sure I want to do it ever. In debug mode each json object could have information about which decode function accessed it, which we could color code and present as a HTML representation. This would also draw attention to json keys not accessed that should be == win.