Repository navigation
v5.0.0
·
488 commits
to 233997995024e20c510e6d107d30ba5c0fb1895d
since this release
5.0.0 (2026-10-06)
⚠ BREAKING CHANGES
- enums: the CSE enum analyzers (CSE0002-CSE0016) and the generator now run in every project that references any CSharpEssentials package that depends on CSharpEssentials.Enums, including .Validation, .Mediator, .Any, .Maybe, .Entity, .Rules, .These, .Resilience and .GcpSecretManager. New CSE warnings and errors can appear; fix them or set their severity in .editorconfig.
- enums: the CSE enum analyzers (CSE0002-CSE0016) and the generator now also run in every project that references CSharpEssentials.Errors, .Results, .AspNetCore.OpenApi or .AspNetCore.Swashbuckle. New CSE diagnostics can appear; fix them or set their severity in .editorconfig.
- enums: the CSE enum analyzers (CSE0002-CSE0016) and the generator now run in every project that references CSharpEssentials.Json, .EntityFrameworkCore, .AspNetCore, .Http or the CSharpEssentials meta-package. New CSE warnings can appear (errors under TreatWarningsAsErrors); fix them or set their severity in .editorconfig.
- swashbuckle: EnumSchemaFilter takes an IServiceProvider and no longer writes the "Possible values" description.
- aspnetcore: hosts that use AddSwagger or the Swagger filters must reference CSharpEssentials.AspNetCore.Swashbuckle.
- json: enums without generated metadata are no longer converted by AddEnumConventions, ConditionalStringEnumConverter or a custom CanHandle predicate; use AddEnumConventionsWithReflection. StringEnumNaming, and the EF Core and binding helpers built on it, throw InvalidOperationException for such enums.
- json: ConditionalStringEnumConverter.AllowUndefinedValues is removed and undefined values are rejected on read and write. Naming policies other than SnakeCaseLower throw NotSupportedException; set the naming at build time instead.
Added
- aspnetcore: add AddEnumConventions, enum wire format and route binding through the conventions (331d94b)
- aspnetcore: move the Swagger support to CSharpEssentials.AspNetCore.Swashbuckle (e74f257)
- efcore: add enum column migration helpers and data audit (ad5d7a4)
- efcore: store enums as wire names or integers with check constraints (59c81f9), closes #64
- enums: add analyzers for wire names, aliases, fallbacks and flags (0f1d441)
- enums: add code fixes for explicit values and none member (57f8a8a)
- enums: add enum metadata, conventions, parser and formatter (c2d3d66), closes #61
- enums: add non-generic EnumValueFormatter overloads (bfb237b), closes #61
- enums: generate enum metadata, registration and wire-name helpers (80c0689), closes #61
- enums: report AlterColumn next to ConvertEnumColumn for the same column (CSE0014) (0dc2562)
- enums: warn with CSE0015 when a [StringEnum] enum gets no generated metadata (b13a2e1), closes #61
- http: format enums in query and route through EnumValueFormatter (462ef1d)
- json: add EnumConverterFactory and AddEnumConventions (4b8a7f6), closes #61
- json: make reflection enum metadata an explicit opt-in and fail loud for [StringEnum] without metadata (a32e6f3), closes #61
- openapi: warn once per enum when a document mixes string and number formats (74ca8f3)
- swashbuckle: describe enums by the enum conventions (7e1258e), closes #63
- validation: add enum rules that reuse the binding error text (cb0233e)
Fixed
- aspnetcore: bind whitespace-only enum values to null for nullable targets (13806b3)
- aspnetcore: keep the host output formatters when applying an enum wire format override (eded825)
- aspnetcore: trim surrounding whitespace of enum binding values (733f389)
- aspnetcore: validate only the first value source of an unannotated MVC enum parameter (212d2ea)
- efcore: compare text[] flags columns as enum values on PostgreSQL (41b521b), closes #64
- efcore: keep SQLite check constraints enforced when an enum conversion fails (b6b0d4b)
- efcore: match a missing migration schema against any schema in CSE0014 (53bf32a)
- efcore: name the PostgreSQL flags conversion column from a short hash of the column name (cb76c18)
- efcore: resolve ConfigureEnumConventions(null) ambiguity with OverloadResolutionPriority (0dc031e)
- efcore: split SQLite flags text with a recursive CTE instead of json_each (b4d9f51)
- efcore: throw when an obsolete CanConvert predicate selects an enum without metadata (5795fd0)
- efcore: write enum wire names in JSON columns on EF Core 9 (44ccbac), closes #64
- enums: escape keyword member names in generated value expressions (a468a28), closes #61
- enums: format a flags zero without a zero member as "0" (fac8d4a), closes #61
- enums: forward IsExternalInit on .NET 5+ targets (b4591c3), closes #61
- enums: register metadata lazily and rerun module initializers on every miss (af0fa89), closes #61
- enums: reject numeric text longer than 20 characters in the parser as the JSON converter does (16eefbd)
- enums: throw from EnumValueFormatter when a handled enum has no generated metadata (68c8aa8)
- enums: use unique hint names and report colliding extensions classes with CSE0016 (d8a5aa4), closes #61
- examples: read the sample database password from the environment instead of appsettings (8d504b2)
- http: annotate reflection based ToQueryString(object) with trimming attributes (e399d2e)
- http: annotate the remaining reflection based query string overloads for trimming (de2395c)
- http: cache builder JSON options per EnumConventions instance with a weak table (5a2c88b)
- http: format non-enum collection items per item with invariant culture in query strings (a7717bb)
- http: serialize WithJsonContent payload at Build so later WithEnumConventions applies (e1f15d0)
- json: do not claim a StringEnum enum without metadata that CanHandle excludes (4e67b63)
- json: keep existing JsonStringEnumConverter when adding enum conventions (47fe470)
- json: reject over-long enum strings before unescaping and truncate error values (282f244), closes #61
- json: reject the JSON number -0 for enums and bound number error values (025c426), closes #61
- json: stop writing parse failures to the console from ConvertToJsonDocument (4c9c9ba)
- openapi: classify MVC enum parameters by their model type (9f8c603)
- openapi: describe enum properties declared on polymorphic derived types (0b5effa)
- openapi: fall back to WriteAs when disposing the selector scope throws (fdd6694)
- openapi: run header format selectors in a scope and fall back to WriteAs when they throw (cdad36b)
- openapi: write ulong enum values above long.MaxValue exactly in both packages (45267a4)
- validation: use the {Prop}.{Rule} format for enum validator error codes (89521bf)
Changed
- aspnetcore: copy request query and form only when an enum binding value changes (611e8ae)
- efcore: drop the per-write closure in EnumColumnCodec (4ff6b20)
- json: drop the per-call delegate array in ConvertToJsonDocument (fe2c5a6)
- json: parse a number token once in the enum converter (4823407)
- json: read an over-long unknown enum value as the fallback without allocating its string (70ea029)
Build
- enums: let every csharpessentials package bring the enums generator and analyzers (0fff7c3)
- enums: let the enums generator and analyzers flow through errors, results, openapi and swashbuckle (0d4a4e3)
- enums: let the enums generator and analyzers flow through json, efcore, aspnetcore, http and the meta-package (49890fc)