talentdeficit / jsx

an erlang application for consuming, producing and manipulating json. inspired by yajl
MIT License
695 stars 218 forks source link

Fix error handler for maps and implemented converter of list fromatted configuration to record #120

Open cleverfox opened 6 years ago

cleverfox commented 6 years ago

Hello. I made a little patch for being able to resume encoding term to JSON in case of key is a bad string. Current implementation of error handler and jsx_parser:resume didn't work with maps. Also something was wrong with config, which was converted to list before calling error handler, but jsx_parser:resume expects record. I done this to use error handler for encoding binary (non printable) keys and/or values in maps and/or arrays. Examples in tests.