Skip to content

Merge master v5.2.0 into openapi #1273

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 74 commits into from
May 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
22761fe
Empty commit to trigger cibuild
bkoelman Feb 9, 2023
0818619
Update GIT_ACCESS_TOKEN to use bkoelman instead of bart-degreed GitHu…
bkoelman Feb 9, 2023
8e63c68
Dummy change to trigger docs deployment
bkoelman Feb 9, 2023
ac7d3ae
Fix formatting
bkoelman Feb 15, 2023
8cad017
Simplify assertions (ShouldContainKey already checks for null)
bart-vmware Feb 16, 2023
9f31f92
Fixed: on secondary endpoint, the incoming filter from query string w…
bart-vmware Feb 16, 2023
0adebfd
Merge pull request #1258 from bart-vmware/assertions-cleanup
bkoelman Feb 16, 2023
a2c50e4
Merge branch 'master' into fix-secondary-reverse-filter
bkoelman Feb 16, 2023
56cfe08
Merge pull request #1259 from bart-vmware/fix-secondary-reverse-filter
bkoelman Feb 16, 2023
2732109
Package updates; fix culture in range parsing (see https://github.com…
bkoelman Feb 18, 2023
a7668ae
Changes LiteralConstantExpression to contain a typed constant instead…
bkoelman Feb 16, 2023
a05a12e
Simplify test
bkoelman Feb 16, 2023
bcc2975
Removed pointless assertion (the preceeding code casts to HasManyAttr…
bkoelman Feb 24, 2023
2bf9405
Removed resource ID from error message, as the error is unrelated to …
bkoelman Feb 24, 2023
1c9a7c9
Fix naming/comment
bkoelman Feb 24, 2023
2022684
Fixed: do not import namespace of resource class when same as control…
bkoelman Mar 5, 2023
177ae01
Fix indents in tests
bkoelman Mar 5, 2023
9e1f9dc
Apply new suggestions from Resharper EAP
bkoelman Feb 24, 2023
82f04b2
Improve change tracking performance
bkoelman Feb 26, 2023
8f19d63
Add workaround for failing 'dotnet pack'
bkoelman Feb 26, 2023
d1ea9ad
Fixed: a duplicate trailing slash was rendered in Location header whe…
bkoelman Feb 26, 2023
eae0e78
Update usages of "paging" with "pagination"
bkoelman Feb 28, 2023
2e1b804
Fixed: missing test coverage for applying default page size in includes
bkoelman Feb 28, 2023
4055c6f
Simplify meta:total assertions and produce better error on failure
bkoelman Feb 28, 2023
adc51e1
Clarify documentation
bkoelman Mar 2, 2023
039ee72
Package updates
bkoelman Mar 10, 2023
8a5e914
Merge pull request #1257 from json-api-dotnet/query-tweaks
maurei Mar 11, 2023
b2e5bb6
Merge branch 'master' into fix-namespace-imports-gen
maurei Mar 11, 2023
0d914d8
Merge pull request #1261 from json-api-dotnet/fix-namespace-imports-gen
maurei Mar 11, 2023
77e838b
Fix heading
bkoelman Mar 16, 2023
6ef75c9
Fix version mismatch on Microsoft.EntityFrameworkCore.Relational, ori…
bkoelman Mar 16, 2023
d137c3a
Refresh NuGet API key
bkoelman Mar 29, 2023
d2e321c
Refresh leaked NuGet API key
bkoelman Mar 29, 2023
5dd256f
Improve performance of response serialization for large number of inc…
bkoelman Apr 7, 2023
9a2f364
Merge pull request #1265 from json-api-dotnet/serializer-perf
bkoelman Apr 12, 2023
db852cf
Use deterministic culture when converting to string
bkoelman Mar 29, 2023
6d49f71
Merge pull request #1267 from json-api-dotnet/fix-runtime-type-converter
maurei Apr 13, 2023
d47751d
Update to Resharper v2023.1
bkoelman Nov 12, 2022
87a7569
InspectCode: Include Roslyn diagnostic ID
bkoelman Mar 12, 2023
476dab0
Enable new inspections
bkoelman Mar 12, 2023
9c38d55
Apply Resharper hint: convert switch statement to expression
bkoelman Apr 13, 2023
f701961
Apply Resharper hint: pass string interpolation
bkoelman Apr 13, 2023
865b3a3
Reduce noice from IDE rules
bkoelman Mar 25, 2023
35eb36f
Package update
bkoelman Apr 13, 2023
05e9037
Merge pull request #1235 from json-api-dotnet/resharper-update
bkoelman Apr 14, 2023
260b47e
Update question template
bkoelman Apr 19, 2023
757dd08
Use short URL in question template
bkoelman Apr 19, 2023
abb6233
PostgreSQL connection strings: remove default port, add error details
bkoelman Mar 26, 2023
93f6532
Use default ASP.NET location for connection strings
bkoelman Mar 26, 2023
a4d0836
Drop /v1 from API namespace, because it suggests API versioning shoul…
bkoelman Mar 26, 2023
67f3ef4
Seed core example with sample data, open browser on run, use long IDs
bkoelman Mar 26, 2023
f202021
Enable detailed logging
bkoelman Apr 15, 2023
c3f5baa
Feed includes from query string to the serializer when custom resourc…
bkoelman Apr 15, 2023
7b63f58
Updates NoEntityFrameworkExample to use a hardcoded in-memory dataset…
bkoelman Apr 18, 2023
2a57fe1
Update documentation
bkoelman Apr 18, 2023
d037c75
Reduce logging from tests during cibuild
bkoelman Apr 19, 2023
9e03e0f
Various (non-breaking) name changes for internal consistency
bkoelman Apr 15, 2023
11894ad
Harden Attr/Relationship attributes against invalid input
bkoelman Apr 15, 2023
b51d681
Add missing null checks
bkoelman Apr 15, 2023
858228b
Remove unused dependencies on Moq
bkoelman Apr 22, 2023
b96cc4e
Revert workaround
bkoelman Apr 25, 2023
012cf4e
Update scripts for breaking change in PowerShell 7.3
bkoelman Apr 25, 2023
6678d87
Fixed: incoming string representation should not be part of the seman…
bkoelman Apr 28, 2023
e0464f5
Correct forgotten part in rename
bkoelman May 3, 2023
5301d04
Merge pull request #1269 from json-api-dotnet/update-examples
maurei May 11, 2023
338c63e
Merge branch 'master' into harden-attributes
maurei May 11, 2023
627bae9
Merge pull request #1268 from json-api-dotnet/harden-attributes
maurei May 11, 2023
779daea
Fixes two problems when using owned entities:
bkoelman May 10, 2023
2596635
Merge pull request #1272 from json-api-dotnet/fix-owned-entities
maurei May 12, 2023
94a6981
Update version to 5.2.0
bkoelman May 12, 2023
3b576b1
Increment version to 5.2.1 (used for pre-release builds from ci)
bkoelman May 12, 2023
c9ec0a5
Merge branch 'master' into merge-master-v5.2.0-into-openapi
bkoelman May 12, 2023
c3c29ba
Apply new Resharper suggestions
bkoelman May 12, 2023
47d1ee3
Drop /v1 from sample namespaces, regenerate swagger.json files
bkoelman May 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using JetBrains.Annotations;
using JsonApiDotNetCore.OpenApi.Client;
using Newtonsoft.Json;

namespace JsonApiDotNetCoreExampleClient;

[UsedImplicitly(ImplicitUseTargetFlags.Itself)]
public partial class ExampleApiClient : JsonApiClient
{
partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings)
Expand Down
3 changes: 1 addition & 2 deletions src/JsonApiDotNetCore.OpenApi.Client/JsonApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,8 @@ public override void WriteJson(JsonWriter writer, object? value, JsonSerializer

if (value != null)
{
if (_alwaysIncludedAttributesPerRequestDocumentInstance.ContainsKey(value))
if (_alwaysIncludedAttributesPerRequestDocumentInstance.TryGetValue(value, out AttributeNamesContainer? attributeNamesContainer))
{
AttributeNamesContainer attributeNamesContainer = _alwaysIncludedAttributesPerRequestDocumentInstance[value];
serializer.ContractResolver = new JsonApiDocumentContractResolver(attributeNamesContainer);
}

Expand Down
8 changes: 4 additions & 4 deletions src/JsonApiDotNetCore.OpenApi/OpenApiEndpointConvention.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ private IReadOnlyCollection<RelationshipAttribute> GetRelationshipsOfPrimaryReso

private static bool IsSecondaryOrRelationshipEndpoint(JsonApiEndpoint endpoint)
{
return endpoint is JsonApiEndpoint.GetSecondary or JsonApiEndpoint.GetRelationship or JsonApiEndpoint.PostRelationship
or JsonApiEndpoint.PatchRelationship or JsonApiEndpoint.DeleteRelationship;
return endpoint is JsonApiEndpoint.GetSecondary or JsonApiEndpoint.GetRelationship or JsonApiEndpoint.PostRelationship or
JsonApiEndpoint.PatchRelationship or JsonApiEndpoint.DeleteRelationship;
}

private void SetResponseMetadata(ActionModel action, JsonApiEndpoint endpoint)
Expand Down Expand Up @@ -160,7 +160,7 @@ private static void SetRequestMetadata(ActionModel action, JsonApiEndpoint endpo

private static bool RequiresRequestBody(JsonApiEndpoint endpoint)
{
return endpoint is JsonApiEndpoint.Post or JsonApiEndpoint.Patch or JsonApiEndpoint.PostRelationship or JsonApiEndpoint.PatchRelationship
or JsonApiEndpoint.DeleteRelationship;
return endpoint is JsonApiEndpoint.Post or JsonApiEndpoint.Patch or JsonApiEndpoint.PostRelationship or JsonApiEndpoint.PatchRelationship or
JsonApiEndpoint.DeleteRelationship;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ private static void ReorderMembers(OpenApiSchema fullSchemaForResourceObject, IE

foreach (string member in orderedMembers)
{
if (fullSchemaForResourceObject.Properties.ContainsKey(member))
if (fullSchemaForResourceObject.Properties.TryGetValue(member, out OpenApiSchema? schema))
{
reorderedMembers[member] = fullSchemaForResourceObject.Properties[member];
reorderedMembers[member] = schema;
}
}

Expand Down