KaliCZ/StrongTypes
42.5
Weak · 21 September 2026
9.9k
lines of production code
C#
primary language
4
measurements over time
What this system is
Kalicz.StrongTypes is a .NET library that provides a comprehensive set of strongly-typed value types, including email addresses, numeric wrappers, intervals, and collections, to enforce invariants at the type level. The system integrates deeply with the .NET ecosystem, offering built-in support for Entity Framework Core persistence, ASP.NET Core model binding, and OpenAPI schema generation. It also includes Roslyn-based analyzers and code fixes to ensure correct package references and configuration binding, while providing source generators and JSON converters to streamline usage across WPF, WinForms, and modern web APIs.
Features
Add EF Core integration for strong types across SQL Server and PostgreSQL
The application now supports Entity Framework Core persistence for strong types, including intervals, numeric types, and strings. This is achieved by adding \SqlServerDbContext\ and \PostgreSqlDbContext\ classes that register DbSets for all supported strong types. The \IntervalEntityConfiguration\ class configures JSON conversion and column mapping for interval types, while \Program.cs\ wires up both database contexts with the \.UseStrongTypes()\ extension, enabling seamless storage and retrieval of strong-typed entities in both SQL Server and PostgreSQL databases.
src/StrongTypes.Api/Data · high confidence
Add Map and MapAsync extension methods for booleans and nullables
Developers can now use MapTrue, MapFalse, and MapAsync extension methods on bool values to project true/false states into other types, and use Map and MapAsync on nullable types to apply a transformation only when a value is present. These new utility methods simplify conditional logic by allowing safe, deferred mapping of boolean and nullable states to structured or class types, with support for both synchronous and asynchronous operations.
src/StrongTypes/Booleans · high confidence
Add OpenAPI schema transformers for strong types
The package registers schema transformers that rewrite OpenAPI schemas for strong types to match their actual JSON wire format. This includes \NonEmptyString\, \Email\, \Digit\, numeric wrappers (\Positive\, \NonNegative\, \Negative\, \NonPositive\), \NonEmptyEnumerable\, \Maybe\, and \Interval\ types. It also re-applies data annotations (e.g., \\[Range\]\, \\[StringLength\]\) that are otherwise dropped by the OpenAPI pipeline, ensuring generated clients and API explorers see the correct constraints.
src/StrongTypes.OpenApi.Microsoft · high confidence
Add OpenAPI test fixtures for strong types and annotations
Added new test API models and controllers in the shared project to exercise OpenAPI schema generation for strong types (including Email, Interval, and Positive/Digit numeric wrappers), as well as validation annotations (StringLength, RegularExpression, Url, etc.) and binding sources (query, route, header, form). These files provide the request/response contracts and controller endpoints used to verify that the OpenAPI generator correctly maps strong types, nullable variants, and collection shapes to Swagger schema definitions.
src/StrongTypes.OpenApi.TestApi.Shared · high confidence
Add OpenAPI/Swagger support for strong types in test APIs
New test API entry points have been added for both Microsoft and Swashuckle OpenAPI implementations. Each test application now configures its respective OpenAPI/Swagger generation to include strong type support via the AddStrongTypes() extension method, allowing the test suites to verify that strong types are correctly documented in the generated API specifications.
src/StrongTypes.OpenApi.TestApi.Microsoft, src/StrongTypes.OpenApi.TestApi.Swashbuckle · high confidence
Add StrongTypes.AspNetCore for NonEmptyEnumerable binding and JSON error-key normalization
The new StrongTypes.AspNetCore package provides a model binder for NonEmptyEnumerable\<T\> that parses multiple raw string values from non-body sources (form, query, header, route) and enforces non-emptiness. It also normalizes JSON request-body validation error keys from the System.Text.Json path format (e.g., $.value) to the property-name format (e.g., Value) in ValidationProblemDetails, with configurable casing (PascalCase, CamelCase, or StripOnly) to match data-annotation and model-binding conventions.
src/StrongTypes.AspNetCore · high confidence
Add Swashbuckle integration for StrongTypes
Introduces the \Kalicz.StrongTypes.OpenApi.Swashbuckle\ package, which registers Swashbuckle schema and operation filters to render strong-type wrappers (e.g., \NonEmptyString\, \Email\, \Digit\, numeric wrappers, \NonEmptyEnumerable\, \Maybe\<T\>\, and interval types) as their actual wire-format JSON schemas. The \PropertyAnnotationSchemaFilter\ and \NonBodyStrongTypeOperationFilter\ re-apply ASP.NET Core data annotations (like \\[Range\]\, \\[StringLength\]\, \\[RegularExpression\]\) that Swashbuckle otherwise drops for custom converters, while the \StrongTypeInliningDocumentFilter\ collapses the intermediate wrapper structures into the final OpenAPI output.
src/StrongTypes.OpenApi.Swashbuckle · high confidence
Add code coverage summary reporting in CI
A new Python script, \scripts/coverage-summary.py\, has been added to parse Cobertura XML reports and generate a Markdown summary of line and branch coverage. This enables the CI pipeline to collect and report code coverage metrics, with support for deduplicating coverage data across generic type instantiations and optionally filtering the report to show only files changed in the current pull request.
python · high confidence
Add configuration binding and validation for strong types
Users can now bind configuration sections to strong types and enforce non-null constraints at startup. The new \Kalicz.StrongTypes.Configuration\ package provides \BindStrongTypes\ and \NonNullableOptionsValidator\ to fail validation if any non-nullable reference property is left null after binding. Additionally, \ParsableTypeConverter\ and \StrongTypeConverter\ in \StrongTypes/ComponentModel\ enable string-to-strong-type conversion via \IParsable\<T\>\, ensuring that invalid input throws with the invariant's own message.
src/StrongTypes.Configuration, src/StrongTypes/ComponentModel · high confidence
Add entity models and database mappings for new strong types
The API now supports persistence and data transfer for a comprehensive set of strong types, including email addresses, various numeric types (int, long, short, decimal, float, double) with positivity constraints, and interval types. This change introduces corresponding Entity classes for Entity Framework Core integration and DTOs for API requests and responses, enabling full end-to-end handling of these types in the database and over the network.
StrongTypes.Api · high confidence
Add generic numeric strong types and JSON serialization support
The library introduces four new generic strong types—Positive, NonNegative, Negative, and NonPositive—each enforcing a specific numeric invariant (e.g., strictly greater than zero). These types include built-in support for System.Text.Json serialization via a dedicated JsonConverterFactory, allowing these values to be read from and written to JSON payloads seamlessly. Additionally, extension methods are provided to easily wrap primitive numeric values into these strong types.
src/StrongTypes/Numbers · high confidence
Add test API endpoints for strong type model binding and validation
The test API now exposes new endpoints to exercise model binding and validation for strong types. BindingProbeController provides GET and POST routes that accept NonEmptyEnumerable, NonEmptyString, Positive\<int\>, and Digit types from query strings, route parameters, headers, and form data. JsonBodyProbeController offers POST endpoints for JSON body deserialization of NonEmptyString and Positive\<int\> types, allowing observation of ValidationProblemDetails error keys. ValidationProbeController adds a range validation endpoint that applies DataAnnotations (Range, Required) to strong-typed properties, verifying that attributes correctly evaluate the wrapped values via IConvertible. Program.cs registers the StrongTypes services. These changes facilitate testing of the ASP.NET Core integration layer for strong types.
src/StrongTypes.AspNetCore.TestApi · high confidence
Added IsExternalInit shim for source generator compatibility
A new file, IsExternalInit.cs, was added to the StrongTypes.SourceGenerators project. This file defines an internal static class IsExternalInit within the System.Runtime.CompilerServices namespace, serving as a compatibility shim for the source generator.
src/StrongTypes.SourceGenerators · high confidence
Automatic generation of numeric wrapper structs with standard interfaces
A new source generator, NumericWrapperGenerator, has been added to the StrongTypes.SourceGenerators project. This generator automatically produces C\# structs that wrap numeric types, implementing a comprehensive set of interfaces including IEquatable, IComparable, IConvertible, IParsable, and ISpanParsable. This allows users to create strongly-typed numeric wrappers that integrate seamlessly with .NET's standard parsing and comparison APIs.
StrongTypes.SourceGenerators · high confidence
EF Core support for strong types and intervals
The library now supports storing strong types (Email, NonEmptyString, MailAddress, and numeric wrappers) and intervals in EF Core. Enabling UseStrongTypes() automatically registers conventions that map strong types to their underlying scalar columns and map intervals to two endpoint columns (or a single JSON column), with server-side translation for Unwrap() and interval Start/End access in LINQ queries.
src/StrongTypes.EfCore · high confidence
Introduce Digit strong type with parsing and conversion support
A new \Digit\ struct has been added to the \StrongTypes\ library, representing a single decimal digit (0–9). It implements \IParsable\<Digit\>\ to allow binding from query strings and forms, and \IConvertible\ for standard type conversions. The type includes parsing via \TryCreate\ and \Parse\ methods, and extension methods in \DigitExtensions\ have been migrated from the old \FuncSharp\ namespace to \StrongTypes\, updating the \AsDigit\ and \FilterDigits\ helpers to work with the new \Digit\ type.
src/StrongTypes/Digits · high confidence
Introduce Email strong type with validation and serialization support
A new Email strong type has been added to the StrongTypes library, providing a validated wrapper around email addresses. The type enforces RFC 5321 constraints (non-empty, max 254 characters) and integrates with the existing NonEmptyString infrastructure. It supports JSON serialization via a dedicated converter, implements IParsable for binding from query/form data, and includes extension methods for convenient parsing and unwrapping of MailAddress objects.
src/StrongTypes/Emails · high confidence
Introduce Maybe\<T\> type with JSON serialization support
A new \Maybe\<T\>\ struct is introduced to represent optional values, providing \Some\/\None\ semantics with LINQ-style extension methods (\Map\, \FlatMap\, \Where\, \Select\, \SelectMany\) and safe collection operations (\SafeFirst\, \SafeLast\, \SafeSingle\, \SafeMax\, \SafeMin\). A \JsonConverter\ is added to serialize \Maybe\<T\>\ to/from JSON objects with a \Value\ property, enabling seamless integration with modern .NET JSON libraries.
src/StrongTypes/Maybe · high confidence
Introduce NonEmptyEnumerable and collection extension methods
Added a new NonEmptyEnumerable type that guarantees at least one element, with factory methods (Create, CreateRange, TryCreateRange) and LINQ-style extensions (Select, SelectMany, Distinct, Concat, Flatten, Prepend, Append, Reverse). Also added IEnumerable extension methods for null-safe operations (ExceptNulls, OrEmptyIfNull, Partition, Flatten, AsReadOnlyList, AsList, AsArray) and exception aggregation. A custom JSON converter enables serialization of NonEmptyEnumerable.
src/StrongTypes/Collections · high confidence
Introduce NonEmptyString strong type with parsing and conversion helpers
A new NonEmptyString strong type has been added, guaranteeing that strings are non-null, non-empty, and not just whitespace. The change includes a core NonEmptyString class with TryCreate/Create patterns, a JsonConverter for serialization, and extension methods on both string and NonEmptyString for safe parsing (AsByte, AsInt, AsDouble, etc.) and conversion (ToByte, ToInt, ToDouble, etc.).
src/StrongTypes/Strings · high confidence
Introduce base entity model and internal backing entities for non-public EF mapping
Added the abstract EntityBase class and IEntity interface to provide a common foundation for strong-type entities, including an Update method and a static Create factory. Also added InternalBackingEntity and InternalBackingIntervalEntity, which expose non-public backing properties (NonEmptyString and Interval) that are explicitly mapped by Entity Framework Core, enabling the framework to persist nullable strong types that EF would otherwise ignore.
src/StrongTypes.Api/Entities · high confidence
Introduce strong-typed interval types with inclusive-by-default bounds and JSON serialization
Added new strong types for representing mathematical intervals: FiniteInterval (both endpoints), Interval (unbounded on either or both sides), IntervalFrom (unbounded upper), and IntervalUntil (unbounded lower). All types support inclusive-by-default endpoint bounds, explicit exclusive bounds, and automatic validation on construction and read (e.g., from EF Core or JSON deserialization). The types include built-in JSON serialization via a custom JsonConverter/JsonConverterFactory that supports per-value or pinned bound inclusivity modes, and helper extensions for DateOnly/DateTime interval operations.
src/StrongTypes/Intervals · high confidence
Introduces a new Result type for error handling
A new \Result\<T, TError\>\ type has been added to the \src/StrongTypes/Result\ directory, providing a structured way to handle success and error states. This includes a \Result\<T\>\ shorthand for exceptions, along with extension methods for catching exceptions (\Catch\), flattening nested results (\Flatten\), partitioning sequences of results (\Partition\), and throwing on error (\ThrowIfError\).
src/StrongTypes/Result · high confidence
New API endpoints for strong-typed entity storage and binding
The API now exposes a comprehensive set of RESTful endpoints for creating, reading, updating, and patching entities that store strong types (such as NonEmptyString, Email, Positive integers, and Intervals) across both SQL Server and PostgreSQL databases. Additionally, a new BindingProbeController has been added to validate that model binding works correctly for these strong types across query, route, header, and form data sources.
src/StrongTypes.Api/Controllers · high confidence
New FsCheck arbitraries for strong types
The StrongTypes.FsCheck package now provides ready-to-use FsCheck arbitraries for scalar strong types (NonEmptyString, Email, Digit, Positive/Negative/NonNegative/NonPositive integers) and their nullable/Maybe variants, as well as generators for interval types. This allows users to write property-based tests against these types without manually constructing generators that respect each type's invariants.
src/StrongTypes.FsCheck · high confidence
New extension methods for parsing and inspecting enums
The library now provides static extension methods on all enum types to safely parse strings into enum values (Parse, TryParse, Create, TryCreate) and inspect flag-based enums (AllValues, AllFlagValues, AllFlagsCombined, GetFlags). These additions allow users to convert string inputs to enums without throwing exceptions on invalid input, and to decompose or combine \[Flags\] enum values programmatically.
src/StrongTypes/Enums · high confidence
New request models for collection types
Added new C\# record types in src/StrongTypes.Api/Models/CollectionJsonModels.cs to represent request payloads for various collection scenarios. The new models cover combinations of standard IEnumerable and NonEmptyEnumerable for int, Positive\<int\>, string, and NonEmptyString types, including both nullable and non-nullable element variants.
src/StrongTypes.Api/Models · medium confidence
OpenAPI schema generation for strong types
The library now automatically converts strong-type wrappers into their underlying wire types in the generated OpenAPI document. This includes inlining the wrapper's schema, merging any caller-supplied data-annotations (such as \[Range\], \[StringLength\], or \[MinLength\]) to tighten constraints, and removing the temporary wrapper components from the final output. Numeric wrappers now correctly expose their specific bounds (e.g., positive, non-negative) in the schema.
src/StrongTypes.OpenApi.Core · high confidence
Removals
Removal of FuncSharp benchmark and example projects
The FuncSharp.Benchmarks and FuncSharp.Examples projects have been removed from the repository. This includes all benchmark files (e.g., \BenchmarkEnum.cs\, \IEnumerableExtensionsBenchmarks.cs\, \OptionBenchmarks.cs\) and example implementations (e.g., \Coproduct.cs\, \DataCube.cs\, \TryBasics.cs\). The solution file \FuncSharp.sln\ has also been deleted, indicating the complete removal of these auxiliary projects from the codebase.
(repo-wide) · high confidence
Behavioural changes
Add WPF test application with strong type bindings
A new WPF test application has been added to demonstrate two-way data binding of strong types (NonEmptyString, Email, Positive, Digit) in a UI. The app features a MainWindow with TextBox controls bound to a PersonViewModel, enabling users to edit fields and observe validation errors via standard WPF error templates.
src/StrongTypes.Wpf.TestApp · medium confidence
Code fixes for adding missing package references and refactoring configuration binding
The analyzer now provides code fixes that automatically add missing package references (Kalicz.StrongTypes.EfCore, Kalicz.StrongTypes.OpenApi.\*) to the project's .csproj file, and offers a fix to refactor .Bind(section) calls to .BindStrongTypes(section) while adding the required using directive.
src/StrongTypes.Analyzers.CodeFixes · high confidence
Library rebranded to Kalicz.StrongTypes with updated documentation and CI configuration
The project has been transferred from MewsSystems/FuncSharp to KaliCZ/StrongTypes, reflected in the readme header, license file, and solution structure. The documentation has been completely rewritten to focus on the new library's features, including strong types, JSON serialization, and EF Core support. Additionally, the repository now includes an .editorconfig for consistent code formatting, a codecov.yml for coverage reporting, and updated .gitignore rules.
(repo-wide) · high confidence
New analyzer warnings for missing OpenAPI, EF Core, and Configuration packages
The StrongTypes.Analyzers project now ships three new diagnostic rules to help developers integrate StrongTypes with other libraries. ST0001 warns when EF Core is present but the Kalicz.StrongTypes.EfCore package is missing, which is required for persistence. ST0002 and ST0003 warn when OpenAPI generators (Microsoft or Swashbuckle) are present but the corresponding Kalicz.StrongTypes.OpenApi.\* adapters are missing, which are needed to correctly describe the types in OpenAPI documents. ST0004 warns when configuration binding is used without Kalicz.StrongTypes.Configuration, which ensures that missing configuration keys fail fast rather than leaving non-nullable reference wrappers as null.
src/StrongTypes.Analyzers · high confidence
Test coverage
Added WPF binding tests for strong types; Added benchmarks for flag enums, interval operations, and EF Core persistence; Added end-to-end tests for WinForms two-way data binding; Added integration test infrastructure for API endpoints; Added integration tests for ASP.NET Core model binding and JSON error key normalization; Added integration tests for OpenAPI schema generation; Added integration tests for collection JSON serialization; Added integration tests for email entity handling; Added integration tests for entity CRUD, nullable value converters, and internal backing properties; Added integration tests for interval strong types; Added integration tests for model binding of strong types; Added integration tests for numeric and string entity APIs; Added integration tests for strong type query translation; Added tests for analyzer code fixes and core extension methods; Removed obsolete test files for collection and utility extensions.
Dependencies
Migrate to .NET 10 and modernize project structure
The solution has been upgraded to target .NET 10.0 across all projects, including the core library, analyzers, and test suites. This migration includes updating the Roslyn dependency to version 5.0.0 for the analyzer and code-fix projects, and adopting the Microsoft Testing Platform (MTP) and xunit v3 for the test projects. Additionally, the legacy FuncSharp project has been removed, and the codebase has been reorganized into a modular structure with separate projects for configuration, Entity Framework Core, ASP.NET Core, and OpenAPI integration.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 41 → 42 (+1.2)
- Rubric changed (rubric-2026.08.18 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 74 → 73 (-0.4)
- Architecture 97 → 97 (+0.0)
- Maturity 57 → 58 (+1.0)
- Readiness 49 → 50 (+1.4)
- Security 20 → 22 (+1.8)
- Performance 84 → 83 (-0.9)
Resolved (23)
- Bounded contexts not declared
- Change coupling: PostgreSqlDbContext.cs ↔ SqlServerDbContext.cs (src/StrongTypes.Api/Data/PostgreSqlDbContext.cs)
- Duplicated block (10 lines × 2) (src/StrongTypes.SourceGenerators/NumericWrapperGenerator.cs)
- Duplicated block (12 lines × 2) (src/StrongTypes.Analyzers/MissingEfCorePackageAnalyzer.cs)
- Duplicated block (5 lines × 2) (src/StrongTypes.Benchmarks/GetFlagsStrategies.cs)
- Duplicated block (8 lines × 2) (src/StrongTypes/Maybe/MaybeCollectionExtensions.cs)
- Duplicated block (9 lines × 2) (src/StrongTypes.OpenApi.Microsoft/Binding/NonBodyStrongTypeOperationTransformer.cs)
- High CVE: SQLitePCLRaw.lib.e_sqlite3 2.1.11
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- IL efficiency: 1 authored method(s) exceed the IL budget (src/StrongTypes.SourceGenerators/NumericWrapperGenerator.cs)
- LLM evaluation failed
- LLM evaluation failed
- …and 3 more
New (107)
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
- Duplicated block (10 lines × 2) (src/StrongTypes.SourceGenerators/NumericWrapperGenerator.cs)
- Duplicated block (13 lines × 2) (src/StrongTypes.OpenApi.Microsoft/Binding/NonBodyStrongTypeOperationTransformer.cs)
- Duplicated block (15–17 lines × 2) (src/StrongTypes.Analyzers/MissingEfCorePackageAnalyzer.cs)
- Duplicated block (45 lines × 2) (src/StrongTypes.Api/Data/PostgreSqlDbContext.cs)
- Duplicated block (5 lines × 2) (src/StrongTypes.Benchmarks/FlagEnums.cs)
- Duplicated block (5 lines × 2) (src/StrongTypes.OpenApi.Core/Inlining/StrongTypeInliner.cs)
- Duplicated block (6 lines × 2) (src/StrongTypes.OpenApi.Microsoft/Intervals/IntervalSchemaTransformer.cs)
- Duplicated block (6–7 lines × 2) (src/StrongTypes.Benchmarks/GetFlagsStrategies.cs)
- Duplicated block (7 lines × 2) (src/StrongTypes.Api/Controllers/ReferenceTypeEntityControllerBase.cs)
- Duplicated block (7 lines × 2) (src/StrongTypes/Collections/NonEmptyEnumerableExtensions.cs)
- Duplicated block (7 lines × 2) (src/StrongTypes/Collections/NonEmptyEnumerableExtensions.cs)
- Duplicated block (7 lines × 3) (src/StrongTypes.Analyzers/MissingEfCorePackageAnalyzer.cs)
- Duplicated block (8 lines × 2) (src/StrongTypes.Analyzers.CodeFixes/AddEfCorePackageCodeFixProvider.cs)
- Duplicated block (8 lines × 2) (src/StrongTypes.OpenApi.Microsoft/PropertyAnnotationSchemaTransformer.cs)
- Duplicated block (8 lines × 2) (src/StrongTypes/Maybe/MaybeCollectionExtensions.cs)
- Duplicated block (9 lines × 2) (src/StrongTypes.Api/Controllers/ReferenceTypeEntityControllerBase.cs)
- High: security finding (details withheld)
- High: security finding (details withheld)
- …and 87 more
API surface
- Unchanged — 54 HTTP endpoints
Architecture
- Unchanged — 6 containers · 3 contexts · 0 edges
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
KaliCZ/StrongTypes was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 21 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 5557d4b351a2a1523b02d8e21cac1ce09cc8f957 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-28e75b8e3254.