From 4d1dd82caa3599fb48954a53396de2cd7c023218 Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Mon, 21 Apr 2025 17:37:18 +0200
Subject: [PATCH 01/31] Increment version to 5.7.1 (used for pre-release builds
from ci)
---
Directory.Build.props | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Directory.Build.props b/Directory.Build.props
index 05d57e58b..5f4e71ab7 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -9,7 +9,7 @@
Recommended$(MSBuildThisFileDirectory)CodingGuidelines.ruleset$(MSBuildThisFileDirectory)tests.runsettings
- 5.7.0
+ 5.7.1pre1direct
From c76ecdb2b64d7cdf7d92411849cdb9a13843f072 Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Mon, 21 Apr 2025 17:39:18 +0200
Subject: [PATCH 02/31] Add prerelease switch to OpenAPI docs
---
docs/usage/openapi-client.md | 6 +++---
docs/usage/openapi.md | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/usage/openapi-client.md b/docs/usage/openapi-client.md
index c0717d47c..58b9ca87e 100644
--- a/docs/usage/openapi-client.md
+++ b/docs/usage/openapi-client.md
@@ -19,7 +19,7 @@ For C# clients, we provide an additional package that provides workarounds for b
To add it to your project, run the following command:
```
-dotnet add package JsonApiDotNetCore.OpenApi.Client.NSwag
+dotnet add package JsonApiDotNetCore.OpenApi.Client.NSwag --prerelease
```
# [Kiota](#tab/kiota)
@@ -28,7 +28,7 @@ For C# clients, we provide an additional package that provides workarounds for b
To add it to your project, run the following command:
```
-dotnet add package JsonApiDotNetCore.OpenApi.Client.Kiota
+dotnet add package JsonApiDotNetCore.OpenApi.Client.Kiota --prerelease
```
---
@@ -60,7 +60,7 @@ The following steps describe how to generate and use a JSON:API client in C#, co
1. Add our client package to your project:
```
- dotnet add package JsonApiDotNetCore.OpenApi.Client.NSwag
+ dotnet add package JsonApiDotNetCore.OpenApi.Client.NSwag --prerelease
```
1. Add code that calls one of your JSON:API endpoints.
diff --git a/docs/usage/openapi.md b/docs/usage/openapi.md
index e49f120a1..ae3a0b68e 100644
--- a/docs/usage/openapi.md
+++ b/docs/usage/openapi.md
@@ -15,7 +15,7 @@ provides OpenAPI support for JSON:API by integrating with [Swashbuckle](https://
1. Install the `JsonApiDotNetCore.OpenApi.Swashbuckle` NuGet package:
```
- dotnet add package JsonApiDotNetCore.OpenApi.Swashbuckle
+ dotnet add package JsonApiDotNetCore.OpenApi.Swashbuckle --prerelease
```
> [!NOTE]
From 4da3f25ad491494455f6b4eee813adf7cc28e035 Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Tue, 22 Apr 2025 08:39:03 +0200
Subject: [PATCH 03/31] Reorganize README, documentation updates (#1718)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Reorganize README (fix #1567)
* Update README.md
Co-authored-by: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
* Documentation updates
* Reverse version table and update
* Use collapsed section for JSON response
---------
Co-authored-by: Grégoire
---
LICENSE | 1 +
PackageReadme.md | 4 +-
README.md | 260 ++++++++++++++----
docs/home/index.html | 26 +-
.../JsonApiDotNetCore.Annotations.csproj | 2 +-
...onApiDotNetCore.OpenApi.Swashbuckle.csproj | 2 +-
.../JsonApiDotNetCore.SourceGenerators.csproj | 2 +-
.../JsonApiDotNetCore.csproj | 2 +-
8 files changed, 221 insertions(+), 78 deletions(-)
diff --git a/LICENSE b/LICENSE
index 9bab1d270..c49362c46 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,5 @@
Copyright (c) 2017 Jared Nance
+Copyright (c) 2020 Bart Koelman
MIT License
diff --git a/PackageReadme.md b/PackageReadme.md
index a6d0017f6..5bb1ac534 100644
--- a/PackageReadme.md
+++ b/PackageReadme.md
@@ -1,5 +1,5 @@
-A framework for building [JSON:API](https://jsonapi.org/) compliant REST APIs using .NET Core and Entity Framework Core. Includes support for [Atomic Operations](https://jsonapi.org/ext/atomic/).
+A framework for building [JSON:API](https://jsonapi.org/) compliant REST APIs using ASP.NET Core and Entity Framework Core. Includes support for the [Atomic Operations](https://jsonapi.org/ext/atomic/) extension.
-The ultimate goal of this library is to eliminate as much boilerplate as possible by offering out-of-the-box features such as sorting, filtering and pagination. You just need to focus on defining the resources and implementing your custom business logic. This library has been designed around dependency injection, making extensibility incredibly easy.
+The ultimate goal of this library is to eliminate as much boilerplate as possible by offering out-of-the-box features, such as sorting, filtering, pagination, sparse fieldset selection, and side-loading related resources. You just need to focus on defining the resources and implementing your custom business logic. This library has been designed around dependency injection, making extensibility incredibly easy.
For more information, visit [www.jsonapi.net](https://www.jsonapi.net/).
diff --git a/README.md b/README.md
index d01f0b2dc..af29c1a68 100644
--- a/README.md
+++ b/README.md
@@ -1,73 +1,207 @@
# JsonApiDotNetCore
-A framework for building [JSON:API](https://jsonapi.org/) compliant REST APIs using .NET Core and Entity Framework Core. Includes support for [Atomic Operations](https://jsonapi.org/ext/atomic/).
[](https://github.com/json-api-dotnet/JsonApiDotNetCore/actions/workflows/build.yml?query=branch%3Amaster)
[](https://codecov.io/gh/json-api-dotnet/JsonApiDotNetCore)
[](https://www.nuget.org/packages/JsonApiDotNetCore/)
+[](LICENSE)
[](https://gitter.im/json-api-dotnet-core/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[](https://www.firsttimersonly.com/)
-The ultimate goal of this library is to eliminate as much boilerplate as possible by offering out-of-the-box features such as sorting, filtering and pagination. You just need to focus on defining the resources and implementing your custom business logic. This library has been designed around dependency injection, making extensibility incredibly easy.
+A framework for building [JSON:API](https://jsonapi.org/) compliant REST APIs using ASP.NET Core and Entity Framework Core. Includes support for the [Atomic Operations](https://jsonapi.org/ext/atomic/) extension.
-## Getting Started
+The ultimate goal of this library is to eliminate as much boilerplate as possible by offering out-of-the-box features, such as sorting, filtering, pagination, sparse fieldset selection, and side-loading related resources. You just need to focus on defining the resources and implementing your custom business logic. This library has been designed around dependency injection, making extensibility incredibly easy.
-These are some steps you can take to help you understand what this project is and how you can use it:
+> [!NOTE]
+> OpenAPI support is now [available](https://www.jsonapi.net/usage/openapi.html), currently in preview. Give it a try!
-### About
-- [What is JSON:API and why should I use it?](https://nordicapis.com/the-benefits-of-using-json-api/) (blog, 2017)
-- [Pragmatic JSON:API Design](https://www.youtube.com/watch?v=3jBJOga4e2Y) (video, 2017)
-- [JSON:API and JsonApiDotNetCore](https://www.youtube.com/watch?v=79Oq0HOxyeI) (video, 2021)
-- [JsonApiDotNetCore Release 4.0](https://dev.to/wunki/getting-started-5dkl) (blog, 2020)
-- [JSON:API, .Net Core, EmberJS](https://youtu.be/KAMuo6K7VcE) (video, 2017)
-- [Embercasts: Full Stack Ember with ASP.NET Core](https://www.embercasts.com/course/full-stack-ember-with-dotnet/watch/whats-in-this-course-cs) (paid course, 2017)
+## Getting started
-### Official documentation
-- [The JSON:API specification](https://jsonapi.org/format/)
-- [JsonApiDotNetCore website](https://www.jsonapi.net/)
-- [Roadmap](ROADMAP.md)
+The following steps describe how to create a JSON:API project.
-## Related Projects
+1. Install the JsonApiDotNetCore package, along with your preferred Entity Framework Core provider:
+ ```bash
+ dotnet add package JsonApiDotNetCore
+ dotnet add package Microsoft.EntityFrameworkCore.Sqlite
+ ```
-- [Performance Reports](https://github.com/json-api-dotnet/PerformanceReports)
-- [JsonApiDotNetCore.MongoDb](https://github.com/json-api-dotnet/JsonApiDotNetCore.MongoDb)
-- [Ember.js Todo List App](https://github.com/json-api-dotnet/TodoListExample)
+1. Declare your entities, annotated with JsonApiDotNetCore attributes:
+ ```c#
+ #nullable enable
+
+ [Resource]
+ public class Person : Identifiable
+ {
+ [Attr] public string? FirstName { get; set; }
+ [Attr] public string LastName { get; set; } = null!;
+ [HasMany] public ISet Children { get; set; } = new HashSet();
+ }
+ ```
-## Examples
+1. Define your `DbContext`, seeding the database with sample data:
+ ```c#
+ public class AppDbContext(DbContextOptions options) : DbContext(options)
+ {
+ public DbSet People => Set();
+
+ protected override void OnConfiguring(DbContextOptionsBuilder builder)
+ {
+ builder.UseSqlite("Data Source=SampleDb.db");
+ builder.UseAsyncSeeding(async (dbContext, _, cancellationToken) =>
+ {
+ dbContext.Set().Add(new Person
+ {
+ FirstName = "John",
+ LastName = "Doe",
+ Children =
+ {
+ new Person
+ {
+ FirstName = "Baby",
+ LastName = "Doe"
+ }
+ }
+ });
+ await dbContext.SaveChangesAsync(cancellationToken);
+ });
+ }
+ }
+ ```
-See the [examples](https://github.com/json-api-dotnet/JsonApiDotNetCore/tree/master/src/Examples) directory for up-to-date sample applications. There is also a [Todo List App](https://github.com/json-api-dotnet/TodoListExample) that includes a JsonApiDotNetCore API and an EmberJs client.
+1. Configure Entity Framework Core and JsonApiDotNetCore in `Program.cs`:
+ ```c#
+ var builder = WebApplication.CreateBuilder(args);
+ builder.Services.AddDbContext();
+ builder.Services.AddJsonApi(options =>
+ {
+ options.UseRelativeLinks = true;
+ options.IncludeTotalResourceCount = true;
+ });
+
+ var app = builder.Build();
+ app.UseRouting();
+ app.UseJsonApi();
+ app.MapControllers();
+ await CreateDatabaseAsync(app.Services);
+ app.Run();
+
+ static async Task CreateDatabaseAsync(IServiceProvider serviceProvider)
+ {
+ await using var scope = serviceProvider.CreateAsyncScope();
+ var dbContext = scope.ServiceProvider.GetRequiredService();
+ await dbContext.Database.EnsureDeletedAsync();
+ await dbContext.Database.EnsureCreatedAsync();
+ }
+ ```
-## Installation and Usage
+1. Start your API
+ ```bash
+ dotnet run
+ ```
-See [our documentation](https://www.jsonapi.net/) for detailed usage.
+1. Send a GET request to retrieve data:
+ ```bash
+ GET http://localhost:5000/people?filter=equals(firstName,'John')&include=children HTTP/1.1
+ ```
-### Models
+
+ Expand to view the JSON response
+
+ ```json
+ {
+ "links": {
+ "self": "/people?filter=equals(firstName,%27John%27)&include=children",
+ "first": "/people?filter=equals(firstName,%27John%27)&include=children",
+ "last": "/people?filter=equals(firstName,%27John%27)&include=children"
+ },
+ "data": [
+ {
+ "type": "people",
+ "id": "1",
+ "attributes": {
+ "firstName": "John",
+ "lastName": "Doe"
+ },
+ "relationships": {
+ "children": {
+ "links": {
+ "self": "/people/1/relationships/children",
+ "related": "/people/1/children"
+ },
+ "data": [
+ {
+ "type": "people",
+ "id": "2"
+ }
+ ]
+ }
+ },
+ "links": {
+ "self": "/people/1"
+ }
+ }
+ ],
+ "included": [
+ {
+ "type": "people",
+ "id": "2",
+ "attributes": {
+ "firstName": "Baby",
+ "lastName": "Doe"
+ },
+ "relationships": {
+ "children": {
+ "links": {
+ "self": "/people/2/relationships/children",
+ "related": "/people/2/children"
+ }
+ }
+ },
+ "links": {
+ "self": "/people/2"
+ }
+ }
+ ],
+ "meta": {
+ "total": 1
+ }
+ }
+ ```
-```c#
-#nullable enable
+
-[Resource]
-public class Article : Identifiable
-{
- [Attr]
- public string Name { get; set; } = null!;
-}
-```
+## Learn more
-### Middleware
+The following links explain what this project provides, why it exists, and how you can use it.
-```c#
-// Program.cs
+### About
-builder.Services.AddJsonApi();
+- [What is JSON:API and why should I use it?](https://nordicapis.com/the-benefits-of-using-json-api/) (blog, 2017)
+- [Pragmatic JSON:API Design](https://www.youtube.com/watch?v=3jBJOga4e2Y) (video, 2017)
+- [JSON:API and JsonApiDotNetCore](https://www.youtube.com/watch?v=79Oq0HOxyeI) (video, 2021)
+- [JsonApiDotNetCore Release 4.0](https://dev.to/wunki/getting-started-5dkl) (blog, 2020)
+- [JSON:API, ASP.NET Core, EmberJS](https://youtu.be/KAMuo6K7VcE) (video, 2017)
+- [Embercasts: Full Stack Ember with ASP.NET Core](https://www.embercasts.com/course/full-stack-ember-with-dotnet/watch/whats-in-this-course-cs) (paid course, 2017)
-// ...
+### Official documentation
-app.UseRouting();
-app.UseJsonApi();
-app.MapControllers();
-```
+- [JsonApiDotNetCore documentation](https://www.jsonapi.net/)
+- [The JSON:API specification](https://jsonapi.org/format/)
+- [JsonApiDotNetCore roadmap](ROADMAP.md)
+
+### Samples
+
+- The [examples](https://github.com/json-api-dotnet/JsonApiDotNetCore/tree/master/src/Examples) directory provides ready-to-run sample API projects
+- Many advanced use cases are covered by integration tests, which can be found [here](https://github.com/json-api-dotnet/JsonApiDotNetCore/tree/master/test/JsonApiDotNetCoreTests/IntegrationTests).
+ This includes topics such as batching, multi-tenancy, authorization, soft-deletion, obfuscated IDs, resource inheritance, alternate routing, custom metadata, error handling and logging.
+- The [Ember.js Todo List App](https://github.com/json-api-dotnet/TodoListExample) showcases a JsonApiDotNetCore API and an Ember.js client with token authentication.
+
+### Related projects
+
+- [JsonApiDotNetCore.MongoDb](https://github.com/json-api-dotnet/JsonApiDotNetCore.MongoDb)
+- [Ember.js Todo List App](https://github.com/json-api-dotnet/TodoListExample)
+- [Performance Reports](https://github.com/json-api-dotnet/PerformanceReports)
## Compatibility
@@ -76,23 +210,21 @@ See also our [versioning policy](./VERSIONING_POLICY.md).
| JsonApiDotNetCore | Status | .NET | Entity Framework Core |
| ----------------- | ------------ | -------- | --------------------- |
-| 3.x | Stable | Core 2.x | 2.x |
-| 4.x | Stable | Core 3.1 | 3.1, 5 |
-| | | 5 | 5 |
-| | | 6 | 5 |
-| 5.0.0-5.0.2 | Stable | 6 | 6 |
-| 5.0.3-5.4.0 | Stable | 6 | 6, 7 |
-| | | 7 | 7 |
-| 5.5+ | Stable | 6 | 6, 7 |
-| | | 7 | 7 |
+| master | Preview | 9 | 9 |
| | | 8 | 8, 9 |
-| | | 9 | 9 |
-| master | Preview | 8 | 8, 9 |
-| | | 9 | 9 |
-
-## Contributing
-
-Have a question, found a bug or want to submit code changes? See our [contributing guidelines](./.github/CONTRIBUTING.md).
+| 5.7.0+ | Stable | 9 | 9 |
+| | | 8 | 8, 9 |
+| 5.5.0-5.6.0 | Stable | 9 | 9 |
+| | | 8 | 8, 9 |
+| | | 7 | 7 |
+| | | 6 | 6, 7 |
+| 5.0.3-5.4.0 | Stable | 7 | 7 |
+| | | 6 | 6, 7 |
+| 5.0.0-5.0.2 | Stable | 6 | 6 |
+| 4.x | Stable | 6 | 5 |
+| | | 5 | 5 |
+| | | Core 3.1 | 3.1, 5 |
+| 3.x | Stable | Core 2.x | 2.x |
## Trying out the latest build
@@ -115,7 +247,11 @@ To try it out, follow the steps below:
and retry with the `--store-password-in-clear-text` switch added.
1. Restart your IDE, open your project, and browse the list of packages from the github-json-api feed (make sure pre-release packages are included).
-## Development
+## Contributing
+
+Have a question, found a bug or want to submit code changes? See our [contributing guidelines](./.github/CONTRIBUTING.md).
+
+## Build from source
To build the code from this repository locally, run:
@@ -123,7 +259,7 @@ To build the code from this repository locally, run:
dotnet build
```
-Running tests locally requires access to a PostgreSQL database. If you have docker installed, this can be propped up via:
+Running tests locally requires access to a PostgreSQL database. If you have docker installed, this can started via:
```bash
pwsh run-docker-postgres.ps1
@@ -143,5 +279,9 @@ pwsh Build.ps1
## Sponsors
+We are very grateful to the sponsors below, who have provided us with a no-cost license for their tools.
+
+
+Do you like this project? Consider to [sponsor](https://github.com/sponsors/json-api-dotnet), or just reward us by giving our repository a star.
diff --git a/docs/home/index.html b/docs/home/index.html
index e21d52ee9..1593c915d 100644
--- a/docs/home/index.html
+++ b/docs/home/index.html
@@ -4,7 +4,7 @@
JsonApiDotNetCore documentation
-
+
@@ -12,7 +12,7 @@
-
+
@@ -51,8 +51,8 @@
JsonApiDotNetCore
- A framework for building JSON:API compliant REST APIs using .NET Core and Entity Framework Core.
- Includes support for Atomic Operations.
+ A framework for building JSON:API compliant REST APIs using ASP.NET Core and Entity Framework Core.
+ Includes support for the Atomic Operations extension.
We strive to eliminate as much boilerplate as possible by offering out-of-the-box features such as sorting, filtering and pagination.
+
+ The ultimate goal of this library is to eliminate as much boilerplate as possible by offering out-of-the-box features, such as sorting, filtering, pagination, sparse fieldset selection, and side-loading related resources.
+
@@ -112,7 +114,7 @@
Filtering
Sorting
-
Order resources on one or multiple attributes using the sort query string parameter
+
Order resources on multiple attributes using the sort query string parameter
@@ -174,7 +176,7 @@
Example usage
Resource
-#nullable enable
+#nullable enable
public class Article : Identifiable<long>
{
@@ -213,7 +215,7 @@
Resource
Request
-
GET /articles?filter=contains(summary,'web')&sort=-lastModifiedAt&fields[articles]=title,summary&include=author HTTP/1.1
+
GET /articles?filter=contains(summary,'web')&sort=-lastModifiedAt&fields[articles]=title,summary&include=author HTTP/1.1
@@ -223,14 +225,14 @@
Request
Response
-{
+{
"meta": {
"totalResources": 1
},
"links": {
- "self": "/articles?filter=contains(summary,'web')&sort=-lastModifiedAt&fields%5Barticles%5D=title,summary&include=author",
- "first": "/articles?filter=contains(summary,'web')&sort=-lastModifiedAt&fields%5Barticles%5D=title,summary&include=author",
- "last": "/articles?filter=contains(summary,'web')&sort=-lastModifiedAt&fields%5Barticles%5D=title,summary&include=author"
+ "self": "/articles?filter=contains(summary,'web')&sort=-lastModifiedAt&fields%5Barticles%5D=title,summary&include=author",
+ "first": "/articles?filter=contains(summary,'web')&sort=-lastModifiedAt&fields%5Barticles%5D=title,summary&include=author",
+ "last": "/articles?filter=contains(summary,'web')&sort=-lastModifiedAt&fields%5Barticles%5D=title,summary&include=author"
},
"data": [
{
diff --git a/src/JsonApiDotNetCore.Annotations/JsonApiDotNetCore.Annotations.csproj b/src/JsonApiDotNetCore.Annotations/JsonApiDotNetCore.Annotations.csproj
index 765c4231d..ed36e0797 100644
--- a/src/JsonApiDotNetCore.Annotations/JsonApiDotNetCore.Annotations.csproj
+++ b/src/JsonApiDotNetCore.Annotations/JsonApiDotNetCore.Annotations.csproj
@@ -10,7 +10,7 @@
jsonapidotnetcore;jsonapi;json:api;dotnet;asp.net;rest;web-api
- Annotations for JsonApiDotNetCore, a framework for building JSON:API compliant REST APIs using ASP.NET and Entity Framework Core.
+ Annotations for JsonApiDotNetCore, which is a framework for building JSON:API compliant REST APIs using ASP.NET Core and Entity Framework Core.json-api-dotnethttps://www.jsonapi.net/MIT
diff --git a/src/JsonApiDotNetCore.OpenApi.Swashbuckle/JsonApiDotNetCore.OpenApi.Swashbuckle.csproj b/src/JsonApiDotNetCore.OpenApi.Swashbuckle/JsonApiDotNetCore.OpenApi.Swashbuckle.csproj
index 89822ff4b..4a57ca1c8 100644
--- a/src/JsonApiDotNetCore.OpenApi.Swashbuckle/JsonApiDotNetCore.OpenApi.Swashbuckle.csproj
+++ b/src/JsonApiDotNetCore.OpenApi.Swashbuckle/JsonApiDotNetCore.OpenApi.Swashbuckle.csproj
@@ -11,7 +11,7 @@
$(VersionPrefix)-preview.$(OpenApiPreviewNumber)jsonapidotnetcore;jsonapi;json:api;dotnet;asp.net;rest;web-api;openapi;swagger;swaggerui;swashbuckle
- A Swashbuckle integration that enables you to describe a JsonApiDotNetCore API with an OpenAPI specification.
+ Provides OpenAPI document generation for JsonApiDotNetCore APIs by using Swashbuckle.json-api-dotnethttps://www.jsonapi.net/MIT
diff --git a/src/JsonApiDotNetCore.SourceGenerators/JsonApiDotNetCore.SourceGenerators.csproj b/src/JsonApiDotNetCore.SourceGenerators/JsonApiDotNetCore.SourceGenerators.csproj
index 8f9e397df..db6f039bd 100644
--- a/src/JsonApiDotNetCore.SourceGenerators/JsonApiDotNetCore.SourceGenerators.csproj
+++ b/src/JsonApiDotNetCore.SourceGenerators/JsonApiDotNetCore.SourceGenerators.csproj
@@ -12,7 +12,7 @@
jsonapidotnetcore;jsonapi;json:api;dotnet;asp.net;rest;web-api
- Source generators for JsonApiDotNetCore, a framework for building JSON:API compliant REST APIs using ASP.NET and Entity Framework Core.
+ Source generators for JsonApiDotNetCore, which is a framework for building JSON:API compliant REST APIs using ASP.NET Core and Entity Framework Core.json-api-dotnethttps://www.jsonapi.net/MIT
diff --git a/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj b/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj
index 1c1ba7ab7..d36600e87 100644
--- a/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj
+++ b/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj
@@ -9,7 +9,7 @@
jsonapidotnetcore;jsonapi;json:api;dotnet;asp.net;rest;web-api
- A framework for building JSON:API compliant REST APIs using ASP.NET and Entity Framework Core. Includes support for Atomic Operations. The ultimate goal of this library is to eliminate as much boilerplate as possible by offering out-of-the-box features such as sorting, filtering and pagination. You just need to focus on defining the resources and implementing your custom business logic. This library has been designed around dependency injection making extensibility incredibly easy.
+ A framework for building JSON:API compliant REST APIs using ASP.NET Core and Entity Framework Core. Includes support for the Atomic Operations extension. The ultimate goal of this library is to eliminate as much boilerplate as possible by offering out-of-the-box features, such as sorting, filtering, pagination, sparse fieldset selection, and side-loading related resources. You just need to focus on defining the resources and implementing your custom business logic. This library has been designed around dependency injection, making extensibility incredibly easy.json-api-dotnethttps://www.jsonapi.net/MIT
From ecc07591c8a90368f7408e4769e22134f6f116aa Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Wed, 23 Apr 2025 01:30:24 +0200
Subject: [PATCH 04/31] Remove outdated install note
---
docs/usage/openapi.md | 4 ----
1 file changed, 4 deletions(-)
diff --git a/docs/usage/openapi.md b/docs/usage/openapi.md
index ae3a0b68e..83f3ce8a3 100644
--- a/docs/usage/openapi.md
+++ b/docs/usage/openapi.md
@@ -18,10 +18,6 @@ provides OpenAPI support for JSON:API by integrating with [Swashbuckle](https://
dotnet add package JsonApiDotNetCore.OpenApi.Swashbuckle --prerelease
```
- > [!NOTE]
- > Because this package is still experimental, it's not yet available on NuGet.
- > Use the steps [here](https://github.com/json-api-dotnet/JsonApiDotNetCore?tab=readme-ov-file#trying-out-the-latest-build) to install.
-
2. Add the JSON:API support to your `Program.cs` file.
```c#
From 3ad189de365d506b37562dbbd9829b637bee44eb Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Wed, 23 Apr 2025 05:53:05 +0200
Subject: [PATCH 05/31] Publish packages to feedz.io (#1719)
* Publish packages to feedz.io
* Remove duplicate warning suppression
* Update feed instructions in README
---
.github/workflows/build.yml | 8 ++++++++
Directory.Build.props | 1 -
README.md | 25 +++++++++++--------------
3 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 7ee1333bd..bc38da9f3 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -270,6 +270,14 @@ jobs:
run: |
dotnet nuget add source --username 'json-api-dotnet' --password "$env:GITHUB_TOKEN" --store-password-in-clear-text --name 'github' 'https://nuget.pkg.github.com/json-api-dotnet/index.json'
dotnet nuget push "$env:GITHUB_WORKSPACE/packages/*.nupkg" --api-key "$env:GITHUB_TOKEN" --source 'github'
+ - name: Publish to feedz.io
+ if: github.event_name == 'push' || github.event_name == 'release'
+ env:
+ FEEDZ_IO_API_KEY: ${{ secrets.FEEDZ_IO_API_KEY }}
+ shell: pwsh
+ run: |
+ dotnet nuget add source --name 'feedz-io' 'https://f.feedz.io/json-api-dotnet/jsonapidotnetcore/nuget/index.json'
+ dotnet nuget push "$env:GITHUB_WORKSPACE/packages/*.nupkg" --api-key "$env:FEEDZ_IO_API_KEY" --source 'feedz-io'
- name: Publish documentation
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: peaceiris/actions-gh-pages@v4
diff --git a/Directory.Build.props b/Directory.Build.props
index 5f4e71ab7..425f6320c 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -13,7 +13,6 @@
pre1direct
- $(NoWarn);NETSDK1215
diff --git a/README.md b/README.md
index af29c1a68..fb58acf05 100644
--- a/README.md
+++ b/README.md
@@ -228,24 +228,21 @@ See also our [versioning policy](./VERSIONING_POLICY.md).
## Trying out the latest build
-After each commit to the master branch, a new pre-release NuGet package is automatically published to [GitHub Packages](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry).
+After each commit to the master branch, a new pre-release NuGet package is automatically published to [feedz.io](https://feedz.io/docs/package-types/nuget).
To try it out, follow the steps below:
-1. [Create a Personal Access Token (classic)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic) with at least `read:packages` scope.
-1. Add our package source to your local user-specific `nuget.config` file by running:
- ```bash
- dotnet nuget add source https://nuget.pkg.github.com/json-api-dotnet/index.json --name github-json-api --username YOUR-GITHUB-USERNAME --password YOUR-PAT-CLASSIC
+1. Create a `nuget.config` file in the same directory as your .sln file, with the following contents:
+ ```xml
+
+
+
+
+
+
+
```
- In the command above:
- - Replace YOUR-GITHUB-USERNAME with the username you use to login your GitHub account.
- - Replace YOUR-PAT-CLASSIC with the token your created above.
- :warning: If the above command doesn't give you access in the next step, remove the package source by running:
- ```bash
- dotnet nuget remove source github-json-api
- ```
- and retry with the `--store-password-in-clear-text` switch added.
-1. Restart your IDE, open your project, and browse the list of packages from the github-json-api feed (make sure pre-release packages are included).
+1. In your IDE, browse the list of packages from the `json-api-dotnet` feed. Make sure pre-release packages are included in the list.
## Contributing
From a0877ab8ab894a23ca68f2112480f7e5c653adee Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Fri, 25 Apr 2025 01:11:13 +0200
Subject: [PATCH 06/31] Property detect collection element type for custom
collection types that have no or multiple type parameters (#1720)
---
.../CollectionConverter.cs | 15 ++-
.../Configuration/ResourceGraphBuilder.cs | 12 +-
.../CollectionConverterTests.cs | 104 ++++++++++++++++++
3 files changed, 118 insertions(+), 13 deletions(-)
create mode 100644 test/JsonApiDotNetCoreTests/UnitTests/TypeConversion/CollectionConverterTests.cs
diff --git a/src/JsonApiDotNetCore.Annotations/CollectionConverter.cs b/src/JsonApiDotNetCore.Annotations/CollectionConverter.cs
index cbf834b63..683e34764 100644
--- a/src/JsonApiDotNetCore.Annotations/CollectionConverter.cs
+++ b/src/JsonApiDotNetCore.Annotations/CollectionConverter.cs
@@ -104,17 +104,26 @@ public IReadOnlyCollection ExtractResources(object? value)
///
public Type? FindCollectionElementType(Type? type)
{
- if (type is { IsGenericType: true, GenericTypeArguments.Length: 1 })
+ if (type != null)
{
- if (type.IsOrImplementsInterface())
+ Type? enumerableClosedType = IsEnumerableClosedType(type) ? type : null;
+ enumerableClosedType ??= type.GetInterfaces().FirstOrDefault(IsEnumerableClosedType);
+
+ if (enumerableClosedType != null)
{
- return type.GenericTypeArguments[0];
+ return enumerableClosedType.GenericTypeArguments[0];
}
}
return null;
}
+ private static bool IsEnumerableClosedType(Type type)
+ {
+ bool isClosedType = type is { IsGenericType: true, ContainsGenericParameters: false };
+ return isClosedType && type.GetGenericTypeDefinition() == typeof(IEnumerable<>);
+ }
+
///
/// Indicates whether a instance can be assigned to the specified type, for example:
/// GetEagerLoads(Type resourceClrTyp
continue;
}
- Type innerType = TypeOrElementType(property.PropertyType);
- eagerLoad.Children = GetEagerLoads(innerType, recursionDepth + 1);
+ Type rightType = CollectionConverter.Instance.FindCollectionElementType(property.PropertyType) ?? property.PropertyType;
+ eagerLoad.Children = GetEagerLoads(rightType, recursionDepth + 1);
eagerLoad.Property = property;
eagerLoads.Add(eagerLoad);
@@ -459,14 +459,6 @@ private static void AssertNoInfiniteRecursion(int recursionDepth)
}
}
- private Type TypeOrElementType(Type type)
- {
- Type[] interfaces = type.GetInterfaces().Where(@interface => @interface.IsGenericType && @interface.GetGenericTypeDefinition() == typeof(IEnumerable<>))
- .ToArray();
-
- return interfaces.Length == 1 ? interfaces.Single().GenericTypeArguments[0] : type;
- }
-
private string FormatResourceName(Type resourceClrType)
{
var formatter = new ResourceNameFormatter(_options.SerializerOptions.PropertyNamingPolicy);
diff --git a/test/JsonApiDotNetCoreTests/UnitTests/TypeConversion/CollectionConverterTests.cs b/test/JsonApiDotNetCoreTests/UnitTests/TypeConversion/CollectionConverterTests.cs
new file mode 100644
index 000000000..1f679912b
--- /dev/null
+++ b/test/JsonApiDotNetCoreTests/UnitTests/TypeConversion/CollectionConverterTests.cs
@@ -0,0 +1,104 @@
+using FluentAssertions;
+using JsonApiDotNetCore;
+using Xunit;
+
+namespace JsonApiDotNetCoreTests.UnitTests.TypeConversion;
+
+public sealed class CollectionConverterTests
+{
+ [Fact]
+ public void Finds_element_type_for_generic_list()
+ {
+ // Arrange
+ Type sourceType = typeof(List);
+
+ // Act
+ Type? elementType = CollectionConverter.Instance.FindCollectionElementType(sourceType);
+
+ // Assert
+ elementType.Should().Be();
+ }
+
+ [Fact]
+ public void Finds_element_type_for_generic_enumerable()
+ {
+ // Arrange
+ Type sourceType = typeof(IEnumerable);
+
+ // Act
+ Type? elementType = CollectionConverter.Instance.FindCollectionElementType(sourceType);
+
+ // Assert
+ elementType.Should().Be();
+ }
+
+ [Fact]
+ public void Finds_element_type_for_custom_generic_collection_with_multiple_type_parameters()
+ {
+ // Arrange
+ Type sourceType = typeof(CustomCollection);
+
+ // Act
+ Type? elementType = CollectionConverter.Instance.FindCollectionElementType(sourceType);
+
+ // Assert
+ elementType.Should().Be();
+ }
+
+ [Fact]
+ public void Finds_element_type_for_custom_non_generic_collection()
+ {
+ // Arrange
+ Type sourceType = typeof(CustomCollectionOfIntString);
+
+ // Act
+ Type? elementType = CollectionConverter.Instance.FindCollectionElementType(sourceType);
+
+ // Assert
+ elementType.Should().Be();
+ }
+
+ [Fact]
+ public void Finds_no_element_type_for_non_generic_type()
+ {
+ // Arrange
+ Type sourceType = typeof(int);
+
+ // Act
+ Type? elementType = CollectionConverter.Instance.FindCollectionElementType(sourceType);
+
+ // Assert
+ elementType.Should().BeNull();
+ }
+
+ [Fact]
+ public void Finds_no_element_type_for_non_collection_generic_type()
+ {
+ // Arrange
+ Type sourceType = typeof(Tuple);
+
+ // Act
+ Type? elementType = CollectionConverter.Instance.FindCollectionElementType(sourceType);
+
+ // Assert
+ elementType.Should().BeNull();
+ }
+
+ [Fact]
+ public void Finds_no_element_type_for_unbound_generic_type()
+ {
+ // Arrange
+ Type sourceType = typeof(List<>);
+
+ // Act
+ Type? elementType = CollectionConverter.Instance.FindCollectionElementType(sourceType);
+
+ // Assert
+ elementType.Should().BeNull();
+ }
+
+ // ReSharper disable once UnusedTypeParameter
+ private class CustomCollection : List;
+
+ private sealed class CustomCollectionOfIntString : CustomCollection;
+}
From ba20f0f5d922b4ea4cf108677cd0d43c1b017c9f Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Fri, 25 Apr 2025 02:10:54 +0200
Subject: [PATCH 07/31] Fixed: build error after adding reference to
JADNC.Kiota package (#1721)
* Fixed: build error after adding reference to JADNC.Kiota package, without any kiota references in project file yet
* Increment OpenAPI preview number
---
Directory.Build.props | 2 +-
.../Build/JsonApiDotNetCore.OpenApi.Client.Kiota.targets | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Directory.Build.props b/Directory.Build.props
index 425f6320c..7fc6d42c5 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -11,7 +11,7 @@
$(MSBuildThisFileDirectory)tests.runsettings5.7.1pre
- 1
+ 2direct
diff --git a/src/JsonApiDotNetCore.OpenApi.Client.Kiota/Build/JsonApiDotNetCore.OpenApi.Client.Kiota.targets b/src/JsonApiDotNetCore.OpenApi.Client.Kiota/Build/JsonApiDotNetCore.OpenApi.Client.Kiota.targets
index 72b32aa7a..44586a10a 100644
--- a/src/JsonApiDotNetCore.OpenApi.Client.Kiota/Build/JsonApiDotNetCore.OpenApi.Client.Kiota.targets
+++ b/src/JsonApiDotNetCore.OpenApi.Client.Kiota/Build/JsonApiDotNetCore.OpenApi.Client.Kiota.targets
@@ -149,8 +149,8 @@
-
+
<_WildcardGroup Include="%2A%2A/%2A.cs">
%(KiotaReference._NonEmptyOutputPath)
From 6f9861b80f0e7e722cc36c962afad219502ebde6 Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Fri, 25 Apr 2025 04:26:51 +0200
Subject: [PATCH 08/31] Use https in external links (docs and schema refs)
(#1722)
---
.github/ISSUE_TEMPLATE/question.md | 2 +-
docs/usage/meta.md | 4 ++--
src/Examples/DapperExample/Properties/launchSettings.json | 2 +-
.../DatabasePerTenantExample/Properties/launchSettings.json | 2 +-
src/Examples/GettingStarted/Properties/launchSettings.json | 2 +-
src/Examples/GettingStarted/README.md | 3 +--
.../JsonApiDotNetCoreExample/Properties/launchSettings.json | 2 +-
.../MultiDbContextExample/Properties/launchSettings.json | 2 +-
.../NoEntityFrameworkExample/Properties/launchSettings.json | 2 +-
.../OpenApiKiotaClientExample/Properties/launchSettings.json | 2 +-
.../OpenApiNSwagClientExample/Properties/launchSettings.json | 2 +-
src/Examples/ReportsExample/Properties/launchSettings.json | 2 +-
12 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md
index 3e3c1ba08..7bf89d4e4 100644
--- a/.github/ISSUE_TEMPLATE/question.md
+++ b/.github/ISSUE_TEMPLATE/question.md
@@ -8,7 +8,7 @@ assignees: ''
---
#### SUMMARY
diff --git a/docs/usage/meta.md b/docs/usage/meta.md
index a115e2574..674d39413 100644
--- a/docs/usage/meta.md
+++ b/docs/usage/meta.md
@@ -60,7 +60,7 @@ public class PersonDefinition : JsonApiResourceDefinition
{
return new Dictionary
{
- ["notice"] = "Check our intranet at http://www.example.com/employees/" +
+ ["notice"] = "Check our intranet at https://www.example.com/employees/" +
$"{person.StringId} for personal details."
};
}
@@ -80,7 +80,7 @@ public class PersonDefinition : JsonApiResourceDefinition
...
},
"meta": {
- "notice": "Check our intranet at http://www.example.com/employees/1 for personal details."
+ "notice": "Check our intranet at https://www.example.com/employees/1 for personal details."
}
}
]
diff --git a/src/Examples/DapperExample/Properties/launchSettings.json b/src/Examples/DapperExample/Properties/launchSettings.json
index 137620d86..0d86e8f61 100644
--- a/src/Examples/DapperExample/Properties/launchSettings.json
+++ b/src/Examples/DapperExample/Properties/launchSettings.json
@@ -1,5 +1,5 @@
{
- "$schema": "http://json.schemastore.org/launchsettings.json",
+ "$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
diff --git a/src/Examples/DatabasePerTenantExample/Properties/launchSettings.json b/src/Examples/DatabasePerTenantExample/Properties/launchSettings.json
index 1ab75296f..43ae84e51 100644
--- a/src/Examples/DatabasePerTenantExample/Properties/launchSettings.json
+++ b/src/Examples/DatabasePerTenantExample/Properties/launchSettings.json
@@ -1,5 +1,5 @@
{
- "$schema": "http://json.schemastore.org/launchsettings.json",
+ "$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
diff --git a/src/Examples/GettingStarted/Properties/launchSettings.json b/src/Examples/GettingStarted/Properties/launchSettings.json
index d806502bc..304c37708 100644
--- a/src/Examples/GettingStarted/Properties/launchSettings.json
+++ b/src/Examples/GettingStarted/Properties/launchSettings.json
@@ -1,5 +1,5 @@
{
- "$schema": "http://json.schemastore.org/launchsettings.json",
+ "$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
diff --git a/src/Examples/GettingStarted/README.md b/src/Examples/GettingStarted/README.md
index 8d8da60bc..4d94ffd82 100644
--- a/src/Examples/GettingStarted/README.md
+++ b/src/Examples/GettingStarted/README.md
@@ -7,8 +7,7 @@
You can verify the project is running by checking this endpoint:
`localhost:14141/api/people`
-For further documentation and implementation of a JsonApiDotNetCore Application see the documentation or GitHub page:
+For further documentation and implementation of a JsonApiDotNetCore application, see the documentation or GitHub page:
Repository: https://github.com/json-api-dotnet/JsonApiDotNetCore
-
Documentation: https://www.jsonapi.net
diff --git a/src/Examples/JsonApiDotNetCoreExample/Properties/launchSettings.json b/src/Examples/JsonApiDotNetCoreExample/Properties/launchSettings.json
index 82b89e184..7c4189f27 100644
--- a/src/Examples/JsonApiDotNetCoreExample/Properties/launchSettings.json
+++ b/src/Examples/JsonApiDotNetCoreExample/Properties/launchSettings.json
@@ -1,5 +1,5 @@
{
- "$schema": "http://json.schemastore.org/launchsettings.json",
+ "$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
diff --git a/src/Examples/MultiDbContextExample/Properties/launchSettings.json b/src/Examples/MultiDbContextExample/Properties/launchSettings.json
index 9d3467265..2cb2d59ca 100644
--- a/src/Examples/MultiDbContextExample/Properties/launchSettings.json
+++ b/src/Examples/MultiDbContextExample/Properties/launchSettings.json
@@ -1,5 +1,5 @@
{
- "$schema": "http://json.schemastore.org/launchsettings.json",
+ "$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
diff --git a/src/Examples/NoEntityFrameworkExample/Properties/launchSettings.json b/src/Examples/NoEntityFrameworkExample/Properties/launchSettings.json
index d1e2e0ca6..e5d1b8837 100644
--- a/src/Examples/NoEntityFrameworkExample/Properties/launchSettings.json
+++ b/src/Examples/NoEntityFrameworkExample/Properties/launchSettings.json
@@ -1,5 +1,5 @@
{
- "$schema": "http://json.schemastore.org/launchsettings.json",
+ "$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
diff --git a/src/Examples/OpenApiKiotaClientExample/Properties/launchSettings.json b/src/Examples/OpenApiKiotaClientExample/Properties/launchSettings.json
index afb5e5dac..142f412e8 100644
--- a/src/Examples/OpenApiKiotaClientExample/Properties/launchSettings.json
+++ b/src/Examples/OpenApiKiotaClientExample/Properties/launchSettings.json
@@ -1,5 +1,5 @@
{
- "$schema": "http://json.schemastore.org/launchsettings.json",
+ "$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"Kestrel": {
"commandName": "Project",
diff --git a/src/Examples/OpenApiNSwagClientExample/Properties/launchSettings.json b/src/Examples/OpenApiNSwagClientExample/Properties/launchSettings.json
index afb5e5dac..142f412e8 100644
--- a/src/Examples/OpenApiNSwagClientExample/Properties/launchSettings.json
+++ b/src/Examples/OpenApiNSwagClientExample/Properties/launchSettings.json
@@ -1,5 +1,5 @@
{
- "$schema": "http://json.schemastore.org/launchsettings.json",
+ "$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"Kestrel": {
"commandName": "Project",
diff --git a/src/Examples/ReportsExample/Properties/launchSettings.json b/src/Examples/ReportsExample/Properties/launchSettings.json
index 7add074ef..83e6baea4 100644
--- a/src/Examples/ReportsExample/Properties/launchSettings.json
+++ b/src/Examples/ReportsExample/Properties/launchSettings.json
@@ -1,5 +1,5 @@
{
- "$schema": "http://json.schemastore.org/launchsettings.json",
+ "$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
From df1935512bbc92f2753a3ffdcd9192ac0cae5631 Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Sat, 26 Apr 2025 02:14:31 +0200
Subject: [PATCH 09/31] Revert accidental binary breaking change
---
.../Queries/Parsing/QueryTokenizer.cs | 24 ++++++++++---------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/src/JsonApiDotNetCore/Queries/Parsing/QueryTokenizer.cs b/src/JsonApiDotNetCore/Queries/Parsing/QueryTokenizer.cs
index 0c5f63437..0e1e7660a 100644
--- a/src/JsonApiDotNetCore/Queries/Parsing/QueryTokenizer.cs
+++ b/src/JsonApiDotNetCore/Queries/Parsing/QueryTokenizer.cs
@@ -1,3 +1,4 @@
+using System.Collections.ObjectModel;
using System.Text;
using JetBrains.Annotations;
@@ -6,17 +7,18 @@ namespace JsonApiDotNetCore.Queries.Parsing;
[PublicAPI]
public sealed class QueryTokenizer
{
- public static readonly Dictionary SingleCharacterToTokenKinds = new()
- {
- ['('] = TokenKind.OpenParen,
- [')'] = TokenKind.CloseParen,
- ['['] = TokenKind.OpenBracket,
- [']'] = TokenKind.CloseBracket,
- ['.'] = TokenKind.Period,
- [','] = TokenKind.Comma,
- [':'] = TokenKind.Colon,
- ['-'] = TokenKind.Minus
- };
+ public static readonly IReadOnlyDictionary SingleCharacterToTokenKinds = new ReadOnlyDictionary(
+ new Dictionary
+ {
+ ['('] = TokenKind.OpenParen,
+ [')'] = TokenKind.CloseParen,
+ ['['] = TokenKind.OpenBracket,
+ [']'] = TokenKind.CloseBracket,
+ ['.'] = TokenKind.Period,
+ [','] = TokenKind.Comma,
+ [':'] = TokenKind.Colon,
+ ['-'] = TokenKind.Minus
+ });
private readonly string _source;
private readonly StringBuilder _textBuffer = new();
From 39668c77b9d417f6293cb9818b1968f5f5b00460 Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Sat, 26 Apr 2025 23:32:46 +0200
Subject: [PATCH 10/31] Move [NotMapped] after field attribute
---
.../IntegrationTests/AtomicOperations/Playlist.cs | 2 +-
.../IntegrationTests/EagerLoading/Building.cs | 6 +++---
.../IntegrationTests/EagerLoading/Street.cs | 6 +++---
.../IntegrationTests/ReadWrite/WorkItem.cs | 2 +-
.../IntegrationTests/ReadWrite/WorkItemGroup.cs | 2 +-
.../ResourceInheritance/Models/AlwaysMovingTandem.cs | 2 +-
.../IntegrationTests/ZeroKeys/Game.cs | 2 +-
7 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Playlist.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Playlist.cs
index e8baf731d..0d6409e76 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Playlist.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Playlist.cs
@@ -12,8 +12,8 @@ public sealed class Playlist : Identifiable
[Attr]
public string Name { get; set; } = null!;
- [NotMapped]
[Attr]
+ [NotMapped]
public bool IsArchived => false;
[HasMany]
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/EagerLoading/Building.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/EagerLoading/Building.cs
index ea3805cb2..78ab51463 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/EagerLoading/Building.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/EagerLoading/Building.cs
@@ -14,12 +14,12 @@ public sealed class Building : Identifiable
[Attr]
public string Number { get; set; } = null!;
- [NotMapped]
[Attr]
+ [NotMapped]
public int WindowCount => Windows.Count;
- [NotMapped]
[Attr(Capabilities = AttrCapabilities.AllowView | AttrCapabilities.AllowChange)]
+ [NotMapped]
public string PrimaryDoorColor
{
get
@@ -50,8 +50,8 @@ public string PrimaryDoorColor
}
}
- [NotMapped]
[Attr(Capabilities = AttrCapabilities.AllowView)]
+ [NotMapped]
public string? SecondaryDoorColor => SecondaryDoor?.Color;
[EagerLoad]
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/EagerLoading/Street.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/EagerLoading/Street.cs
index db440ad85..263bb6cfd 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/EagerLoading/Street.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/EagerLoading/Street.cs
@@ -12,16 +12,16 @@ public sealed class Street : Identifiable
[Attr]
public string Name { get; set; } = null!;
- [NotMapped]
[Attr(Capabilities = AttrCapabilities.AllowView)]
+ [NotMapped]
public int BuildingCount => Buildings.Count;
- [NotMapped]
[Attr(Capabilities = AttrCapabilities.AllowView)]
+ [NotMapped]
public int DoorTotalCount => Buildings.Sum(building => building.SecondaryDoor == null ? 1 : 2);
- [NotMapped]
[Attr(Capabilities = AttrCapabilities.AllowView)]
+ [NotMapped]
public int WindowTotalCount => Buildings.Sum(building => building.WindowCount);
[EagerLoad]
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/ReadWrite/WorkItem.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/ReadWrite/WorkItem.cs
index c722592e8..baf2da12c 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/ReadWrite/WorkItem.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/ReadWrite/WorkItem.cs
@@ -18,8 +18,8 @@ public sealed class WorkItem : Identifiable
[Attr]
public WorkItemPriority Priority { get; set; }
- [NotMapped]
[Attr(Capabilities = AttrCapabilities.All & ~(AttrCapabilities.AllowCreate | AttrCapabilities.AllowChange))]
+ [NotMapped]
public bool IsImportant
{
get => Priority == WorkItemPriority.High;
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/ReadWrite/WorkItemGroup.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/ReadWrite/WorkItemGroup.cs
index 7f132c899..b5b94258f 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/ReadWrite/WorkItemGroup.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/ReadWrite/WorkItemGroup.cs
@@ -15,8 +15,8 @@ public sealed class WorkItemGroup : Identifiable
[Attr]
public bool IsPublic { get; set; }
- [NotMapped]
[Attr]
+ [NotMapped]
public bool IsDeprecated => !string.IsNullOrEmpty(Name) && Name.StartsWith("DEPRECATED:", StringComparison.OrdinalIgnoreCase);
[HasOne]
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/ResourceInheritance/Models/AlwaysMovingTandem.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/ResourceInheritance/Models/AlwaysMovingTandem.cs
index 590e05333..c90aad6ad 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/ResourceInheritance/Models/AlwaysMovingTandem.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/ResourceInheritance/Models/AlwaysMovingTandem.cs
@@ -9,8 +9,8 @@ namespace JsonApiDotNetCoreTests.IntegrationTests.ResourceInheritance.Models;
[Resource(ControllerNamespace = "JsonApiDotNetCoreTests.IntegrationTests.ResourceInheritance", GenerateControllerEndpoints = JsonApiEndpoints.None)]
public sealed class AlwaysMovingTandem : Bike
{
- [NotMapped]
[Attr]
+ [NotMapped]
public Guid LocationToken
{
get => Guid.NewGuid();
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/ZeroKeys/Game.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/ZeroKeys/Game.cs
index 55372d4b0..a983c66d7 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/ZeroKeys/Game.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/ZeroKeys/Game.cs
@@ -13,8 +13,8 @@ public sealed class Game : Identifiable
[Attr]
public string Title { get; set; } = null!;
- [NotMapped]
[Attr]
+ [NotMapped]
public Guid SessionToken => Guid.NewGuid();
[HasOne]
From 049ed69f23a3bbc20d88f5f881f09195ec34293d Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Sat, 26 Apr 2025 23:33:01 +0200
Subject: [PATCH 11/31] Add missing null check
---
test/TestBuildingBlocks/ServiceCollectionExtensions.cs | 1 +
1 file changed, 1 insertion(+)
diff --git a/test/TestBuildingBlocks/ServiceCollectionExtensions.cs b/test/TestBuildingBlocks/ServiceCollectionExtensions.cs
index 8e5102fa2..886a5f0fb 100644
--- a/test/TestBuildingBlocks/ServiceCollectionExtensions.cs
+++ b/test/TestBuildingBlocks/ServiceCollectionExtensions.cs
@@ -10,6 +10,7 @@ internal static class ServiceCollectionExtensions
public static void ReplaceControllers(this IServiceCollection services, TestControllerProvider provider)
{
ArgumentNullException.ThrowIfNull(services);
+ ArgumentNullException.ThrowIfNull(provider);
services.AddMvcCore().ConfigureApplicationPartManager(manager =>
{
From 6321a1a597712d1b085e1d363a5201a6923413ca Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Sat, 26 Apr 2025 23:33:19 +0200
Subject: [PATCH 12/31] Simplify single-line lambda
---
.../IntegrationTests/Meta/TopLevelCountTests.cs | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/Meta/TopLevelCountTests.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/Meta/TopLevelCountTests.cs
index 5a72d4af8..aa4eb0659 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/Meta/TopLevelCountTests.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/Meta/TopLevelCountTests.cs
@@ -83,10 +83,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
public async Task Renders_resource_count_for_empty_collection()
{
// Arrange
- await _testContext.RunOnDatabaseAsync(async dbContext =>
- {
- await dbContext.ClearTableAsync();
- });
+ await _testContext.RunOnDatabaseAsync(async dbContext => await dbContext.ClearTableAsync());
const string route = "/supportTickets";
From 7a59c74dcd8d39857f902b1efef2183dae345432 Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Sat, 26 Apr 2025 23:55:23 +0200
Subject: [PATCH 13/31] Minor tweaks to improve code readability (#1723)
---
src/JsonApiDotNetCore/Configuration/TypeLocator.cs | 10 +++++++++-
.../CarCompositeKeyAwareRepository.cs | 14 ++++++++++++--
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/src/JsonApiDotNetCore/Configuration/TypeLocator.cs b/src/JsonApiDotNetCore/Configuration/TypeLocator.cs
index 6b8c54574..768f94a98 100644
--- a/src/JsonApiDotNetCore/Configuration/TypeLocator.cs
+++ b/src/JsonApiDotNetCore/Configuration/TypeLocator.cs
@@ -82,8 +82,16 @@ internal sealed class TypeLocator
$"instead of {interfaceTypeArguments.Length}.", nameof(interfaceTypeArguments));
}
- return assembly.GetTypes().Select(type => GetContainerRegistrationFromType(type, unboundInterface, interfaceTypeArguments))
+ // @formatter:wrap_chained_method_calls chop_always
+ // @formatter:wrap_before_first_method_call true
+
+ return assembly
+ .GetTypes()
+ .Select(type => GetContainerRegistrationFromType(type, unboundInterface, interfaceTypeArguments))
.FirstOrDefault(result => result != null);
+
+ // @formatter:wrap_before_first_method_call restore
+ // @formatter:wrap_chained_method_calls restore
}
private static (Type implementationType, Type serviceInterface)? GetContainerRegistrationFromType(Type nextType, Type unboundInterface,
diff --git a/test/JsonApiDotNetCoreTests/IntegrationTests/CompositeKeys/CarCompositeKeyAwareRepository.cs b/test/JsonApiDotNetCoreTests/IntegrationTests/CompositeKeys/CarCompositeKeyAwareRepository.cs
index 089f48790..d320c65d0 100644
--- a/test/JsonApiDotNetCoreTests/IntegrationTests/CompositeKeys/CarCompositeKeyAwareRepository.cs
+++ b/test/JsonApiDotNetCoreTests/IntegrationTests/CompositeKeys/CarCompositeKeyAwareRepository.cs
@@ -39,11 +39,21 @@ private void RecursiveRewriteFilterInLayer(QueryLayer queryLayer)
if (queryLayer.Selection is { IsEmpty: false })
{
- foreach (QueryLayer? nextLayer in queryLayer.Selection.GetResourceTypes().Select(queryLayer.Selection.GetOrCreateSelectors)
- .SelectMany(selectors => selectors.Select(selector => selector.Value).Where(layer => layer != null)))
+ // @formatter:wrap_chained_method_calls chop_always
+ // @formatter:keep_existing_linebreaks true
+
+ foreach (QueryLayer? nextLayer in queryLayer.Selection
+ .GetResourceTypes()
+ .Select(queryLayer.Selection.GetOrCreateSelectors)
+ .SelectMany(selectors => selectors
+ .Select(selector => selector.Value)
+ .Where(layer => layer != null)))
{
RecursiveRewriteFilterInLayer(nextLayer!);
}
+
+ // @formatter:keep_existing_linebreaks restore
+ // @formatter:wrap_chained_method_calls restore
}
}
}
From b45b3ffe5834143468a285c71065ba3e5ce177d1 Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Sun, 27 Apr 2025 00:25:11 +0200
Subject: [PATCH 14/31] Remove Experimental attribute from
AddOpenApiForJsonApi, now that preview packages are deployed on NuGet (#1724)
---
src/Examples/JsonApiDotNetCoreExample/Program.cs | 2 --
.../ServiceCollectionExtensions.cs | 2 --
test/OpenApiTests/OpenApiStartup.cs | 3 ---
3 files changed, 7 deletions(-)
diff --git a/src/Examples/JsonApiDotNetCoreExample/Program.cs b/src/Examples/JsonApiDotNetCoreExample/Program.cs
index d2677ea78..56448b271 100644
--- a/src/Examples/JsonApiDotNetCoreExample/Program.cs
+++ b/src/Examples/JsonApiDotNetCoreExample/Program.cs
@@ -79,9 +79,7 @@ static void ConfigureServices(WebApplicationBuilder builder)
using (CodeTimingSessionManager.Current.Measure("AddOpenApiForJsonApi()"))
{
-#pragma warning disable JADNC_OA_001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
builder.Services.AddOpenApiForJsonApi(options => options.DocumentFilter());
-#pragma warning restore JADNC_OA_001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
}
}
diff --git a/src/JsonApiDotNetCore.OpenApi.Swashbuckle/ServiceCollectionExtensions.cs b/src/JsonApiDotNetCore.OpenApi.Swashbuckle/ServiceCollectionExtensions.cs
index df5247d9d..3b421c31d 100644
--- a/src/JsonApiDotNetCore.OpenApi.Swashbuckle/ServiceCollectionExtensions.cs
+++ b/src/JsonApiDotNetCore.OpenApi.Swashbuckle/ServiceCollectionExtensions.cs
@@ -1,4 +1,3 @@
-using System.Diagnostics.CodeAnalysis;
using JsonApiDotNetCore.Configuration;
using JsonApiDotNetCore.Middleware;
using JsonApiDotNetCore.OpenApi.Swashbuckle.JsonApiMetadata;
@@ -21,7 +20,6 @@ public static class ServiceCollectionExtensions
///
/// Configures OpenAPI for JsonApiDotNetCore using Swashbuckle.
///
- [Experimental("JADNC_OA_001", UrlFormat = "https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/docs/usage/openapi.md")]
public static void AddOpenApiForJsonApi(this IServiceCollection services, Action? configureSwaggerGenOptions = null)
{
ArgumentNullException.ThrowIfNull(services);
diff --git a/test/OpenApiTests/OpenApiStartup.cs b/test/OpenApiTests/OpenApiStartup.cs
index ba0a5256c..e8ee0fdb2 100644
--- a/test/OpenApiTests/OpenApiStartup.cs
+++ b/test/OpenApiTests/OpenApiStartup.cs
@@ -14,10 +14,7 @@ public class OpenApiStartup : TestableStartup
public override void ConfigureServices(IServiceCollection services)
{
base.ConfigureServices(services);
-
-#pragma warning disable JADNC_OA_001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
services.AddOpenApiForJsonApi(SetupSwaggerGenAction);
-#pragma warning restore JADNC_OA_001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
}
protected override void SetJsonApiOptions(JsonApiOptions options)
From fe386789273a41f4873ca1de8a8400cdaadbc256 Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Sun, 27 Apr 2025 02:14:26 +0200
Subject: [PATCH 15/31] Increment version to 5.7.2 (used for pre-release builds
from ci)
---
Directory.Build.props | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Directory.Build.props b/Directory.Build.props
index 7fc6d42c5..1ef255f56 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -9,9 +9,9 @@
Recommended$(MSBuildThisFileDirectory)CodingGuidelines.ruleset$(MSBuildThisFileDirectory)tests.runsettings
- 5.7.1
+ 5.7.2pre
- 2
+ 3direct
From b21cf5cb688f5fab7908f46d4ec582adbb2e51da Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Tue, 6 May 2025 04:20:02 +0200
Subject: [PATCH 16/31] Various documentation enhancements (#1728)
* Document public OpenAPI members, remove unused IJsonApiClient
* Include OpenAPI types in API Browser, fix docfx logo, enable Google Analytics
* Add redirects for changed APIs (based on 404s from Google Search Console)
* Convert TOCs to yaml
* Fix caching during local build
* List example projects in documentation
* List key types on API index page
* Document advanced use cases
* Consolidate getting-started steps
* Add GitHub icon
* Fix broken Araxis logo
---
README.md | 19 +-
...ollers.Annotations.NoHttpPatchAttribute.md | 3 +
....Controllers.JsonApiCommandController-1.md | 3 +
...NetCore.Controllers.ModelStateViolation.md | 3 +
...tNetCore.Diagnostics.CascadingCodeTimer.md | 3 +
...ceIdInCreateResourceNotAllowedException.md | 3 +
...re.Errors.ResourceTypeMismatchException.md | 3 +
...tCore.Hooks.IResourceHookExecutorFacade.md | 3 +
...ooks.Internal.Discovery.IHooksDiscovery.md | 3 +
...nal.Execution.DiffableResourceHashSet-1.md | 3 +
...s.Internal.Execution.IResourceHashSet-1.md | 3 +
...Core.Hooks.Internal.ICreateHookExecutor.md | 3 +
...Core.Hooks.Internal.IUpdateHookExecutor.md | 3 +
...iDotNetCore.Middleware.JsonApiExtension.md | 3 +
...xpressions.CollectionNotEmptyExpression.md | 3 +
...Queries.Internal.IEvaluatedIncludeCache.md | 3 +
....Queries.Internal.Parsing.IncludeParser.md | 3 +
...tCore.Queries.Internal.Parsing.Keywords.md | 3 +
....Internal.Parsing.QueryExpressionParser.md | 3 +
...Parsing.QueryStringParameterScopeParser.md | 3 +
...Queries.Internal.Parsing.QueryTokenizer.md | 3 +
....Internal.QueryableBuilding.LambdaScope.md | 3 +
...l.QueryableBuilding.SelectClauseBuilder.md | 3 +
...al.QueryableBuilding.WhereClauseBuilder.md | 3 +
...ngs.IDefaultsQueryStringParameterReader.md | 3 +
...rnal.DefaultsQueryStringParameterReader.md | 3 +
...ternal.FilterQueryStringParameterReader.md | 3 +
...ernal.IncludeQueryStringParameterReader.md | 3 +
...al.PaginationQueryStringParameterReader.md | 3 +
...ourceDefinitionQueryableParameterReader.md | 3 +
...JsonApiDotNetCore.QueryStrings.Internal.md | 3 +
.../JsonApiDotNetCore.Resources.Internal.md | 3 +
...ore.Resources.ResourceHooksDefinition-1.md | 3 +
...tNetCore.Serialization.BaseDeserializer.md | 3 +
...DotNetCore.Serialization.BaseSerializer.md | 3 +
...Building.IIncludedResourceObjectBuilder.md | 3 +
...ization.Building.IResourceObjectBuilder.md | 3 +
....Building.ResourceObjectBuilderSettings.md | 3 +
...lization.Client.Internal.ManyResponse-1.md | 3 +
...ation.Client.Internal.RequestSerializer.md | 3 +
...otNetCore.Serialization.Client.Internal.md | 3 +
...Core.Serialization.IJsonApiDeserializer.md | 3 +
...DotNetCore.Serialization.IJsonApiWriter.md | 3 +
...Serialization.Objects.IResourceIdentity.md | 3 +
...Serialization.ResponseSerializerFactory.md | 3 +
...ApiDotNetCore.Services.IGetAllService-1.md | 3 +
...rvices.IRemoveFromRelationshipService-1.md | 3 +
...Core.Services.IResourceCommandService-1.md | 3 +
...etCore.Services.IResourceQueryService-1.md | 3 +
...tCore.Services.JsonApiResourceService-1.md | 3 +
docs/api/index.md | 96 +++++++++-
docs/build-dev.ps1 | 6 +-
docs/docfx.json | 46 ++---
docs/getting-started/faq.md | 179 +-----------------
docs/getting-started/index.md | 5 +
docs/getting-started/install.md | 27 +--
docs/getting-started/step-by-step.md | 137 +-------------
docs/getting-started/toc.md | 5 -
docs/home/assets/img/araxis-logo.png | Bin 0 -> 2502 bytes
docs/home/index.html | 13 +-
docs/internals/toc.md | 1 -
docs/internals/toc.yml | 2 +
docs/request-examples/README.md | 26 +--
docs/request-examples/index.md | 27 ++-
docs/request-examples/toc.md | 0
docs/template/public/main.css | 6 +
docs/template/public/main.js | 11 ++
docs/toc.yml | 13 +-
docs/usage/advanced/alternate-routes.md | 8 +
docs/usage/advanced/archiving.md | 14 ++
docs/usage/advanced/auth-scopes.md | 10 +
docs/usage/advanced/blobs.md | 9 +
docs/usage/advanced/composite-keys.md | 8 +
docs/usage/advanced/content-negotiation.md | 15 ++
docs/usage/advanced/eager-loading.md | 12 ++
docs/usage/advanced/error-handling.md | 13 ++
docs/usage/advanced/hosting-iis.md | 7 +
docs/usage/advanced/id-obfuscation.md | 16 ++
docs/usage/advanced/index.md | 19 ++
docs/usage/advanced/links.md | 19 ++
docs/usage/advanced/microservices.md | 22 +++
docs/usage/advanced/model-state.md | 14 ++
docs/usage/advanced/multi-tenancy.md | 21 ++
docs/usage/advanced/operations.md | 15 ++
docs/usage/advanced/query-string-functions.md | 23 +++
docs/usage/advanced/resource-injection.md | 11 ++
docs/usage/advanced/soft-deletion.md | 15 ++
docs/usage/advanced/state-machine.md | 11 ++
docs/usage/advanced/toc.yml | 38 ++++
docs/usage/caching.md | 6 +-
docs/usage/extensibility/toc.yml | 14 ++
docs/usage/faq.md | 176 +++++++++++++++++
docs/usage/reading/toc.yml | 10 +
docs/usage/resources/index.md | 7 +-
docs/usage/resources/inheritance.md | 2 +-
docs/usage/resources/toc.yml | 8 +
docs/usage/toc.md | 39 ----
docs/usage/toc.yml | 35 ++++
docs/usage/writing/toc.yml | 8 +
.../ApiException.cs | 14 ++
.../ApiResponse.cs | 14 ++
.../BlockedJsonInheritanceConverter.cs | 13 ++
.../IJsonApiClient.cs | 41 ----
.../NotifyPropertySet.cs | 3 +-
104 files changed, 971 insertions(+), 505 deletions(-)
create mode 100644 docs/api/JsonApiDotNetCore.Controllers.Annotations.NoHttpPatchAttribute.md
create mode 100644 docs/api/JsonApiDotNetCore.Controllers.JsonApiCommandController-1.md
create mode 100644 docs/api/JsonApiDotNetCore.Controllers.ModelStateViolation.md
create mode 100644 docs/api/JsonApiDotNetCore.Diagnostics.CascadingCodeTimer.md
create mode 100644 docs/api/JsonApiDotNetCore.Errors.ResourceIdInCreateResourceNotAllowedException.md
create mode 100644 docs/api/JsonApiDotNetCore.Errors.ResourceTypeMismatchException.md
create mode 100644 docs/api/JsonApiDotNetCore.Hooks.IResourceHookExecutorFacade.md
create mode 100644 docs/api/JsonApiDotNetCore.Hooks.Internal.Discovery.IHooksDiscovery.md
create mode 100644 docs/api/JsonApiDotNetCore.Hooks.Internal.Execution.DiffableResourceHashSet-1.md
create mode 100644 docs/api/JsonApiDotNetCore.Hooks.Internal.Execution.IResourceHashSet-1.md
create mode 100644 docs/api/JsonApiDotNetCore.Hooks.Internal.ICreateHookExecutor.md
create mode 100644 docs/api/JsonApiDotNetCore.Hooks.Internal.IUpdateHookExecutor.md
create mode 100644 docs/api/JsonApiDotNetCore.Middleware.JsonApiExtension.md
create mode 100644 docs/api/JsonApiDotNetCore.Queries.Expressions.CollectionNotEmptyExpression.md
create mode 100644 docs/api/JsonApiDotNetCore.Queries.Internal.IEvaluatedIncludeCache.md
create mode 100644 docs/api/JsonApiDotNetCore.Queries.Internal.Parsing.IncludeParser.md
create mode 100644 docs/api/JsonApiDotNetCore.Queries.Internal.Parsing.Keywords.md
create mode 100644 docs/api/JsonApiDotNetCore.Queries.Internal.Parsing.QueryExpressionParser.md
create mode 100644 docs/api/JsonApiDotNetCore.Queries.Internal.Parsing.QueryStringParameterScopeParser.md
create mode 100644 docs/api/JsonApiDotNetCore.Queries.Internal.Parsing.QueryTokenizer.md
create mode 100644 docs/api/JsonApiDotNetCore.Queries.Internal.QueryableBuilding.LambdaScope.md
create mode 100644 docs/api/JsonApiDotNetCore.Queries.Internal.QueryableBuilding.SelectClauseBuilder.md
create mode 100644 docs/api/JsonApiDotNetCore.Queries.Internal.QueryableBuilding.WhereClauseBuilder.md
create mode 100644 docs/api/JsonApiDotNetCore.QueryStrings.IDefaultsQueryStringParameterReader.md
create mode 100644 docs/api/JsonApiDotNetCore.QueryStrings.Internal.DefaultsQueryStringParameterReader.md
create mode 100644 docs/api/JsonApiDotNetCore.QueryStrings.Internal.FilterQueryStringParameterReader.md
create mode 100644 docs/api/JsonApiDotNetCore.QueryStrings.Internal.IncludeQueryStringParameterReader.md
create mode 100644 docs/api/JsonApiDotNetCore.QueryStrings.Internal.PaginationQueryStringParameterReader.md
create mode 100644 docs/api/JsonApiDotNetCore.QueryStrings.Internal.ResourceDefinitionQueryableParameterReader.md
create mode 100644 docs/api/JsonApiDotNetCore.QueryStrings.Internal.md
create mode 100644 docs/api/JsonApiDotNetCore.Resources.Internal.md
create mode 100644 docs/api/JsonApiDotNetCore.Resources.ResourceHooksDefinition-1.md
create mode 100644 docs/api/JsonApiDotNetCore.Serialization.BaseDeserializer.md
create mode 100644 docs/api/JsonApiDotNetCore.Serialization.BaseSerializer.md
create mode 100644 docs/api/JsonApiDotNetCore.Serialization.Building.IIncludedResourceObjectBuilder.md
create mode 100644 docs/api/JsonApiDotNetCore.Serialization.Building.IResourceObjectBuilder.md
create mode 100644 docs/api/JsonApiDotNetCore.Serialization.Building.ResourceObjectBuilderSettings.md
create mode 100644 docs/api/JsonApiDotNetCore.Serialization.Client.Internal.ManyResponse-1.md
create mode 100644 docs/api/JsonApiDotNetCore.Serialization.Client.Internal.RequestSerializer.md
create mode 100644 docs/api/JsonApiDotNetCore.Serialization.Client.Internal.md
create mode 100644 docs/api/JsonApiDotNetCore.Serialization.IJsonApiDeserializer.md
create mode 100644 docs/api/JsonApiDotNetCore.Serialization.IJsonApiWriter.md
create mode 100644 docs/api/JsonApiDotNetCore.Serialization.Objects.IResourceIdentity.md
create mode 100644 docs/api/JsonApiDotNetCore.Serialization.ResponseSerializerFactory.md
create mode 100644 docs/api/JsonApiDotNetCore.Services.IGetAllService-1.md
create mode 100644 docs/api/JsonApiDotNetCore.Services.IRemoveFromRelationshipService-1.md
create mode 100644 docs/api/JsonApiDotNetCore.Services.IResourceCommandService-1.md
create mode 100644 docs/api/JsonApiDotNetCore.Services.IResourceQueryService-1.md
create mode 100644 docs/api/JsonApiDotNetCore.Services.JsonApiResourceService-1.md
create mode 100644 docs/getting-started/index.md
delete mode 100644 docs/getting-started/toc.md
create mode 100644 docs/home/assets/img/araxis-logo.png
delete mode 100644 docs/internals/toc.md
create mode 100644 docs/internals/toc.yml
delete mode 100644 docs/request-examples/toc.md
create mode 100644 docs/template/public/main.css
create mode 100644 docs/template/public/main.js
create mode 100644 docs/usage/advanced/alternate-routes.md
create mode 100644 docs/usage/advanced/archiving.md
create mode 100644 docs/usage/advanced/auth-scopes.md
create mode 100644 docs/usage/advanced/blobs.md
create mode 100644 docs/usage/advanced/composite-keys.md
create mode 100644 docs/usage/advanced/content-negotiation.md
create mode 100644 docs/usage/advanced/eager-loading.md
create mode 100644 docs/usage/advanced/error-handling.md
create mode 100644 docs/usage/advanced/hosting-iis.md
create mode 100644 docs/usage/advanced/id-obfuscation.md
create mode 100644 docs/usage/advanced/index.md
create mode 100644 docs/usage/advanced/links.md
create mode 100644 docs/usage/advanced/microservices.md
create mode 100644 docs/usage/advanced/model-state.md
create mode 100644 docs/usage/advanced/multi-tenancy.md
create mode 100644 docs/usage/advanced/operations.md
create mode 100644 docs/usage/advanced/query-string-functions.md
create mode 100644 docs/usage/advanced/resource-injection.md
create mode 100644 docs/usage/advanced/soft-deletion.md
create mode 100644 docs/usage/advanced/state-machine.md
create mode 100644 docs/usage/advanced/toc.yml
create mode 100644 docs/usage/extensibility/toc.yml
create mode 100644 docs/usage/faq.md
create mode 100644 docs/usage/reading/toc.yml
create mode 100644 docs/usage/resources/toc.yml
delete mode 100644 docs/usage/toc.md
create mode 100644 docs/usage/toc.yml
create mode 100644 docs/usage/writing/toc.yml
delete mode 100644 src/JsonApiDotNetCore.OpenApi.Client.NSwag/IJsonApiClient.cs
diff --git a/README.md b/README.md
index fb58acf05..8dd6a6ecf 100644
--- a/README.md
+++ b/README.md
@@ -20,16 +20,23 @@ The ultimate goal of this library is to eliminate as much boilerplate as possibl
The following steps describe how to create a JSON:API project.
+1. Create a new ASP.NET Core Web API project:
+
+ ```bash
+ dotnet new webapi --no-openapi --use-controllers --name ExampleJsonApi
+ cd ExampleJsonApi
+ ```
+
1. Install the JsonApiDotNetCore package, along with your preferred Entity Framework Core provider:
+
```bash
dotnet add package JsonApiDotNetCore
dotnet add package Microsoft.EntityFrameworkCore.Sqlite
```
1. Declare your entities, annotated with JsonApiDotNetCore attributes:
- ```c#
- #nullable enable
+ ```c#
[Resource]
public class Person : Identifiable
{
@@ -40,6 +47,7 @@ The following steps describe how to create a JSON:API project.
```
1. Define your `DbContext`, seeding the database with sample data:
+
```c#
public class AppDbContext(DbContextOptions options) : DbContext(options)
{
@@ -70,6 +78,7 @@ The following steps describe how to create a JSON:API project.
```
1. Configure Entity Framework Core and JsonApiDotNetCore in `Program.cs`:
+
```c#
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddDbContext();
@@ -96,11 +105,13 @@ The following steps describe how to create a JSON:API project.
```
1. Start your API
+
```bash
dotnet run
```
1. Send a GET request to retrieve data:
+
```bash
GET http://localhost:5000/people?filter=equals(firstName,'John')&include=children HTTP/1.1
```
@@ -256,7 +267,7 @@ To build the code from this repository locally, run:
dotnet build
```
-Running tests locally requires access to a PostgreSQL database. If you have docker installed, this can started via:
+Running tests locally requires access to a PostgreSQL database. If you have docker installed, this can be started via:
```bash
pwsh run-docker-postgres.ps1
@@ -279,6 +290,6 @@ pwsh Build.ps1
We are very grateful to the sponsors below, who have provided us with a no-cost license for their tools.
-
+
Do you like this project? Consider to [sponsor](https://github.com/sponsors/json-api-dotnet), or just reward us by giving our repository a star.
diff --git a/docs/api/JsonApiDotNetCore.Controllers.Annotations.NoHttpPatchAttribute.md b/docs/api/JsonApiDotNetCore.Controllers.Annotations.NoHttpPatchAttribute.md
new file mode 100644
index 000000000..b63f67fae
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Controllers.Annotations.NoHttpPatchAttribute.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Resources.Annotations.ResourceAttribute.html#JsonApiDotNetCore_Resources_Annotations_ResourceAttribute_GenerateControllerEndpoints
+---
diff --git a/docs/api/JsonApiDotNetCore.Controllers.JsonApiCommandController-1.md b/docs/api/JsonApiDotNetCore.Controllers.JsonApiCommandController-1.md
new file mode 100644
index 000000000..5d980615f
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Controllers.JsonApiCommandController-1.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Controllers.JsonApiCommandController-2.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Controllers.ModelStateViolation.md b/docs/api/JsonApiDotNetCore.Controllers.ModelStateViolation.md
new file mode 100644
index 000000000..9414c98cc
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Controllers.ModelStateViolation.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Errors.InvalidModelStateException.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Diagnostics.CascadingCodeTimer.md b/docs/api/JsonApiDotNetCore.Diagnostics.CascadingCodeTimer.md
new file mode 100644
index 000000000..1b27f4c57
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Diagnostics.CascadingCodeTimer.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Diagnostics.ICodeTimer.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Errors.ResourceIdInCreateResourceNotAllowedException.md b/docs/api/JsonApiDotNetCore.Errors.ResourceIdInCreateResourceNotAllowedException.md
new file mode 100644
index 000000000..bd889e534
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Errors.ResourceIdInCreateResourceNotAllowedException.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Errors.ResourceAlreadyExistsException.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Errors.ResourceTypeMismatchException.md b/docs/api/JsonApiDotNetCore.Errors.ResourceTypeMismatchException.md
new file mode 100644
index 000000000..f840a3f3a
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Errors.ResourceTypeMismatchException.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Errors.InvalidRequestBodyException.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Hooks.IResourceHookExecutorFacade.md b/docs/api/JsonApiDotNetCore.Hooks.IResourceHookExecutorFacade.md
new file mode 100644
index 000000000..59094b11c
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Hooks.IResourceHookExecutorFacade.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Resources.IResourceDefinition-2.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Hooks.Internal.Discovery.IHooksDiscovery.md b/docs/api/JsonApiDotNetCore.Hooks.Internal.Discovery.IHooksDiscovery.md
new file mode 100644
index 000000000..59094b11c
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Hooks.Internal.Discovery.IHooksDiscovery.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Resources.IResourceDefinition-2.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Hooks.Internal.Execution.DiffableResourceHashSet-1.md b/docs/api/JsonApiDotNetCore.Hooks.Internal.Execution.DiffableResourceHashSet-1.md
new file mode 100644
index 000000000..4cf783422
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Hooks.Internal.Execution.DiffableResourceHashSet-1.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Resources.JsonApiResourceDefinition-2.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Hooks.Internal.Execution.IResourceHashSet-1.md b/docs/api/JsonApiDotNetCore.Hooks.Internal.Execution.IResourceHashSet-1.md
new file mode 100644
index 000000000..59094b11c
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Hooks.Internal.Execution.IResourceHashSet-1.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Resources.IResourceDefinition-2.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Hooks.Internal.ICreateHookExecutor.md b/docs/api/JsonApiDotNetCore.Hooks.Internal.ICreateHookExecutor.md
new file mode 100644
index 000000000..dacf9c60b
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Hooks.Internal.ICreateHookExecutor.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Resources.IResourceDefinition-2.html#JsonApiDotNetCore_Resources_IResourceDefinition_2_OnWritingAsync__0_JsonApiDotNetCore_Middleware_WriteOperationKind_System_Threading_CancellationToken_
+---
diff --git a/docs/api/JsonApiDotNetCore.Hooks.Internal.IUpdateHookExecutor.md b/docs/api/JsonApiDotNetCore.Hooks.Internal.IUpdateHookExecutor.md
new file mode 100644
index 000000000..dacf9c60b
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Hooks.Internal.IUpdateHookExecutor.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Resources.IResourceDefinition-2.html#JsonApiDotNetCore_Resources_IResourceDefinition_2_OnWritingAsync__0_JsonApiDotNetCore_Middleware_WriteOperationKind_System_Threading_CancellationToken_
+---
diff --git a/docs/api/JsonApiDotNetCore.Middleware.JsonApiExtension.md b/docs/api/JsonApiDotNetCore.Middleware.JsonApiExtension.md
new file mode 100644
index 000000000..5ce9d0e02
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Middleware.JsonApiExtension.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Middleware.JsonApiMediaTypeExtension.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Queries.Expressions.CollectionNotEmptyExpression.md b/docs/api/JsonApiDotNetCore.Queries.Expressions.CollectionNotEmptyExpression.md
new file mode 100644
index 000000000..05c7012a7
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Queries.Expressions.CollectionNotEmptyExpression.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Queries.Expressions.HasExpression.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Queries.Internal.IEvaluatedIncludeCache.md b/docs/api/JsonApiDotNetCore.Queries.Internal.IEvaluatedIncludeCache.md
new file mode 100644
index 000000000..d990b723a
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Queries.Internal.IEvaluatedIncludeCache.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Queries.IEvaluatedIncludeCache.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Queries.Internal.Parsing.IncludeParser.md b/docs/api/JsonApiDotNetCore.Queries.Internal.Parsing.IncludeParser.md
new file mode 100644
index 000000000..b7cc54796
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Queries.Internal.Parsing.IncludeParser.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Queries.Parsing.IncludeParser.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Queries.Internal.Parsing.Keywords.md b/docs/api/JsonApiDotNetCore.Queries.Internal.Parsing.Keywords.md
new file mode 100644
index 000000000..a1a604ffb
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Queries.Internal.Parsing.Keywords.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Queries.Parsing.Keywords.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Queries.Internal.Parsing.QueryExpressionParser.md b/docs/api/JsonApiDotNetCore.Queries.Internal.Parsing.QueryExpressionParser.md
new file mode 100644
index 000000000..d3574188c
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Queries.Internal.Parsing.QueryExpressionParser.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Queries.Parsing.QueryExpressionParser.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Queries.Internal.Parsing.QueryStringParameterScopeParser.md b/docs/api/JsonApiDotNetCore.Queries.Internal.Parsing.QueryStringParameterScopeParser.md
new file mode 100644
index 000000000..0403d40eb
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Queries.Internal.Parsing.QueryStringParameterScopeParser.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Queries.Parsing.QueryStringParameterScopeParser.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Queries.Internal.Parsing.QueryTokenizer.md b/docs/api/JsonApiDotNetCore.Queries.Internal.Parsing.QueryTokenizer.md
new file mode 100644
index 000000000..0cf46bdf5
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Queries.Internal.Parsing.QueryTokenizer.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Queries.Parsing.QueryTokenizer.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Queries.Internal.QueryableBuilding.LambdaScope.md b/docs/api/JsonApiDotNetCore.Queries.Internal.QueryableBuilding.LambdaScope.md
new file mode 100644
index 000000000..1884dc786
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Queries.Internal.QueryableBuilding.LambdaScope.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Queries.QueryableBuilding.LambdaScope.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Queries.Internal.QueryableBuilding.SelectClauseBuilder.md b/docs/api/JsonApiDotNetCore.Queries.Internal.QueryableBuilding.SelectClauseBuilder.md
new file mode 100644
index 000000000..005a6b211
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Queries.Internal.QueryableBuilding.SelectClauseBuilder.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Queries.QueryableBuilding.SelectClauseBuilder.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Queries.Internal.QueryableBuilding.WhereClauseBuilder.md b/docs/api/JsonApiDotNetCore.Queries.Internal.QueryableBuilding.WhereClauseBuilder.md
new file mode 100644
index 000000000..5ff3e97e5
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Queries.Internal.QueryableBuilding.WhereClauseBuilder.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Queries.QueryableBuilding.WhereClauseBuilder.html
+---
diff --git a/docs/api/JsonApiDotNetCore.QueryStrings.IDefaultsQueryStringParameterReader.md b/docs/api/JsonApiDotNetCore.QueryStrings.IDefaultsQueryStringParameterReader.md
new file mode 100644
index 000000000..d46a26681
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.QueryStrings.IDefaultsQueryStringParameterReader.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.QueryStrings.IQueryStringParameterReader.html
+---
diff --git a/docs/api/JsonApiDotNetCore.QueryStrings.Internal.DefaultsQueryStringParameterReader.md b/docs/api/JsonApiDotNetCore.QueryStrings.Internal.DefaultsQueryStringParameterReader.md
new file mode 100644
index 000000000..0c6da2ca5
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.QueryStrings.Internal.DefaultsQueryStringParameterReader.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.QueryStrings.QueryStringParameterReader.html
+---
diff --git a/docs/api/JsonApiDotNetCore.QueryStrings.Internal.FilterQueryStringParameterReader.md b/docs/api/JsonApiDotNetCore.QueryStrings.Internal.FilterQueryStringParameterReader.md
new file mode 100644
index 000000000..645687485
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.QueryStrings.Internal.FilterQueryStringParameterReader.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.QueryStrings.FilterQueryStringParameterReader.html
+---
diff --git a/docs/api/JsonApiDotNetCore.QueryStrings.Internal.IncludeQueryStringParameterReader.md b/docs/api/JsonApiDotNetCore.QueryStrings.Internal.IncludeQueryStringParameterReader.md
new file mode 100644
index 000000000..d8ceb2d5f
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.QueryStrings.Internal.IncludeQueryStringParameterReader.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.QueryStrings.IncludeQueryStringParameterReader.html
+---
diff --git a/docs/api/JsonApiDotNetCore.QueryStrings.Internal.PaginationQueryStringParameterReader.md b/docs/api/JsonApiDotNetCore.QueryStrings.Internal.PaginationQueryStringParameterReader.md
new file mode 100644
index 000000000..d0fc4348c
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.QueryStrings.Internal.PaginationQueryStringParameterReader.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.QueryStrings.PaginationQueryStringParameterReader.html
+---
diff --git a/docs/api/JsonApiDotNetCore.QueryStrings.Internal.ResourceDefinitionQueryableParameterReader.md b/docs/api/JsonApiDotNetCore.QueryStrings.Internal.ResourceDefinitionQueryableParameterReader.md
new file mode 100644
index 000000000..ef485e70a
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.QueryStrings.Internal.ResourceDefinitionQueryableParameterReader.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.QueryStrings.ResourceDefinitionQueryableParameterReader.html
+---
diff --git a/docs/api/JsonApiDotNetCore.QueryStrings.Internal.md b/docs/api/JsonApiDotNetCore.QueryStrings.Internal.md
new file mode 100644
index 000000000..9535aea47
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.QueryStrings.Internal.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.QueryStrings.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Resources.Internal.md b/docs/api/JsonApiDotNetCore.Resources.Internal.md
new file mode 100644
index 000000000..f547f0925
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Resources.Internal.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Resources.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Resources.ResourceHooksDefinition-1.md b/docs/api/JsonApiDotNetCore.Resources.ResourceHooksDefinition-1.md
new file mode 100644
index 000000000..4cf783422
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Resources.ResourceHooksDefinition-1.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Resources.JsonApiResourceDefinition-2.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Serialization.BaseDeserializer.md b/docs/api/JsonApiDotNetCore.Serialization.BaseDeserializer.md
new file mode 100644
index 000000000..e4bd9d0bf
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Serialization.BaseDeserializer.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Serialization.Request.Adapters.DocumentAdapter.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Serialization.BaseSerializer.md b/docs/api/JsonApiDotNetCore.Serialization.BaseSerializer.md
new file mode 100644
index 000000000..af24d07eb
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Serialization.BaseSerializer.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Serialization.Response.ResponseModelAdapter.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Serialization.Building.IIncludedResourceObjectBuilder.md b/docs/api/JsonApiDotNetCore.Serialization.Building.IIncludedResourceObjectBuilder.md
new file mode 100644
index 000000000..79a6ec638
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Serialization.Building.IIncludedResourceObjectBuilder.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Serialization.Response.ResponseModelAdapter.html#JsonApiDotNetCore_Serialization_Response_ResponseModelAdapter_ConvertResource_JsonApiDotNetCore_Resources_IIdentifiable_JsonApiDotNetCore_Configuration_ResourceType_JsonApiDotNetCore_Middleware_EndpointKind_
+---
diff --git a/docs/api/JsonApiDotNetCore.Serialization.Building.IResourceObjectBuilder.md b/docs/api/JsonApiDotNetCore.Serialization.Building.IResourceObjectBuilder.md
new file mode 100644
index 000000000..79a6ec638
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Serialization.Building.IResourceObjectBuilder.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Serialization.Response.ResponseModelAdapter.html#JsonApiDotNetCore_Serialization_Response_ResponseModelAdapter_ConvertResource_JsonApiDotNetCore_Resources_IIdentifiable_JsonApiDotNetCore_Configuration_ResourceType_JsonApiDotNetCore_Middleware_EndpointKind_
+---
diff --git a/docs/api/JsonApiDotNetCore.Serialization.Building.ResourceObjectBuilderSettings.md b/docs/api/JsonApiDotNetCore.Serialization.Building.ResourceObjectBuilderSettings.md
new file mode 100644
index 000000000..03cbfa162
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Serialization.Building.ResourceObjectBuilderSettings.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Configuration.JsonApiOptions.html#JsonApiDotNetCore_Configuration_JsonApiOptions_SerializerOptions
+---
diff --git a/docs/api/JsonApiDotNetCore.Serialization.Client.Internal.ManyResponse-1.md b/docs/api/JsonApiDotNetCore.Serialization.Client.Internal.ManyResponse-1.md
new file mode 100644
index 000000000..2b6744f22
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Serialization.Client.Internal.ManyResponse-1.md
@@ -0,0 +1,3 @@
+---
+redirect_url: ../usage/openapi-client.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Serialization.Client.Internal.RequestSerializer.md b/docs/api/JsonApiDotNetCore.Serialization.Client.Internal.RequestSerializer.md
new file mode 100644
index 000000000..2b6744f22
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Serialization.Client.Internal.RequestSerializer.md
@@ -0,0 +1,3 @@
+---
+redirect_url: ../usage/openapi-client.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Serialization.Client.Internal.md b/docs/api/JsonApiDotNetCore.Serialization.Client.Internal.md
new file mode 100644
index 000000000..2b6744f22
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Serialization.Client.Internal.md
@@ -0,0 +1,3 @@
+---
+redirect_url: ../usage/openapi-client.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Serialization.IJsonApiDeserializer.md b/docs/api/JsonApiDotNetCore.Serialization.IJsonApiDeserializer.md
new file mode 100644
index 000000000..767e0c94d
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Serialization.IJsonApiDeserializer.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Serialization.Request.Adapters.IDocumentAdapter.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Serialization.IJsonApiWriter.md b/docs/api/JsonApiDotNetCore.Serialization.IJsonApiWriter.md
new file mode 100644
index 000000000..b9bbf20b7
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Serialization.IJsonApiWriter.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Serialization.Response.IJsonApiWriter.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Serialization.Objects.IResourceIdentity.md b/docs/api/JsonApiDotNetCore.Serialization.Objects.IResourceIdentity.md
new file mode 100644
index 000000000..4a3f2ca61
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Serialization.Objects.IResourceIdentity.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Serialization.Objects.ResourceIdentity.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Serialization.ResponseSerializerFactory.md b/docs/api/JsonApiDotNetCore.Serialization.ResponseSerializerFactory.md
new file mode 100644
index 000000000..03cbfa162
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Serialization.ResponseSerializerFactory.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Configuration.JsonApiOptions.html#JsonApiDotNetCore_Configuration_JsonApiOptions_SerializerOptions
+---
diff --git a/docs/api/JsonApiDotNetCore.Services.IGetAllService-1.md b/docs/api/JsonApiDotNetCore.Services.IGetAllService-1.md
new file mode 100644
index 000000000..36fcd2e43
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Services.IGetAllService-1.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Services.IGetAllService-2.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Services.IRemoveFromRelationshipService-1.md b/docs/api/JsonApiDotNetCore.Services.IRemoveFromRelationshipService-1.md
new file mode 100644
index 000000000..5df240af1
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Services.IRemoveFromRelationshipService-1.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Services.IRemoveFromRelationshipService-2.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Services.IResourceCommandService-1.md b/docs/api/JsonApiDotNetCore.Services.IResourceCommandService-1.md
new file mode 100644
index 000000000..fedee0f01
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Services.IResourceCommandService-1.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Services.IResourceCommandService-2.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Services.IResourceQueryService-1.md b/docs/api/JsonApiDotNetCore.Services.IResourceQueryService-1.md
new file mode 100644
index 000000000..0801fc22f
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Services.IResourceQueryService-1.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Services.IResourceQueryService-2.html
+---
diff --git a/docs/api/JsonApiDotNetCore.Services.JsonApiResourceService-1.md b/docs/api/JsonApiDotNetCore.Services.JsonApiResourceService-1.md
new file mode 100644
index 000000000..5a2be335c
--- /dev/null
+++ b/docs/api/JsonApiDotNetCore.Services.JsonApiResourceService-1.md
@@ -0,0 +1,3 @@
+---
+redirect_url: JsonApiDotNetCore.Services.JsonApiResourceService-2.html
+---
diff --git a/docs/api/index.md b/docs/api/index.md
index 7eb109b9a..8cdc3c745 100644
--- a/docs/api/index.md
+++ b/docs/api/index.md
@@ -1,9 +1,93 @@
-# API
+# Public API surface
-This section documents the package API and is generated from the XML source comments.
+This topic documents the public API, which is generated from the triple-slash XML documentation comments in source code.
+Commonly used types are listed in the following sections.
-## Common APIs
+## Setup
-- [`JsonApiOptions`](JsonApiDotNetCore.Configuration.JsonApiOptions.yml)
-- [`IResourceGraph`](JsonApiDotNetCore.Configuration.IResourceGraph.yml)
-- [`JsonApiResourceDefinition`](JsonApiDotNetCore.Resources.JsonApiResourceDefinition-2.yml)
+- implements
+- implements
+ -
+ - implements
+ - and
+ -
+ -
+ -
+ -
+ -
+- , (OpenAPI)
+-
+- implements
+ -
+ -
+
+## Query strings
+
+- implements
+ - implements
+ - and
+ - implements
+ - implements
+ - implements
+ - implements
+ - implements
+ - implements
+ - implements
+ - implements
+ - implements
+ - implements
+-
+ -
+ -
+ -
+ -
+ -
+ -
+ -
+- implements
+ - implements
+ - implements
+ - implements
+ - implements
+ - implements
+
+## Request pipeline
+
+- implements
+ -
+ -
+- implements
+ - implements
+ -
+ - implements
+ - implements
+ - implements
+ - implements
+ - implements
+ - implements
+-
+ - implements
+- implements
+- implements
+ - implements
+- implements
+ -
+ -
+
+## Serialization
+
+- implements
+ - implements
+ - implements
+ - implements
+- implements
+ - implements
+ - implements
+-
+-
+- implements
+
+## Error handling
+
+- implements
+ - implements
diff --git a/docs/build-dev.ps1 b/docs/build-dev.ps1
index 6345875fc..348233253 100644
--- a/docs/build-dev.ps1
+++ b/docs/build-dev.ps1
@@ -29,12 +29,14 @@ EnsureHttpServerIsInstalled
VerifySuccessExitCode
if (-Not $NoBuild -Or -Not (Test-Path -Path _site)) {
- Remove-Item _site -Recurse -ErrorAction Ignore
+ Remove-Item _site\* -Recurse -ErrorAction Ignore
dotnet build .. --configuration Release
VerifySuccessExitCode
Invoke-Expression ./generate-examples.ps1
+} else {
+ Remove-Item _site\* -Recurse -ErrorAction Ignore
}
dotnet tool restore
@@ -58,4 +60,4 @@ Write-Host "Web server started. Press Enter to close."
$key = [Console]::ReadKey()
Stop-Job -Id $webServerJob.Id
-Get-job | Remove-Job
+Get-job | Remove-Job -Force
diff --git a/docs/docfx.json b/docs/docfx.json
index 232d8768e..25a4aa943 100644
--- a/docs/docfx.json
+++ b/docs/docfx.json
@@ -1,4 +1,5 @@
{
+ "$schema": "https://raw.githubusercontent.com/dotnet/docfx/main/schemas/docfx.schema.json",
"metadata": [
{
"properties": {
@@ -8,30 +9,21 @@
{
"files": [
"**/JsonApiDotNetCore.csproj",
- "**/JsonApiDotNetCore.Annotations.csproj"
+ "**/JsonApiDotNetCore.Annotations.csproj",
+ "**/JsonApiDotNetCore.OpenApi.Swashbuckle.csproj",
+ "**/JsonApiDotNetCore.OpenApi.Client.NSwag.csproj",
+ "**/JsonApiDotNetCore.OpenApi.Client.Kiota"
],
"src": "../"
}
],
- "dest": "api",
- "disableGitFeatures": false
+ "output": "api"
}
],
"build": {
"content": [
{
- "files": [
- "api/**.yml",
- "api/index.md",
- "ext/openapi/index.md",
- "getting-started/**.md",
- "getting-started/**/toc.yml",
- "usage/**.md",
- "request-examples/**.md",
- "internals/**.md",
- "toc.yml",
- "*.md"
- ],
+ "files": "**.{md|yml}",
"exclude": [
"**/README.md"
]
@@ -44,25 +36,15 @@
]
}
],
- "overwrite": [
- {
- "exclude": [
- "obj/**",
- "_site/**"
- ]
- }
- ],
- "dest": "_site",
- "globalMetadataFiles": [],
- "fileMetadataFiles": [],
+ "output": "_site",
"template": [
"default",
- "modern"
+ "modern",
+ "template"
],
- "postProcessors": [],
- "noLangKeyword": false,
- "keepFileLink": false,
- "cleanupCacheHistory": false,
- "disableGitFeatures": false
+ "globalMetadata": {
+ "_appLogoPath": "styles/img/favicon.png",
+ "_googleAnalyticsTagId": "G-78GTGF1FM2"
+ }
}
}
diff --git a/docs/getting-started/faq.md b/docs/getting-started/faq.md
index 54b4e50d5..c36a09f99 100644
--- a/docs/getting-started/faq.md
+++ b/docs/getting-started/faq.md
@@ -1,176 +1,3 @@
-# Frequently Asked Questions
-
-#### Where can I find documentation and examples?
-While the [documentation](~/usage/resources/index.md) covers basic features and a few runnable example projects are available [here](https://github.com/json-api-dotnet/JsonApiDotNetCore/tree/master/src/Examples),
-many more advanced use cases are available as integration tests [here](https://github.com/json-api-dotnet/JsonApiDotNetCore/tree/master/test/JsonApiDotNetCoreTests/IntegrationTests), so be sure to check them out!
-
-#### Why don't you use the built-in OpenAPI support in ASP.NET Core?
-The structure of JSON:API request and response bodies differs significantly from the signature of JsonApiDotNetCore controllers.
-JsonApiDotNetCore provides OpenAPI support using [Swashbuckle](https://github.com/domaindrivendev/Swashbuckle.AspNetCore), a mature and feature-rich library that is highly extensible.
-The [OpenAPI support in ASP.NET Core](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/openapi/overview) is still very young
-and doesn't provide the level of extensibility needed for JsonApiDotNetCore.
-
-#### What's available to implement a JSON:API client?
-It depends on the programming language used. There's an overwhelming list of client libraries at https://jsonapi.org/implementations/#client-libraries.
-
-The JSON object model inside JsonApiDotNetCore is tweaked for server-side handling (be tolerant at inputs and strict at outputs).
-While you technically *could* use our `JsonSerializer` converters from a .NET client application with some hacks, we don't recommend it.
-You'll need to build the resource graph on the client and rely on internal implementation details that are subject to change in future versions.
-
-In the long term, we'd like to solve this through OpenAPI, which enables the generation of a (statically typed) client library in various languages.
-
-#### How can I debug my API project?
-Due to auto-generated controllers, you may find it hard to determine where to put your breakpoints.
-In Visual Studio, controllers are accessible below **Solution Explorer > Project > Dependencies > Analyzers > JsonApiDotNetCore.SourceGenerators**.
-
-After turning on [Source Link](https://devblogs.microsoft.com/dotnet/improving-debug-time-productivity-with-source-link/#enabling-source-link) (which enables to download the JsonApiDotNetCore source code from GitHub), you can step into our source code and add breakpoints there too.
-
-Here are some key places in the execution pipeline to set a breakpoint:
-- `JsonApiRoutingConvention.Apply`: Controllers are registered here (executes once at startup)
-- `JsonApiMiddleware.InvokeAsync`: Content negotiation and `IJsonApiRequest` setup
-- `QueryStringReader.ReadAll`: Parses the query string parameters
-- `JsonApiReader.ReadAsync`: Parses the request body
-- `OperationsProcessor.ProcessAsync`: Entry point for handling atomic operations
-- `JsonApiResourceService`: Called by controllers, delegating to the repository layer
-- `EntityFrameworkCoreRepository.ApplyQueryLayer`: Builds the `IQueryable<>` that is offered to Entity Framework Core (which turns it into SQL)
-- `JsonApiWriter.WriteAsync`: Renders the response body
-- `ExceptionHandler.HandleException`: Interception point for thrown exceptions
-
-Aside from debugging, you can get more info by:
-- Including exception stack traces and incoming request bodies in error responses, as well as writing human-readable JSON:
-
- ```c#
- // Program.cs
- builder.Services.AddJsonApi(options =>
- {
- options.IncludeExceptionStackTraceInErrors = true;
- options.IncludeRequestBodyInErrors = true;
- options.SerializerOptions.WriteIndented = true;
- });
- ```
-- Turning on verbose logging and logging of executed SQL statements, by adding the following to your `appsettings.Development.json`:
-
- ```json
- {
- "Logging": {
- "LogLevel": {
- "Default": "Warning",
- "Microsoft.EntityFrameworkCore.Database.Command": "Information",
- "JsonApiDotNetCore": "Verbose"
- }
- }
- }
- ```
-
-#### What if my JSON:API resources do not exactly match the shape of my database tables?
-We often find users trying to write custom code to solve that. They usually get it wrong or incomplete, and it may not perform well.
-Or it simply fails because it cannot be translated to SQL.
-The good news is that there's an easier solution most of the time: configure Entity Framework Core mappings to do the work.
-
-For example, if your primary key column is named "CustomerId" instead of "Id":
-```c#
-builder.Entity().Property(x => x.Id).HasColumnName("CustomerId");
-```
-
-It certainly pays off to read up on these capabilities at [Creating and Configuring a Model](https://learn.microsoft.com/ef/core/modeling/).
-Another great resource is [Learn Entity Framework Core](https://www.learnentityframeworkcore.com/configuration).
-
-#### Can I share my resource models with .NET Framework projects?
-Yes, you can. Put your model classes in a separate project that only references [JsonApiDotNetCore.Annotations](https://www.nuget.org/packages/JsonApiDotNetCore.Annotations/).
-This package contains just the JSON:API attributes and targets NetStandard 1.0, which makes it flexible to consume.
-At startup, use [Auto-discovery](~/usage/resource-graph.md#auto-discovery) and point it to your shared project.
-
-#### What's the best place to put my custom business/validation logic?
-For basic input validation, use the attributes from [ASP.NET ModelState Validation](https://learn.microsoft.com/aspnet/core/mvc/models/validation?source=recommendations&view=aspnetcore-7.0#built-in-attributes) to get the best experience.
-JsonApiDotNetCore is aware of them and adjusts behavior accordingly. And it produces the best possible error responses.
-
-For non-trivial business rules that require custom code, the place to be is [Resource Definitions](~/usage/extensibility/resource-definitions.md).
-They provide a callback-based model where you can respond to everything going on.
-The great thing is that your callbacks are invoked for various endpoints.
-For example, the filter callback on Author executes at `GET /authors?filter=`, `GET /books/1/authors?filter=` and `GET /books?include=authors?filter[authors]=`.
-Likewise, the callbacks for changing relationships execute for POST/PATCH resource endpoints, as well as POST/PATCH/DELETE relationship endpoints.
-
-#### Can API users send multiple changes in a single request?
-Yes, just activate [atomic operations](~/usage/writing/bulk-batch-operations.md).
-It enables sending multiple changes in a batch request, which are executed in a database transaction.
-If something fails, all changes are rolled back. The error response indicates which operation failed.
-
-#### Is there any way to add `[Authorize(Roles = "...")]` to the generated controllers?
-Sure, this is possible. Simply add the attribute at the class level.
-See the docs on [Augmenting controllers](~/usage/extensibility/controllers.md#augmenting-controllers).
-
-#### How do I expose non-JSON:API endpoints?
-You can add your own controllers that do not derive from `(Base)JsonApiController` or `(Base)JsonApiOperationsController`.
-Whatever you do in those is completely ignored by JsonApiDotNetCore.
-This is useful if you want to add a few RPC-style endpoints or provide binary file uploads/downloads.
-
-A middle-ground approach is to add custom action methods to existing JSON:API controllers.
-While you can route them as you like, they must return JSON:API resources.
-And on error, a JSON:API error response is produced.
-This is useful if you want to stay in the JSON:API-compliant world, but need to expose something non-standard, for example: `GET /users/me`.
-
-#### How do I optimize for high scalability and prevent denial of service?
-Fortunately, JsonApiDotNetCore [scales pretty well](https://github.com/json-api-dotnet/PerformanceReports) under high load and/or large database tables.
-It never executes filtering, sorting, or pagination in-memory and tries pretty hard to produce the most efficient query possible.
-There are a few things to keep in mind, though:
-- Prevent users from executing slow queries by locking down [attribute capabilities](~/usage/resources/attributes.md#capabilities) and [relationship capabilities](~/usage/resources/relationships.md#capabilities).
- Ensure the right database indexes are in place for what you enable.
-- Prevent users from fetching lots of data by tweaking [maximum page size/number](~/usage/options.md#pagination) and [maximum include depth](~/usage/options.md#maximum-include-depth).
-- Avoid long-running transactions by tweaking `MaximumOperationsPerRequest` in options.
-- Tell your users to utilize [E-Tags](~/usage/caching.md) to reduce network traffic.
-- Not included in JsonApiDotNetCore: Apply general practices such as rate limiting, load balancing, authentication/authorization, blocking very large URLs/request bodies, etc.
-
-#### Can I offload requests to a background process?
-Yes, that's possible. Override controller methods to return `HTTP 202 Accepted`, with a `Location` HTTP header where users can retrieve the result.
-Your controller method needs to store the request state (URL, query string, and request body) in a queue, which your background process can read from.
-From within your background process job handler, reconstruct the request state, execute the appropriate `JsonApiResourceService` method and store the result.
-There's a basic example available at https://github.com/json-api-dotnet/JsonApiDotNetCore/pull/1144, which processes a captured query string.
-
-#### What if I want to use something other than Entity Framework Core?
-This basically means you'll need to implement data access yourself. There are two approaches for interception: at the resource service level and at the repository level.
-Either way, you can use the built-in query string and request body parsing, as well as routing, error handling, and rendering of responses.
-
-Here are some injectable request-scoped types to be aware of:
-- `IJsonApiRequest`: This contains routing information, such as whether a primary, secondary, or relationship endpoint is being accessed.
-- `ITargetedFields`: Lists the attributes and relationships from an incoming POST/PATCH resource request. Any fields missing there should not be stored (partial updates).
-- `IEnumerable`: Provides access to the parsed query string parameters.
-- `IEvaluatedIncludeCache`: This tells the response serializer which related resources to render.
-- `ISparseFieldSetCache`: This tells the response serializer which fields to render in the `attributes` and `relationships` objects.
-
-You may also want to inject the singletons `IJsonApiOptions` (which contains settings such as default page size) and `IResourceGraph` (the JSON:API model of resources, attributes and relationships).
-
-So, back to the topic of where to intercept. It helps to familiarize yourself with the [execution pipeline](~/internals/queries.md).
-Replacing at the service level is the simplest. But it means you'll need to read the parsed query string parameters and invoke
-all resource definition callbacks yourself. And you won't get change detection (HTTP 203 Not Modified).
-Take a look at [JsonApiResourceService](https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/src/JsonApiDotNetCore/Services/JsonApiResourceService.cs) to see what you're missing out on.
-
-You'll get a lot more out of the box if replacing at the repository level instead. You don't need to apply options or analyze query strings.
-And most resource definition callbacks are handled.
-That's because the built-in resource service translates all JSON:API query aspects of the request into a database-agnostic data structure called `QueryLayer`.
-Now the hard part for you becomes reading that data structure and producing data access calls from that.
-If your data store provides a LINQ provider, you can probably reuse [QueryableBuilder](https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/src/JsonApiDotNetCore/Queries/QueryableBuilding/QueryableBuilder.cs),
-which drives the translation into [System.Linq.Expressions](https://learn.microsoft.com/dotnet/csharp/programming-guide/concepts/expression-trees/).
-Note however, that it also produces calls to `.Include("")`, which is an Entity Framework Core-specific extension method, so you'll need to
-[prevent that from happening](https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/src/JsonApiDotNetCore/Queries/QueryableBuilding/QueryLayerIncludeConverter.cs).
-
-The example [here](https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/src/Examples/NoEntityFrameworkExample/Repositories/InMemoryResourceRepository.cs) compiles and executes
-the LINQ query against an in-memory list of resources.
-For [MongoDB](https://github.com/json-api-dotnet/JsonApiDotNetCore.MongoDb/blob/master/src/JsonApiDotNetCore.MongoDb/Repositories/MongoRepository.cs), we use the MongoDB LINQ provider.
-If there's no LINQ provider available, the example [here](https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/src/Examples/DapperExample/Repositories/DapperRepository.cs) may be of help,
-which produces SQL and uses [Dapper](https://github.com/DapperLib/Dapper) for data access.
-
-> [!TIP]
-> [ExpressionTreeVisualizer](https://github.com/zspitz/ExpressionTreeVisualizer) is very helpful in trying to debug LINQ expression trees!
-
-#### I love JsonApiDotNetCore! How can I support the team?
-The best way to express your gratitude is by starring our repository.
-This increases our leverage when asking for bug fixes in dependent projects, such as the .NET runtime and Entity Framework Core.
-You can also [sponsor](https://github.com/sponsors/json-api-dotnet) our project.
-Of course, a simple thank-you message in our [Gitter channel](https://gitter.im/json-api-dotnet-core/Lobby) is appreciated too!
-
-If you'd like to do more: try things out, ask questions, create GitHub bug reports or feature requests, or upvote existing issues that are important to you.
-We welcome PRs, but keep in mind: The worst thing in the world is opening a PR that gets rejected after you've put a lot of effort into it.
-So for any non-trivial changes, please open an issue first to discuss your approach and ensure it fits the product vision.
-
-#### Is there anything else I should be aware of?
-See [Common Pitfalls](~/usage/common-pitfalls.md).
+---
+redirect_url: ../usage/faq.html
+---
diff --git a/docs/getting-started/index.md b/docs/getting-started/index.md
new file mode 100644
index 000000000..0b309e46e
--- /dev/null
+++ b/docs/getting-started/index.md
@@ -0,0 +1,5 @@
+# Getting Started
+
+The easiest way to get started is to run the [example project](https://github.com/json-api-dotnet/JsonApiDotNetCore/tree/master/src/Examples/GettingStarted).
+
+Or create your first JsonApiDotNetCore project by following the steps described [here](https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/README.md#getting-started).
diff --git a/docs/getting-started/install.md b/docs/getting-started/install.md
index bd210e0a7..b09e389c9 100644
--- a/docs/getting-started/install.md
+++ b/docs/getting-started/install.md
@@ -1,24 +1,3 @@
-# Installation
-
-Click [here](https://www.nuget.org/packages/JsonApiDotNetCore/) for the latest NuGet version.
-
-### CLI
-
-```
-dotnet add package JsonApiDotNetCore
-```
-
-### Visual Studio
-
-```powershell
-Install-Package JsonApiDotNetCore
-```
-
-### *.csproj
-
-```xml
-
-
-
-
-```
+---
+redirect_url: index.html
+---
diff --git a/docs/getting-started/step-by-step.md b/docs/getting-started/step-by-step.md
index 57090d2d0..b09e389c9 100644
--- a/docs/getting-started/step-by-step.md
+++ b/docs/getting-started/step-by-step.md
@@ -1,134 +1,3 @@
-# Step-By-Step Guide to a Running API
-
-The most basic use case leverages Entity Framework Core.
-The shortest path to a running API looks like:
-
-- Create a new API project
-- Install
-- Define models
-- Define the DbContext
-- Add services and middleware
-- Seed the database
-- Start the API
-
-This page will walk you through the **simplest** use case. More detailed examples can be found in the detailed usage subsections.
-
-### Create a new API project
-
-```
-mkdir MyApi
-cd MyApi
-dotnet new webapi
-```
-
-### Install
-
-```
-dotnet add package JsonApiDotNetCore
-
-- or -
-
-Install-Package JsonApiDotNetCore
-```
-
-### Define models
-
-Define your domain models such that they implement `IIdentifiable`.
-The easiest way to do this is to inherit from `Identifiable`.
-
-```c#
-#nullable enable
-
-[Resource]
-public class Person : Identifiable
-{
- [Attr]
- public string Name { get; set; } = null!;
-}
-```
-
-### Define the DbContext
-
-Nothing special here, just an ordinary `DbContext`.
-
-```
-public class AppDbContext : DbContext
-{
- public DbSet People => Set();
-
- public AppDbContext(DbContextOptions options)
- : base(options)
- {
- }
-}
-```
-
-### Add services and middleware
-
-Finally, register the services and middleware by adding them to your Program.cs:
-
-```c#
-WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
-
-// Add services to the container.
-
-// Add the Entity Framework Core DbContext like you normally would.
-builder.Services.AddDbContext(options =>
-{
- string connectionString = GetConnectionString();
-
- // Use whatever provider you want, this is just an example.
- options.UseNpgsql(connectionString);
-});
-
-// Add JsonApiDotNetCore services.
-builder.Services.AddJsonApi();
-
-WebApplication app = builder.Build();
-
-// Configure the HTTP request pipeline.
-
-app.UseRouting();
-
-// Add JsonApiDotNetCore middleware.
-app.UseJsonApi();
-
-app.MapControllers();
-
-app.Run();
-```
-
-### Seed the database
-
-One way to seed the database is from your Program.cs:
-
-```c#
-await CreateDatabaseAsync(app.Services);
-
-app.Run();
-
-static async Task CreateDatabaseAsync(IServiceProvider serviceProvider)
-{
- await using AsyncServiceScope scope = serviceProvider.CreateAsyncScope();
-
- var dbContext = scope.ServiceProvider.GetRequiredService();
- await dbContext.Database.EnsureCreatedAsync();
-
- if (!dbContext.People.Any())
- {
- dbContext.People.Add(new Person
- {
- Name = "John Doe"
- });
-
- await dbContext.SaveChangesAsync();
- }
-}
-```
-
-### Start the API
-
-```
-dotnet run
-curl http://localhost:5000/people
-```
+---
+redirect_url: index.html
+---
diff --git a/docs/getting-started/toc.md b/docs/getting-started/toc.md
deleted file mode 100644
index 12f943b7f..000000000
--- a/docs/getting-started/toc.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# [Installation](install.md)
-
-# [Step By Step](step-by-step.md)
-
-# [FAQ](faq.md)
diff --git a/docs/home/assets/img/araxis-logo.png b/docs/home/assets/img/araxis-logo.png
new file mode 100644
index 0000000000000000000000000000000000000000..b25ed12ab84ac5839b693f0e99e4a2f8958b03c4
GIT binary patch
literal 2502
zcmdT`30G5D5{`{5qM$&l2-tEESu_a*j7Zo9iI7F4#n3DPBpWdhk`NNZZW}~Vr$Kg{
zMzDn_7zkj1K!VbUAPS1o$RYwNON4;n*da$TIxn`znfV7Z=e+ywt$VA!s`~1_I`7<%
zhy4un&GbPakO3Nn3IY3xT_4fA$ff{nweBVcjwQL0ZM{4V^xYE?074vvL$FMY
zqcai^i5^y8fDyo2v+ZEz>CPrcBLb1WUo`;9!|FJP!$LSX@OV5Z&l$>OQypNguC5M_
zP7Y2^5I_Txki_5+5+RI)onHZvlmrr+#^TVJ3`-3lfym@?Jgm4}8W|Byh=vo%WH^LK
za3(`wFfsu`AUne#WM^lx3mmrJDH=w!`s$uTi~hHNM#5Jb074uzCk`;Eqb6j{8WF&z
zQGh5kE2$bSUp`PUARE3o>;jE1If>{1v2r96N;a6!p>5JkTVDkG701I2Tdcr)&;KR`!PluN5E>e~b)l
zzSfzG)@sU)_|ea(=3#Kp=7rg)5_S8==7j!$XLn-7eUCid+}y;9t;gC!Co}B`?NxiS
z@_vspTAOij(}peHjv;G1{cem^8k14^fzU`kp3Hb)(pk%YVFRF#YG$tC{{<`jL$-THC=99y=9KyAeUX
zR8}F<*A9hAos*2O2Bl*LO#+eA%5JGNW+tj*0Kkww@P4qZdPk>Wc2Mz4s_y!qN)=7X
zkLTW>(pFGAF8Xywz3(xjaf9sUXHLdCw?2t;A-s8Y#1y;(kMT<+`U`4XZw){Bg)et{
z%Qw5b%t)%DKDE-0rTc3^a=alKW5&4Zi^rrECsNX2ibwo9O>P1;&X-m-fV!ef!i&EWv2)&zdS^4?=+Ip%Tv~i_vy%?#eR7|f+$h@BN
zC{e`v=YDGC0p5A>%9M|9pE=0Eb?2_Lt4)GluBkY^Lgn)vAxS5;P!|fg<3e7Kq*vZc
z0`ICiH$I6_kMKRqrW&hK3fYxI*oB)mqcKS<4V-u3V#C+j(@yr2&Tr$?(6LHyhW*fLL3?1NKQebhC5l6oOsHSZc7GkBO{`Qty}xTil;FF>#}@
z-;KBre`=BtRo_$W48l*=J^WBCa|0^-=Yqo>z5v^p9Gc}LfsFH{Ng~L-8{P-H^Gl6Xc(M$e`8_emd<8H97sJ)`FXYUVW|*3L808GbufN(46nc
z-JZ$l!$2}d#O6;iq1~#Z_bCH`lXd7}kvurFO>tTRFTzW2jml2Xo90`)
ziYe8`%5^Z&vkSw3gXHbtRR<7=Ful-z3Rr&aZ<@|IcC=u79WLy
zdy_8?n=6343qGX#_eEndnZ?+0qxLOWRSyb>|5fb$w6Z||JyNn&HIvhlSEH~4inPxX
z510UrFx+OBfbU^hivE0D%>k^U9{SRF#3fdB$#Any{IqdND%awN!534AboL4fj$Q}|
z0Xk-i?1TJnv&)cmF}nYZ>6_0A6+o^WrfmBjQA#c2f9hO!osH>Ay>e3DSk5+SrW@Z(
zjelSRE#5sYcnoXzBJ#?D(Bb;xmHe%B`rpB-KO~3W{{|n*Ou@|LNb%)e@tu#MV=!1umq61O
+
+