Follow-up to the jsoncpp vcpkg migration (#179). The migration is done in two steps:
- Step 1 (vcpkg move): migrate
//thirdparty/jsoncpp to vcpkg jsoncpp 1.9.x, keeping flare's existing Json::Reader/FastWriter/StyledWriter usage and silencing their deprecation with -Wno-deprecated-declarations on the consuming targets. This isolates the library/version change from any API rewrite.
- Step 2 (this issue): replace the deprecated APIs with the 1.x builder API so we can drop the warning suppression (and stay compatible past jsoncpp's eventual removal of the legacy classes).
Scope
Deprecated APIs are used in ~23 files / ~12 targets (http builtin handlers, binlog, base/option, monitoring, plus tests):
Json::Reader (≈21 sites) → Json::CharReaderBuilder + Json::parseFromStream / CharReader::parse.
Json::FastWriter (≈4) / Json::StyledWriter (≈8) → Json::StreamWriterBuilder + Json::writeString.
Behavioral pitfalls to handle in the rewrite
FastWriter::write() appends a trailing \n; writeString() does not. StreamWriterBuilder defaults to pretty output — set builder["indentation"]="" for compact. Update golden/string-compare tests accordingly.
- 1.x throws
Json::LogicError/RuntimeError on type misuse (e.g. asString() on a non-string) where 0.x coerced/defaulted.
- 1.x parsing is stricter; revisit any inputs relying on 0.x leniency.
Optional cleanup
- Switch includes from flare's
jsoncpp/<h> alias to the canonical json/<h> and drop the include_prefix={'jsoncpp':'json'} mapping added in Step 1.
🤖 Generated with Claude Code
Follow-up to the jsoncpp vcpkg migration (#179). The migration is done in two steps:
//thirdparty/jsoncppto vcpkg jsoncpp 1.9.x, keeping flare's existingJson::Reader/FastWriter/StyledWriterusage and silencing their deprecation with-Wno-deprecated-declarationson the consuming targets. This isolates the library/version change from any API rewrite.Scope
Deprecated APIs are used in ~23 files / ~12 targets (http builtin handlers, binlog, base/option, monitoring, plus tests):
Json::Reader(≈21 sites) →Json::CharReaderBuilder+Json::parseFromStream/CharReader::parse.Json::FastWriter(≈4) /Json::StyledWriter(≈8) →Json::StreamWriterBuilder+Json::writeString.Behavioral pitfalls to handle in the rewrite
FastWriter::write()appends a trailing\n;writeString()does not.StreamWriterBuilderdefaults to pretty output — setbuilder["indentation"]=""for compact. Update golden/string-compare tests accordingly.Json::LogicError/RuntimeErroron type misuse (e.g.asString()on a non-string) where 0.x coerced/defaulted.Optional cleanup
jsoncpp/<h>alias to the canonicaljson/<h>and drop theinclude_prefix={'jsoncpp':'json'}mapping added in Step 1.🤖 Generated with Claude Code