Modify wrong requiredPrivileges key style
authorChanggyu Choi <changyu.choi@samsung.com>
Mon, 28 Apr 2025 07:31:32 +0000 (16:31 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Mon, 28 Apr 2025 07:31:32 +0000 (16:31 +0900)
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
src/common/action_schema.cc
src/pkgmgr_plugin_parser/json_action_schema_parser.cc
test/unit_tests/action_schema_test.cc

index cfab45082e775e6930543c5d79c1757a4fa12da4..565642e60cfcc7477e1eb3b4ef33789e6f3e233b 100644 (file)
@@ -90,7 +90,7 @@ ActionSchema::ActionSchema(const std::string& json_str) {
       returns_.emplace_back(name, type, "", description, false);
     }
 
-    for (auto const& it : root.array("requiredprivileges"))
+    for (auto const& it : root.array("requiredPrivileges"))
       privileges_.push_back(it->GetString());
 
     // details
index 34464c0233a7095d9d5bb534f42894bfccdb5cb5..bce1099925fadab15361115fa329462180af467d 100644 (file)
@@ -36,7 +36,7 @@ ActionSchema JsonActionSchemaParser::Parse(const std::string& pkgid,
   common::SafeJson root(json);
   std::string name = root.get<std::string>("name");
   std::string category = root.get<std::string>("category");
-  const auto priv_array = root.array("requiredprivileges");
+  const auto priv_array = root.array("requiredPrivileges");
   std::vector<std::string> privs;
   privs.reserve(priv_array.size());
   std::transform(priv_array.begin(), priv_array.end(),
index f9349d281039a7b3784d25b4beecc0e524da7c6c..29e14e6d8cedee9e720ec106ac58e4233c68a5ce 100644 (file)
@@ -29,7 +29,7 @@ class ActionSchemaTest : public ::testing::Test {
               "desc": "Return 1"
             }
           },
-          "requiredprivileges": ["priv1", "priv2"],
+          "requiredPrivileges": ["priv1", "priv2"],
           "details": {
             "appid": "com.example.app"
           }
@@ -56,7 +56,7 @@ class ActionSchemaTest : public ::testing::Test {
                 "desc": "Return 1"
               }
             },
-            "requiredprivileges": ["priv1", "priv2"],
+            "requiredPrivileges": ["priv1", "priv2"],
             "details": {
               "pluginPath": "/path/to/plugin"
             }