Json Tools

logo

firefox_WfkNVi5fj3

About

Collection of blocks that perform typical JSON functions. Helpful with MQTT or HTTP interaction. Under Library Json Tools

All of my (Kyle Mason) (mediatech15) blocks are free to copy modify and edit how you see fit. You may re-post the variants freely (an inspired by is nice)

Note the Documentation blocks are from my other library posted on the marketplace.

Blocks

Stringify

firefox_8BgmKTYyz5

Takes a complex object and converts it to a JSON string with proper escaping.
Returns: String

Usage

firefox_bi5TnJErre

Parse

firefox_s7SsQ9VKrO

Takes a proper JSON string and converts to a complex object.
Returns: List|Dictionary

Usage

firefox_GgbuEXJygQ

Validate String

firefox_ylbWFjy5BU

Validates a JSON string or string against the JSON parser to determine if valid.
Returns: true|false

Usage

firefox_qQba9vOR6b

Changelog

Version 1.0

  • initial release

Resources

latest

Gitlab Snippet (RAW)

v1.0

Gitlab Snippet

3 Likes

Thanks for the contribution of the JSON tools. I am sure a number of people will use it.

Even though yours goes much further it should be noted that there is some support for JSON also in the core blocks.

Even though I know where the name “stringify” comes from (javascript) I feel it is not very intuitive for most blockly users (we put a lot of thoughts into the naming of the core blocks). I would recommend to use a clearer expression for that.

I checked the library quickly and did not find the “Document” block there. It seems it is not part of that library here, so I recommend to take it out of the documentation or explain where it comes from.

As stated in the other thread I can update the docs. The core features being half baked in complete support drives us to created these libs. To have to piece meal around the core libs/blocks that sorta support some things is problematic. Also JSON path transform is not the same as proper conversion to and from string/object.

I didn’t say that the core block JSON path transform I mentioned is the same. I just mentioned it here, so people can refer to it - I see no duplication necessarily here.