Joufflu.Data 0.8.0

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

Joufflu.Data

JSON Schema editing for Joufflu.

Two trees instead of a raw JSON text box: write a schema, and fill a value in against one. Follows the Joufflu design system and themes with it.

Joufflu.Data on NuGet License: MIT

What's inside

Piece Purpose
DataEditor Fills a value in against a schema — one row per value, edited by the widget its kind calls for. Any field can hold a reference instead of a literal.
SchemaEditor Writes a JSON Schema — name, kind, required, description, enum options, per value.
SchemaView Shows a schema read-only, as the tree of values it describes.
DataDocument / DataNode The value being filled in, and what the schema holds against it.
SchemaDocument / SchemaNode The schema being written, and the JsonSchema it amounts to.

Schemas are NJsonSchema JsonSchema objects, so a schema generated from a .NET type with JsonSchema.FromType<T>() round-trips through the editors without a conversion layer.

Filling a value in

Bind the shape and the value; the value is written back on every edit.

<data:DataEditor SchemaJson="{Binding ExpectedSchemaJson}"
                 Json="{Binding SettingsJson, Mode=TwoWay}" />

Json comes back null when nothing was filled in, so a caller storing "nothing" as null keeps storing null rather than {}. Every property the schema declares is written; the row's options menu holds "Set to null" for a value the reader means to leave empty rather than fill in.

Ask for the errors whenever you need them — each field is handed its own, and the call returns them as a whole:

IReadOnlyList<DataValidationError> errors = Editor.Validate();

Writing a schema

<data:SchemaEditor Json="{Binding InputSchemaJson, Mode=TwoWay}" />

Json is the JSON Schema document itself, and comes back null for a schema describing nothing.

References

A field can hold a token to be resolved later instead of a literal — a mapping reading $previous.Value rather than a value typed in. Hand the editor what may be read:

Editor.References =
[
    new DataReference("previous", "$previous", "{ }", EnumDataKind.Object)
    {
        Children = { new DataReference("Value", "$previous.Value", "42", EnumDataKind.Integer) }
    }
];

Each field then offers the references its kind can hold, and writes the token as a string where the value would go. The library resolves nothing: what a token means is the caller's business. ReferencePrefix (default $) is how a stored value holding one is read back as a reference rather than as the text it is; leave References empty and the affordance never appears.

Shapes that do not fit

A schema saying nothing of a type, and a schema referencing itself past the first time it is opened, are edited as the JSON they are — the text is kept rather than lost. A schema that cannot be read at all leaves the whole value as text, and says why through Error.

Product Compatible and additional computed target framework versions.
.NET net10.0-windows7.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.8.0 83 9/26/2026