DevOp.Toon.Core is the contracts layer of the TOON .NET package stack. It provides the shared types that sit at the bottom of the dependency chain — used by shared model libraries, application services, and the higher-level TOON packages alike.
It is intentionally small and stable. Adding it to a project introduces no serialization logic, no DI registration, and no framework dependencies beyond netstandard2.0.
ToonPropertyNameAttribute — annotate DTO members with their TOON wire namesToonDelimiter — controls the delimiter used in tabular rows and inline arraysToonKeyFolding — controls key folding behavior during encodeToonPathExpansion — controls dotted-key expansion during decodeToonObjectArrayLayout — controls how arrays of objects are encodedToonProtocolVersion — selects official or custom protocol versionsToonProtocolVersions — formats and parses concrete HTTP transport version namesToonProtocolVersion includes Auto, V3_0, V4_0 through V4_4, CustomLegacy, and CustomV4_4. Auto is a decode policy only. ToonProtocolVersions.Format formats concrete versions; TryParse accepts transport names or concrete enum names and rejects Auto and unsupported versions.
string name = ToonProtocolVersions.Format(ToonProtocolVersion.CustomV4_4); // custom-4.4
bool supported = ToonProtocolVersions.TryParse("4.4", out var version);
Version scope: Core 0.2.0, runtime 0.3.0, API 0.2.0, and Client 0.2.0.
Encoding defaults to official 4.4. Supply ToonEncodeOptions.ProtocolVersion with a concrete ToonProtocolVersion: V3_0, V4_0 through V4_4, CustomLegacy, or CustomV4_4. Decoding defaults to Auto; ambiguous version-dependent input needs an explicit ToonDecodeOptions.ProtocolVersion. Auto cannot be used for encoding or as a transport version.
Select CustomLegacy to retain the earlier custom wire profile. CustomV4_4 combines nested header groups with row/keyed spills. Custom profiles require compatible readers at both ends and default IgnoreNullOrEmpty and ExcludeEmptyArrays to true. Official profiles default both to false. Set both explicitly false when preserving null, empty-string, and empty-array distinctions matters. Explicit option overrides remain effective when changing versions. Columnar requires a custom protocol selection.
Encoder options and runtime DI encoding default to one-space indentation; decoder options default to two spaces. With explicit decode options, match the producer’s indentation or detect options using the supplied version hint. API registration aligns both widths at two spaces. Byte sequences default to Base64 strings; numeric-array output is an explicit policy choice.
Use DevOp.Toon.Core when a project needs TOON-aware metadata or configuration types but should not take a dependency on the serialization runtime.
Typical cases:
DevOp.Toon runtime would be too heavyFor engineering readers: architecture notes, public surface guidance, and build configuration are in the development section.
https://www.nuget.org/packages/DevOp.Toon.Core
Source usage reference: DevOp.Toon.Core README.