From c42c4b619bfdfa44e4eae45312c05d9d46b2ce0d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 26 Jan 2025 20:44:43 +0000 Subject: [PATCH 1/6] Bump jetbrains.resharper.globaltools from 2024.3.3 to 2024.3.4 (#1669) --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index f18a477221..fd1839e408 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "jetbrains.resharper.globaltools": { - "version": "2024.3.3", + "version": "2024.3.4", "commands": [ "jb" ], From 3e63c4c93039b86a7237a5ac8fa8c8c43dfd405f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 8 Feb 2025 14:36:23 +0000 Subject: [PATCH 2/6] Bump jetbrains.resharper.globaltools from 2024.3.4 to 2024.3.5 (#1672) --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index fd1839e408..ea671b47ee 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "jetbrains.resharper.globaltools": { - "version": "2024.3.4", + "version": "2024.3.5", "commands": [ "jb" ], From d98f1df640d242d01231037de500b8f6ec37526f Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Fri, 14 Feb 2025 00:16:37 +0100 Subject: [PATCH 3/6] Block new buggy .NET SDK (#1678) * Block new buggy .NET SDK * Remove SourceLink NuGet reference (included in .NET 8 SDK) --- .github/workflows/build.yml | 15 +++++++++------ .github/workflows/codeql.yml | 5 +++-- package-versions.props | 1 - .../JsonApiDotNetCore.Annotations.csproj | 2 -- src/JsonApiDotNetCore/JsonApiDotNetCore.csproj | 2 -- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 84616d1d42..b42c08d59c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,9 +45,10 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: + # Block buggy release from February 11, 2025 dotnet-version: | - 8.0.x - 9.0.x + 8.0.309 + 9.0.103 - name: Show installed versions shell: pwsh run: | @@ -163,9 +164,10 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: + # Block buggy release from February 11, 2025 dotnet-version: | - 8.0.x - 9.0.x + 8.0.309 + 9.0.103 - name: Git checkout uses: actions/checkout@v4 - name: Restore tools @@ -218,9 +220,10 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: + # Block buggy release from February 11, 2025 dotnet-version: | - 8.0.x - 9.0.x + 8.0.309 + 9.0.103 - name: Git checkout uses: actions/checkout@v4 with: diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 92e716594d..8e430ee6a4 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -26,9 +26,10 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: + # Block buggy release from February 11, 2025 dotnet-version: | - 8.0.x - 9.0.x + 8.0.309 + 9.0.103 - name: Git checkout uses: actions/checkout@v4 - name: Initialize CodeQL diff --git a/package-versions.props b/package-versions.props index 8594f66150..2a26bd7b7a 100644 --- a/package-versions.props +++ b/package-versions.props @@ -14,7 +14,6 @@ 7.0.* 2.4.* 2.0.* - 8.0.* 9.0.* 17.12.* 2.9.* diff --git a/src/JsonApiDotNetCore.Annotations/JsonApiDotNetCore.Annotations.csproj b/src/JsonApiDotNetCore.Annotations/JsonApiDotNetCore.Annotations.csproj index 09968a0922..755299c79a 100644 --- a/src/JsonApiDotNetCore.Annotations/JsonApiDotNetCore.Annotations.csproj +++ b/src/JsonApiDotNetCore.Annotations/JsonApiDotNetCore.Annotations.csproj @@ -20,7 +20,6 @@ package-icon.png PackageReadme.md true - true embedded @@ -47,7 +46,6 @@ - diff --git a/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj b/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj index b30f89cb9f..91809e8903 100644 --- a/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj +++ b/src/JsonApiDotNetCore/JsonApiDotNetCore.csproj @@ -19,7 +19,6 @@ package-icon.png PackageReadme.md true - true embedded @@ -42,7 +41,6 @@ - From bef0863fd98685dce3e44e0e410cccb8ed4ae7c6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 00:24:04 +0000 Subject: [PATCH 4/6] Bump dotnet-reportgenerator-globaltool from 5.4.3 to 5.4.4 (#1674) --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index ea671b47ee..4ae453e0c4 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -17,7 +17,7 @@ "rollForward": false }, "dotnet-reportgenerator-globaltool": { - "version": "5.4.3", + "version": "5.4.4", "commands": [ "reportgenerator" ], From 1e8275c959be7f683bd37cf21dd57c6f391880b0 Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Sat, 15 Feb 2025 11:48:32 +0100 Subject: [PATCH 5/6] Add note about shared models (#1679) --- docs/usage/common-pitfalls.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/usage/common-pitfalls.md b/docs/usage/common-pitfalls.md index f1f3fed3d6..9e839abb06 100644 --- a/docs/usage/common-pitfalls.md +++ b/docs/usage/common-pitfalls.md @@ -50,7 +50,7 @@ Did you notice the missing type of the `LoginAccount.Customer` property? We must This is only one of the issues you'll run into. Just don't go there. The right way to model this is by having only `Customer` instead of `WebCustomer` and `AdminCustomer`. And then: -- Hide the `CreditRating` property for web users using [this](https://www.jsonapi.net/usage/extensibility/resource-definitions.html#excluding-fields) approach. +- Hide the `CreditRating` property for web users using [this](~/usage/extensibility/resource-definitions.md#excluding-fields) approach. - Block web users from setting the `CreditRating` property from POST/PATCH resource endpoints by either: - Detecting if the `CreditRating` property has changed, such as done [here](https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/test/JsonApiDotNetCoreTests/IntegrationTests/InputValidation/RequestBody/WorkflowDefinition.cs). - Injecting `ITargetedFields`, throwing an error when it contains the `CreditRating` property. @@ -87,6 +87,11 @@ Neither sounds very compelling. If stored procedures is what you need, you're be Although recommended by Microsoft for hard-written controllers, the opinionated behavior of [`[ApiController]`](https://learn.microsoft.com/en-us/aspnet/core/web-api/?view=aspnetcore-7.0#apicontroller-attribute) violates the JSON:API specification. Despite JsonApiDotNetCore trying its best to deal with it, the experience won't be as good as leaving it out. +#### Don't use auto-generated controllers with shared models + +When model classes are defined in a separate project, the controllers are generated in that project as well, which is probably not what you want. +For details, see [here](~/usage/extensibility/controllers.md#auto-generated-controllers). + #### Register/override injectable services Register your JSON:API resource services, resource definitions and repositories with `services.AddResourceService/AddResourceDefinition/AddResourceRepository()` instead of `services.AddScoped()`. When using [Auto-discovery](~/usage/resource-graph.md#auto-discovery), you don't need to register these at all. From 169ffee3a7f46a9c5c4c6d9c6a3bc6dc254f6924 Mon Sep 17 00:00:00 2001 From: Bart Koelman <10324372+bkoelman@users.noreply.github.com> Date: Sat, 15 Feb 2025 13:15:58 +0100 Subject: [PATCH 6/6] Fail docfx on invalid internal link, fix build warning based on https://github.com/dotnet/docfx/issues/9804 (#1681) --- .github/workflows/build.yml | 2 +- docs/build-dev.ps1 | 2 +- docs/docfx.json | 110 ++++++++++++++++++++---------------- 3 files changed, 64 insertions(+), 50 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b42c08d59c..d16479acd2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -133,7 +133,7 @@ jobs: run: | cd docs & ./generate-examples.ps1 - dotnet docfx docfx.json + dotnet docfx docfx.json --warningsAsErrors true if ($LastExitCode -ne 0) { Write-Error "docfx failed with exit code $LastExitCode." } diff --git a/docs/build-dev.ps1 b/docs/build-dev.ps1 index d65826687a..6345875fc7 100644 --- a/docs/build-dev.ps1 +++ b/docs/build-dev.ps1 @@ -40,7 +40,7 @@ if (-Not $NoBuild -Or -Not (Test-Path -Path _site)) { dotnet tool restore VerifySuccessExitCode -dotnet docfx ./docfx.json +dotnet docfx ./docfx.json --warningsAsErrors true VerifySuccessExitCode Copy-Item -Force home/*.html _site/ diff --git a/docs/docfx.json b/docs/docfx.json index eb94da412e..da0c58cac8 100644 --- a/docs/docfx.json +++ b/docs/docfx.json @@ -1,53 +1,67 @@ { - "metadata": [ + "metadata": [ + { + "properties": { + "ProduceReferenceAssembly": "true" + }, + "src": [ { - "src": [ - { - "files": [ "**/JsonApiDotNetCore.csproj","**/JsonApiDotNetCore.Annotations.csproj" ], - "src": "../" - } - ], - "dest": "api", - "disableGitFeatures": false + "files": [ + "**/JsonApiDotNetCore.csproj", + "**/JsonApiDotNetCore.Annotations.csproj" + ], + "src": "../" } - ], - "build": { - "content": [ - { - "files": [ - "api/**.yml", - "api/index.md", - "getting-started/**.md", - "getting-started/**/toc.yml", - "usage/**.md", - "request-examples/**.md", - "internals/**.md", - "toc.yml", - "*.md" - ], - "exclude": [ - "**/README.md" - ] - } - ], - "resource": [ - { - "files": [ "diagrams/*.svg" ] - } - ], - "overwrite": [ - { - "exclude": [ "obj/**", "_site/**" ] - } - ], - "dest": "_site", - "globalMetadataFiles": [], - "fileMetadataFiles": [], - "template": [ "default", "modern" ], - "postProcessors": [], - "noLangKeyword": false, - "keepFileLink": false, - "cleanupCacheHistory": false, - "disableGitFeatures": false + ], + "dest": "api", + "disableGitFeatures": false } + ], + "build": { + "content": [ + { + "files": [ + "api/**.yml", + "api/index.md", + "getting-started/**.md", + "getting-started/**/toc.yml", + "usage/**.md", + "request-examples/**.md", + "internals/**.md", + "toc.yml", + "*.md" + ], + "exclude": [ + "**/README.md" + ] + } + ], + "resource": [ + { + "files": [ + "diagrams/*.svg" + ] + } + ], + "overwrite": [ + { + "exclude": [ + "obj/**", + "_site/**" + ] + } + ], + "dest": "_site", + "globalMetadataFiles": [], + "fileMetadataFiles": [], + "template": [ + "default", + "modern" + ], + "postProcessors": [], + "noLangKeyword": false, + "keepFileLink": false, + "cleanupCacheHistory": false, + "disableGitFeatures": false + } }