Menu

parse as much as possible from a broken array

Help
2012-02-19
2013-06-12
  • Moritz Hilger

    Moritz Hilger - 2012-02-19

    Is it possible to parse as much as possible from a broken array/object?
    So, given the (broken) json "[{x:0, y:1},{x:1, y:3},{x:2, y:", I'd like to retrieve the two objects {x:0,y:1} and {x:1,y:3} (ideally also {x:2, y:null}). I can achieve this by simply skipping the opening bracket and feeding the remainder to a JSONStream, but maybe there's a better way.

     
  • Jonathan Wallace

    No, libjson doesn't provide any functionality for retrieving partial json objects other than the streams.

     

Log in to post a comment.