Skip to content
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

Update openapi branch #1105

Merged
merged 28 commits into from
Nov 23, 2021
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
fb0c5fc
Empty commit to republish docs from master branch
Oct 18, 2021
758a191
Redesign conversion between JSON objects and ASP.NET models (#1091)
Oct 27, 2021
4a2abe9
Remove short-hand interfaces for TId is int (#1093)
Oct 28, 2021
f0d638f
Nullable reference types (#1095)
Nov 3, 2021
edfcd8c
Abort build when install failed
Nov 3, 2021
1c2313a
Downgrade docfx due to published corrupt zip
Nov 3, 2021
4798144
Secondary paging (#1100)
Nov 4, 2021
b8f63e5
Add None enum member to flags
Nov 4, 2021
fb8913f
Merge master
maurei Nov 4, 2021
b88d39e
fix broken build
Nov 4, 2021
78a4e9d
Resource Graph validations (#1101)
Nov 8, 2021
40f6826
- Replaced ResourceContext with ResourceType and calls to ResourceTyp…
maurei Nov 8, 2021
ee9f2eb
removed JsonApiObjectNullabilityProcessor and enabled NRT support in …
maurei Nov 8, 2021
7b78e99
Remove unused members
maurei Nov 8, 2021
fb5102f
Merge branch 'master' into master-into-openapi
maurei Nov 8, 2021
67b39e7
Merge branch 'openapi' into master-into-openapi
maurei Nov 9, 2021
b7930de
Added authors element to NuGet package spec
Nov 9, 2021
1b01e52
Added .NET 6 support to roadmap
Nov 15, 2021
e07903c
Process review feedback
maurei Nov 16, 2021
8a6bfac
Fix code cleanup (#1107)
Nov 18, 2021
a1b0a7b
Process review feedback
maurei Nov 19, 2021
ae17e01
Various fixes and improvements (#1114)
Nov 22, 2021
15f5923
Fixed: swapped method names
Nov 22, 2021
a6e11be
- Renamed ExpansibleEndpointMetadata to NonPrimaryEndpointMetadata
maurei Nov 22, 2021
1bdb70a
Process review feedback
maurei Nov 22, 2021
17fed9b
Rephrase
maurei Nov 22, 2021
8694e6a
Merge branch 'master' into master-into-openapi
Nov 23, 2021
d50719b
Update version prefix after merge
Nov 23, 2021
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
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"jetbrains.resharper.globaltools": {
"version": "2021.1.4",
"version": "2021.2.2",
"commands": [
"jb"
]
Expand Down
2 changes: 1 addition & 1 deletion Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function CheckLastExitCode {

function RunInspectCode {
$outputPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), 'jetbrains-inspectcode-results.xml')
dotnet jb inspectcode JsonApiDotNetCore.sln --output="$outputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=SolutionPersonal -dsl=ProjectPersonal
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
CheckLastExitCode

[xml]$xml = Get-Content "$outputPath"
Expand Down
2 changes: 1 addition & 1 deletion CSharpGuidelinesAnalyzer.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<cSharpGuidelinesAnalyzerSettings>
<setting rule="AV1561" name="MaxParameterCount" value="6" />
<setting rule="AV1561" name="MaxConstructorParameterCount" value="12" />
<setting rule="AV1561" name="MaxConstructorParameterCount" value="13" />
</cSharpGuidelinesAnalyzerSettings>
7 changes: 4 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
<JsonApiDotNetCoreVersionPrefix>4.2.0</JsonApiDotNetCoreVersionPrefix>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodingGuidelines.ruleset</CodeAnalysisRuleSet>
<WarningLevel>9999</WarningLevel>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2021.1.0" PrivateAssets="All" />
<PackageReference Include="JetBrains.Annotations" Version="2021.3.0" PrivateAssets="All" />
<PackageReference Include="CSharpGuidelinesAnalyzer" Version="3.7.0" PrivateAssets="All" />
<AdditionalFiles Include="$(MSBuildThisFileDirectory)CSharpGuidelinesAnalyzer.config" Visible="False" />
</ItemGroup>
Expand All @@ -26,9 +27,9 @@
<PropertyGroup>
<BogusVersion>33.1.1</BogusVersion>
<CoverletVersion>3.1.0</CoverletVersion>
<FluentAssertionsVersion>6.1.0</FluentAssertionsVersion>
<FluentAssertionsVersion>6.2.0</FluentAssertionsVersion>
<MoqVersion>4.16.1</MoqVersion>
<XUnitVersion>2.4.*</XUnitVersion>
<TestSdkVersion>16.11.0</TestSdkVersion>
<TestSdkVersion>17.0.0</TestSdkVersion>
</PropertyGroup>
</Project>
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ public class Startup
The following chart should help you pick the best version, based on your environment.
See also our [versioning policy](./VERSIONING_POLICY.md).

| .NET version | EF Core version | JsonApiDotNetCore version |
| ------------ | --------------- | ------------------------- |
| Core 2.x | 2.x | 3.x |
| Core 3.1 | 3.1 | 4.x |
| Core 3.1 | 5 | 4.x |
| 5 | 5 | 4.x or 5.x |
| 6 | 6 | 5.x |
| .NET version | Entity Framework Core version | JsonApiDotNetCore version |
| ------------ | ----------------------------- | ------------------------- |
| Core 2.x | 2.x | 3.x |
| Core 3.1 | 3.1 | 4.x |
| Core 3.1 | 5 | 4.x |
| 5 | 5 | 4.x or 5.x |
| 6 | 6 | 5.x |

## Contributing

Expand Down
8 changes: 4 additions & 4 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ The need for breaking changes has blocked several efforts in the v4.x release, s
- [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)
- [ ] 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)
- [ ] Nullable reference types [#1029](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1029)
- [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)

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.

- Improved paging links [#1010](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1010)
- Auto-generated controllers [#732](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/732) [#365](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/365)
- Configuration validation [#170](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/170)
- Optimistic concurrency [#1004](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1004)
- Extract annotations into separate package [#730](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/730)
- OpenAPI (Swagger) [#1046](https://github.com/json-api-dotnet/JsonApiDotNetCore/issues/1046)
Expand Down
7 changes: 6 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ for:
# https://dotnet.github.io/docfx/tutorial/docfx_getting_started.html
git checkout $env:APPVEYOR_REPO_BRANCH -q
}
choco install docfx -y
# Pinning to previous version, because zip of v2.58.8 (released 2d ago) is corrupt.
# Tracked at https://github.com/dotnet/docfx/issues/7689
choco install docfx -y --version 2.58.5
if ($lastexitcode -ne 0) {
throw "docfx install failed with exit code $lastexitcode."
}
after_build:
- pwsh: |
CD ./docs
Expand Down
16 changes: 0 additions & 16 deletions benchmarks/BenchmarkResource.cs

This file was deleted.

10 changes: 0 additions & 10 deletions benchmarks/BenchmarkResourcePublicNames.cs

This file was deleted.

2 changes: 1 addition & 1 deletion benchmarks/Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.0" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
<PackageReference Include="Moq" Version="$(MoqVersion)" />
</ItemGroup>
</Project>
18 changes: 0 additions & 18 deletions benchmarks/DependencyFactory.cs

This file was deleted.

124 changes: 124 additions & 0 deletions benchmarks/Deserialization/DeserializationBenchmarkBase.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.Text.Json;
using JetBrains.Annotations;
using JsonApiDotNetCore.Configuration;
using JsonApiDotNetCore.Middleware;
using JsonApiDotNetCore.Resources;
using JsonApiDotNetCore.Resources.Annotations;
using JsonApiDotNetCore.Serialization.JsonConverters;
using JsonApiDotNetCore.Serialization.Request.Adapters;
using Microsoft.Extensions.Logging.Abstractions;

namespace Benchmarks.Deserialization
{
public abstract class DeserializationBenchmarkBase
{
protected readonly JsonSerializerOptions SerializerReadOptions;
protected readonly DocumentAdapter DocumentAdapter;

protected DeserializationBenchmarkBase()
{
var options = new JsonApiOptions();
IResourceGraph resourceGraph = new ResourceGraphBuilder(options, NullLoggerFactory.Instance).Add<IncomingResource>().Build();
options.SerializerOptions.Converters.Add(new ResourceObjectConverter(resourceGraph));
SerializerReadOptions = ((IJsonApiOptions)options).SerializerReadOptions;

var serviceContainer = new ServiceContainer();
var resourceFactory = new ResourceFactory(serviceContainer);
var resourceDefinitionAccessor = new ResourceDefinitionAccessor(resourceGraph, serviceContainer);

serviceContainer.AddService(typeof(IResourceDefinitionAccessor), resourceDefinitionAccessor);

serviceContainer.AddService(typeof(IResourceDefinition<IncomingResource, int>),
new JsonApiResourceDefinition<IncomingResource, int>(resourceGraph));

// ReSharper disable once VirtualMemberCallInConstructor
JsonApiRequest request = CreateJsonApiRequest(resourceGraph);
var targetedFields = new TargetedFields();

var resourceIdentifierObjectAdapter = new ResourceIdentifierObjectAdapter(resourceGraph, resourceFactory);
var relationshipDataAdapter = new RelationshipDataAdapter(resourceIdentifierObjectAdapter);
var resourceObjectAdapter = new ResourceObjectAdapter(resourceGraph, resourceFactory, options, relationshipDataAdapter);
var resourceDataAdapter = new ResourceDataAdapter(resourceDefinitionAccessor, resourceObjectAdapter);

var atomicReferenceAdapter = new AtomicReferenceAdapter(resourceGraph, resourceFactory);
var atomicOperationResourceDataAdapter = new ResourceDataInOperationsRequestAdapter(resourceDefinitionAccessor, resourceObjectAdapter);

var atomicOperationObjectAdapter = new AtomicOperationObjectAdapter(options, atomicReferenceAdapter,
atomicOperationResourceDataAdapter, relationshipDataAdapter);

var resourceDocumentAdapter = new DocumentInResourceOrRelationshipRequestAdapter(options, resourceDataAdapter, relationshipDataAdapter);
var operationsDocumentAdapter = new DocumentInOperationsRequestAdapter(options, atomicOperationObjectAdapter);

DocumentAdapter = new DocumentAdapter(request, targetedFields, resourceDocumentAdapter, operationsDocumentAdapter);
}

protected abstract JsonApiRequest CreateJsonApiRequest(IResourceGraph resourceGraph);

[UsedImplicitly(ImplicitUseTargetFlags.Members)]
public sealed class IncomingResource : Identifiable<int>
{
[Attr]
public bool Attribute01 { get; set; }

[Attr]
public char Attribute02 { get; set; }

[Attr]
public ulong? Attribute03 { get; set; }

[Attr]
public decimal Attribute04 { get; set; }

[Attr]
public float? Attribute05 { get; set; }

[Attr]
public string Attribute06 { get; set; } = null!;

[Attr]
public DateTime? Attribute07 { get; set; }

[Attr]
public DateTimeOffset? Attribute08 { get; set; }

[Attr]
public TimeSpan? Attribute09 { get; set; }

[Attr]
public DayOfWeek Attribute10 { get; set; }

[HasOne]
public IncomingResource Single1 { get; set; } = null!;

[HasOne]
public IncomingResource Single2 { get; set; } = null!;

[HasOne]
public IncomingResource Single3 { get; set; } = null!;

[HasOne]
public IncomingResource Single4 { get; set; } = null!;

[HasOne]
public IncomingResource Single5 { get; set; } = null!;

[HasMany]
public ISet<IncomingResource> Multi1 { get; set; } = null!;

[HasMany]
public ISet<IncomingResource> Multi2 { get; set; } = null!;

[HasMany]
public ISet<IncomingResource> Multi3 { get; set; } = null!;

[HasMany]
public ISet<IncomingResource> Multi4 { get; set; } = null!;

[HasMany]
public ISet<IncomingResource> Multi5 { get; set; } = null!;
}
}
}
Loading