Morphir.Myriad.SystemTextJson.Annotations 0.5.0-alpha.6

Prefix Reserved
This is a prerelease version of Morphir.Myriad.SystemTextJson.Annotations.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Morphir.Myriad.SystemTextJson.Annotations --version 0.5.0-alpha.6
                    
NuGet\Install-Package Morphir.Myriad.SystemTextJson.Annotations -Version 0.5.0-alpha.6
                    
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="Morphir.Myriad.SystemTextJson.Annotations" Version="0.5.0-alpha.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Morphir.Myriad.SystemTextJson.Annotations" Version="0.5.0-alpha.6" />
                    
Directory.Packages.props
<PackageReference Include="Morphir.Myriad.SystemTextJson.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 Morphir.Myriad.SystemTextJson.Annotations --version 0.5.0-alpha.6
                    
#r "nuget: Morphir.Myriad.SystemTextJson.Annotations, 0.5.0-alpha.6"
                    
#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 Morphir.Myriad.SystemTextJson.Annotations@0.5.0-alpha.6
                    
#: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=Morphir.Myriad.SystemTextJson.Annotations&version=0.5.0-alpha.6&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Morphir.Myriad.SystemTextJson.Annotations&version=0.5.0-alpha.6&prerelease
                    
Install as a Cake Tool

Morphir.Myriad.SystemTextJson.Annotations

Attributes and options for Morphir.Myriad.SystemTextJson, a Myriad plugin that generates trim-safe and Native AOT-safe System.Text.Json converters and contexts for F# records, unions and enums at build time.

This package has no dependency and targets netstandard2.0. Nothing in it runs: the generator reads the attributes from the F# source at build time.

open Morphir.Myriad.SystemTextJson

[<JsonUnion(BaseEncoding = (JsonUnionEncoding.InternalTag ||| JsonUnionEncoding.NamedFields), TagName = "kind")>]
type Shape =
    | [<JsonName "circle">] Circle of radius: float
    | [<JsonName "square">] Square of side: float
Attribute Use
JsonUnion The encoding of one union: base encoding and flags, tag and fields names, naming.
JsonRecord The member rules of one record: naming, skippable options, unknown members, null fields.
JsonName The JSON name of a case or field. More names are accepted when reading.
JsonParsedValue A type that is written as text and read only through its parser.
JsonIgnoreType Leave a type out of the context.
JsonDefaultValue A string, Boolean or numeric literal for an absent record member.
JsonDefaultEmpty An empty sequence or map for an absent member.
JsonDefaultValueProvider A direct call to an accessible static method with no arguments, returning the field's type.
JsonDefaultJson An explicit JSON-literal default read through the generated field codec.
JsonOmitEmpty Leave an empty record collection out on writing.
JsonOmitDefault Leave a Boolean record field out on writing when it equals its JsonDefaultValue.
JsonVersionAlias Read one exact legacy member/version pair and normalize it to the current form.
JsonKnownPaths Require every critical path in a string collection to match the exact allowlist.

Scalar strings are ordinary values, without JSON quoting. Decimal and domain defaults can use JsonDefaultValueProvider(typeof<Defaults>, nameof Defaults.Create); provider code runs only for an absent member at deserialization, and the generated call is checked by the F# compiler. It does not use reflection. Each field can declare only one default. Explicit null retains the field's normal rules.

The generator also supports System.Text.Json's JsonPropertyName and JsonExtensionData attributes; extension data requires a string-keyed JsonElement map record field. Unknown members are preserved beside the named members without a wrapper. New member rules are opt-in; unannotated fields retain their encodings and required-member checks.

The union encodings use the names and meanings of FSharp.SystemTextJson. See the Morphir.Myriad.SystemTextJson guide for the full reference.

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 was computed.  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 was computed.  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.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Morphir.Myriad.SystemTextJson.Annotations:

Package Downloads
Morphir.Mep

Shared Morphir Extension Protocol messages and transports

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.5.0-alpha.7 96 12/2/2026
0.5.0-alpha.6 105 11/30/2026
0.5.0-alpha.5 111 11/22/2026
0.5.0-alpha.4 108 11/16/2026
0.5.0-alpha.3 113 11/14/2026
0.5.0-alpha.2 113 11/13/2026
0.5.0-alpha.1 110 11/13/2026
0.4.0-alpha.5 104 11/13/2026
0.4.0-alpha.4 90 11/10/2026
0.4.0-alpha.3 95 11/9/2026
0.4.0-alpha.2 63 11/8/2026

### Added

