Skip to content

Schema

Namespace Nfty.Core.Model in assembly Nfty.Ticket.

public static class Schema

The manifest schema range this build can read and write.

Fields

Current

public const int Current = 2;

The schema version this build WRITES. It reads this and every earlier one — see Schema.IsSupported().

Oldest

public const int Oldest = 2;

The oldest schema this build can read. Rise, 2026-09-25: v1 dropped by the author's decision — no v1 archives kept, and every fixture under tests/fixtures/ was regenerated at v2 (see tests/fixtures/README.md and CLAUDE.md). A schemaVersion below 2 is therefore refused exactly like one above Schema.Current: named by name, not silently misparsed (see Nfty.Core's UnsupportedSchemaVersionException — this project stays dependency-free, so it cannot cref that type). Nothing predates 1, so a version below 1 stays a malformed manifest rather than an old one.

Methods

IsSupported(int, int)

public static bool IsSupported(int version, int current);

Whether version is readable by a build whose newest schema is current. current is a parameter rather than being read from Schema.Current so the RANGE itself is testable. With Current == 1 the range 1..Current contains exactly one value, which makes "accepts older versions" indistinguishable from "demands exact equality" — a test written against the constant passes either way and proves nothing. Passing a hypothetical current lets the rule be pinned now, before there is a version 2 to try it on.

Parameters

  • version (int) - The schema version a manifest declares.
  • current (int) - The newest schema the reading build understands.

Returns. True when version lies between Schema.Oldest and current.