Mock Turtle: Dynamic JSON Generator

John Grisham
4 min readOct 19, 2022
Photo by Tatyana Dobreva on Unsplash

JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is also easy for machines to parse and generate. For these reasons, JSON has become the de facto standard for data interchange on the web. But unfortunately, it can also be rather dull to work with. This blog post will show you how to use Mock Turtle to generate dynamic trees and make JSON fun again!

Why Mock Turtle?

If you’ve ever used a text editor to work any data serialization language such as JSON or YAML you’ll know some of the headaches already. Like other programming languages, the syntax is crucial but even more so for data serialization. Having the wrong value or nesting an object in the wrong place can be disastrous, that’s where Mock Turtle can help. With this free online tool, you can modify JSON tree structures easily with a graphical user interface.

When you first navigate to the Mock Turtle home page you’ll see a sample JSON tree like this. You’ll get some neat UI that serializes into a real JSON output such as this:

[
{
"full name": "Shannon Kerluke",
"address": {
"street": "790 Ward Green",
"city": "Lynbrook"
}
},
{
"full name": "Peggy Kautzer",
"address": {
"street": "647 D'Amore Canyon",
"city": "Smala"
}
},
{
"full name": "Joanne Blanda",
"address": {
"street": "60148 Florian Springs",
"city": "Singapore"
}
},
{
"full name": "Stacy Tromp",
"address": {
"street": "881 Paucek Station",
"city": "Jendouba"
}
},
{
"full name": "Albert Krajcik",
"address": {
"street": "71891 Rogelio Hills",
"city": "Alofi"
}
}
]

And what’s better is that you don’t have to come up with dummy data to test your tree since Mock Turtle does this for you in the live preview.

Working with Nodes

Adding, modifying, and deleting nodes within your tree is easy. You can quickly add a new node by clicking the plus icon wherever you’d like to insert a node:

Let’s add a new node under the city and call it ZIP. Clicking the type rectangle will give us a model where we can select postal code as the data type:

You’ll notice that you can select a country for your postal code so go ahead and select “United States of America”. From the live preview, you can see that Mock Turtle instantly changes the mockup data to match whatever country you selected!

You can also edit any of the current nodes by changing the data type, name, or percentage of null values if you want to make your data seem more volatile for realism. And once you’re done with a particular node clicking the trash can icon will delete it.

Once you’re satisfied with the state of your tree you can easily save it to continue editing later at your leisure. Then you can reimport it to override your current tree or combine trees for limitless possibilities!

Conclusion

In this post, we learned about the power of Mock Turtle a GUI-based random nested JSON generator. We learned a little about the interface and how to work with nodes. With Mock Turtle, it’s never been easier to work with JSON whether it’s for test data or validating your next JSON schema. Give it a try and see what you think!

--

--