Skip to content

Merge v5 into openapi #1150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 35 commits into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
4c0eafc
Corrected test to detect all fields are retrieved
Dec 20, 2021
3000ba9
Removed unused injected parameters
Dec 20, 2021
f116338
Renamed parameter to match base class
Dec 20, 2021
affef06
TestContext: Only dispose factory when created
Dec 20, 2021
88e2074
Removed external JsonTimeSpanConverter (TimeSpan support was added in…
Dec 20, 2021
b6870f5
Add missing assertion comments
Dec 20, 2021
b17f8f5
Fixed: do not auto-register abstract base classes and interfaces
Dec 20, 2021
8a0657a
Removed Templates checkbox from PR template
Dec 20, 2021
ab7aa7e
Resource management
Dec 21, 2021
b13c4ff
Corrected AddRange with single item
Dec 21, 2021
c2cf072
Merge pull request #1131 from json-api-dotnet/small-fixes
Dec 21, 2021
368e694
Added an example project that uses a different database per tenant.
Jan 15, 2022
9ee8ee7
Merge pull request #1135 from json-api-dotnet/database-per-tenant
maurei Jan 21, 2022
c214e19
Workaround for bug in EF Core 6.0.2
Feb 14, 2022
bc5fbe0
Added workaround for bug in EF Core 6.0.2 (#1139)
Feb 16, 2022
a622954
Bugfix: hide Self link in included resources when there's no register…
Mar 2, 2022
473d53b
Added test
Mar 2, 2022
ab67c86
Fixed: also hide links for missing controllers on deeply nested relat…
Mar 8, 2022
e623e84
Merge pull request #1141 from json-api-dotnet/self-links-fix
maurei Mar 11, 2022
978a311
Replaced references to Error in documentation, which was renamed to E…
Mar 21, 2022
5b99f22
Refreshed expired NuGet API key
Apr 1, 2022
388f94f
Added link to new video (from me) (#1147)
bkoelman Apr 4, 2022
b48f02e
Resource inheritance (#1142)
Apr 4, 2022
a3a9389
Package updates (#1146)
Apr 5, 2022
80c0ce5
Pinned versions of dependent packages for the next major release
bkoelman Apr 6, 2022
4181d4e
Added notes on how to create a new release
bkoelman Apr 6, 2022
4c5d065
Merge pull request #1148 from json-api-dotnet/pin-pkg-versions
maurei Apr 6, 2022
5831f25
Merge pull request #1149 from json-api-dotnet/notes-how-to-release
maurei Apr 6, 2022
f104e06
Increment version number (used for pre-release builds from ci)
bkoelman Apr 6, 2022
0e42ebf
Update ROADMAP.md
bkoelman Apr 6, 2022
8ac90a2
Merge branch 'master' into merge-v5-into-openapi
bkoelman Apr 6, 2022
0e82d2a
Fixes after merging v5 into openapi branch
bkoelman Apr 6, 2022
4dc8115
Fixed: Sorting by ID from a lambda expression in a resource definitio…
bkoelman Apr 6, 2022
71e5398
Increment version number (used for pre-release builds from ci)
bkoelman Apr 6, 2022
c73c2ad
Merge branch 'master' into merge-v5-into-openapi
bkoelman Apr 6, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"isRoot": true,
"tools": {
"jetbrains.resharper.globaltools": {
"version": "2021.3.0",
"version": "2021.3.4",
"commands": [
"jb"
]
},
"regitlint": {
"version": "6.0.6",
"version": "6.0.8",
"commands": [
"regitlint"
]
Expand All @@ -21,7 +21,7 @@
]
},
"dotnet-reportgenerator-globaltool": {
"version": "5.0.0",
"version": "5.1.3",
"commands": [
"reportgenerator"
]
Expand Down
12 changes: 10 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,23 @@ public sealed class AppDbContext : DbContext
}
```

## Creating a release (for maintainers)

- Verify documentation is up-to-date
- Bump the package version in Directory.Build.props
- Create a GitHub release
- Update https://github.com/json-api-dotnet/JsonApiDotNetCore.MongoDb to consume the new version and release
- Create a new branch in https://github.com/json-api-dotnet/MigrationGuide and update README.md in master

## Backporting and hotfixes (for maintainers)

- Checkout the version you want to apply the feature on top of and create a new branch to release the new version:
```
git checkout tags/v2.5.1 -b release/2.5.2
```
- Cherrypick the merge commit: `git cherry-pick {git commit SHA}`
- Bump the package version in the csproj
- Make any other compatibility, documentation or tooling related changes
- Bump the package version in Directory.Build.props
- Make any other compatibility, documentation, or tooling related changes
- Push the branch to origin and verify the build
- Once the build is verified, create a GitHub release, tagging the release branch
- Open a PR back to master with any other additions
1 change: 0 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ Closes #{ISSUE_NUMBER}
- [ ] Complies with our [contributing guidelines](./.github/CONTRIBUTING.md)
- [ ] Adapted tests
- [ ] Documentation updated
- [ ] Created issue to update [Templates](https://github.com/json-api-dotnet/Templates/issues/new): {ISSUE_NUMBER}
3 changes: 2 additions & 1 deletion CodingGuidelines.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
<Rule Id="AV1555" Action="Warning" />
<Rule Id="AV1564" Action="Info" />
<Rule Id="AV1568" Action="Warning" />
<Rule Id="AV1580" Action="None" />
<Rule Id="AV1706" Action="Warning" />
<Rule Id="AV1710" Action="Info" />
<Rule Id="AV1711" Action="Info" />
<Rule Id="AV1738" Action="Warning" />
<Rule Id="AV1739" Action="Warning" />
<Rule Id="AV1745" Action="Warning" />
<Rule Id="AV1755" Action="Warning" />
<Rule Id="AV2210" Action="None" />
<Rule Id="AV2210" Action="Warning" />
<Rule Id="AV2220" Action="Warning" />
<Rule Id="AV2230" Action="Info" />
<Rule Id="AV2305" Action="None" />
Expand Down
18 changes: 11 additions & 7 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<AspNetVersion>6.0.*</AspNetVersion>
<EFCoreVersion>6.0.*</EFCoreVersion>
<EFCorePostgresVersion>6.0.*</EFCorePostgresVersion>
<MicrosoftCodeAnalysisVersion>4.*</MicrosoftCodeAnalysisVersion>
<HumanizerVersion>2.*</HumanizerVersion>
<MicrosoftCodeAnalysisVersion>4.1.*</MicrosoftCodeAnalysisVersion>
<HumanizerVersion>2.14.1</HumanizerVersion>
<SwashbuckleVersion>6.2.*</SwashbuckleVersion>
<JsonApiDotNetCoreVersionPrefix>5.0.0</JsonApiDotNetCoreVersionPrefix>
<JsonApiDotNetCoreVersionPrefix>5.0.2</JsonApiDotNetCoreVersionPrefix>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodingGuidelines.ruleset</CodeAnalysisRuleSet>
<WarningLevel>9999</WarningLevel>
<Nullable>enable</Nullable>
Expand All @@ -18,7 +18,7 @@

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2021.3.0" PrivateAssets="All" />
<PackageReference Include="CSharpGuidelinesAnalyzer" Version="3.7.1" PrivateAssets="All" />
<PackageReference Include="CSharpGuidelinesAnalyzer" Version="3.8.0" PrivateAssets="All" />
<AdditionalFiles Include="$(MSBuildThisFileDirectory)CSharpGuidelinesAnalyzer.config" Visible="False" />
</ItemGroup>

Expand All @@ -28,10 +28,14 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<NoWarn>$(NoWarn);AV2210</NoWarn>
</PropertyGroup>

<!-- Test Project Dependencies -->
<PropertyGroup>
<CoverletVersion>3.1.0</CoverletVersion>
<MoqVersion>4.16.1</MoqVersion>
<TestSdkVersion>17.0.0</TestSdkVersion>
<CoverletVersion>3.1.2</CoverletVersion>
<MoqVersion>4.17.2</MoqVersion>
<TestSdkVersion>17.1.0</TestSdkVersion>
</PropertyGroup>
</Project>
15 changes: 15 additions & 0 deletions JsonApiDotNetCore.sln
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SourceGeneratorTests", "tes
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonApiDotNetCore.Annotations", "src\JsonApiDotNetCore.Annotations\JsonApiDotNetCore.Annotations.csproj", "{83FF097C-C8C6-477B-9FAB-DF99B84978B5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DatabasePerTenantExample", "src\Examples\DatabasePerTenantExample\DatabasePerTenantExample.csproj", "{60334658-BE51-43B3-9C4D-F2BBF56C89CE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonApiDotNetCore.OpenApi", "src\JsonApiDotNetCore.OpenApi\JsonApiDotNetCore.OpenApi.csproj", "{71287D6F-6C3B-44B4-9FCA-E78FE3F02289}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenApiTests", "test\OpenApiTests\OpenApiTests.csproj", "{B693DE14-BB28-496F-AB39-B4E674ABCA80}"
Expand Down Expand Up @@ -276,6 +278,18 @@ Global
{83FF097C-C8C6-477B-9FAB-DF99B84978B5}.Release|x64.Build.0 = Release|Any CPU
{83FF097C-C8C6-477B-9FAB-DF99B84978B5}.Release|x86.ActiveCfg = Release|Any CPU
{83FF097C-C8C6-477B-9FAB-DF99B84978B5}.Release|x86.Build.0 = Release|Any CPU
{60334658-BE51-43B3-9C4D-F2BBF56C89CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{60334658-BE51-43B3-9C4D-F2BBF56C89CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{60334658-BE51-43B3-9C4D-F2BBF56C89CE}.Debug|x64.ActiveCfg = Debug|Any CPU
{60334658-BE51-43B3-9C4D-F2BBF56C89CE}.Debug|x64.Build.0 = Debug|Any CPU
{60334658-BE51-43B3-9C4D-F2BBF56C89CE}.Debug|x86.ActiveCfg = Debug|Any CPU
{60334658-BE51-43B3-9C4D-F2BBF56C89CE}.Debug|x86.Build.0 = Debug|Any CPU
{60334658-BE51-43B3-9C4D-F2BBF56C89CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{60334658-BE51-43B3-9C4D-F2BBF56C89CE}.Release|Any CPU.Build.0 = Release|Any CPU
{60334658-BE51-43B3-9C4D-F2BBF56C89CE}.Release|x64.ActiveCfg = Release|Any CPU
{60334658-BE51-43B3-9C4D-F2BBF56C89CE}.Release|x64.Build.0 = Release|Any CPU
{60334658-BE51-43B3-9C4D-F2BBF56C89CE}.Release|x86.ActiveCfg = Release|Any CPU
{60334658-BE51-43B3-9C4D-F2BBF56C89CE}.Release|x86.Build.0 = Release|Any CPU
{71287D6F-6C3B-44B4-9FCA-E78FE3F02289}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{71287D6F-6C3B-44B4-9FCA-E78FE3F02289}.Debug|Any CPU.Build.0 = Debug|Any CPU
{71287D6F-6C3B-44B4-9FCA-E78FE3F02289}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -358,6 +372,7 @@ Global
{87D066F9-3540-4AC7-A748-134900969EE5} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F}
{0E0B5C51-F7E2-4F40-A4E4-DED0E9731DC9} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F}
{83FF097C-C8C6-477B-9FAB-DF99B84978B5} = {7A2B7ADD-ECB5-4D00-AA6A-D45BD11C97CF}
{60334658-BE51-43B3-9C4D-F2BBF56C89CE} = {026FBC6C-AF76-4568-9B87-EC73457899FD}
{71287D6F-6C3B-44B4-9FCA-E78FE3F02289} = {7A2B7ADD-ECB5-4D00-AA6A-D45BD11C97CF}
{B693DE14-BB28-496F-AB39-B4E674ABCA80} = {24B15015-62E5-42E1-9BA0-ECE6BE7AA15F}
{5ADAA902-5A75-4ECB-B4B4-03291D63CE9C} = {7A2B7ADD-ECB5-4D00-AA6A-D45BD11C97CF}
Expand Down
2 changes: 2 additions & 0 deletions JsonApiDotNetCore.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -632,8 +632,10 @@ $left$ = $right$;</s:String>
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=B3D9EE6B4EC62A4F961EB15F9ADEC2C6/ReplacePattern/@EntryValue">$collection$.IsNullOrEmpty()</s:String>
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=B3D9EE6B4EC62A4F961EB15F9ADEC2C6/SearchPattern/@EntryValue">$collection$ == null || !$collection$.Any()</s:String>
<s:String x:Key="/Default/PatternsAndTemplates/StructuralSearch/Pattern/=B3D9EE6B4EC62A4F961EB15F9ADEC2C6/Severity/@EntryValue">WARNING</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Accurize/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=appsettings/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Assignee/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Contoso/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Injectables/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=jsonapi/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=linebreaks/@EntryIndexedValue">True</s:Boolean>
Expand Down
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,17 @@ The ultimate goal of this library is to eliminate as much boilerplate as possibl

These are some steps you can take to help you understand what this project is and how you can use it:

- [What is JSON:API and why should I use it?](https://nordicapis.com/the-benefits-of-using-json-api/)
- [The JSON:API specification](http://jsonapi.org/format/)
- Demo [Video](https://youtu.be/KAMuo6K7VcE), [Blog](https://dev.to/wunki/getting-started-5dkl)
- [Our documentation](https://www.jsonapi.net/)
- [Check out the example projects](https://github.com/json-api-dotnet/JsonApiDotNetCore/tree/master/src/Examples)
- [Embercasts: Full Stack Ember with ASP.NET Core](https://www.embercasts.com/course/full-stack-ember-with-dotnet/watch/whats-in-this-course-cs)
### 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)

### Official documentation
- [The JSON:API specification](https://jsonapi.org/format/1.1/)
- [JsonApiDotNetCore website](https://www.jsonapi.net/)
- [Roadmap](ROADMAP.md)

## Related Projects
Expand Down Expand Up @@ -79,7 +84,7 @@ See also our [versioning policy](./VERSIONING_POLICY.md).
| | | Core 3.1 | 5 |
| | | 5 | 5 |
| | | 6 | 5 |
| v5.x | Pre-release | 6 | 6 |
| v5.x | Stable | 6 | 6 |

## Contributing

Expand Down
31 changes: 3 additions & 28 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,12 @@ This document provides an overview of the direction this project is heading and

> Disclaimer: This is an open source project. The available time of our contributors varies and therefore we do not plan release dates. This document expresses our current intent, which may change over time.

## v4.x
We have interest in the following topics. It's too soon yet to decide whether they'll make it into v5.x or in a later major version.

We've completed active development on v4.x, but we'll still fix important bugs or add small enhancements on request that don't require breaking changes nor lots of testing.

## v5.x

The need for breaking changes has blocked several efforts in the v4.x release, so now that we're starting work on v5, we're going to catch up.

- [x] Remove Resource Hooks [#1025](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1025)
- [x] Update to .NET 5 with EF Core 5 [#1026](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1026)
- [x] Native many-to-many [#935](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/935)
- [x] Refactorings [#1027](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1027) [#944](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/944)
- [x] Tweak trace logging [#1033](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1033)
- [x] Instrumentation [#1032](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1032)
- [x] Optimized delete to-many [#1030](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1030)
- [x] Support System.Text.Json [#664](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/664) [#999](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/999) [1077](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1077) [1078](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1078)
- [x] Optimize IIdentifiable to ResourceObject conversion [#1028](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1028) [#1024](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1024) [#233](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/233)
- [x] Nullable reference types [#1029](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1029)
- [x] Improved paging links [#1010](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1010)
- [x] Configuration validation [#170](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/170)
- [x] Auto-generated controllers [#732](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/732) [#365](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/365)
- [x] Support .NET 6 with EF Core 6 [#1109](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1109)
- [x] Extract annotations into separate package [#730](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/730)

Aside from the list above, we have interest in the following topics. It's too soon yet to decide whether they'll make it into v5.x or in a later major version.

- Optimistic concurrency [#1004](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1004)
- Optimistic concurrency [#1119](https://github.com/json-api-dotnet/JsonApiDotNetCore/pull/1119)
- OpenAPI (Swagger) [#1046](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1046)
- Fluent API [#776](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/776)
- Resource inheritance [#844](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/844)
- Idempotency
- Idempotency [#1132](https://github.com/json-api-dotnet/JsonApiDotNetCore/pull/1132)

## Feedback

Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ for:
- provider: NuGet
skip_symbols: false
api_key:
secure: OBYPCgp3WCuwkDRMuZ9a4QcBdTja/lqlUwZ+Yl5VHqooSJRVTYKP5y15XK0fuHsZ
secure: S9fkLwmhi7w+DGouXYqYq/1PGocnYo8UBUKwv+BGpWHnzE6yHZEYth3j/XJ9Ydsa
on:
branch: master
appveyor_repo_tag: true
- provider: NuGet
skip_symbols: false
api_key:
secure: OBYPCgp3WCuwkDRMuZ9a4QcBdTja/lqlUwZ+Yl5VHqooSJRVTYKP5y15XK0fuHsZ
secure: S9fkLwmhi7w+DGouXYqYq/1PGocnYo8UBUKwv+BGpWHnzE6yHZEYth3j/XJ9Ydsa
on:
branch: /release\/.+/
appveyor_repo_tag: true
Expand Down
18 changes: 13 additions & 5 deletions benchmarks/Serialization/ResourceSerializationBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,19 @@ protected override IEvaluatedIncludeCache CreateEvaluatedIncludeCache(IResourceG
RelationshipAttribute multi4 = resourceAType.GetRelationshipByPropertyName(nameof(OutgoingResource.Multi4));
RelationshipAttribute multi5 = resourceAType.GetRelationshipByPropertyName(nameof(OutgoingResource.Multi5));

ImmutableArray<ResourceFieldAttribute> chain = ImmutableArray.Create<ResourceFieldAttribute>(single2, single3, multi4, multi5);
IEnumerable<ResourceFieldChainExpression> chains = new ResourceFieldChainExpression(chain).AsEnumerable();

var converter = new IncludeChainConverter();
IncludeExpression include = converter.FromRelationshipChains(chains);
var include = new IncludeExpression(new HashSet<IncludeElementExpression>
{
new(single2, new HashSet<IncludeElementExpression>
{
new(single3, new HashSet<IncludeElementExpression>
{
new(multi4, new HashSet<IncludeElementExpression>
{
new(multi5)
}.ToImmutableHashSet())
}.ToImmutableHashSet())
}.ToImmutableHashSet())
}.ToImmutableHashSet());

var cache = new EvaluatedIncludeCache();
cache.Set(include);
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/Serialization/SerializationBenchmarkBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ public Task OnSetToManyRelationshipAsync<TResource>(TResource leftResource, HasM
return Task.CompletedTask;
}

public Task OnAddToRelationshipAsync<TResource, TId>(TId leftResourceId, HasManyAttribute hasManyRelationship, ISet<IIdentifiable> rightResourceIds,
public Task OnAddToRelationshipAsync<TResource>(TResource leftResource, HasManyAttribute hasManyRelationship, ISet<IIdentifiable> rightResourceIds,
CancellationToken cancellationToken)
where TResource : class, IIdentifiable<TId>
where TResource : class, IIdentifiable
{
return Task.CompletedTask;
}
Expand Down Expand Up @@ -245,7 +245,7 @@ public RelationshipLinks GetRelationshipLinks(RelationshipAttribute relationship

private sealed class FakeMetaBuilder : IMetaBuilder
{
public void Add(IReadOnlyDictionary<string, object?> values)
public void Add(IDictionary<string, object?> values)
{
}

Expand Down
2 changes: 1 addition & 1 deletion docs/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"src": [
{
"files": [ "**/JsonApiDotNetCore.csproj" ],
"files": [ "**/JsonApiDotNetCore.csproj","**/JsonApiDotNetCore.Annotations.csproj" ],
"src": "../"
}
],
Expand Down
12 changes: 6 additions & 6 deletions docs/usage/errors.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Errors

Errors returned will contain only the properties that are set on the `Error` class. Custom fields can be added through `Error.Meta`.
You can create a custom error by throwing a `JsonApiException` (which accepts an `Error` instance), or returning an `Error` instance from an `ActionResult` in a controller.
Please keep in mind that JSON:API requires Title to be a generic message, while Detail should contain information about the specific problem occurence.
Errors returned will contain only the properties that are set on the `ErrorObject` class. Custom fields can be added through `ErrorObject.Meta`.
You can create a custom error by throwing a `JsonApiException` (which accepts an `ErrorObject` instance), or returning an `ErrorObject` instance from an `ActionResult` in a controller.
Please keep in mind that JSON:API requires `Title` to be a generic message, while `Detail` should contain information about the specific problem occurence.

From a controller method:

```c#
return Conflict(new Error(HttpStatusCode.Conflict)
return Conflict(new ErrorObject(HttpStatusCode.Conflict)
{
Title = "Target resource was modified by another user.",
Detail = $"User {userName} changed the {resourceField} field on {resourceName} resource."
Expand All @@ -17,7 +17,7 @@ return Conflict(new Error(HttpStatusCode.Conflict)
From other code:

```c#
throw new JsonApiException(new Error(HttpStatusCode.Conflict)
throw new JsonApiException(new ErrorObject(HttpStatusCode.Conflict)
{
Title = "Target resource was modified by another user.",
Detail = $"User {userName} changed the {resourceField} field on {resourceName} resource."
Expand Down Expand Up @@ -75,7 +75,7 @@ public class CustomExceptionHandler : ExceptionHandler
{
return new[]
{
new Error(HttpStatusCode.Conflict)
new ErrorObject(HttpStatusCode.Conflict)
{
Title = "Product is temporarily available.",
Detail = $"Product {productOutOfStock.ProductId} " +
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/extensibility/resource-definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public class EmployeeDefinition : JsonApiResourceDefinition<Employee, int>
if (existingIncludes.Any(include =>
include.Relationship.Property.Name == nameof(Employee.Manager)))
{
throw new JsonApiException(new Error(HttpStatusCode.BadRequest)
throw new JsonApiException(new ErrorObject(HttpStatusCode.BadRequest)
{
Title = "Including the manager of employees is not permitted."
});
Expand Down
Loading