You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix regression with parsing of scalar value documents (#90)
* Add tests for scalar value jsons
* Fix parsing of scalar value documents
With the ondemand parser, the document to value conversion fails with
the error SCALAR_DOCUMENT_AS_VALUE if the document is a single null,
string, bool, or number value.
* Add explicit types in for loop variables
Since we are now using a template type, this is no longer inferable by
an IDE. Adding explicit types also reduces the number of `.value()`
conversions required.
voidconvert_ondemand_element_to_table(lua_State *L, T element) {
47
+
static_assert(std::is_base_of<ondemand::document_reference, T>::value || std::is_base_of<ondemand::value, T>::value, "type parameter must be document_reference or value");
48
+
46
49
switch (element.type()) {
47
50
48
51
case ondemand::json_type::array:
49
52
{
50
53
int count = 1;
51
54
lua_newtable(L);
52
55
53
-
for (auto child : element.get_array()) {
56
+
for (ondemand::value child : element.get_array()) {
0 commit comments