{\r
PropertiesPtr property = std::make_shared<Properties>(attName);\r
\r
- cJSON *propertyUpdateFrequency = cJSON_GetObjectItem(childProperties, "update_frequency");\r
- if (propertyUpdateFrequency)\r
- {\r
- property->setUpdateFrequencyTime(propertyUpdateFrequency->valueint);\r
- }\r
cJSON *propertyDescription = cJSON_GetObjectItem(childProperties, "description");\r
if (propertyDescription)\r
{\r
}\r
else if (attType == "integer")\r
{\r
- readNumber(childProperties, property);\r
+ readInteger(childProperties, property);\r
}\r
else if (attType == "array")\r
{\r
}\r
else if (attType == "number")\r
{\r
- readNumber(childProperties, property);\r
+ readDouble(childProperties, property);\r
}\r
}\r
\r
}\r
}\r
\r
- void JsonSchema::readNumber(cJSON *childProperties, PropertiesPtr property)\r
+ void JsonSchema::readInteger(cJSON *childProperties, PropertiesPtr property)\r
{\r
cJSON *Max = cJSON_GetObjectItem(childProperties, "maximum");\r
if (Max)\r
}\r
\r
}\r
+\r
+ void JsonSchema::readDouble(cJSON *childProperties, PropertiesPtr property)\r
+ {\r
+ cJSON *Max = cJSON_GetObjectItem(childProperties, "maximum");\r
+ if (Max)\r
+ {\r
+ cJSON *exclusiveMax = cJSON_GetObjectItem(childProperties, "exclusiveMaximum");\r
+ if (exclusiveMax)\r
+ {\r
+ if (exclusiveMax->type == cJSON_True)\r
+ property->setMaxDouble( --(Max->valuedouble));\r
+ else\r
+ property->setMaxDouble(Max->valuedouble);\r
+ }\r
+ else\r
+ property->setMaxDouble(Max->valuedouble);\r
+ }\r
+ cJSON *Min = cJSON_GetObjectItem(childProperties, "minimum");\r
+ if (Min)\r
+ {\r
+ cJSON *exclusiveMin = cJSON_GetObjectItem(childProperties, "exclusiveMinimum");\r
+ if (exclusiveMin)\r
+ {\r
+ if (exclusiveMin->type == cJSON_True)\r
+ property->setMinDouble( ++(Min->valuedouble));\r
+ else\r
+ property->setMinDouble(Min->valuedouble);\r
+ }\r
+ else\r
+ property->setMinDouble(Min->valuedouble);\r
+ }\r
+ cJSON *multipleOf = cJSON_GetObjectItem(childProperties, "multipleOf");\r
+ if (multipleOf)\r
+ {\r
+ property->setMultipleOf(multipleOf->valueint);\r
+ }\r
+\r
+ }\r
+\r
DefinitionsPtr JsonSchema::readRef(std::string m_ref)\r
{\r
std::string delimiter1 = "#";\r