Morphir.Myriad.SystemTextJson.Annotations
0.5.0-alpha.1
Prefix Reserved
See the version list below for details.
dotnet add package Morphir.Myriad.SystemTextJson.Annotations --version 0.5.0-alpha.1
NuGet\Install-Package Morphir.Myriad.SystemTextJson.Annotations -Version 0.5.0-alpha.1
<PackageReference Include="Morphir.Myriad.SystemTextJson.Annotations" Version="0.5.0-alpha.1" />
<PackageVersion Include="Morphir.Myriad.SystemTextJson.Annotations" Version="0.5.0-alpha.1" />
<PackageReference Include="Morphir.Myriad.SystemTextJson.Annotations" />
paket add Morphir.Myriad.SystemTextJson.Annotations --version 0.5.0-alpha.1
#r "nuget: Morphir.Myriad.SystemTextJson.Annotations, 0.5.0-alpha.1"
#:package Morphir.Myriad.SystemTextJson.Annotations@0.5.0-alpha.1
#addin nuget:?package=Morphir.Myriad.SystemTextJson.Annotations&version=0.5.0-alpha.1&prerelease
#tool nuget:?package=Morphir.Myriad.SystemTextJson.Annotations&version=0.5.0-alpha.1&prerelease
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 | Versions 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. |
-
.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.4 | 72 | 11/16/2026 |
| 0.5.0-alpha.3 | 91 | 11/14/2026 |
| 0.5.0-alpha.2 | 92 | 11/13/2026 |
| 0.5.0-alpha.1 | 88 | 11/13/2026 |
| 0.4.0-alpha.5 | 86 | 11/13/2026 |
| 0.4.0-alpha.4 | 82 | 11/10/2026 |
| 0.4.0-alpha.3 | 86 | 11/9/2026 |
| 0.4.0-alpha.2 | 53 | 11/8/2026 |
### Added
- Documentation: a getting-started walkthrough, [Your first model with morphirup](docs/content/docs/getting-started/first-model.md), and a [troubleshooting](docs/content/docs/getting-started/troubleshooting.md) page. The walkthrough installs `morphirup`, sets up the toolchain, compiles the `examples/morphirup-fsharp` model, generates F#, changes a rule and compares the output, then compiles and generates again offline. The getting-started pages now cover tasks only: the local candidate journey moves to the contributing section, implementation detail moves to the reference pages, and troubleshooting moves to the new page. The [morphirup](docs/content/docs/cli/morphirup.md) reference opens with a task section for `setup`, `show`, `select` and `run`, and `examples/morphirup-fsharp/README.md` repeats the walkthrough's commands.
- Install `morphirup` with one command. `scripts/install-morphirup.sh` (POSIX `sh`, Linux x64 and ARM64, macOS on Apple silicon) and `scripts/install-morphirup.ps1` (Windows x64 and ARM64, Windows PowerShell 5.1 and PowerShell 7) install the newest `finos/morphir-dotnet` release that has `morphirup` for the machine, prereleases included, or the release given with `--version` / `-Version`. Each script checks the file against the release's `morphirup-v<version>.sha256` and installs nothing on a mismatch or a missing line. The `sh` script installs to `~/.local/bin` and prints the `PATH` line to add; the PowerShell script installs to `%LOCALAPPDATA%/Programs/morphirup` and adds it to the user `PATH`. Intel macOS and musl Linux are refused. On restricted networks, both scripts use `HTTPS_PROXY` and `NO_PROXY` (the PowerShell script also uses the Windows proxy settings and the current user's proxy credentials, and passes `HTTPS_PROXY` itself on Windows PowerShell 5.1), accept an HTTPS mirror in `MORPHIRUP_DOWNLOAD_URL`, fall back to the release feed on github.com when api.github.com cannot be reached, and stop connecting after 30 seconds. The manually triggered workflow `install-scripts.yml` (inputs `version` and `platforms`) runs both scripts and the mise command `mise use -g 'github:finos/morphir-dotnet[matching=morphirup,version_prefix=v,prerelease=true]'` (also with `@<version>`) on Linux, macOS and Windows.
- Release setup on macOS ARM64: the release attaches the `osx-arm64` toolchain (the self-contained host archive, the F# frontend and backend archives with their release and manifest files, `morphir-host-candidate-osx-arm64.json`, `morphir-extensions-osx-arm64.json` and the bundle `morphir-toolchain-osx-arm64.json`), and its one `SHA256SUMS` covers win-x64, win-arm64 and osx-arm64. On Apple silicon, `morphirup setup --yes`, then `run -- compile` and `run -- generate --target fsharp`, work from the published release. The release job packs the toolchain on the native macOS ARM64 runner of `build-morphirup` and runs the acquired setup journey there; the pull request workflow does not, so its macOS job is unchanged. `WindowsToolchainChecksums` takes `--toolchain-platforms` for a run that packs only some toolchains.
- Experimental `morphirup` setup on macOS ARM64 (`osx-arm64`). `morphirup setup --local-developer` with a local candidate, host archive and bundle, then `select`, then `run -- compile` and `run -- generate --target fsharp`, works on Apple silicon with no .NET on `PATH` and no network. Release setup (`setup --yes`) accepts an `osx-arm64` manager and bundle too. Intel macOS stays unsupported.
- Build: `PackWindowsToolchain --rid osx-arm64` packs the macOS ARM64 setup inputs: tar.gz archives, the entry points `morphir`, `morphir-fsharp-frontend` and `morphir-fsharp-backend`, and the candidate, selection, release descriptors, manifests, bundle and `SHA256SUMS`. The target keeps its name, and the Windows outputs are unchanged.
- `Morphir.Extensions.Installation` installs tar.gz extension packages by the package policy of ZIP packages: at most 4096 entries (for tar, PAX/GNU metadata headers count too), only regular files and directories, the same package path rules (a `./` prefix, as `tar -C dir -czf package.tar.gz .` writes, is removed), the same size bounds, no inspection of a resource as a nested archive, and the canonical modes 0555 and 0444. Before, it refused them with `package.format_not_implemented`. A package format other than `zip` or `tar.gz` is refused with `package.archive_format` before staging.
### Changed
- The README and the installation guide start with `morphirup`: the install scripts, mise, manual download with checksum verification, and what works on each platform: macOS on Apple silicon and Windows set up, compile and generate; on Linux `morphirup` installs, but `morphirup setup` does not support Linux yet. Troubleshooting moves to its own page. The proto, `install-*.sh` and `dotnet tool install` routes to the standalone `morphir` CLI follow under "Other ways to install the standalone morphir CLI". The duplicate page `docs/content/getting-started/installation.md` is gone; its address redirects to the installation guide.
- The composed local-toolchains family moves from `0.1.0-preview.3` to `0.1.0-preview.4` ([finos/morphir#1164](https://github.com/finos/morphir/pull/1164), merged as `648ae374`; [spec](https://github.com/finos/morphir/blob/main/docs/spec/toolchain/local-platforms-and-release-bundle.md)), for every platform. Preview.4 adds `osx-arm64` with the archive format `tar-gzip`. The producer writes preview.4, and `morphirup` reads preview.4 only: candidates, bundles, receipts, selections and generations of preview.3 (written by 0.4.0-alpha.5 and earlier) are not read and are not converted. `select`, `show` and `run` read only the preview.4 selection pointer: in a Home set up with preview.2 or preview.3 they refuse with `local.setup_required`, which says to run `morphirup setup --yes` again (and then `select`, for a local candidate). Setup in that Home installs preview.4 beside the earlier generations without reading them, and replaces the selection pointer. The historical preview.1 local route is unchanged. The candidate reader refuses an `osx-arm64` candidate that does not declare `tar-gzip`, and a Windows candidate that does not declare `zip`. Setup and run refuse an `osx-arm64` entry point that is not `morphir` with `local.launch_structure` when they check the archive or the installed folder.
- `morphirup` off Windows uses the physical path of the parent folders of `--home`, with each link resolved (at most 40). The installed host refuses a source file below a link, and on macOS `$TMPDIR` is below the link `/var`. The last part is not followed, so a Home that is itself a link is still refused.
- `morphirup run` and the setup probes also remove `DOTNET_ROOT_ARM64` from the host's environment.
- A refused `morphirup setup`, `select` or `show` writes a local-toolchains `0.1.0-preview.4` result, on the preview.1 local route too. Before, every refusal except the composed local setup's wrote the preview.1 result with `origin: local-developer`. The `origin` is now the origin of the preview.4 generation that `select` names or of the selection that `show` reads, and `local-developer` when there is none. A completed preview.1 step still writes the preview.1 result.
### Fixed
- `morphir ir verify` no longer runs without end on a typical IR file. Each union branch of the schema checked its whole subtree even when the tag was another branch's, so the time grew exponentially with nesting. The `greeting-example.json` IR v3 example of finos/morphir (29 KB) ran for more than ten minutes and now takes under a second. The 3.5 MB LCR example takes about 20 seconds. A value with an unknown tag still lists the tags that were expected. For a value with a known tag, the deep errors of the other branches are gone: each other branch reports only that its tag does not match.
- `morphir ir verify` accepts IR v3 whose values carry their inferred types as attributes, as morphir-elm writes them, and names with a word that is a number. Both come from the current finos/morphir v3 schema. Before, the greeting example was not valid.
- `morphir ir verify` reads IR nested up to 512 levels. Before, a file deeper than 64 levels, such as the LCR example of finos/morphir, was reported as malformed JSON.
- `morphir` (and so `morphirup run -- compile` and `run -- generate`) no longer writes `[INF] Foundatio.Mediator registered 3 handler(s) and 0 middleware.` to stderr. The CLI logger caps the `Foundatio.Mediator` category at Warning, so the mediator's warnings and errors are still shown. Stdout is unchanged.
- Build: restoring the solution no longer rewrites the committed `packages.lock.json` of the `Morphir.Configuration.IO.Smoke` and `Morphir.Configuration.Microsoft.Smoke` hosts with the host's RID, so release artifacts built on Linux or Windows no longer record a dirty origin. A trimmed publish of these hosts passes `-p:PublishTrimmed=true`, and CI fails when restore changes the working tree.
- On Linux and macOS, an extension installation lock is free as soon as its owner releases it. Before, the lock stayed held while another thread of the same process was starting a child process, because that child shared the lock's file until it ran its program. A second extension operation in that window could fail with "Lease is busy".
- Extension installation works on Linux ARM64. Before, every operation on the extension Home there failed with `Cannot access '…/.morphir': native error 22.`: installing and registering extensions, reading the installed state, and `morphirup` downloads. The safe file layer passed the Linux x64 values of `O_DIRECTORY` and `O_NOFOLLOW`, which on ARM64 mean `O_DIRECT` and `O_LARGEFILE`, so it also did not refuse a symbolic link there. It now takes its open flags from a table for Linux x64, Linux ARM64 and macOS.