Skip to content

v5.12.0

Latest

Choose a tag to compare

@bkoelman bkoelman released this 09 Oct 23:42
· 19 commits to master since this release
5b578fc

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 DbContext entities 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 the DbContext model and loads all the needed related entities in the change tracker upfront, so that EF Core can issue update statements (setting remote foreign keys to null) 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.MySql to 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 DbContext for 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 setting ThrowForProblematicEntityMappings to false in AddJsonApi() options.
  • To support retryable transactions, the public IOperationsTransactionFactory interface 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

New Contributors

Full Changelog: v5.11.0...v5.12.0