Skip to content

Commit 0090871

Browse files
Bump the patch group with 24 updates (#281)
* Bump the patch group with 24 updates Bumps csharpier from 1.0.2 to 1.2.1 Bumps Elastic.CommonSchema.Serilog from 8.18.1 to 9.0.0 Bumps Elastic.Serilog.Enrichers.Web from 8.18.1 to 9.0.0 FluentValidation from 12.0.0 to 12.1.0 Bumps MartinCostello.Logging.XUnit from 0.6.0 to 0.7.0 Bumps Microsoft.AspNetCore.Authentication.JwtBearer from 9.0.6 to 9.0.11 Bumps Microsoft.AspNetCore.HeaderPropagation from 9.0.6 to 9.0.11 Bumps Microsoft.AspNetCore.Mvc.Testing from 9.0.6 to 9.0.11 Bumps Microsoft.CodeAnalysis.CSharp from 4.14.0 to 5.0.0 Bumps Microsoft.Extensions.Diagnostics.Testing from 9.7.0 to 10.0.0 Bumps Microsoft.Extensions.Http.Resilience from 9.6.0 to 10.0.0 Bumps Microsoft.NET.Test.Sdk from 17.14.1 to 18.0.1 Bumps Microsoft.OpenApi.Readers from 1.6.24 to 1.6.28 Bumps Serilog.AspNetCore from 9.0.0 to 10.0.0 Bumps Serilog.Enrichers.ClientInfo from 2.2.0 to 2.7.0 Bumps Serilog.Settings.Configuration from 9.0.0 to 10.0.0 Bumps SonarAnalyzer.CSharp from 10.12.0.118525 to 10.16.0.128591 Bumps Swashbuckle.AspNetCore from 9.0.1 to 10.0.1 Bumps swashbuckle.aspnetcore.cli from 9.0.1 to 10.0.1 Bumps Swashbuckle.AspNetCore.ReDoc from 9.0.1 to 10.0.1 Bumps Verify.Xunit from 30.4.0 to 31.7.2 Bumps WireMock.Net from 1.8.13 to 1.16.0 Bumps xunit.runner.visualstudio from 3.1.1 to 3.1.5 Replace FluentAssertions with AwesomeAssestions --- updated-dependencies: - dependency-name: csharpier dependency-version: 1.2.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: patch - dependency-name: Elastic.CommonSchema.Serilog dependency-version: 9.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: patch - dependency-name: Elastic.Serilog.Enrichers.Web dependency-version: 9.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: patch - dependency-name: FluentValidation dependency-version: 12.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: patch - dependency-name: MartinCostello.Logging.XUnit dependency-version: 0.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: patch - dependency-name: Microsoft.AspNetCore.Authentication.JwtBearer dependency-version: 9.0.11 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch - dependency-name: Microsoft.AspNetCore.HeaderPropagation dependency-version: 9.0.11 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch - dependency-name: Microsoft.AspNetCore.Mvc.Testing dependency-version: 9.0.11 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch - dependency-name: Microsoft.CodeAnalysis.CSharp dependency-version: 5.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: patch - dependency-name: Microsoft.Extensions.Diagnostics.Testing dependency-version: 10.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: patch - dependency-name: Microsoft.Extensions.Http.Resilience dependency-version: 10.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: patch - dependency-name: Microsoft.NET.Test.Sdk dependency-version: 18.0.1 dependency-type: direct:production update-type: version-update:semver-major dependency-group: patch - dependency-name: Microsoft.OpenApi.Readers dependency-version: 1.6.28 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch - dependency-name: Serilog.AspNetCore dependency-version: 10.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: patch - dependency-name: Serilog.Settings.Configuration dependency-version: 10.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: patch - dependency-name: Serilog.Enrichers.ClientInfo dependency-version: 2.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: patch - dependency-name: SonarAnalyzer.CSharp dependency-version: 10.16.0.128591 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: patch - dependency-name: Swashbuckle.AspNetCore dependency-version: 10.0.1 dependency-type: direct:production update-type: version-update:semver-major dependency-group: patch - dependency-name: swashbuckle.aspnetcore.cli dependency-version: 10.0.1 dependency-type: direct:production update-type: version-update:semver-major dependency-group: patch - dependency-name: Swashbuckle.AspNetCore.ReDoc dependency-version: 10.0.1 dependency-type: direct:production update-type: version-update:semver-major dependency-group: patch - dependency-name: Verify.Xunit dependency-version: 31.7.2 dependency-type: direct:production update-type: version-update:semver-major dependency-group: patch - dependency-name: WireMock.Net dependency-version: 1.16.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: patch - dependency-name: WireMock.Net.FluentAssertions dependency-version: 1.16.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: patch - dependency-name: xunit.runner.visualstudio dependency-version: 3.1.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: patch ... Signed-off-by: dependabot[bot] <[email protected]> * PHAIN-211 - Updated OpenAPI library version * BAU : Swapped FluentAssertions for AwesomeAssertions, lint --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: D Klemm <[email protected]>
1 parent 1c2d06e commit 0090871

16 files changed

+232
-231
lines changed

.config/dotnet-tools.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
"isRoot": true,
44
"tools": {
55
"swashbuckle.aspnetcore.cli": {
6-
"version": "9.0.1",
6+
"version": "10.0.1",
77
"commands": [
88
"swagger"
99
],
1010
"rollForward": false
1111
},
1212
"csharpier": {
13-
"version": "1.0.2",
13+
"version": "1.2.1",
1414
"commands": [
1515
"csharpier"
1616
],

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<Nullable>enable</Nullable>
66
</PropertyGroup>
77
<ItemGroup>
8-
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.12.0.118525">
8+
<PackageReference Include="SonarAnalyzer.CSharp" Version="10.16.0.128591">
99
<PrivateAssets>all</PrivateAssets>
1010
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1111
</PackageReference>

src/Api/Api.csproj

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@
1313
</ItemGroup>
1414
<ItemGroup>
1515
<PackageReference Include="Amazon.CloudWatch.EMF" Version="2.2.0" />
16-
<PackageReference Include="Elastic.CommonSchema.Serilog" Version="8.18.1" />
17-
<PackageReference Include="Elastic.Serilog.Enrichers.Web" Version="8.18.1" />
18-
<PackageReference Include="FluentValidation" Version="12.0.0" />
19-
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.6" />
20-
<PackageReference Include="Microsoft.AspNetCore.HeaderPropagation" Version="9.0.6" />
21-
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="9.6.0" />
22-
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
23-
<PackageReference Include="Serilog.Enrichers.ClientInfo" Version="2.2.0" />
16+
<PackageReference Include="Elastic.CommonSchema.Serilog" Version="9.0.0" />
17+
<PackageReference Include="Elastic.Serilog.Enrichers.Web" Version="9.0.0" />
18+
<PackageReference Include="FluentValidation" Version="12.1.0" />
19+
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.11" />
20+
<PackageReference Include="Microsoft.AspNetCore.HeaderPropagation" Version="9.0.11" />
21+
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="10.0.0" />
22+
<PackageReference Include="Serilog.AspNetCore" Version="10.0.0" />
23+
<PackageReference Include="Serilog.Enrichers.ClientInfo" Version="2.7.0" />
2424
<PackageReference Include="Serilog.Enrichers.Environment" Version="3.0.1" />
2525
<PackageReference Include="Serilog.Enrichers.Thread" Version="4.0.0" />
26-
<PackageReference Include="Serilog.Settings.Configuration" Version="9.0.0" />
27-
<PackageReference Include="Swashbuckle.AspNetCore" Version="9.0.1" />
28-
<PackageReference Include="Swashbuckle.AspNetCore.ReDoc" Version="9.0.1" />
26+
<PackageReference Include="Serilog.Settings.Configuration" Version="10.0.0" />
27+
<PackageReference Include="Swashbuckle.AspNetCore" Version="10.0.1" />
28+
<PackageReference Include="Swashbuckle.AspNetCore.ReDoc" Version="10.0.1" />
2929
</ItemGroup>
3030
<ItemGroup>
3131
<ProjectReference Include="..\Contracts\Contracts.csproj" />

src/Api/Authentication/PhaJwtAuthenticationHandler.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,10 @@ IOptions<AclOptions> aclOptions
2828
if (client == null)
2929
return Task.CompletedTask;
3030

31-
claimsIdentity.AddClaims(
32-
[
33-
.. client.Bcps.Select(ClaimTypes.CreateBcpClaim),
34-
.. client.ChedTypes.Select(ClaimTypes.CreateChedTypeClaim),
35-
]
36-
);
31+
claimsIdentity.AddClaims([
32+
.. client.Bcps.Select(ClaimTypes.CreateBcpClaim),
33+
.. client.ChedTypes.Select(ClaimTypes.CreateChedTypeClaim),
34+
]);
3735

3836
context.Principal = new ClaimsPrincipal(claimsIdentity);
3937

src/Api/OpenApi/DescriptionSchemaFilter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
using System.ComponentModel;
22
using System.Diagnostics.CodeAnalysis;
3-
using Microsoft.OpenApi.Models;
3+
using Microsoft.OpenApi;
44
using Swashbuckle.AspNetCore.SwaggerGen;
55

66
namespace Defra.PhaImportNotifications.Api.OpenApi;
77

88
[ExcludeFromCodeCoverage]
99
public class DescriptionSchemaFilter : ISchemaFilter
1010
{
11-
public void Apply(OpenApiSchema schema, SchemaFilterContext context)
11+
public void Apply(IOpenApiSchema schema, SchemaFilterContext context)
1212
{
1313
if (context.ParameterInfo != null)
1414
{

src/Api/OpenApi/ExampleValueSchemaFilter.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1+
using System.Text.Json.Nodes;
12
using Defra.PhaImportNotifications.Contracts;
2-
using Microsoft.OpenApi.Any;
3-
using Microsoft.OpenApi.Models;
3+
using Microsoft.OpenApi;
44
using Swashbuckle.AspNetCore.SwaggerGen;
55

66
namespace Defra.PhaImportNotifications.Api.OpenApi;
77

88
public class ExampleValueSchemaFilter : ISchemaFilter
99
{
10-
public void Apply(OpenApiSchema schema, SchemaFilterContext context)
10+
public void Apply(IOpenApiSchema schema, SchemaFilterContext context)
1111
{
12+
var open = schema as OpenApiSchema;
13+
1214
var exampleValueAttributes =
1315
context.MemberInfo?.GetCustomAttributes(false).OfType<ExampleValueAttribute>().ToList() ?? [];
1416

@@ -20,9 +22,12 @@ public void Apply(OpenApiSchema schema, SchemaFilterContext context)
2022
+ " underlying systems evolve. Consuming clients should cater for this possibility.";
2123

2224
var values = exampleValueAttributes.Select(a => a.Value).Where(v => !string.IsNullOrWhiteSpace(v));
25+
26+
open!.Enum ??= new List<JsonNode>();
27+
2328
foreach (var value in values)
2429
{
25-
schema.Enum.Add(new OpenApiString(value));
30+
open.Enum.Add(value);
2631
}
2732
}
2833
}
Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using Microsoft.OpenApi.Any;
2-
using Microsoft.OpenApi.Models;
1+
using System.Text.Json.Nodes;
2+
using Microsoft.OpenApi;
33
using Swashbuckle.AspNetCore.SwaggerGen;
44

55
namespace Defra.PhaImportNotifications.Api.OpenApi;
@@ -10,22 +10,23 @@ public class TagsDocumentFilter : IDocumentFilter
1010

1111
public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context)
1212
{
13-
swaggerDoc.Extensions["tags"] = new OpenApiArray
13+
var tag = swaggerDoc.Tags?.FirstOrDefault(t => t.Name == ImportNotificationsTag);
14+
if (tag is not null)
1415
{
15-
new OpenApiObject
16-
{
17-
["name"] = new OpenApiString(ImportNotificationsTag),
18-
["description"] = new OpenApiString("Get updated import notifications for a PHA"),
19-
},
20-
};
16+
tag.Description = "Get updated import notifications for a PHA";
17+
}
2118

22-
swaggerDoc.Extensions["x-tagGroups"] = new OpenApiArray
23-
{
24-
new OpenApiObject
19+
swaggerDoc.Extensions ??= new Dictionary<string, IOpenApiExtension>();
20+
21+
swaggerDoc.Extensions["x-tagGroups"] = new JsonNodeExtension(
22+
new JsonArray
2523
{
26-
["name"] = new OpenApiString("Endpoints"),
27-
["tags"] = new OpenApiArray { new OpenApiString(ImportNotificationsTag) },
28-
},
29-
};
24+
new JsonObject
25+
{
26+
["name"] = "Endpoints",
27+
["tags"] = new JsonArray { ImportNotificationsTag },
28+
},
29+
}
30+
);
3031
}
3132
}

src/Api/Program.cs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
using Microsoft.AspNetCore.WebUtilities;
1717
using Microsoft.Extensions.DependencyInjection.Extensions;
1818
using Microsoft.Extensions.Options;
19-
using Microsoft.OpenApi.Models;
19+
using Microsoft.OpenApi;
2020
using Serilog;
2121
using Swashbuckle.AspNetCore.SwaggerGen;
2222

@@ -114,18 +114,10 @@ static void ConfigureWebApplication(WebApplicationBuilder builder, string[] args
114114
},
115115
}
116116
);
117-
c.AddSecurityRequirement(
118-
new OpenApiSecurityRequirement
119-
{
120-
{
121-
new OpenApiSecurityScheme
122-
{
123-
Reference = new OpenApiReference { Type = ReferenceType.SecurityScheme, Id = "oAuth" },
124-
},
125-
[]
126-
},
127-
}
128-
);
117+
c.AddSecurityRequirement(document => new OpenApiSecurityRequirement
118+
{
119+
[new OpenApiSecuritySchemeReference("oAuth", document)] = [],
120+
});
129121
c.IncludeXmlComments(Assembly.GetExecutingAssembly());
130122
c.IncludeXmlComments(typeof(ImportPreNotification).Assembly);
131123
c.DocumentFilter<TagsDocumentFilter>();
Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,79 @@
1-
#nullable enable
2-
using System.Text.Json.Serialization;
3-
using System.ComponentModel;
4-
5-
namespace Defra.PhaImportNotifications.Contracts;
6-
public partial record CommodityComplements
7-
{
8-
[JsonPropertyName("uniqueComplementId")]
9-
[Description("UUID used to match commodityComplement to its complementParameter set. CHEDPP only")]
10-
public string? UniqueComplementId { get; init; }
11-
12-
[JsonPropertyName("commodityDescription")]
13-
[Description("Description of the commodity")]
14-
public string? CommodityDescription { get; init; }
15-
16-
[JsonPropertyName("commodityId")]
17-
[Description("The unique commodity ID")]
18-
public string? CommodityId { get; init; }
19-
20-
[JsonPropertyName("complementId")]
21-
[Description("Identifier of complement chosen from speciesFamily,speciesClass and speciesType'. This is also used to link to the complementParameterSet")]
22-
public int? ComplementId { get; init; }
23-
24-
[JsonPropertyName("complementName")]
25-
[Description("Represents the lowest granularity - either type, class, family or species name - for the commodity selected. This is also used to drive behaviour for EU Import journeys")]
26-
public string? ComplementName { get; init; }
27-
28-
[JsonPropertyName("eppoCode")]
29-
[Description("EPPO Code related to plant commodities and wood packaging")]
30-
public string? EppoCode { get; init; }
31-
32-
[JsonPropertyName("isWoodPackaging")]
33-
[Description("(Deprecated in IMTA-11832) Is this commodity wood packaging?")]
34-
public bool? IsWoodPackaging { get; init; }
35-
36-
[JsonPropertyName("speciesId")]
37-
[Description("The species ID of the commodity that is imported. Not every commodity has a species ID. This is also used to link to the complementParameterSet. The species ID can change over time")]
38-
public string? SpeciesId { get; init; }
39-
40-
[JsonPropertyName("speciesName")]
41-
[Description("Species name")]
42-
public string? SpeciesName { get; init; }
43-
44-
[JsonPropertyName("speciesNomination")]
45-
[Description("Species nomination")]
46-
public string? SpeciesNomination { get; init; }
47-
48-
[JsonPropertyName("speciesTypeName")]
49-
[Description("Species type name")]
50-
public string? SpeciesTypeName { get; init; }
51-
52-
[JsonPropertyName("speciesType")]
53-
[Description("Species type identifier of commodity")]
54-
public string? SpeciesType { get; init; }
55-
56-
[JsonPropertyName("speciesClassName")]
57-
[Description("Species class name")]
58-
public string? SpeciesClassName { get; init; }
59-
60-
[JsonPropertyName("speciesClass")]
61-
[Description("Species class identifier of commodity")]
62-
public string? SpeciesClass { get; init; }
63-
64-
[JsonPropertyName("speciesFamilyName")]
65-
[Description("Species family name of commodity")]
66-
public string? SpeciesFamilyName { get; init; }
67-
68-
[JsonPropertyName("speciesFamily")]
69-
[Description("Species family identifier of commodity")]
70-
public string? SpeciesFamily { get; init; }
71-
72-
[JsonPropertyName("speciesCommonName")]
73-
[Description("Species common name of commodity for IMP notification simple commodity selection")]
74-
public string? SpeciesCommonName { get; init; }
75-
76-
[JsonPropertyName("isCdsMatched")]
77-
[Description("Has commodity been matched with corresponding CDS declaration")]
78-
public bool? IsCdsMatched { get; init; }
79-
}
1+
#nullable enable
2+
using System.Text.Json.Serialization;
3+
using System.ComponentModel;
4+
5+
namespace Defra.PhaImportNotifications.Contracts;
6+
public partial record CommodityComplements
7+
{
8+
[JsonPropertyName("uniqueComplementId")]
9+
[Description("UUID used to match commodityComplement to its complementParameter set. CHEDPP only")]
10+
public string? UniqueComplementId { get; init; }
11+
12+
[JsonPropertyName("commodityDescription")]
13+
[Description("Description of the commodity")]
14+
public string? CommodityDescription { get; init; }
15+
16+
[JsonPropertyName("commodityId")]
17+
[Description("The unique commodity ID")]
18+
public string? CommodityId { get; init; }
19+
20+
[JsonPropertyName("complementId")]
21+
[Description("Identifier of complement chosen from speciesFamily,speciesClass and speciesType'. This is also used to link to the complementParameterSet")]
22+
public int? ComplementId { get; init; }
23+
24+
[JsonPropertyName("complementName")]
25+
[Description("Represents the lowest granularity - either type, class, family or species name - for the commodity selected. This is also used to drive behaviour for EU Import journeys")]
26+
public string? ComplementName { get; init; }
27+
28+
[JsonPropertyName("eppoCode")]
29+
[Description("EPPO Code related to plant commodities and wood packaging")]
30+
public string? EppoCode { get; init; }
31+
32+
[JsonPropertyName("isWoodPackaging")]
33+
[Description("(Deprecated in IMTA-11832) Is this commodity wood packaging?")]
34+
public bool? IsWoodPackaging { get; init; }
35+
36+
[JsonPropertyName("speciesId")]
37+
[Description("The species ID of the commodity that is imported. Not every commodity has a species ID. This is also used to link to the complementParameterSet. The species ID can change over time")]
38+
public string? SpeciesId { get; init; }
39+
40+
[JsonPropertyName("speciesName")]
41+
[Description("Species name")]
42+
public string? SpeciesName { get; init; }
43+
44+
[JsonPropertyName("speciesNomination")]
45+
[Description("Species nomination")]
46+
public string? SpeciesNomination { get; init; }
47+
48+
[JsonPropertyName("speciesTypeName")]
49+
[Description("Species type name")]
50+
public string? SpeciesTypeName { get; init; }
51+
52+
[JsonPropertyName("speciesType")]
53+
[Description("Species type identifier of commodity")]
54+
public string? SpeciesType { get; init; }
55+
56+
[JsonPropertyName("speciesClassName")]
57+
[Description("Species class name")]
58+
public string? SpeciesClassName { get; init; }
59+
60+
[JsonPropertyName("speciesClass")]
61+
[Description("Species class identifier of commodity")]
62+
public string? SpeciesClass { get; init; }
63+
64+
[JsonPropertyName("speciesFamilyName")]
65+
[Description("Species family name of commodity")]
66+
public string? SpeciesFamilyName { get; init; }
67+
68+
[JsonPropertyName("speciesFamily")]
69+
[Description("Species family identifier of commodity")]
70+
public string? SpeciesFamily { get; init; }
71+
72+
[JsonPropertyName("speciesCommonName")]
73+
[Description("Species common name of commodity for IMP notification simple commodity selection")]
74+
public string? SpeciesCommonName { get; init; }
75+
76+
[JsonPropertyName("isCdsMatched")]
77+
[Description("Has commodity been matched with corresponding CDS declaration")]
78+
public bool? IsCdsMatched { get; init; }
79+
}

0 commit comments

Comments
 (0)