Skip to content

Commit

Permalink
Ignore null objects in ValidateSchema.
Browse files Browse the repository at this point in the history
  • Loading branch information
dwfncar committed Oct 27, 2023
1 parent 27f2d26 commit 59f479f
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions include/micm/configure/camp_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,11 @@ namespace micm
{
for (const auto& object : config_subset[CAMP_DATA])
{
objects.push_back(object);
if (!object.is_null())
{
// std::cout << object.dump(4) << std::endl;
objects.push_back(object);
}
}
}
else
Expand All @@ -199,7 +203,6 @@ namespace micm
}
}


// Clear vectors and maps
species_arr_.clear();
user_defined_rate_arr_.clear();
Expand Down Expand Up @@ -245,8 +248,8 @@ namespace micm
std::string type = object[TYPE].get<std::string>();

// debug statements
// std::cout << type << std::endl;
// std::cout << object.dump(4) << std::endl;
std::cout << type << std::endl;
std::cout << object.dump(4) << std::endl;

if (type == "CHEM_SPEC")
{
Expand Down Expand Up @@ -907,7 +910,11 @@ namespace micm
// starting with __
// anything else is reported as an error so that typos are caught, specifically for optional keys

std::cout << object.dump(4) << std::endl;
std::cout << "ValidateSchema object " << object.dump(4) << std::endl;
if (object.begin().value().is_null())
{
return ConfigParseStatus::Success;
}

std::vector<std::string> sorted_object_keys;
for (auto& [key, value] : object.items())
Expand Down

0 comments on commit 59f479f

Please sign in to comment.