Remove object schema parsing in CommandDefinition
The only thing we now care about in CommandDefinition is the
"minimalRole" field. Everything else is a black-box which we just
forward to the server without any semantic parsing.
Also completely removed command visibility support since it no
longer applies to trait/component model.
BUG: 25841230
Change-Id: Ie8fff57ffada289caa7876c2a53150bb116fd65b
Reviewed-on: https://weave-review.googlesource.com/1617
Reviewed-by: Vitaly Buka <vitalybuka@google.com>
diff --git a/src/base_api_handler_unittest.cc b/src/base_api_handler_unittest.cc
index a025e44..2975bdd 100644
--- a/src/base_api_handler_unittest.cc
+++ b/src/base_api_handler_unittest.cc
@@ -107,39 +107,38 @@
TEST_F(BaseApiHandlerTest, Initialization) {
auto command_defs =
- command_manager_->GetCommandDictionary().GetCommandsAsJson(
- [](const CommandDefinition* def) { return true; }, true, nullptr);
+ command_manager_->GetCommandDictionary().GetCommandsAsJson(nullptr);
auto expected = R"({
"base": {
"updateBaseConfiguration": {
- "minimalRole": "manager",
- "parameters": {
- "localAnonymousAccessMaxRole": {
- "enum": [ "none", "viewer", "user" ],
- "type": "string"
- },
- "localDiscoveryEnabled": {
- "type": "boolean"
- },
- "localPairingEnabled": {
- "type": "boolean"
- }
- }
+ "minimalRole": "manager",
+ "parameters": {
+ "localAnonymousAccessMaxRole": {
+ "enum": [ "none", "viewer", "user" ],
+ "type": "string"
+ },
+ "localDiscoveryEnabled": {
+ "type": "boolean"
+ },
+ "localPairingEnabled": {
+ "type": "boolean"
+ }
+ }
},
"updateDeviceInfo": {
- "minimalRole": "manager",
- "parameters": {
- "description": {
- "type": "string"
- },
- "location": {
- "type": "string"
- },
- "name": {
- "type": "string"
- }
- }
+ "minimalRole": "manager",
+ "parameters": {
+ "description": {
+ "type": "string"
+ },
+ "location": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
}
}
})";