Opened 13 years ago

Closed 13 years ago

#3981 closed Bugs (invalid)

json writer generates invalid output for bool values

Reported by: Alessandro Vergani <avergani@…> Owned by: Sebastian Redl
Milestone: Boost 1.43.0 Component: property_tree
Version: Boost 1.42.0 Severity: Problem
Keywords: Cc:

Description

This piece of code should produce the string ( cr and lf removed) { "success" : false }. It wrongly generates { "success" : "false" }

std::ostringstream output;
using namespace boost::property_tree;
ptree pt;
pt.put("success", false);
json_parser::write_json(output, pt);
std::string result = output.str();

Change History (1)

comment:1 by Sebastian Redl, 13 years ago

Resolution: invalid
Status: newclosed

The ptree typedef of property tree contains strings. Only strings. Therefore, all properties are written out as strings.

Note: See TracTickets for help on using tickets.