Skip to content

0.2.0

Latest

Choose a tag to compare

@alftore alftore released this 12 Nov 11:06
v0.2.0
028c9bd

For .NET 11. Zorg.Json now has a net11.0 build, which reads what System.Text.Json 11 added. Nothing changes on .NET 10.

  • C# 15 unions: a property of a union type, such as union Pet(Cat, Dog), becomes anyOf of its cases and null. It used to accept any value. The serializer reads null as an unset union and writes one as null. Nothing inside a union is removed, at any depth, so the serializer's classifier sees the JSON as written and picks the same case as without Zorg. A union the serializer can't read, such as two object cases without JsonUnionTypeStructuralClassifier, fails with deserialization_failed.
  • docs/limits.md has a section on C# unions: where the schema promises more than the serializer reads.
  • New number types: BFloat16, Decimal32, Decimal64 and Decimal128 are numbers in typed schemas and with Z.Number<T>(). Like float, they state no range, and parsing refuses a value that overflows.
  • The source generator reports .NET 11 async validation, AsyncValidationAttribute and IAsyncValidatableObject, with ZORG0005, saying where it still runs. It doesn't turn it into RefineAsync, because such a check usually needs services and the finished object from its ValidationContext. The guide shows how to write the refinement with the service captured.
  • closed class hierarchies with InferClosedTypePolymorphism, IReadOnlySet<T>, extension data in an IReadOnlyDictionary or a JsonObject, and [JsonNamingPolicy] on a member already worked through the contract. They're now covered by tests.

Packages

Package
Zorg.Json Now built for .NET 10 and .NET 11. The .NET 11 build reads C# unions and the new number types
Zorg.Json.AspNetCore Unchanged
Zorg.Json.AspNetCore.OpenApi Unchanged since 0.1.1
Zorg.Json.Llm Unchanged
Zorg.Json.Extensions.AI Unchanged

The packages attached here are the ones the Release run built and attested. Verify one with:

gh attestation verify Zorg.Json.0.2.0.nupkg --repo alftore/Zorg.Json