Skip to content

Commit 47320f0

Browse files
committed
Package updates, centralize versions, address breaking changes
1 parent 0413d6d commit 47320f0

File tree

10 files changed

+199
-101
lines changed

10 files changed

+199
-101
lines changed

Directory.Build.props

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
<EFCorePostgresVersion>6.0.*</EFCorePostgresVersion>
77
<MicrosoftCodeAnalysisVersion>4.3.*</MicrosoftCodeAnalysisVersion>
88
<HumanizerVersion>2.14.1</HumanizerVersion>
9-
<SwashbuckleVersion>6.2.*</SwashbuckleVersion>
9+
<SwashbuckleVersion>6.4.*</SwashbuckleVersion>
10+
<NSwagApiClientVersion>13.16.*</NSwagApiClientVersion>
11+
<MicrosoftApiClientVersion>6.0.*</MicrosoftApiClientVersion>
12+
<NewtonsoftJsonVersion>13.0.*</NewtonsoftJsonVersion>
1013
<JsonApiDotNetCoreVersionPrefix>5.0.4</JsonApiDotNetCoreVersionPrefix>
1114
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodingGuidelines.ruleset</CodeAnalysisRuleSet>
1215
<WarningLevel>9999</WarningLevel>

src/Examples/JsonApiDotNetCoreExampleClient/JsonApiDotNetCoreExampleClient.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
</ItemGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Microsoft.Extensions.ApiDescription.Client" Version="5.0.10">
12+
<PackageReference Include="Microsoft.Extensions.ApiDescription.Client" Version="$(MicrosoftApiClientVersion)">
1313
<PrivateAssets>all</PrivateAssets>
1414
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1515
</PackageReference>
16-
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
17-
<PackageReference Include="NSwag.ApiDescription.Client" Version="13.13.2">
16+
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
17+
<PackageReference Include="NSwag.ApiDescription.Client" Version="$(NSwagApiClientVersion)">
1818
<PrivateAssets>all</PrivateAssets>
1919
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2020
</PackageReference>

src/JsonApiDotNetCore.OpenApi/SwaggerComponents/JsonApiSchemaGenerator.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using JsonApiDotNetCore.OpenApi.JsonApiObjects;
44
using JsonApiDotNetCore.OpenApi.JsonApiObjects.Documents;
55
using JsonApiDotNetCore.OpenApi.JsonApiObjects.Relationships;
6+
using Microsoft.AspNetCore.Mvc.ApiExplorer;
67
using Microsoft.OpenApi.Models;
78
using Swashbuckle.AspNetCore.SwaggerGen;
89

@@ -42,29 +43,30 @@ public JsonApiSchemaGenerator(SchemaGenerator defaultSchemaGenerator, IResourceG
4243
_resourceObjectSchemaGenerator = new ResourceObjectSchemaGenerator(defaultSchemaGenerator, resourceGraph, options, _schemaRepositoryAccessor);
4344
}
4445

45-
public OpenApiSchema GenerateSchema(Type type, SchemaRepository schemaRepository, MemberInfo? memberInfo = null, ParameterInfo? parameterInfo = null)
46+
public OpenApiSchema GenerateSchema(Type modelType, SchemaRepository schemaRepository, MemberInfo? memberInfo = null, ParameterInfo? parameterInfo = null,
47+
ApiParameterRouteInfo? routeInfo = null)
4648
{
47-
ArgumentGuard.NotNull(type, nameof(type));
49+
ArgumentGuard.NotNull(modelType, nameof(modelType));
4850
ArgumentGuard.NotNull(schemaRepository, nameof(schemaRepository));
4951

5052
_schemaRepositoryAccessor.Current = schemaRepository;
5153

52-
if (schemaRepository.TryLookupByType(type, out OpenApiSchema jsonApiDocumentSchema))
54+
if (schemaRepository.TryLookupByType(modelType, out OpenApiSchema jsonApiDocumentSchema))
5355
{
5456
return jsonApiDocumentSchema;
5557
}
5658

57-
if (IsJsonApiDocument(type))
59+
if (IsJsonApiDocument(modelType))
5860
{
59-
OpenApiSchema schema = GenerateJsonApiDocumentSchema(type);
61+
OpenApiSchema schema = GenerateJsonApiDocumentSchema(modelType);
6062

61-
if (IsDataPropertyNullable(type))
63+
if (IsDataPropertyNullable(modelType))
6264
{
6365
SetDataObjectSchemaToNullable(schema);
6466
}
6567
}
6668

67-
return _defaultSchemaGenerator.GenerateSchema(type, schemaRepository, memberInfo, parameterInfo);
69+
return _defaultSchemaGenerator.GenerateSchema(modelType, schemaRepository, memberInfo, parameterInfo);
6870
}
6971

7072
private static bool IsJsonApiDocument(Type type)

0 commit comments

Comments
 (0)