Serialize empty tuple into '[]' instead of null (#4594)

Signed-off-by: Michael Valladolid <mikevalladolid@gmail.com>
This commit is contained in:
Michael Valladolid authored and GitHub committed 2025-01-18 20:34:11 +01:00
1 parent e72046ef9f
commit bdb8d2b7b3
4 files changed
+35

No files matched your search

@@ -426,6 +426,13 @@ inline void to_json_tuple_impl(BasicJsonType& j, const Tuple& t, index_sequence<
j = { std::get<Idx>(t)... };
}
template<typename BasicJsonType, typename Tuple>
inline void to_json_tuple_impl(BasicJsonType& j, const Tuple& /*unused*/, index_sequence<> /*unused*/)
{
using array_t = typename BasicJsonType::array_t;
j = array_t();
}
template<typename BasicJsonType, typename T, enable_if_t<is_constructible_tuple<BasicJsonType, T>::value, int > = 0>
inline void to_json(BasicJsonType& j, const T& t)
{