#[non_exhaustive]pub enum JsonMode {
Artifact,
Supported,
}Expand description
How a subcommand interacts with --mode json.
Wire shape: every variant serialises to an object with a status
discriminant, so a consumer sees uniform {"status":"…", …}
records (#[serde(tag = "status")]). Before #215 the previous
mixed string/object representation forced consumers to handle two
JSON shapes for sibling variants.
Tuple variants not permitted. #[serde(tag = "status")]
requires the tag to live in the same flat object as variant
fields; tuple variants are incompatible with internally-tagged
representation. Future variants MUST use named fields.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Artifact
The command’s primary output IS the requested artifact, not
informational chatter. --mode is informational here; the
exact stdout shape (e.g. JSON for csl / graph /
capabilities and the JSON-RPC stream from serve; BibTeX
for bib; PDF-on-disk + stderr summary for fetch; a
--dry-run JSON plan in the dry-run variants) is fixed by
the subcommand and may vary across flags. Consult
examples for the per-flag stdout form rather than
assuming JSON.
Supported
Under --mode json the command emits a structured JSON body
on stdout; otherwise the human form (e.g. info,
list-recent, audit-log, provenance migrate, batch).