- `morphir compile` composes `ir.layout` (`single-file`, `document-tree`) with `ir.format` (`json`, `yaml`, `ion`):
- `morphir generate` reads JSON (`manifest.json`), YAML (`manifest.yaml`/`manifest.yml`), and Ion (`manifest.ion`) document trees (both plain and name-compacted contextual envelopes across IR `3`, `3.1.0`, and `4`/`4.0.0`) as well as single-file JSON, YAML, and Ion IR models, adds `--input-format yaml` (`autojsonyamlion`), and reads all three formats from `compile.json` without `--input`. Built-in backends (`fsharp`, `csharp`) generate identically across formats and layouts; external MEP draft.2 guests run bounded multi-document sessions over recorded or explicit JSON/YAML trees (including YAML and Classic `3.1.0` support and draft.1 lossless conversion reporting `morphir-yaml`/`morphir-json`), while `morphir validate` keeps its released JSON/Ion-only policy. `Morphir.Extensions.Installation` supports extension-state contract `0.1.0-preview.4` (for `capabilities.modelAccess` locks/catalogs) while retaining `0.1.0-preview.3`, and `Morphir.Ion` detects non-finite / precision-losing Classic `3.1.0` decimals (`unrepresentable_literal`) before typed decode. `DocumentTreeStore` adds multi-profile bounded loading (`TryReadModel`, `TryReadYamlDocument`, `TreeReadOptions`, and F#-only `readAnyProfile`) while keeping `DocumentTreeStore.Read` JSON-only, plus PascalCase `ReadOptions.Defaults` and `WriteOptions.DefaultPathBudget` for C# callers. See [morphir generate](docs/content/docs/cli/generate.md).
- Diagram layouts and renderers. `DiagramExport.Layout` gives every diagram a public, renderer-neutral layout of each page: shapes, lines with bound ends, waypoints and exact paths, text, images, composite elements, containers and groups, in `Distance` units (quarter EMU, exact for 0.01 px, points and EMU), with resolved colours and the diagram's links. A renderer from any assembly subclasses `DiagramRenderer` and declares the `LayoutFeature`s it draws; `DiagramExport.Assess` reports whether pages are native, degraded or unsupported for it, and `DiagramExport.RenderAsync` lowers them through fallbacks in a fixed order and applies a strict, allow-degraded or picture-fallback policy. `Diagnostic.Error` and `Diagnostic.Warning` let renderers report, and `DiagramRenderers` registers them by file extension. The new package `Morphir.Diagrams.Canvas` exports editable draw.io files, Excalidraw scenes and Obsidian Excalidraw notes whose shapes, bound connectors and element references survive editing. A transition from the reserved state `root` is now refused with `state/reserved-id`, and text that XML cannot hold is drawn with U+FFFD instead of failing. See [Layouts and renderers](src/Morphir.Diagrams/README.md#layouts-and-renderers) and [Morphir.Diagrams.Canvas](src/Morphir.Diagrams.Canvas/README.md) ([#705](https://github.com/finos/morphir-dotnet/issues/705))
- Diagram slide export. The new package `Morphir.Diagrams.Slides` places layouts on slides with `SlidePlacement` (widescreen or 4:3, a content area, an exact fit on the format's grid) and writes them as PowerPoint presentations (`PowerPointRenderer`, with exact routes or connectors glued to shapes), OpenDocument presentations for LibreOffice Impress (`OpenDocumentRenderer`, with glued connectors that keep their routes), Google Slides `batchUpdate` request bodies that the caller sends with their own client (`GoogleSlidesRenderer`), and reveal.js decks of the original SVG (`RevealJsRenderer`). The office formats embed SVG images with a PNG fallback. See [Morphir.Diagrams.Slides](src/Morphir.Diagrams.Slides/README.md) ([#706](https://github.com/finos/morphir-dotnet/issues/706))
- `Morphir.Ion` writes the Ion IR format. `IonIrWriter.write` gives the canonical Ion 1.0 text of draft `0.1.0-draft.1` for a v3 library (`3.0.0`), a v3 specs distribution (`3.1.0`) and every v4 distribution (`4.0.0`), and `IonIrWriter.writeTree` gives the canonical Ion document tree, with `manifest.ion`, `module.ion` and one `<stem>.type.ion` or `<stem>.value.ion` for each member, stems cut to the path budget, and no footer. What it writes reads back through `IonIr.read` and `IonIrTree.read` as the same distribution, and writing it again gives the same bytes; what Ion cannot hold that way is refused, such as a v3 value attribute that is not the classic JSON of a type (`unrepresentable_attribute`) or a version other than `3`, `3.0.0`, `3.1.0`, `4` and `4.0.0` (`IonIrVersions`). The header states the exact release. The reference CLI's single files and trees are matched byte for byte where the IR holds what they spell. `IonIrWriter.readJson` and `ofJson` start from IR JSON, and `IonIrWriting.TryWriteJson`, `TryWriteJsonTree` (both flat entries and versioned `VFileTree`) and `IonIrReading.TryRead` serve C# callers, with an `IonFailure` whose locations are text or null; the root's single `formatVersion` is checked by the format-version grammar (type, syntax and 32-bit range) and then for Ion support before the distribution is read, so `4.0`, `"3.4294967296.0"`, an uncarried release such as `3.0.1`, or a missing or repeated one is refused; a v3 member the classic model cannot keep is refused (`unknown_member`); a v3 inferred type with a name or path that Ion cannot read back, such as an empty name, is `unrepresentable_attribute`; a repeated member of any JSON object is refused (`duplicate_member`), at an RFC 9535 location that writes a key other than an ASCII member-name shorthand (a letter or `_`, then letters, digits and `_`) as an escaped `["key"]`, so `a-b` is `$["a-b"]`; a v4 float lexeme that does not spell its value is refused (`invalid_literal`); a document number whose decimal scale passes the reader's 1,000 stays `number::` text; a v3 member without documentation is `unrepresentable_documentation`, because Ion reads a missing `doc` as the empty one; `ofJsonAs` / `ofJsonTreeAs` state another carried release, such as `3.1.0`; and a tree whose cut stems give two documents one path is refused with `stem_collision`. See [Writing the Ion IR format](src/Morphir.Ion/README.md#writing-the-ion-ir-format).
- `Morphir.IR.Trees.CanonicalYaml` writes a JSON value as the canonical YAML of the YAML profile: block mappings with two-space indentation, flow sequences unless a mapping is nested in them, `{}` and `[]` for empty containers, plain strings unless plain YAML would change their meaning (control characters, the line and paragraph separators, U+FFFE and U+FFFF are escaped, and only a whole octal or hexadecimal token such as `0x10` is quoted, so `0xylophone` stays plain; a key longer than the 1,024 characters of an implicit key is an explicit `? key`), JSON number lexemes unchanged, and one final line feed. The profile's reader gives the same value back, a mapping key `<<`, which the profile refuses even quoted, and a repeated member are refused, and the kit's canonical YAML spellings and `complete-example.yaml` are matched byte for byte. `CanonicalYaml.ofJsonTree` and `CanonicalYamlWriter.TryWriteTree` convert the files of a JSON document tree into a YAML tree (`manifest.yaml`, `module.yaml`, `*.type.yaml`, `*.value.yaml`), and `CanonicalYamlWriter.TryWriteJson` serves C# callers.
- MCK vNext .NET runner in `Morphir.Mck` and `Morphir.Conformance`: adds `check`, `prepare`, `run`, `verify`, and `render` commands for IR inverted-control binding harnesses (`--exec`), MEP (`--target` / `--wasm`), and Morphir runtime verification, with sandboxed Jint JS driver execution, built-in comparators (`exact`, `json`, `ir-semantic`, `ion`, `diagnostic`), capability rollups, `--check-underclaims`, and standalone offline HTML report rendering. See [morphir-mck](docs/content/docs/cli/morphir-mck.md) and [MCK vNext .NET Runner](docs/contributing/mck-vnext-runner.md) ([#716](https://github.com/finos/morphir-dotnet/pull/716)).
- `Morphir.Mck` is packaged and published as a NuGet .NET tool (`morphir-mck`), installable via `dotnet tool install --global Morphir.Mck --prerelease` (or locally in a tool manifest) and delegated automatically by `morphir mck <args>` when on `PATH`. See [morphir-mck](docs/content/docs/cli/morphir-mck.md) and [mck](docs/content/docs/cli/mck.md).

### Changed

- The JSON locations that `V4Json` and the strict classic reader report, and the duplicate-member locations of the Ion writer, follow RFC 9535: a member whose name is an ASCII member-name shorthand (a letter or `_`, then letters, digits and `_`) follows a dot, and every other member is an escaped name selector, so `tx-id` is `["tx-id"]` and a key with a quote is `["a/"b"]`. `Morphir.Json.JsonPaths` writes them for every reader, and `morphir model verify` reads escaped selectors back into JSON Pointers.

### Fixed

- Pin LF (`/n`) line endings in `Morphir.Diagrams.Canvas` (`ExcalidrawRenderer` and `ObsidianExcalidrawRenderer`) and `Morphir.Models` (`ClassicJsonWriter`), ensuring byte-identical JSON output across Windows, macOS, and Linux ([#712](https://github.com/finos/morphir-dotnet/pull/712)).