Skip to content

RDKEMW-20911 : Fix intent type as object and not string#92

Open
swethasukumarr wants to merge 1 commit into
developfrom
feature/20911n
Open

RDKEMW-20911 : Fix intent type as object and not string#92
swethasukumarr wants to merge 1 commit into
developfrom
feature/20911n

Conversation

@swethasukumarr

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings July 15, 2026 16:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Actions “intent” payload contract to treat the intent field as a JSON object (rather than a string), aligning tests and the OpenRPC spec with the updated wire format.

Changes:

  • Updated unit/component tests to validate intent as an object with nested fields (action, context.source).
  • Updated OpenRPC schema for Actions.intent and Actions.onIntent so intent is typed as an object (and constrained intentId to be non-negative).
  • Refreshed generated JSON type documentation comments to reflect the new payload shape.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
test/unit/actionsTest.cpp Adjusts unit test expectations to parse intent as an object and verify nested fields.
test/component/actionsGeneratedTest.cpp Updates component tests + event trigger payload to match the new intent object shape.
src/json_types/actions.h Updates the documentation comment describing the Actions intent wire format.
docs/openrpc/the-spec/firebolt-open-rpc.json Changes the OpenRPC schema/examples to declare intent as an object and enforce intentId >= 0.

Comment thread test/unit/actionsTest.cpp
EXPECT_TRUE(parsed.at("intent").is_object());
EXPECT_EQ(parsed.at("intent").at("action").get<std::string>(), "pre-load");
EXPECT_EQ(parsed.at("intent").at("context").at("source").get<std::string>(), "system");
EXPECT_EQ(parsed.at("intentId").get<unsigned>(), 0u);
EXPECT_TRUE(parsed.at("intent").is_object());
EXPECT_EQ(parsed.at("intent").at("action").get<std::string>(), "pre-load");
EXPECT_EQ(parsed.at("intent").at("context").at("source").get<std::string>(), "system");
EXPECT_EQ(parsed.at("intentId").get<unsigned>(), 0u);
EXPECT_TRUE(parsed.at("intent").is_object());
EXPECT_EQ(parsed.at("intent").at("action").get<std::string>(), "pre-load");
EXPECT_EQ(parsed.at("intent").at("context").at("source").get<std::string>(), "system");
EXPECT_EQ(parsed.at("intentId").get<unsigned>(), 0u);
Comment on lines 73 to 76
"properties": {
"intent": { "type": "string" },
"intentId": { "type": "integer" }
"intent": { "type": "object" },
"intentId": { "type": "integer", "minimum": 0 }
}
Comment on lines 119 to 122
"properties": {
"intent": { "type": "string" },
"intentId": { "type": "integer" }
"intent": { "type": "object" },
"intentId": { "type": "integer", "minimum": 0 }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants