Skip to content

UnsupportedSchemaVersionException

Namespace Nfty.Core.Formats in assembly Nfty.Core.

public class UnsupportedSchemaVersionException : NotSupportedException

A manifest declares a schema this build cannot read. Raised instead of letting an unknown format deserialize into whatever happens to fit. (Not an InvalidDataException only because that type is sealed — the archive is well-formed, just too new to support.)

Constructors

UnsupportedSchemaVersionException(int, int, string)

public UnsupportedSchemaVersionException(int found, int supported, string message);

Creates the exception.

Parameters

  • found (int) - The version the manifest declared.
  • supported (int) - The newest version this build reads.
  • message (string) - The message shown to the user verbatim.

Properties

Found

public int Found { get; }

The schema version the manifest declared.

Supported

public int Supported { get; }

The newest version this build can read.

Methods

Require<T>(T)

public static void Require<T>(T manifest);

Accepts any schema this build understands — Schema.Oldest through Schema.Current — and rejects anything outside that range, older or newer alike. This used to demand EXACT equality with Schema.Current, which made the format unevolvable: bumping Current by one would have made every .cbk, .rcp and .igt already written unreadable, including the tests/fixtures archives that exist to catch precisely that. A version gate whose only safe value is the one it already has is not a gate. Reading an older-but-still-supported version is sound because of a contract this project keeps deliberately: **every field added after the floor schema is optional and carries a default that means "absent"**. A floor-schema archive is therefore a valid vN archive with those fields unset. A change that cannot honour that — a renamed field, a changed meaning, a new REQUIRED field — is a breaking change, and needs a real migration here rather than a bump. Newer is still refused outright: a future field this build does not know about could change what the archive means, and silently ignoring it would produce confidently wrong output. Rise, 2026-09-25: Schema.Oldest moved from 1 to 2 — v1 is dropped by the author's decision, no archives kept (see CLAUDE.md) — so a schemaVersion below the floor is now refused too, by the same exception type and the same "name it, don't misparse it" reason as a too-new one, distinguished from a version below 1 (which was never a schema at all).

Parameters

Type parameters

  • T - The manifest type; its name (minus "Manifest") appears in the message.

Exceptions