TeaLeaf.Annotations 2.0.0-beta.14

This is a prerelease version of TeaLeaf.Annotations.
dotnet add package TeaLeaf.Annotations --version 2.0.0-beta.14
                    
NuGet\Install-Package TeaLeaf.Annotations -Version 2.0.0-beta.14
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TeaLeaf.Annotations" Version="2.0.0-beta.14" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TeaLeaf.Annotations" Version="2.0.0-beta.14" />
                    
Directory.Packages.props
<PackageReference Include="TeaLeaf.Annotations" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TeaLeaf.Annotations --version 2.0.0-beta.14
                    
#r "nuget: TeaLeaf.Annotations, 2.0.0-beta.14"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TeaLeaf.Annotations@2.0.0-beta.14
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TeaLeaf.Annotations&version=2.0.0-beta.14&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=TeaLeaf.Annotations&version=2.0.0-beta.14&prerelease
                    
Install as a Cake Tool

TeaLeaf.Annotations

Attribute definitions for the TeaLeaf serialization framework. Use these attributes to annotate your C# classes and records for TeaLeaf format conversion.

Installation

dotnet add package TeaLeaf.Annotations

Note: This package is automatically included as a dependency of the main TeaLeaf package. Install it directly only if you need the attributes without the runtime library.

Attributes

Attribute Target Description
[TeaLeaf] Class/Record Marks a type for TeaLeaf serialization
[TeaLeaf(Generate = true)] Class/Record Enables compile-time source generation (requires partial)
[TLKey("name")] Class/Record Sets the top-level document key
[TLRename("name")] Property Overrides the field name in output
[TLType("float64")] Property Overrides the TeaLeaf type in schema
[TLOptional] Property Marks field as nullable in schema
[TLSkip] Property Excludes property from serialization

Usage

Reflection-based serialization

using TeaLeaf.Annotations;

[TeaLeaf]
[TLKey("employee")]
public class Employee
{
    public string Name { get; set; } = "";
    public int Age { get; set; }

    [TLRename("dept")]
    public string Department { get; set; } = "";

    [TLOptional]
    public string? Email { get; set; }

    [TLSkip]
    public string InternalId { get; set; } = "";
}

Source generator (compile-time)

Add Generate = true and the partial keyword:

using TeaLeaf.Annotations;

[TeaLeaf(Generate = true)]
[TLKey("employee")]
public partial class Employee
{
    public string Name { get; set; } = "";
    public int Age { get; set; }

    [TLRename("dept")]
    public string Department { get; set; } = "";

    [TLOptional]
    public string? Email { get; set; }

    [TLSkip]
    public string InternalId { get; set; } = "";
}

These attributes are consumed by:

  • TeaLeaf runtime library (reflection-based serialization via TeaLeafSerializer)
  • TeaLeaf.Generators source generator (compile-time code generation, requires Generate = true)

License

MIT

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on TeaLeaf.Annotations:

Package Downloads
TeaLeaf

Schema-aware data format with human-readable text and compact binary representation. Includes native libraries for high-performance parsing and serialization.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0-beta.14 54 2/17/2026
2.0.0-beta.13 49 2/13/2026
2.0.0-beta.12 53 2/13/2026
2.0.0-beta.11 55 2/12/2026
2.0.0-beta.10 49 2/12/2026
2.0.0-beta.9 48 2/12/2026
2.0.0-beta.8 52 2/10/2026
2.0.0-beta.7 49 2/10/2026
2.0.0-beta.6 51 2/10/2026
2.0.0-beta.5 47 2/10/2026
2.0.0-beta.4 54 2/9/2026
2.0.0-beta.3 49 2/9/2026
2.0.0-beta.2 54 2/4/2026