Sashiko.Registries 0.1.1

dotnet add package Sashiko.Registries --version 0.1.1
                    
NuGet\Install-Package Sashiko.Registries -Version 0.1.1
                    
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="Sashiko.Registries" Version="0.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sashiko.Registries" Version="0.1.1" />
                    
Directory.Packages.props
<PackageReference Include="Sashiko.Registries" />
                    
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 Sashiko.Registries --version 0.1.1
                    
#r "nuget: Sashiko.Registries, 0.1.1"
                    
#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 Sashiko.Registries@0.1.1
                    
#: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=Sashiko.Registries&version=0.1.1
                    
Install as a Cake Addin
#tool nuget:?package=Sashiko.Registries&version=0.1.1
                    
Install as a Cake Tool

🌸 Sashiko.Registries

Sashiko.Registries provides lightweight helpers for loading structured registry data from JSON.

It is designed for packages and applications that rely on declarative data: languages, names, biomes, items, rules, or any domain where structured data defines behavior.


✨ Features

  • JSON object registry loader
  • JSON list registry loader
  • Separate loading behavior for trusted embedded data and untrusted external data
  • Schema validation integration through ISchemaValidator
  • Option-aware JSON parsing with System.Text.Json
  • Predictable RegistryLoadException wrapping for external input failures
  • Clear source/type diagnostics for easier debugging

πŸ“¦ Installation

dotnet add package Sashiko.Registries

πŸš€ Usage

Create a registry loader

using System.Text.Json;
using Sashiko.Registries.Json;
using Sashiko.Validation.Validators.Json;

var loader = new JsonRegistryObjectLoader<MyRegistryEntry>(
    schemaValidator: new JsonSchemaValidator(),
    embeddedOptions: new JsonSerializerOptions
    {
        PropertyNameCaseInsensitive = false
    },
    externalOptions: new JsonSerializerOptions
    {
        PropertyNameCaseInsensitive = true,
        AllowTrailingCommas = true
    });

Load trusted embedded JSON

var entry = loader.LoadEmbedded(json, "MyRegistryEntry.json");

Load and validate external JSON

try
{
    var entry = loader.LoadExternal(json, "MyRegistryEntry.json");
}
catch (RegistryLoadException ex)
{
    Console.WriteLine($"Failed to load registry data from {ex.SourceName}");
}

πŸ›‘οΈ Error Model

Scenario Exception
Embedded JSON invalid JsonException
External JSON invalid RegistryLoadException
External schema mismatch ValidationException
External deserialization failure RegistryLoadException

Embedded data is treated as trusted package data. External data is validated and wrapped so callers can handle registry-loading failures consistently.


πŸ§ͺ Testing

The test suite covers:

  • embedded vs external loading behavior
  • JSON option inheritance
  • trailing comma handling
  • schema validation integration
  • validation context metadata
  • exception wrapping semantics

πŸ—ΊοΈ Roadmap

Future versions may include:

  • additional structured-data formats
  • richer registry composition helpers
  • source-mapped diagnostics
  • built-in validator integrations

🀝 Contributing

Contributions are welcome.
Please see CONTRIBUTING.md in the repository root.


πŸ“„ License

This project is licensed under the Apache License 2.0.
See LICENSE for the full license text.

Copyright Β© 2026 Alexandru Luca (alex98luca)

Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Sashiko.Registries:

Package Downloads
Sashiko.Names

Culturally aware person name generator for the Sashiko ecosystem. Provides embedded, curated name pools and language-specific generation rules for realistic structured person names without runtime external data sources.

Sashiko.Languages

Strongly-typed ISO 639-3/2/1 language registry for the Sashiko ecosystem. Provides a complete embedded dataset derived from SIL International's ISO 639-3 tables, with lookup utilities and a stable, immutable registry model.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.1 190 5/3/2026
0.1.0 224 3/28/2026