diff --git a/cpp/json_schema_converter.cc b/cpp/json_schema_converter.cc index 5cd0eafb..2525cb10 100644 --- a/cpp/json_schema_converter.cc +++ b/cpp/json_schema_converter.cc @@ -956,11 +956,11 @@ std::string JSONSchemaConverter::URIToRule(const std::string& uri) { } } - picojson::value current = json_schema_; + auto current = std::cref(json_schema_); for (const auto& part : parts) { - XGRAMMAR_CHECK(current.is() && current.contains(part)) - << "Cannot find field " << part << " in " << current.serialize(false); - current = current.get(part); + XGRAMMAR_CHECK(current.get().is() && current.get().contains(part)) + << "Cannot find field " << part << " in " << current.get().serialize(false); + current = current.get().get(part); } auto new_rule_name = ebnf_script_creator_.AllocateRuleName(new_rule_name_perfix);