fix: don't output null properties
This commit is contained in:
parent
e92c2a69c8
commit
f58eb14a00
@ -10,6 +10,7 @@ namespace ppc::data::json {
|
|||||||
out << '[';
|
out << '[';
|
||||||
|
|
||||||
for (const auto &el : val.array()) {
|
for (const auto &el : val.array()) {
|
||||||
|
if (el.is_null()) continue;
|
||||||
if (!first) out << ',';
|
if (!first) out << ',';
|
||||||
first = false;
|
first = false;
|
||||||
out << stringify(el);
|
out << stringify(el);
|
||||||
@ -21,6 +22,7 @@ namespace ppc::data::json {
|
|||||||
out << '{';
|
out << '{';
|
||||||
|
|
||||||
for (const auto &el : val.map()) {
|
for (const auto &el : val.map()) {
|
||||||
|
if (el.second.is_null()) continue;
|
||||||
if (!first) out << ',';
|
if (!first) out << ',';
|
||||||
first = false;
|
first = false;
|
||||||
out << '"' << el.first << '"' << ':' << stringify(el.second);
|
out << '"' << el.first << '"' << ':' << stringify(el.second);
|
||||||
|
Loading…
Reference in New Issue
Block a user