Morphir.Myriad.SystemTextJson.Annotations 0.4.0-alpha.3

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.4.0-alpha.3
                    
NuGet\Install-Package Morphir.Myriad.SystemTextJson.Annotations -Version 0.4.0-alpha.3
                    
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.4.0-alpha.3" />
                    
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.4.0-alpha.3" />
                    
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.4.0-alpha.3
                    
#r "nuget: Morphir.Myriad.SystemTextJson.Annotations, 0.4.0-alpha.3"
                    
#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.4.0-alpha.3
                    
#: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.4.0-alpha.3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Morphir.Myriad.SystemTextJson.Annotations&version=0.4.0-alpha.3&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.3 57 11/14/2026
0.5.0-alpha.2 62 11/13/2026
0.5.0-alpha.1 60 11/13/2026
0.4.0-alpha.5 60 11/13/2026
0.4.0-alpha.4 67 11/10/2026
0.4.0-alpha.3 80 11/9/2026
0.4.0-alpha.2 53 11/8/2026

### Added

- Docs: [Compile F# to Morphir IR](https://finos.github.io/morphir-dotnet/docs/getting-started/compile-fsharp/), a five-minute start, and two tutorials: car rental pricing from F# to C#, and compiling F# with the native `morphir` executable. The finished example is in `examples/car-rental-pricing` ([#499](https://github.com/finos/morphir-dotnet/issues/499))
- Releases publish the F# frontend extension `Morphir.Frontend.FSharp.Extension` (command `morphir-fsharp-frontend`) to NuGet next to `Morphir.Tool` ([#499](https://github.com/finos/morphir-dotnet/issues/499))
- `morphir compile`: compiles F# sources to Morphir IR with the in-process F# frontend of the dotnet tool `dotnet-morphir`. Sources come from `--input` files in order, one `--input` directory in lexical order, `--project-file`, `[frontend.<language>].project_file`, or `project.source_directory`. `--ir-version` and `ir.format_version` keep the exact format version, for example `4.0.0`. `--json` writes one report with setting origins; `--json-lines` writes the compile events and ends with the report. Human mode writes each stage's diagnostics to stderr when the stage completes. Exit codes are 0, 1, 2 and 130. The AOT executable `morphir` has no built-in F# frontend; it compiles F# through the MEP guest with `--extension` ([#499](https://github.com/finos/morphir-dotnet/issues/499))
- `morphir compile --extension <command, path or .dll>` and `[frontend.<language>].extension`: run a frontend as a MEP `0.2.0-draft.1` guest process. The AOT `morphir` compiles F# through `morphir-fsharp-frontend` for IR versions 1 to 4; classic versions 1 and 2 are compiled at `3.0.0` and written at the requested version. Extension failures are exit code 2 with `extension.unavailable`, `extension.not_admitted`, `extension.tuple_unavailable`, `extension.protocol_error` or `extension.timeout` ([#499](https://github.com/finos/morphir-dotnet/issues/499))
- `morphir compile --target <id> --generate-output <dir> [--option KEY=VALUE]`: continue into code generation on the compiled IR, as `generate` does ([#499](https://github.com/finos/morphir-dotnet/issues/499))
- Compile task records: `compile` writes `compile.json` under the out root (`--out-dir`, `MORPHIR_OUT_DIR` or `workspace.out_dir`), holds `compile.lock` while it runs, leaves a tombstone when it fails, and installs a copy of the IR with `-o/--output` without changing files it did not write ([#499](https://github.com/finos/morphir-dotnet/issues/499))
- `morphir generate` without `--input` reads the IR of the most recent compile of the project, and fails with `compile.record_missing` when there is none ([#499](https://github.com/finos/morphir-dotnet/issues/499))
- `morphir.unrepresentable`: a classic IR version that cannot hold a value of the model (an integer outside the 64-bit range, or a character outside the Basic Multilingual Plane) fails with exit code 1 and writes no document ([#499](https://github.com/finos/morphir-dotnet/issues/499))
- Configuration: `ir.format_version` accepts a SemVer string such as `"4.1.0-draft.1"`, and every `[frontend.<language>]` table accepts `project_file` and `extension` ([#499](https://github.com/finos/morphir-dotnet/issues/499))
- Generation JSON reports: a diagnostic can have an optional `range`. Reports without ranges are unchanged ([#499](https://github.com/finos/morphir-dotnet/issues/499))
- `Morphir.Mep` foundation: parsed protocol versions, generated describe params, bounded `Content-Length` framing, pinned-contract tests and a C# consumer verified under Native AOT ([#512](https://github.com/finos/morphir-dotnet/issues/512)).
- Myriad System.Text.Json record wire rules: typed scalar, empty-collection and static-provider defaults for missing members, an explicit JSON-literal fallback, empty-collection omission, flattened extension data, exact versioned-member migration and critical-path allowlists. Existing encodings remain unchanged unless annotated.
- `Morphir.FSharp.Annotations`: `[<MorphirName("...")>]` sets the Morphir name of an F# value, type, union case, record field or module, in canonical Morphir name syntax, for example to name an operator. For `netstandard2.0`, with no dependency ([#499](https://github.com/finos/morphir-dotnet/issues/499))
- `morphir-fsharp-frontend`: the F# frontend as a MEP `0.2.0-draft.1` guest, packaged as the framework-dependent dotnet tool `Morphir.Frontend.FSharp.Extension`. It serves `morphir.frontend.compileModel` with JSON model tuples for IR `4.0.0` and `3.0.0` ([#499](https://github.com/finos/morphir-dotnet/issues/499))
- `Morphir.Mep` frontend messages: the `compileModel` request types, the result sum, the reserved options, the request check, RFC 8785 canonical JSON and the request context digest ([#499](https://github.com/finos/morphir-dotnet/issues/499))
- The F# generator writes more Morphir SDK operations: `Basics.integerDivide`, `negate`, `abs`, `min`, `max`, `and`, `or` and `not`; `Decimal.add`, `sub` and `mul`; `List.singleton`, `append`, `length`, `head` and `cons`; `Maybe.andThen` and `Result.andThen`; `String.append`, `length` and `join`; and the `Int.Int64` type ([#499](https://github.com/finos/morphir-dotnet/issues/499))

### Changed

- The F# generator gives each union case field the name of its constructor argument (`Large of seats: int`), so the names stay in the generated F#. A case whose argument names repeat keeps positional fields ([#499](https://github.com/finos/morphir-dotnet/issues/499))
- The F# generator renames a parameter or local value (`__morphirLocal_` prefix) only when it hides a module value that its definition uses. It renamed every local with the name of a module value before ([#499](https://github.com/finos/morphir-dotnet/issues/499))
- The F# generator writes `List.cons` with two arguments as `head :: tail`, not as an applied lambda ([#499](https://github.com/finos/morphir-dotnet/issues/499))

### Fixed

- Custom Myriad plugin scaffolds build and load with Myriad 0.85.0, using Fantomas syntax types and copied runtime dependencies. Myriad and its coupled code generation dependencies now have their own Renovate update group, including the bundled host pins.