feat(eventsub): Add support for channel.moderate Warn (#5932)
* fix(eventsub): Be less strict with strings & vectors
String foo from `{"foo":null}` is now accepted, and returns an empty string
std::vector<String> foo from `{"foo":null}` is now accepted, and returns an empty array
This commit is contained in:
@@ -11,6 +11,12 @@ boost::json::result_for<String, boost::json::value>::type tag_invoke(
|
||||
boost::json::try_value_to_tag<String> /*tag*/,
|
||||
const boost::json::value &jvRoot)
|
||||
{
|
||||
if (jvRoot.is_null())
|
||||
{
|
||||
// We treat null "strings" as empty strings
|
||||
return String("");
|
||||
}
|
||||
|
||||
auto v = boost::json::try_value_to<std::string>(jvRoot);
|
||||
if (v.has_error())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user