Skip to content

Commit d1be707

Browse files
Delia 67918 main (rdkcentral#6279)
* DELIA-67918 : parse parameter as strgified json (rdkcentral#6221) Reason for change: users of api want to send stringified json Test Procedure: None Risks: None Signed-off-by: Nikita Poltorapavlo <[email protected]> Co-authored-by: Anand Kandasamy <[email protected]> * update changelog and api version --------- Signed-off-by: Nikita Poltorapavlo <[email protected]> Co-authored-by: Anand Kandasamy <[email protected]>
1 parent ee8204f commit d1be707

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

ContentProtection/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ All notable changes to this RDK Service will be documented in this file.
1616

1717
* For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README.
1818

19+
## [2.0.0] - 2025-06-12
20+
### Changed
21+
- Parameters initData, openSessionResponse, updateSessionResponse to be stringified json instead of json
22+
1923
## [1.1.1] - 2025-05-26
2024
### Fixed
2125
- Increase secmanager timeout

ContentProtection/ContentProtection.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919

2020
#include "ContentProtection.h"
2121

22-
#define API_VERSION_NUMBER_MAJOR 1
23-
#define API_VERSION_NUMBER_MINOR 1
24-
#define API_VERSION_NUMBER_PATCH 1
22+
#define API_VERSION_NUMBER_MAJOR 2
23+
#define API_VERSION_NUMBER_MINOR 0
24+
#define API_VERSION_NUMBER_PATCH 0
2525

2626
namespace WPEFramework {
2727
namespace Plugin {

ContentProtection/ContentProtection.h

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,10 @@ namespace Plugin {
348348
override
349349
{
350350
uint32_t result;
351+
Core::JSON::String jsonString;
352+
jsonString.FromString(initData);
351353
JsonObject out;
352-
out.FromString(initData);
354+
out.FromString(jsonString);
353355
out["clientId"] = clientId;
354356
out["keySystem"] = Core::JSON::EnumType<KeySystem>(keySystem)
355357
.Data();
@@ -362,7 +364,9 @@ namespace Plugin {
362364
result = Core::ERROR_GENERAL;
363365
} else {
364366
sessionId = in["sessionId"].Number();
365-
in.ToString(response);
367+
string inStr;
368+
in.ToString(inStr);
369+
response = Core::ToQuotedString('\"', inStr);
366370

367371
_parent._sessionStorage.Set(sessionId,
368372
{ clientId, appId, keySystem });
@@ -406,8 +410,10 @@ namespace Plugin {
406410
}
407411

408412
uint32_t result;
413+
Core::JSON::String jsonString;
414+
jsonString.FromString(initData);
409415
JsonObject out;
410-
out.FromString(initData);
416+
out.FromString(jsonString);
411417
out["clientId"] = session.Value().ClientId;
412418
out["sessionId"] = sessionId;
413419
out["keySystem"] = Core::JSON::EnumType<KeySystem>(
@@ -422,7 +428,9 @@ namespace Plugin {
422428
if (!in["success"].Boolean()) {
423429
result = Core::ERROR_GENERAL;
424430
} else {
425-
in.ToString(response);
431+
string inStr;
432+
in.ToString(inStr);
433+
response = Core::ToQuotedString('\"', inStr);
426434
}
427435
}
428436
return result;

0 commit comments

Comments
 (0)