AnointedAutomation.Serialization
2.0.0
dotnet add package AnointedAutomation.Serialization --version 2.0.0
NuGet\Install-Package AnointedAutomation.Serialization -Version 2.0.0
<PackageReference Include="AnointedAutomation.Serialization" Version="2.0.0" />
<PackageVersion Include="AnointedAutomation.Serialization" Version="2.0.0" />
<PackageReference Include="AnointedAutomation.Serialization" />
paket add AnointedAutomation.Serialization --version 2.0.0
#r "nuget: AnointedAutomation.Serialization, 2.0.0"
#:package AnointedAutomation.Serialization@2.0.0
#addin nuget:?package=AnointedAutomation.Serialization&version=2.0.0
#tool nuget:?package=AnointedAutomation.Serialization&version=2.0.0
AnointedAutomation.Serialization
Jesus is King ✝️
Shared serialization helpers for .NET 10. No MongoDB dependency (the BSON pieces live in AnointedAutomation.Repository.Mongo).
AnointedAutomation.Serialization.Naming.NamingRules:ToCamel,ToCamelJson,ToPascal,ToSnake, and the hybrid rule (IsCamelMember/ToHybrid: value-type, enum and struct members camelCase, reference-type members PascalCase).AnointedAutomation.Serialization.SystemTextJson:JsonCasingConvention,UtcDateTimeJsonConverter,JsonPresets(shared read-only option sets) andAnointedJson.ConfigureApi(one call for MVC and Minimal API hosts).AnointedAutomation.Serialization.Newtonsoft:TolerantEnumConverter,StringOrBoolConverter,DateFormatConverter,NullOnErrorConverter.AnointedAutomation.Serialization.Json: lenientJsonElementreaders (JsonElementExtensions,ResponseJson).
builder.Services.AddControllers().AddJsonOptions(o => AnointedJson.ConfigureApi(o.JsonSerializerOptions));
builder.Services.ConfigureHttpJsonOptions(o => AnointedJson.ConfigureApi(o.SerializerOptions));
- Target framework:
net10.0 - Dependencies:
Newtonsoft.Json,AnointedAutomation.Logging(NullOnErrorConverterlogs each value it drops)
Nullable reference types (2.0.0)
The package is compiled with nullable reference types enabled. API nullability changes, which can surface new warnings in consumers that have nullable enabled:
- Every
JsonElementreader that can miss returnsstring?:GetStringOrNull,GetNonEmptyStringOrNull,GetNonBlankStringOrNull,GetTrimmedStringOrNull,GetStringOrNumberStringOrNull,GetNonBlankStringOrNumberStringOrNull,GetStringOrRawTextOrNull,GetScalarTextOrNull,GetStringOrToString,GetFirstNonBlankStringOrNull,AsStringOrRawTextOrNulland bothRawTextOrNulloverloads. The...OrEmptyreaders still return a non-nullstring. GetPathOrDefaultandGetFirstNonBlankStringOrNullaccept a nullparamsarray (the former returns the element, the latter null);ParseIntLeading,ResponseJson.TryParseandResponseJson.IsNotJsonaccept a nullstring?and treat it as not JSON or no number.NamingRules.ToCamel,ToCamelJson,ToPascal,ToSnakeandToHybridtakestring?and are annotated[NotNullIfNotNull], so a non-null name still gives a non-null result.IsPureCasingVarianttakesstring?.StringOrBoolConverter.ParseandTolerantEnumConverter.Parse(Type, string?)/Parse<T>(string?)take a nullable text and return null for unknown text, as before.- The Newtonsoft converters'
ReadJsonandWriteJsonoverrides matchJsonConverter(object? existingValue,object? value), andReadJsonreturnsobject?. StringOrBoolConverter.ReadJsonnow throwsJsonSerializationExceptionfor a boolean token with no value (previously aNullReferenceException), andTolerantEnumConverterthrowsInvalidOperationExceptionif an enum field has no value (cannot happen for a real enum).
License
MIT. DateFormatConverter and NullOnErrorConverter are derived from ShopifySharp (Copyright (c) 2015 Joshua Harms, MIT).
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- AnointedAutomation.Logging (>= 3.0.0)
- Newtonsoft.Json (>= 13.0.4)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on AnointedAutomation.Serialization:
| Package | Downloads |
|---|---|
|
AnointedAutomation.Objects
Plain POCO models for user accounts, billing and payments, single sign-on identities (Google, Microsoft, Apple, Facebook, Discord, GitHub, LinkedIn, Twitch, Yahoo, Amazon, Reddit, Shopify), and standard API response envelopes. |
|
|
AnointedAutomation.Repository.Mongo
A MongoDB helper and generic repository base for .NET, with CRUD, paging, aggregation, index management, BSON class maps and casing conventions. |
|
|
AnointedAutomation.Objects.API
ASP.NET Core helpers: an in memory IFormFile, a hybrid casing System.Text.Json naming convention, and a GraphQL response envelope reader. |
|
|
AnointedAutomation.Shopify
Plain Newtonsoft.Json POCO models for the Shopify Admin REST API (customers, orders, products, fulfillments, inventory, refunds, transactions, webhooks and more), derived from ShopifySharp's REST entities. Plus a transport-neutral Admin GraphQL client (HttpClient based) with error parsing, cost-bucket throttling, safe retries (unkeyed mutations are never resent after an unknown outcome), cursor paging and @idempotent keys. Also bulk operations (staged JSONL upload, polling with backoff, streamed results), webhook HMAC verification with an idempotent subscription registrar, typed builders for common non-money catalog operations, and System.Text.Json response models. |
GitHub repositories
This package is not used by any popular GitHub repositories.