Skip to content

Releases: json-api-dotnet/JsonApiDotNetCore

v4.0.0-beta1

10 Sep 16:03
38d23a3

Choose a tag to compare

v4.0.0-beta1 Pre-release
Pre-release

New features

  • Composable filters and deeply nested queries (see #792 for details)

Breaking changes

  • We no longer call app.UseRouting() and app.UseEndpoints(...) anymore, so you need to add these yourself to Startup.cs
  • Code namespace changes (details at #808)
  • New filter query string syntax. Set options.EnableLegacyFilterNotation to true to allow legacy filters
    To use new notation, prefix with "expr:", for example: ?filter=expr:equals(lastName,'Smith')
  • Multiple filters in query string at same depth are combined using OR operator (used to be AND, which violates json:api recommendations)
  • Using a negative page number (to reverse order) is no longer possible
  • "total-records" in response meta has been renamed to "total-resources" (and casing convention is applied)
  • ResourceDefinition<T>.HideFields() has been replaced by ResourceDefinition<T>.OnApplySparseFieldSet()
  • ResourceDefinition<T>.GetQueryFilters() has been replaced by ResourceDefinition<T>.OnRegisterQueryableHandlersForQueryStringParameters
    These are no longer tied to only filters. For example: ?filter[isHighRisk]=true now uses: ?isHighRisk=true
  • When no sort is provided, resources are sorted ascending by ID
  • Notable renames:
    DefaultResourceService -> JsonApiResourceService
    DefaultResourceRepository -> EntityFrameworkCoreRepository
    BaseJsonApiController.GetRelationshipsAsync -> GetRelationshipAsync
    BaseJsonApiController.GetRelationshipAsync -> GetSecondaryAsync
    AttrCapabilities.AllowMutate -> AllowChange
  • Most occurrences of 'entity' were renamed to 'resource' and Default prefix was removed from various class names

Closed issues

  • Routing does not respect custom pluralized resource name (#805)
  • Changes on public API surface (#808)
  • Fixed versioning on AppVeyor NuGet feed (#802)
  • fix: support for lazy loading proxies (#793)
  • Composable filters and deeply nested queries (#792)
  • Required Input validation disabled for partial patching / relationships (#781)
  • Fix synchronous error in flushasync (#773)
  • Fixed: only run custom path cutting logic when RouteAttribute is used (#769)
  • Fixed: Namespace not honored when RelativeLinks=true (#763)
  • Simplified signature of app.UseJsonApi() (#750)
  • Fixed: exception logged in Kestrel on Delete request (#762)
  • Show helpful error when ActionResult returns unsupported type (#753)
  • Fixed: Filter passes query validation, but the filter is not applied (#659)
  • Simplify/optimize filter query string parsing (#758)
  • Unexpected behavior on negative page number (#757)
  • Fixed: error setting default sort for non-string properties (#754)
  • Fixed: sorting on multiple attributes (#755)
  • Fixed: do not intercept exceptions thrown from non-json:api requests (#749)
  • Fix for GetDefaultSortOrder not firing (#746)
  • Fixed: missing property setter in options (#742)

Special thanks to @bjornharrtell and @fdlane for providing feedback, trying things out, submitting bugs or even fixing them!

v4.0.0-alpha5

08 May 12:24
36bc489

Choose a tag to compare

v4.0.0-alpha5 Pre-release
Pre-release

New features

  • Configurable default attribute capabilities in options.
  • Resources are found from DbContext.Model (no more need to expose them via DbSet<> properties).
  • Inject services in entities (see limitations at https://docs.microsoft.com/en-us/ef/core/modeling/constructors#injecting-services).
  • Return updated resource from PATCH only if the update changes the resource in ways other than those specified by the request.
  • SourceLink: enables to step into the NuGet library by downloading sources from GitHub.
  • Improved support for custom logging and error handling.
  • Eager loading: unconditionally include unexposed related entities.
  • Overloads on app.UseJsonApi() to influence middleware order.
  • New options to constrain maximum page size and number.

Breaking changes

  • Paging is now enabled by default. Set options.DefaultPageSize = 0 in Startup for the old behavior.
  • Query string parameters omitNull/omitDefault have been renamed to nulls/defaults and the meaning of their true/false values is inverted.
  • Casing convention is set in options using Newtonsoft.Json.Serialization.NamingStrategy.
  • Some types were renamed, had signature changes and/or moved into different namespaces.
  • ILoggerFactory is no longer optional. Use NullLoggerFactory.Instance from tests.
  • Replaced set of optional booleans on Attr with flags enumeration.
  • Content negotiation returns 406 to browsers that send incompatible Accept headers.

Closed issues

  • Default attribute capabilities (#707)
  • Fixed: Re-fetch entity after CREATE without relationships (#724)
  • Fixes in content negotiation, better separation between json:api and asp.net controllers (#725)
  • Bugfixes on combining sparse fieldsets with includes (#708)
  • Fail on mismatch between ID in URL and patch body (#702)
  • Use EF Core entity model when scanning for resources (#550)
  • Added support for injecting DbContext in resources (#657)
  • Fixed NullReferenceException on parallel requests (#727)
  • Use NamingStrategy from Newtonsoft.Json to configure casing convention (#718)
  • Fixed: custom serializer settings are ignored (#687)
  • Fixed: crash on invalid relationship name (#713)
  • Replaced omitNull/omitDefault query string parameters with nulls/defaults (#720)
  • Change tracking for patch updates, to improve json:api spec compliance (#577)
  • Fixed: run tests in parallel (#485)
  • Restored SourceLink support (#692)
  • Fixed: null data returned when resource not found (#631)
  • Fixed: crash on invalid relationship name (#709)
  • Improved and pluggable error handling and logging (#714)
  • Improved request validation (#655)
  • Eager loading: unconditionally include unexposed related entities (#652)
  • Include query string parameters in top-level self link and paging links (#276)
  • Fixed: Filtering on special chars sends back an un-escaped special character in the links urls (#408)
  • Updated to .NET Core 3.1 (#711)
  • Fixed inefficient cache usage (#450)
  • Cleanup of public overloads for ILoggerFactory (#674)
  • Added MaximumPageSize and MaximumPageNumber to IJsonApiOptions (#673)
  • Allow user flexibility in authentication/authorization middleware options (#656)
  • Fixed invalid top-level self link (#646)
  • Expose DefaultPageSize/RequestedPageSize to give the user more control over pagination (#641)
  • Support query param operations on nested resources (#634)
  • Fixed: first/prev links not rendered on second page (#622)

v4.0.0-alpha4

11 Nov 10:59

Choose a tag to compare

v4.0.0-alpha4 Pre-release
Pre-release

Version v4 is now feature-freezed. We will need some time to

  • create a migration guide for those coming from v3.1
  • update the docs and example projects

In the meanwhile we will beta (battle) testing this version in our own applications.

  • Fix a NullReferenceException when a 404 is returned (#620)
  • Fix/deviating dbset name (#603)
  • Fix/pagesize (#601)
  • fix: typo LoaDatabaseValues (#608)
  • Acceptance tests EF inheritance (#610)
  • Improve usability RequestSerializer (#613)
  • Move EF core related building to extension methods (#616)
  • Hooks discovery detection of implemented hooks issue (#617)
  • feat: use camelCase as default (#618)
  • Simplify DefaultResourceService constructor (#592)
  • Upgrade to .net core 3.0 (pr #595 issue (#559) (with great contributions of @wisepotato)
  • Fix DiscoveryTests and NoEntityFrameworkExample project/tests (#590)
  • Renaming and consistency (#589)
  • Separation of concerns ResourceGraph (#586)
  • Use relationships as navigations in sparse field queries (#584)
  • Allow for multiple naming conventions (camelCase vs kebab-case) (#581)
  • New constructor overload in query controllers (#580)
  • Cleanup of repository layer (#579)
  • Query parameter services (#574)
  • (Temporary) removal of bulk and split (#571)
  • Serialization wiki (#561)
  • Serializer decoupling (#558)
  • Context decoupling (#557)

v4.0.0-alpha3

17 Jun 11:00
ec4e76e

Choose a tag to compare

v4.0.0-alpha3 Pre-release
Pre-release

Breaking changes:

#520: Patch requests where the payload does not include the id(s) of the target resource(s) is no longer accepted.
#519: UpdateAsync(TId id, TEnity entity) was replaced with UpdateAsync(TEnity entity)
#478: RelationshipAttribute.Type was replaced with RelationshipAttribute.DependentType
#478: EntityResourceService constructor EntityResourceService(IJsonApiContext, IEntityRepository<TEntity, TId>, ILoggerFactory, loggerFactory, IResourceMapper ) was deprecated and replaced with EntityResourceService(IJsonApiContext, IEntityRepository<TEntity, TId>, IResourceHookExecutor = null, IResourceMapper mapper = null, ILoggerFactory = null)

Bug fixes / clean up

#522 An issue with deserializing timespans was fixed. Thanks to @ngboardway!
#518: The DefaultEntityRepository has had a major cleanup. Thanks to @wisepotato for reviewing!

  • problems errors of with entities being attached to the DbContext with the usage of hooks and custom services has been fixed
  • changes done to entity in a custom service before calling the old UpdateAsync(TId id, TEnity entity) repository method were not actually saved to the database.
  • Progress was made to decouple IJsonApiContext (see #512) from the repository layer by removing usage of HasOnePointers and HasManyPointers.

New features

#502 support for "implicit removal" of relationships
#478 Resource Hooks, see the usage guide for detailed description. Thanks @wisepotato, @milosloub and @jaredcnance for extensive reviewing!

v4.0.0-alpha2

24 May 11:36
c4ebf4b

Choose a tag to compare

v4.0.0-alpha2 Pre-release
Pre-release

Breaking changes

#513 Revert back from new GetQueryable() to Get() in DefaultEntityRepository. Difference between v3.1.0 and v4.0.0-alpha2 is order of Select method call, which is responsible for sparse fields resolve.

If sparse fields are requested:

Old way in 3.1.: EntityResourceService.GetAsync() calls DefaultEntityRepository.Get().Select() -> this limits selected columns in the begining and filters stops working for atributes that are not requested in fields!

New way in 4.0: EntityResourceService.GetAsync() calls pure DefaultEntityRepository.Get(), Select() is separated and resolved in EntityResourceService.GetAsync() after get, include, filter and sort operations. This solution provides correct SQL translation and functional sparse fields system!

v4.0.0-alpha1

23 May 09:10
7cb3fbd

Choose a tag to compare

v4.0.0-alpha1 Pre-release
Pre-release

Breaking changes:

#476 and #498 Sparse fields set not applied to query correctly. Thanks @maurei for cooperation !
#482 Increase ResourceDefinition GetFilterQuery Flexibility. Thanks @joshhubers !

Bug fixes:

#492 Update one-to-many through PATCH on resource not working. Thanks @maurei !
#494 Update many-to-many through PATCH on resource not working. Thanks @maurei !
#509 DateTimeOffset is modified during deserialization.

Description fixes/improvements:

#481 Fix typo in controller. Thanks @diegobrum !
#487 added explanation for ValidateModelState option. Thanks @CoolGoose !
#489 and #490 fixed descriptions. Thanks @fdlane !

v3.1.0

13 Feb 15:25
eaa5d7f

Choose a tag to compare

No additional changes since v3.1.0-alpha4

#454 Fix null values attributes are omitted from included. Thanks @milosloub!
#464 Added extra information to FilterQuery. Thanks @wisepotato!
#458: Allow filter[id] and filter[related.id]. Thanks @milosloub!
#457 Fix Content-Type checking on non-json:api routes. Thanks @jonnolen !
#453 via #456 Fixed HasManyThrough relationships returning empty data array without 'include'. Thanks @XaserAcheron !
#436: Nested sparse fields. Thanks @milosloub!
#442: Nullable parent in nested inclusion. Thanks @milosloub!
#451 via #452 - DefaultRelationshipLinks. Thanks @milosloub!
#445 via #446 - Introduce mappedBy in HasOneAttribute to support Entity-Resource separation

v3.1.0-alpha4

31 Jan 09:02
f72e8ae

Choose a tag to compare

v3.1.0-alpha4 Pre-release
Pre-release

#454 Fix null values attributes are omitted from included
#464 Added extra information to FilterQuery. Thanks @wisepotato!

v3.1.0-alpha3

11 Dec 07:16
c633c71

Choose a tag to compare

v3.1.0-alpha3 Pre-release
Pre-release

#458: Allow filter[id] and filter[related.id]

v3.1.0-alpha2

10 Dec 04:19
bd162d0

Choose a tag to compare

v3.1.0-alpha2 Pre-release
Pre-release

Bug Fixes Only

#457 Fix Content-Type checking on non-json:api routes. Thanks @jonnolen !
#453 via #456 Fixed HasManyThrough relationships returning empty data array without 'include'. Thanks @XaserAcheron !