Releases: json-api-dotnet/JsonApiDotNetCore
v3.1.0
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
#454 Fix null values attributes are omitted from included
#464 Added extra information to FilterQuery. Thanks @wisepotato!
v3.1.0-alpha3
#458: Allow filter[id] and filter[related.id]
v3.1.0-alpha2
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
#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
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 byResourceObject
. Thanks @btecu! (#400 via #403)- #317 via #428: rename
ContextGraph
toResourceGraph
- #359 via #416 Nested Sort. Thanks @milosloub!
SortQuery
: use public attribute string name when constructingSortQuery(SortDirection, AttrAttribute)
toSortQuery(SortDirection, string)
SortedAttribute
toAttribute
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"
services.AddResourceService<FooService>();
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),
}
}
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; }
}
- #382 via #395: Identifiable causes exceptions in Post
- #39 via #378: Deeply Nested Inclusions. Thanks @NullVoxPopuli for all the help landing this!
- #388 Exact Error Codes for Error Collections thanks @rtablada !
- #387 Additional filter operations: isnull and isnotnull thanks @NullVoxPopuli !
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
v3.0.0-beta7
#359 via #416 Nested Sort. Thanks @milosloub!
Breaking Changes
-
SortQuery
SortQuery(SortDirection, AttrAttribute)
toSortQuery(SortDirection, string)
SortedAttribute
toAttribute
-
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)
v3.0.0-beta6
v3.0.0-beta5
Non-Breaking Changes
[Attr] // → "compound-name"
public string CompoundName { get; set; }
builder.AddResource<TestResource>(); // → "test-resources"
services.AddResourceService<FooService>();
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),
}
}
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; }
}
Breaking Changes
v3.0.0-beta4
#382 via #395: Identifiable causes exceptions in Post
#39 via #378: Deeply Nested Inclusions. Thanks @NullVoxPopuli for all the help landing this!