Skip to content

Releases: json-api-dotnet/JsonApiDotNetCore

v4.0.0-alpha4

11 Nov 10:59
Compare
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
Compare
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
Compare
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
Compare
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
Compare
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
Compare
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
Compare
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
Compare
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 !

v3.1.0-alpha1

04 Dec 03:56
3ade2a7
Compare
Choose a tag to compare
v3.1.0-alpha1 Pre-release
Pre-release

#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.0.0

13 Nov 05:01
Compare
Choose a tag to compare

After 3 months, it's finally here. There have been no functional modifications since v3.0.0-beta7, only improved error checks and messages. The following is a summary of all the changes that went out in the beta versions.


Breaking Changes

  • DocumentData replaced by ResourceObject. Thanks @btecu! (#400 via #403)
  • #317 via #428: rename ContextGraph to ResourceGraph
  • #359 via #416 Nested Sort. Thanks @milosloub!
    • SortQuery: use public attribute string name when constructing
      • SortQuery(SortDirection, AttrAttribute) to SortQuery(SortDirection, string)
      • SortedAttribute to Attribute
    • IQueryableExtension
      • Sort<T>(IQueryable<TSource>, List<SortQuery>) to
        Sort<T>(IQueryable<TSource>, IJsonApiContext, List<SortQuery>)
      • Sort<T>(IQueryable<TSource>, SortQuery) to
        Sort<T>(IQueryable<TSource>, IJsonApiContext, SortQuery)
      • Sort<T>(IOrderedQueryable<TSource>, SortQuery) to
        Sort<T>(IOrderedQueryable<TSource>, IJsonApiContext, SortQuery)

Non-Breaking Changes

  • #425 via #427: fix DocumentBuilder; includes member missing when fetching HasManyThrough. Thanks @maurei!
  • Naming conventions (#293 via #409)
[Attr] // → "compound-name"
public string CompoundName { get; set; }

builder.AddResource<TestResource>();  // → "test-resources"
  • API for easy service/repo registration (#384 via #409)
services.AddResourceService<FooService>();
  • ResourceDefinition improvements: Custom filters and default sort (#402 via #409)
public class FooResource : ResourceDefinition<Foo>
{
  protected override QueryFilters GetQueryFilters() => new QueryFilters { 
        { "key1", (query, value) => query.Where(x => x == value) },
        { "key2", (query, value) => query.Where(x => x != value) },
   };

  public override PropertySortOrder<Foo> GetDefaultSortOrder() => new PropertySortOrder { 
     (foo => foo.Bar, SortDirection.Ascending),
     (foo => foo.Baz, SortDirection.Descending),
  }
}
  • Many-to-Many support via [HasManyThrough] (#151 via #419)
public class Article : Identifiable
{
    [NotMapped] // ← tells EF to ignore this property
    [HasManyThrough(nameof(ArticleTags))] // ← tells JADNC to use this as an alias to ArticleTags.Tags
    public List<Tag> Tags { get; set; }

    // this is the EF join relationship
    public List<ArticleTag> ArticleTags { get; set; }
}

Usage

This change introduces two new filter operators isnull and isnotnull. Like all other operators, it is appended by a colon (:), however, any value provided after the colon is ignored.

GET /api/v1/todo-items?filter[updated-date]=isnull: HTTP/1.1
Accept: application/vnd.api+json
  • #377: Fix TypeLocator bug that results in app crashing at startup
  • #241 via #376 Auto Resource/Service Discovery