A framework for building JSON:API compliant REST APIs using ASP.NET and Entity Framework Core.
This patch eliminates building an intermediate ServiceProvider
at startup, which unblocks usage in Aspire (more specifically, its usage of AddNpgsqlDataSource
) and improves Serilog compatibility.
Furthermore, this patch makes methods on FilterParser
overridable, which enables plugging in custom parsing of constant values (text surrounded by single quotes) inside a filter query string value.
Full Changelog: https://github.com/json-api-dotnet/JsonApiDotNetCore/compare/v5.5.0...v5.5.1
TryAdd[Singleton/Scoped/Transient]
internally, which makes it easier to replace built-in dependencies with your own.Full Changelog: https://github.com/json-api-dotnet/JsonApiDotNetCore/compare/v5.4.0...v5.5.0
Forbidden
/Allowed
/Required
(both per type and globally). See the documentation for details.The boolean AllowClientGeneratedIds
in options has been obsoleted in favor of the new IJsonApiOptions.ClientIdGeneration
(see above)
AddJsonApi
calls.QueryExpressionRewriter.VisitResourceFieldChain
method.inheritdoc
usage to correct IntelliSense/documentation on classes.Full Changelog: https://github.com/json-api-dotnet/JsonApiDotNetCore/compare/v5.3.0...v5.4.0
This release opens up query string parsing plus LINQ expression building for extensibility. This means that you can now define and plug in your own functions, available for use in query strings. Also, errors for invalid query string values now include the failure position, along with the ^
marker. See https://github.com/json-api-dotnet/JsonApiDotNetCore/pull/1286 for details and examples.
Related to the above, the query string parsers, LINQ builders, and RuntimeTypeConverter
have been moved out of .Internal
namespaces.
count()
with null
; do not treat null
as a possible field name.Full Changelog: https://github.com/json-api-dotnet/JsonApiDotNetCore/compare/v5.2.0...v5.3.0
long
IDs, detailed logging.
Location
header when request path ended with a slash.include
and fields
with EF Core owned entities.QueryExpression
model shape, to make it easier to understand and consume.Full Changelog: https://github.com/json-api-dotnet/JsonApiDotNetCore/compare/v5.1.2...v5.2.0
[ApiController]
has improved, though its use is not recommended because it degrades JSON:API compliance. Therefore we now log a warning when found.[Range]
that does not include the type's default value.AppContext.SetSwitch("JsonApiDotNetCore.ParseQueryStringsUsingCurrentCulture", true);
Full Changelog: https://github.com/json-api-dotnet/JsonApiDotNetCore/compare/v5.1.1...v5.1.2
This patch relaxes the requirements for the any()
filter function: Instead of requiring at least two constants, now a single constant works as well.
Full Changelog: https://github.com/json-api-dotnet/JsonApiDotNetCore/compare/v5.1.0...v5.1.1
The final version of JSON:API v1.1 was released recently, eight years after its initial draft. We've always tried to keep up-to-date with specification changes, and this release follows that tradition. We've slightly adapted JsonApiDotNetCore in corner cases (https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1195 and https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1196) where the specification used to be ambiguous.
New in this release: capabilities for relationships. Similar to [Attr(Capabilities = ...)]
, you can now declare what's permitted in requests where relationships are involved: [HasOne(HasOneCapabilities = ...)]
and set the default in options. Despite this was already possible by writing custom code in resource definitions (which can still be useful when depending on externally changing conditions), relationship capabilities are just a shorthand for simpler cases. See its documentation and feature design for details.
Based on our own research and experiments, we've updated the guidance on mapping Entity Framework Core one-to-one relationships at https://www.jsonapi.net/usage/resources/relationships.html#one-to-one-relationships-in-entity-framework-core to make JsonApiDotNetCore work properly. In summary, there are two pitfalls to watch out for, where you need to override the default mappings: identifying foreign keys and using DeleteBehavior.SetNull
instead of the misleading default DeleteBehavior.ClientSetNull
.
You can now share your models (that is, your Entity Framework Core entity classes that are decorated with JsonApiDotNetCore attributes) with .NET Framework code. To accomplish this, move them into a separate, shared project that references only the JsonApiDotNetCore.Annotations
package. Aside from targeting .NET Standard 1.0 instead of .NET 6, we've fixed https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1198 and https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1199.
Related to the above, we've obsoleted CanInclude
on relationships. The equivalent functionality is now covered by relationship capabilities.
Full Changelog: https://github.com/json-api-dotnet/JsonApiDotNetCore/compare/v5.0.3...v5.1.0
This patch removes a limitation that blocked future use of EF Core 7, as well as minor tweaks and optimizations.
// <auto-generated />
comment to source-generated controllers by @bkoelman in https://github.com/json-api-dotnet/JsonApiDotNetCore/pull/1178
Full Changelog: https://github.com/json-api-dotnet/JsonApiDotNetCore/compare/v5.0.2...v5.0.3
This patch fixes an error when sorting by a base/interface property from a lambda expression in a resource definition.
Full Changelog: https://github.com/json-api-dotnet/JsonApiDotNetCore/compare/v5.0.1...v5.0.2