Skip to content

Commit fb8913f

Browse files
committed
Merge master
2 parents 1c4d034 + b8f63e5 commit fb8913f

File tree

829 files changed

+19805
-14554
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

829 files changed

+19805
-14554
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"jetbrains.resharper.globaltools": {
6-
"version": "2021.1.4",
6+
"version": "2021.2.2",
77
"commands": [
88
"jb"
99
]

Build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function CheckLastExitCode {
88

99
function RunInspectCode {
1010
$outputPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), 'jetbrains-inspectcode-results.xml')
11-
dotnet jb inspectcode JsonApiDotNetCore.sln --output="$outputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=SolutionPersonal -dsl=ProjectPersonal
11+
dotnet jb inspectcode JsonApiDotNetCore.sln --no-build --output="$outputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=SolutionPersonal -dsl=ProjectPersonal
1212
CheckLastExitCode
1313

1414
[xml]$xml = Get-Content "$outputPath"

CSharpGuidelinesAnalyzer.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<cSharpGuidelinesAnalyzerSettings>
33
<setting rule="AV1561" name="MaxParameterCount" value="6" />
4-
<setting rule="AV1561" name="MaxConstructorParameterCount" value="12" />
4+
<setting rule="AV1561" name="MaxConstructorParameterCount" value="13" />
55
</cSharpGuidelinesAnalyzerSettings>

Directory.Build.props

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
<JsonApiDotNetCoreVersionPrefix>4.2.0</JsonApiDotNetCoreVersionPrefix>
99
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodingGuidelines.ruleset</CodeAnalysisRuleSet>
1010
<WarningLevel>9999</WarningLevel>
11+
<Nullable>enable</Nullable>
1112
</PropertyGroup>
1213

1314
<ItemGroup>
14-
<PackageReference Include="JetBrains.Annotations" Version="2021.1.0" PrivateAssets="All" />
15+
<PackageReference Include="JetBrains.Annotations" Version="2021.3.0" PrivateAssets="All" />
1516
<PackageReference Include="CSharpGuidelinesAnalyzer" Version="3.7.0" PrivateAssets="All" />
1617
<AdditionalFiles Include="$(MSBuildThisFileDirectory)CSharpGuidelinesAnalyzer.config" Visible="False" />
1718
</ItemGroup>
@@ -26,9 +27,9 @@
2627
<PropertyGroup>
2728
<BogusVersion>33.1.1</BogusVersion>
2829
<CoverletVersion>3.1.0</CoverletVersion>
29-
<FluentAssertionsVersion>6.1.0</FluentAssertionsVersion>
30+
<FluentAssertionsVersion>6.2.0</FluentAssertionsVersion>
3031
<MoqVersion>4.16.1</MoqVersion>
3132
<XUnitVersion>2.4.*</XUnitVersion>
32-
<TestSdkVersion>16.11.0</TestSdkVersion>
33+
<TestSdkVersion>17.0.0</TestSdkVersion>
3334
</PropertyGroup>
3435
</Project>

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ public class Startup
8787
The following chart should help you pick the best version, based on your environment.
8888
See also our [versioning policy](./VERSIONING_POLICY.md).
8989

90-
| .NET version | EF Core version | JsonApiDotNetCore version |
91-
| ------------ | --------------- | ------------------------- |
92-
| Core 2.x | 2.x | 3.x |
93-
| Core 3.1 | 3.1 | 4.x |
94-
| Core 3.1 | 5 | 4.x |
95-
| 5 | 5 | 4.x or 5.x |
96-
| 6 | 6 | 5.x |
90+
| .NET version | Entity Framework Core version | JsonApiDotNetCore version |
91+
| ------------ | ----------------------------- | ------------------------- |
92+
| Core 2.x | 2.x | 3.x |
93+
| Core 3.1 | 3.1 | 4.x |
94+
| Core 3.1 | 5 | 4.x |
95+
| 5 | 5 | 4.x or 5.x |
96+
| 6 | 6 | 5.x |
9797

9898
## Contributing
9999

ROADMAP.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ The need for breaking changes has blocked several efforts in the v4.x release, s
2020
- [x] Instrumentation [#1032](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1032)
2121
- [x] Optimized delete to-many [#1030](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1030)
2222
- [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)
23-
- [ ] 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)
24-
- [ ] Nullable reference types [#1029](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1029)
23+
- [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)
24+
- [x] Nullable reference types [#1029](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1029)
25+
- [x] Improved paging links [#1010](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1010)
2526

2627
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.
2728

28-
- Improved paging links [#1010](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1010)
2929
- Auto-generated controllers [#732](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/732) [#365](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/365)
3030
- Configuration validation [#170](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/170)
3131
- Optimistic concurrency [#1004](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1004)

appveyor.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ for:
4343
# https://dotnet.github.io/docfx/tutorial/docfx_getting_started.html
4444
git checkout $env:APPVEYOR_REPO_BRANCH -q
4545
}
46-
choco install docfx -y
46+
# Pinning to previous version, because zip of v2.58.8 (released 2d ago) is corrupt.
47+
# Tracked at https://github.com/dotnet/docfx/issues/7689
48+
choco install docfx -y --version 2.58.5
49+
if ($lastexitcode -ne 0) {
50+
throw "docfx install failed with exit code $lastexitcode."
51+
}
4752
after_build:
4853
- pwsh: |
4954
CD ./docs

benchmarks/BenchmarkResource.cs

Lines changed: 0 additions & 16 deletions
This file was deleted.

benchmarks/BenchmarkResourcePublicNames.cs

Lines changed: 0 additions & 10 deletions
This file was deleted.

benchmarks/Benchmarks.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</ItemGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="BenchmarkDotNet" Version="0.13.0" />
12+
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
1313
<PackageReference Include="Moq" Version="$(MoqVersion)" />
1414
</ItemGroup>
1515
</Project>

benchmarks/DependencyFactory.cs

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.ComponentModel.Design;
4+
using System.Text.Json;
5+
using JetBrains.Annotations;
6+
using JsonApiDotNetCore.Configuration;
7+
using JsonApiDotNetCore.Middleware;
8+
using JsonApiDotNetCore.Resources;
9+
using JsonApiDotNetCore.Resources.Annotations;
10+
using JsonApiDotNetCore.Serialization.JsonConverters;
11+
using JsonApiDotNetCore.Serialization.Request.Adapters;
12+
using Microsoft.Extensions.Logging.Abstractions;
13+
14+
namespace Benchmarks.Deserialization
15+
{
16+
public abstract class DeserializationBenchmarkBase
17+
{
18+
protected readonly JsonSerializerOptions SerializerReadOptions;
19+
protected readonly DocumentAdapter DocumentAdapter;
20+
21+
protected DeserializationBenchmarkBase()
22+
{
23+
var options = new JsonApiOptions();
24+
IResourceGraph resourceGraph = new ResourceGraphBuilder(options, NullLoggerFactory.Instance).Add<IncomingResource>().Build();
25+
options.SerializerOptions.Converters.Add(new ResourceObjectConverter(resourceGraph));
26+
SerializerReadOptions = ((IJsonApiOptions)options).SerializerReadOptions;
27+
28+
var serviceContainer = new ServiceContainer();
29+
var resourceFactory = new ResourceFactory(serviceContainer);
30+
var resourceDefinitionAccessor = new ResourceDefinitionAccessor(resourceGraph, serviceContainer);
31+
32+
serviceContainer.AddService(typeof(IResourceDefinitionAccessor), resourceDefinitionAccessor);
33+
34+
serviceContainer.AddService(typeof(IResourceDefinition<IncomingResource, int>),
35+
new JsonApiResourceDefinition<IncomingResource, int>(resourceGraph));
36+
37+
// ReSharper disable once VirtualMemberCallInConstructor
38+
JsonApiRequest request = CreateJsonApiRequest(resourceGraph);
39+
var targetedFields = new TargetedFields();
40+
41+
var resourceIdentifierObjectAdapter = new ResourceIdentifierObjectAdapter(resourceGraph, resourceFactory);
42+
var relationshipDataAdapter = new RelationshipDataAdapter(resourceIdentifierObjectAdapter);
43+
var resourceObjectAdapter = new ResourceObjectAdapter(resourceGraph, resourceFactory, options, relationshipDataAdapter);
44+
var resourceDataAdapter = new ResourceDataAdapter(resourceDefinitionAccessor, resourceObjectAdapter);
45+
46+
var atomicReferenceAdapter = new AtomicReferenceAdapter(resourceGraph, resourceFactory);
47+
var atomicOperationResourceDataAdapter = new ResourceDataInOperationsRequestAdapter(resourceDefinitionAccessor, resourceObjectAdapter);
48+
49+
var atomicOperationObjectAdapter = new AtomicOperationObjectAdapter(options, atomicReferenceAdapter,
50+
atomicOperationResourceDataAdapter, relationshipDataAdapter);
51+
52+
var resourceDocumentAdapter = new DocumentInResourceOrRelationshipRequestAdapter(options, resourceDataAdapter, relationshipDataAdapter);
53+
var operationsDocumentAdapter = new DocumentInOperationsRequestAdapter(options, atomicOperationObjectAdapter);
54+
55+
DocumentAdapter = new DocumentAdapter(request, targetedFields, resourceDocumentAdapter, operationsDocumentAdapter);
56+
}
57+
58+
protected abstract JsonApiRequest CreateJsonApiRequest(IResourceGraph resourceGraph);
59+
60+
[UsedImplicitly(ImplicitUseTargetFlags.Members)]
61+
public sealed class IncomingResource : Identifiable<int>
62+
{
63+
[Attr]
64+
public bool Attribute01 { get; set; }
65+
66+
[Attr]
67+
public char Attribute02 { get; set; }
68+
69+
[Attr]
70+
public ulong? Attribute03 { get; set; }
71+
72+
[Attr]
73+
public decimal Attribute04 { get; set; }
74+
75+
[Attr]
76+
public float? Attribute05 { get; set; }
77+
78+
[Attr]
79+
public string Attribute06 { get; set; } = null!;
80+
81+
[Attr]
82+
public DateTime? Attribute07 { get; set; }
83+
84+
[Attr]
85+
public DateTimeOffset? Attribute08 { get; set; }
86+
87+
[Attr]
88+
public TimeSpan? Attribute09 { get; set; }
89+
90+
[Attr]
91+
public DayOfWeek Attribute10 { get; set; }
92+
93+
[HasOne]
94+
public IncomingResource Single1 { get; set; } = null!;
95+
96+
[HasOne]
97+
public IncomingResource Single2 { get; set; } = null!;
98+
99+
[HasOne]
100+
public IncomingResource Single3 { get; set; } = null!;
101+
102+
[HasOne]
103+
public IncomingResource Single4 { get; set; } = null!;
104+
105+
[HasOne]
106+
public IncomingResource Single5 { get; set; } = null!;
107+
108+
[HasMany]
109+
public ISet<IncomingResource> Multi1 { get; set; } = null!;
110+
111+
[HasMany]
112+
public ISet<IncomingResource> Multi2 { get; set; } = null!;
113+
114+
[HasMany]
115+
public ISet<IncomingResource> Multi3 { get; set; } = null!;
116+
117+
[HasMany]
118+
public ISet<IncomingResource> Multi4 { get; set; } = null!;
119+
120+
[HasMany]
121+
public ISet<IncomingResource> Multi5 { get; set; } = null!;
122+
}
123+
}
124+
}

0 commit comments

Comments
 (0)