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
Why built-in JSON matters
Section titled “Why built-in JSON matters”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.
Where you will see it in Riot
Section titled “Where you will see it in Riot”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.
When to use JSON versus TOML
Section titled “When to use JSON versus TOML”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.