Fix for type data
@@ -806,9 +806,14 @@ const std::string OMF::createTypeData(const Reading& reading) const
// Add the Static data part
- string tData("[{ \"type\": \"object\", \"properties\": { "
-"\"Company\": {\"type\": \"string\"}, \"Location\": {\"type\": \"string\"}, "
-"\"Name\": { \"type\": \"string\", \"isindex\": true } }, "
+ string tData("[{ \"type\": \"object\", \"properties\": { ");
+ for (auto it = m_staticData->cbegin(); it != m_staticData->cend(); ++it)
+ {
+ tData.append("\"");
+ tData.append(it->first.c_str());
+ tData.append("\": {\"type\": \"string\"},");
+ }
+ tData.append("\"Name\": { \"type\": \"string\", \"isindex\": true } }, "
"\"classification\": \"static\", \"id\": \"");
// Add type_id + '_' + asset_name + '_typename_sensor'
