What is a JSONata playground?
A JSONata playground is a web application for evaluating JSONata expressions against a JSON structure. It has a user interface with an input area for entering the JSON source, another input area for writing JSONata expressions, and an output area for displaying the result. It is a convenient tool for building and debugging JSONata expressions efficiently. Without it, developers need to write a script and run it each time one of the inputs changes to see the evaluated result.
Which JSONata playground is best?
Currently, there are only two JSONata playgrounds available on the internet which differ in key ways.
1. JSONata Exerciser - The Official JSONata Playground
Developed by the creators of the JSONata query and transformation language, JSONata Exerciser is the original and official playground for transforming JSON with JSONata. In addition to trying out expressions, it is open-sourced and allows the option to attach bindings to your expressions, select a previous version of jsonata, and share a link to the playground along with your inputs pre-filled. Unfortunately, JSONata Exerciser does not provide any IntelliSense when using the JSONata code editor, does not have a dark mode and its user interface looks outdated from a designer's point of view.
2. Stedi JSONata Playground - A Prettier Alternative to JSONata Exerciser
The team behind Stedi, an API-first clearinghouse, has developed its own JSONata Playground which is sleek and offers the same functionality as the original JSONata Exerciser. Stedi's version does provide rich IntelliSense when typing expressions and accessing the properties of the JSON source. Documentation with examples from the official JSONata docs shows up when hovering over built-in functions in the JSONata editor. The state of the playground can be shared and embedded. The user interface supports dark mode but only if you've set it as your preferred mode via the operating system; there is no toggle to enable or disable it during the day if needed. Unlike JSONata Exercise, the Stedi playground does not throw an error when there is a duplicate key in the JSON source.
How do the playgrounds compare?
Below is a table with the key features of each playground indicating how the playgrounds compare to each other and the JSONata Studio Playground.
JSONata Exerciser | Stedi JSONata Playground | JSONata Studio | |
---|---|---|---|
Free | ✅ | ✅ | ✅ |
Bindings | ✅ | ❌ | ❌ |
Custom Functions | ✅ | ❌ | ✅ |
Link Share | ✅ | ✅ | ✅ |
Version Downgrade | ✅ | ❌ | ❌ |
Dark Mode | ❌ | ✅ | ✅ |
IntelliSense | ❌ | ✅ | ✅ |
Modern UI | ❌ | ✅ | ✅ |
Vertical Layout | ❌ | ✅ | ✅ |