Skip to content
Riot Docs

Search is only available in production builds. Try building and previewing the site to test it out locally.

Install Riot GitHub

JSON

JSON support matters because almost every nontrivial toolchain eventually has to speak to something outside itself.

In Riot, JSON is useful for:

  • machine-readable input and output
  • protocol payloads
  • structured data interchange
  • tests and snapshots

When a toolchain has a standard JSON story, several things get easier:

  • examples become consistent
  • CLI JSON output can use the same conventions as libraries
  • test snapshots stay reviewable
  • packages do not have to reinvent the same parsing/rendering choices

That is why JSON belongs in the docs at the product level, not just buried in generated API docs.

JSON appears in a few especially important places:

  • machine-readable CLI output
  • snapshot assertions for tests
  • package-level protocol and encoding code

That makes it one of the more practical standard-library surfaces to learn early.

Use JSON when:

  • the consumer is another program
  • the data is a protocol payload
  • the output should be machine-first

Use TOML when the document is more configuration-shaped and intended for humans to edit comfortably.