id summary reporter owner description type status milestone component version severity resolution keywords cc 9496 property_tree write_json should output correct types in JSON Egbert van der Wal Sebastian Redl "When using boost::property_tree::write_json it will write all types as strings, which is unwanted when wanting to preserve the correct types for data. - The boolean value is stored as the string ""true"" or ""false"", - Null is stored as the string ""null"" - Numeric values are also stored as strings - Floating point values might end up in their scientific, lossy representations For my purposes, I need to transfer numeric values (unix timestamps represented as double) in their most accurate representation using JSON and boolean values to represent correct boolean values without writing another text-to-bool converter. I will attach a patch that fixes this. For every value in the property_tree, it will * try to match is with boolean true or false, and write that value unquoted to the JSON output * try to read it as an integer and if that succeeds, write it unquoted to the JSON output * try to read it as a double value and if that succeeds, write it unquoted with appropriate numeric precision (based on std::numeric_limits) to the JSON output * try to see if the string matches 'null' and if it does, it will write null unquoted to the JSON output * if all else fails, write the value as a quoted string to the JSON output This will make it a lot easier to interpret the JSON on the receiving and, and greatly improve accuracy for double values." Patches closed To Be Determined property_tree Boost Development Trunk Optimization invalid