Skip to main content

Module schema

Module schema 

Source
Expand description

Layer: Config support (JSON Schema generation, v0.7.3 P0.1/P0.2)

Single source of truth for the JSON Schema that describes rivet.yaml. Used by:

  • rivet schema config — prints the schema to stdout so operators can drop it into their repo or pipe it to a file.
  • tests/schema_drift.rs — pins the in-tree schemas/rivet.schema.json artifact to the value derived from the current binary’s types, so a config field added without a schema refresh fails CI.

The schema title carries the running binary’s version so editor tooling can show “Rivet 0.7.3 config” rather than a versionless generic name.

Functions§

generate_config_schema
Generate the JSON Schema for the top-level Config struct.
generate_config_schema_pretty
Render the schema as a pretty-printed JSON string, terminated by a trailing newline (POSIX text-file convention; matches what serde_json::to_writer_pretty + writeln! produces and what the schema-drift test expects in the checked-in artifact).