New JSON Tutorial in the docs

In addition to explaining JSON, it also has a built-in JSON linter so you can enter JSON have have it validated, stringified, and Unicode encoded, right from the docs page.

https://docs.particle.io/tutorials/device-os/json/

One pain point if you’re generating JSON by hand on a device and publishing it is making minor JSON syntax error in your code. The JSON event decoder monitors published events and decodes and validates the JSON. If there’s a syntax error in your event, you can mouseover to get the error.

There’s also a huge section on using mustache templates, and an interactive mustache template tester.

5 Likes

@rickkas7 , Thank you for this great new resource. The mysteries of JSON and Mustache are much easier to fathom when you can use interactive tools to test your assumptions.

Chip

1 Like

This is great. I’ve always been a fan of your tool for creating webhook templates.
https://rickkas7.github.io/mustache/

Thanks! The Particle mustache tester is better because there’s built-in JSON linting and syntax error highlighting on both the input and output JSON. And it uses the same mustache templating engine and version that the Particle cloud uses, so it should be closer to the same result now.

1 Like

this is amazing. I like a lot the Generate using sprintf section. Thanks!

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.