Repository navigation
New features and enhancements
This release brings the following minor convenience changes:
- Errors in multiple query string parameters are now aggregated (instead of returning only the first error).
- A new method is provided to suppress the "does not implement 'IIdentifiable'" warning for
DbContextentities that can't be annotated with[NoResource]because they are defined in a third-party assembly (typically the entities from ASP.NET Core Identity).
Example usage:builder.Services.AddJsonApi<AppDbContext>(resources: resourceGraphBuilder => resourceGraphBuilder.SuppressWarningNotIdentifiable<IdentityRole>());
- Deleting a resource from an optional one-to-one relationship is now fully working on SQL Server, even in complex database models with multiple foreign keys, cyclic dependencies, etc. This fixes errors like:
update or delete on table "(table_name)" violates foreign key (fk_name).JsonApiDotNetCore now scans the foreign key dependency tree in theDbContextmodel and loads all the needed related entities in the change tracker upfront, so that EF Core can issue update statements (setting remote foreign keys tonull) before deletion. - Transient failures in atomic:operations transactions are now retryable. This is opt-in for regular API projects, while enabled by default in Aspire projects.
- DapperExample was updated to support
Microting.EntityFrameworkCore.MySqlto create the database, aside from the abandoned Pomelo NuGet package.
Breaking changes
- As announced in #2059, we discontinued OpenAPI support and deprecated its experimental packages.
- The entity mappings in your
DbContextfor publicly exposed resource types are now validated for common pitfalls:ClientSetNull(except for SQL Server) and Identifying FKs. You can downgrade the new startup error to logged warnings by settingThrowForProblematicEntityMappingstofalseinAddJsonApi()options. - To support retryable transactions, the public
IOperationsTransactionFactoryinterface has changed. - The dependency on Ben.Demystifier has been removed because built-in exception stack traces have improved over the years, and this package is no longer maintained.
Bugfixes
- When a transaction commit failed in an atomic:operations request, the source pointer in the error response was incorrect.
Merged PRs
- Remove OpenAPI support by @bkoelman in #2065
- Add Dapper support for Microting.EntityFrameworkCore.MySql by @bkoelman in #2076
- Use Docker Compose to start containers by @bkoelman in #2077
- Aggregate all query string errors in response by @bkoelman in #2084
- Add ResourceGraphBuilder.SuppressWarningNotIdentifiable() by @rghvgrv in #2092
- Validate entity model and support optional one-to-one relationships on SQL Server by @bkoelman in #2090
- Retryable transactions by @bkoelman in #2098
New Contributors
Full Changelog: v5.11.0...v5.12.0