Remove object schema parsing in state definition
State definition schema is no longer parsed by libweave for semantic
understanding. We just keep it around for clients who explicitly
as for it, but we no longer use the schema to validate the state
values. They are now stored as an opaque JSON object.
BUG: 25841230
Change-Id: Ib54b3d1f52dd8c63e9fa74afc174adeb5ca56d4d
Reviewed-on: https://weave-review.googlesource.com/1627
Reviewed-by: Vitaly Buka <vitalybuka@google.com>
diff --git a/src/device_registration_info.cc b/src/device_registration_info.cc
index d60b6cb..5c8625a 100644
--- a/src/device_registration_info.cc
+++ b/src/device_registration_info.cc
@@ -1120,23 +1120,11 @@
return;
std::unique_ptr<base::ListValue> patches{new base::ListValue};
- for (const auto& state_change : state_changes) {
+ for (auto& state_change : state_changes) {
std::unique_ptr<base::DictionaryValue> patch{new base::DictionaryValue};
patch->SetString("timeMs",
std::to_string(state_change.timestamp.ToJavaTime()));
-
- std::unique_ptr<base::DictionaryValue> changes{new base::DictionaryValue};
- for (const auto& pair : state_change.changed_properties) {
- auto value = pair.second->ToJson();
- CHECK(value);
- // The key in |pair.first| is the full property name in format
- // "package.property_name", so must use DictionaryValue::Set() instead of
- // DictionaryValue::SetWithoutPathExpansion to recreate the JSON
- // property tree properly.
- changes->Set(pair.first, value.release());
- }
- patch->Set("patch", changes.release());
-
+ patch->Set("patch", state_change.changed_properties.release());
patches->Append(patch.release());
}