Jump to content

Print json string in readable format 1.0.0

   (0 reviews)

About This File

This function can come in handy if you want to print a json structure in readable form for debugging or inspection.

 

It takes a json string as input and returns a HTML formatted string which can be printed in the debug window using fibaro:debug();

 

Example

Input:

"{\"api_data\":{\"status\":\"online\",\"timestamp\":\"2019-01-18-18:01:32\",\"sensor_1\":[\"value_1\":125,\"value_2\":35],\"sensor_2\":[\"value_a\":34.5,\"value_b\":45]}}"

Output:

{
  "api_data" : {
    "status" : "online",
    "timestamp" : "2019-01-18-18:01:32",
    "sensor_1" : [
      "value_1" : 125,
      "value_2" : 35
    ],
    "sensor_2" : [
      "value_a" : 34.5,
      "value_b" : 45
    ]
  }
}

 


User Feedback

You may only provide a review once you have downloaded the file.

There are no reviews to display.

×
×
  • Create New...