Skip to main content

SCHEMA_VERSION

Constant SCHEMA_VERSION 

Source
pub const SCHEMA_VERSION: u32 = 1;
Expand description

Wire-format version written by this build of dev-report.

Every Report and MultiReport carries it in schema_version. It stays at 1 for the whole 0.x line. Deserializing a document whose schema_version is 0 or newer than this constant fails with a descriptive error, so a consumer never silently misreads a format it does not understand.

ยงExample

use dev_report::{Report, SCHEMA_VERSION};

let r = Report::new("crate", "0.1.0");
assert_eq!(r.schema_version, SCHEMA_VERSION);

let future = r#"{"schema_version": 99, "subject": "c", "subject_version": "0.1.0",
    "producer": null, "started_at": "2026-01-01T00:00:00Z",
    "finished_at": null, "checks": []}"#;
assert!(Report::from_json(future).is_err());