Lower restrictions when parsing json-files (needed for Schoenau, as there are no special days.)

This commit is contained in:
Gerhard Hoffmann 2023-11-07 14:43:26 +01:00
parent 1c13a705c8
commit 10b018a338

View File

@ -34,8 +34,8 @@ bool Configuration::ParseJson(Configuration* cfg, const char* json)
}
// Parse JSON to document
Document document;
document.Parse(json);
Document document;
document.Parse(json);
// Return if parse error has been found
ParseErrorCode err = document.GetParseError();
@ -55,13 +55,13 @@ bool Configuration::ParseJson(Configuration* cfg, const char* json)
// Validate JSON, check configuration members
if (!document.HasMember("Currency")
|| !document.HasMember("PaymentMethod")
|| !document.HasMember("PaymentOption")
|| !document.HasMember("PaymentRate")
|| !document.HasMember("Duration")
//|| !document.HasMember("WeekDays")
|| !document.HasMember("SpecialDaysWorktime")
|| !document.HasMember("SpecialDays"))
|| !document.HasMember("PaymentMethod")
|| !document.HasMember("PaymentOption")
|| !document.HasMember("PaymentRate")
|| !document.HasMember("Duration"))
//|| !document.HasMember("WeekDays")
//|| !document.HasMember("SpecialDaysWorktime")
//|| !document.HasMember("SpecialDays"))
{
printf("%s", "Error: not a valid configuration JSON\n");
return false;