mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 01:07:57 +00:00
Fix JSON for arrays.
This commit is contained in:
@@ -831,8 +831,20 @@ std::string STArray::getText() const
|
|||||||
Json::Value STArray::getJson(int p) const
|
Json::Value STArray::getJson(int p) const
|
||||||
{
|
{
|
||||||
Json::Value v = Json::arrayValue;
|
Json::Value v = Json::arrayValue;
|
||||||
BOOST_FOREACH(const STObject& o, value)
|
int index = 1;
|
||||||
v.append(o.getJson(p));
|
BOOST_FOREACH(const STObject& object, value)
|
||||||
|
{
|
||||||
|
if (object.getSType() != STI_NOTPRESENT)
|
||||||
|
{
|
||||||
|
Json::Value inner = Json::objectValue;
|
||||||
|
if (!object.getFName().hasName())
|
||||||
|
inner[lexical_cast_i(index)] = object.getJson(p);
|
||||||
|
else
|
||||||
|
inner[object.getName()] = object.getJson(p);
|
||||||
|
v.append(inner);
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
}
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user