diff --git a/lib/json/reflector.h b/lib/json/reflector.h index 77ab0b2..ef796d3 100644 --- a/lib/json/reflector.h +++ b/lib/json/reflector.h @@ -474,6 +474,21 @@ inline void pull( reflectable = value.GetString(); } +/*! + * \brief Checks whether the specified value contains a string. + * \remarks Does not actually store the value since the ownership would not be clear (see README.md). + */ +template , std::is_same>...> +inline void pull(Type &, const RAPIDJSON_NAMESPACE::GenericValue> &value, JsonDeserializationErrors *errors) +{ + if (!value.IsString()) { + if (errors) { + errors->reportTypeMismatch(value.GetType()); + } + return; + } +} + /*! * \brief Pulls the specified \a reflectable which is an iteratable without reserve() method from the specified value which is checked to contain an array. */