mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-09 22:56:27 +00:00
serialize boolean in JSON to "true/false" instead of "0/1"
Change-Id: I90cf519c00eaf9ccd9fcab8035a91b9205587c3b
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
44261ccdf1
commit
5de28c74f9
@@ -60,7 +60,12 @@ template<typename T> void Print(T val, Type type, int /*indent*/,
|
||||
return;
|
||||
}
|
||||
}
|
||||
text += NumToString(val);
|
||||
|
||||
if (type.base_type == BASE_TYPE_BOOL) {
|
||||
text += val ? "true" : "false";
|
||||
} else {
|
||||
text += NumToString(val);
|
||||
}
|
||||
}
|
||||
|
||||
// Print a vector a sequence of JSON values, comma separated, wrapped in "[]".
|
||||
|
||||
Reference in New Issue
Block a user