Skip to content

ToJson

Name Mandatory Description Default Type
⬅️ Input If Pure is set to false, this shard accepts an input of any type. If Pure is set to true, this shard only accepts standard JSON types (tables, sequences, strings, numbers, booleans and none). Any
Output ➡️ Outputs the input converted to a JSON string. String
Pure No If the input string is generic pure json rather then shards flavored json. true Bool
Indent No How many spaces to use as json prettify indent. 0 Int

This shard takes its input and converts it into a JSON string.

Details

If the Pure parameter is set to false, the shard will accept an input of any type, but the output JSON will not be a standard JSON, but a Shards-specific JSON format that retains Shards type information.

If Pure is set to true, the shard will only accept basic JSON-compatible types: tables, sequences, strings, integers. floats, booleans, and null, but will return a standard JSON string.