I know nothing about the JSON module, but couldn't you get it (the JSON module) to do the parsing and then implement a post-JSON processing, grep based duplicate keys error generator ?
Just a thought in an idle passing moment ...
A user level that continues to overstate my experience :-))