fledge-iot / fledge

An open source platform for the Industrial Internet of Things, it acts as an edge gateway between sensor devices and cloud storage systems.

Home Page:https://www.lfedge.org/projects/fledge/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Control pipelines: string parameters contains extra quote

FlorentP42 opened this issue · comments

Describe the bug
When exiting a control pipeline, if the reading contained some string json values, when they are converted into operation parameters by Fledge, they will contain extra quote (") character around the value.

To Reproduce
Steps to reproduce the behavior:

  1. Create a north service that can call an operation "TestOP" containing two parameters: "type" which is a string and "value" which is an integer.
  2. Create a south service that can receive the same operation and print its parameters.
  3. Create a control pipeline between those services.
  4. Add a filter to this pipeline that just forwards the reading and logs its json content.
  5. Restart Fledge so that the pipeline becomes active.
  6. Call the operation from the north plugin: operation TestOP with 2 parameters: [{"name": "type", "value": "test"}, {"name": "power", "value": "42"}] .
  7. In the log from the filter, notice that the content of the json reading generated is correct, "type" remains a sting in json format, and "power" became a number: {"asset_code":"TestOP","user_ts":"2023-12-08 15:29:40.782635+00:00","ts":"2023-12-08 15:29:40.782635+00:00","reading":{"type":"test","power":42}}
  8. In the log from the south plugin, notice that the operation received contains an extra quote for the value of "type": operation TestOP with 2 parameters: [{"name": "type", "value": ""test""}, {"name": "power", "value": "42"}]

Expected behavior
String parameters are properly converted back into operations, without extra quotes around them.

Additional context
N/A