| 454 | } |
| 455 | |
| 456 | std::optional<Json> checkKeys(Json const& _input, std::set<std::string> const& _keys, std::string const& _name) |
| 457 | { |
| 458 | if (!_input.empty() && !_input.is_object()) |
| 459 | return formatFatalError(Error::Type::JSONError, "\"" + _name + "\" must be an object"); |
| 460 | |
| 461 | for (auto const& [member, _]: _input.items()) |
| 462 | if (!_keys.count(member)) |
| 463 | return formatFatalError(Error::Type::JSONError, "Unknown key \"" + member + "\""); |
| 464 | |
| 465 | return std::nullopt; |
| 466 | } |
| 467 | |
| 468 | std::optional<Json> checkRootKeys(Json const& _input) |
| 469 | { |
no test coverage detected