Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#4387 closed Bugs (fixed)

property_tree json_grammar should accept array at root level

Reported by: Dan Teitsort <dan@…> Owned by: Sebastian Redl
Milestone: Boost 1.44.0 Component: property_tree
Version: Boost 1.42.0 Severity: Problem
Keywords: property_tree json read_json Cc:

Description

According to http://www.ietf.org/rfc/rfc4627.txt?number=4627, section 2:

"A JSON text is a serialized object or array."

However, the implementation of the json_grammar in json_parser_read.hpp does not accept an array at the root level. Rather, it expects an object only.

This means read_json cannot successfully parse the following, even though according to rfc4627 it is valid jSON:

["apple","orange","tomato"]

Change History (3)

comment:1 by Sebastian Redl, 12 years ago

Fixed on trunk in r68992.

comment:2 by Sebastian Redl, 11 years ago

Resolution: fixed
Status: newclosed

(In [71991]) Merge r68990-68993, several fixes to PTree. Fixes bug 1678. Fixes bug 4387.

comment:3 by Sebastian Redl, 11 years ago

(In [71992]) Merge r68990-68993, several fixes to PTree. Fixes bug 1678. Fixes bug 4387. Forgot to commit these together with the header part.

Note: See TracTickets for help on using tickets.