1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! Shared knowledge of the `FormatMetadata` enum shape, needed by every backend that
//! navigates the crate's serialized JSON directly instead of through a typed accessor.
//!
//! `FormatMetadata` is internally tagged (`#[serde(tag = "format_type", rename_all =
//! "snake_case")]`), so its wire form is FLAT: the variant's own fields sit as siblings of the
//! `format_type` discriminator, with no JSON key for the variant name itself
//! (`{"format_type":"excel","sheet_count":2,...}`). Typed-language e2e backends (python, rust,
//! elixir, ruby) map a fixture path's `.excel` segment to a real variant accessor and need no
//! help here. A backend that instead walks the parsed JSON tree by key — Zig's
//! `std.json.Value` lookup chain, Swift's `JSONSerialization` navigation of a swift-bridge
//! JSON-bridged leaf — must skip that segment entirely, or it looks up a `"excel"` key that
//! does not exist and the assertion silently reads `null`.
/// Variant names of `FormatMetadata` (snake_case, from `#[serde(rename_all = "snake_case")]`).
///
/// These appear as typed accessors in fixture paths (e.g. `format.excel.sheet_count`) but are
/// NOT JSON keys. Kept as a single hand-maintained list, shared by every JSON-navigating
/// backend, rather than duplicated per backend where the copies could drift.
pub const FORMAT_METADATA_VARIANTS: & = &;
/// Whether `segment` is a `FormatMetadata` variant-name accessor immediately following a
/// `format` field in a fixture path — the shape a JSON-navigating backend must skip rather
/// than look up as a key. `prev_segment` is the bare (bracket-stripped) name of the segment
/// immediately before `segment` in the same path.
pub