Skip to content

Commit 4b7419b

Browse files
authored
V9.0.0/dotnet rc2 (#5)
💬 updated community health pages ⬆️ bump dependencies to support .net9-rc2 👽 consequence changes due to changes on YAML dependency
1 parent a743b2c commit 4b7419b

File tree

7 files changed

+55
-45
lines changed

7 files changed

+55
-45
lines changed

CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
55
For more details, please refer to `PackageReleaseNotes.txt` on a per assembly basis in the `.nuget` folder.
66

77
> [!NOTE]
8-
> Changelog entries prior to version 8.4.0 was migrated from previous versions of Codebelt.Extensions.Asp.Versioning.
8+
> Changelog entries prior to version 8.4.0 was migrated from previous versions of Cuemon.Extensions.Asp.Versioning.
99
1010
## [9.0.0] - TBD
1111

@@ -20,7 +20,6 @@ This major release is first and foremost focused on ironing out any wrinkles tha
2020

2121
- RestfulApiVersioningOptions class in the Codebelt.Extensions.Asp.Versioning namespace to include non-official MIME-types in the ValidAcceptHeaders property
2222

23-
2423
## [7.1.0] 2022-12-11
2524

2625
### Added

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
<PrivateAssets>all</PrivateAssets>
7878
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
7979
</PackageReference>
80-
<PackageReference Include="Codebelt.Extensions.Xunit.App" Version="9.0.0-preview.8" />
80+
<PackageReference Include="Codebelt.Extensions.Xunit.App" Version="9.0.0-preview.10" />
8181
</ItemGroup>
8282

8383
</Project>

src/Codebelt.Extensions.Asp.Versioning/Codebelt.Extensions.Asp.Versioning.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<PackageReference Include="Asp.Versioning.Http" Version="8.1.0" />
1515
<PackageReference Include="Asp.Versioning.Mvc" Version="8.1.0" />
1616
<PackageReference Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0" />
17-
<PackageReference Include="Cuemon.AspNetCore" Version="9.0.0-preview.9" />
17+
<PackageReference Include="Cuemon.AspNetCore" Version="9.0.0-preview.11" />
1818
</ItemGroup>
1919

2020
</Project>

test/Codebelt.Extensions.Asp.Versioning.Tests/ApiVersionReaderTest.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
using Microsoft.Extensions.DependencyInjection;
2020
using Xunit;
2121
using Xunit.Abstractions;
22+
using YamlDotNet.Serialization.NamingConventions;
2223

2324
namespace Codebelt.Extensions.Asp.Versioning
2425
{
@@ -207,7 +208,7 @@ public async Task GetRequest_ShouldFailWithBadRequestFormattedAsXmlResponse_As_d
207208
.AddApplicationPart(typeof(FakeController).Assembly)
208209
.AddJsonFormatters()
209210
.AddXmlFormatters()
210-
.AddYamlFormatters();
211+
.AddYamlFormatters(o => o.Settings.NamingConvention = PascalCaseNamingConvention.Instance);
211212
services.AddHttpContextAccessor();
212213
services.AddRestfulApiVersioning();
213214
}, app =>
@@ -228,13 +229,14 @@ public async Task GetRequest_ShouldFailWithBadRequestFormattedAsXmlResponse_As_d
228229
Assert.Equal(HttpStatusCode.BadRequest, sut.StatusCode);
229230
Assert.Equal(HttpMethod.Get, sut.RequestMessage.Method);
230231
Assert.EndsWith(yamlAccept, sut.Content.Headers.ContentType.ToString());
231-
Assert.Equal("""
232+
Assert.True(Match("""
232233
Error:
234+
Instance: http://localhost/fake/throw
233235
Status: 400
234236
Code: BadRequest
235237
Message: The HTTP resource that matches the request URI 'http://localhost/fake/throw' does not support the API version 'd3'.
236-
237-
""", await sut.Content.ReadAsStringAsync(), ignoreLineEndingDifferences: true);
238+
TraceId: *
239+
""".ReplaceLineEndings(), await sut.Content.ReadAsStringAsync(), o => o.ThrowOnNoMatch = true));
238240
}
239241
}
240242

test/Codebelt.Extensions.Asp.Versioning.Tests/Codebelt.Extensions.Asp.Versioning.Tests.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Cuemon.Extensions.AspNetCore.Mvc" Version="9.0.0-preview.9" />
8+
<PackageReference Include="Cuemon.Extensions.AspNetCore.Mvc" Version="9.0.0-preview.11" />
99
<PackageReference Include="Cuemon.Extensions.AspNetCore.Mvc.Formatters.Newtonsoft.Json" Version="9.0.0-preview.7" />
10-
<PackageReference Include="Cuemon.Extensions.AspNetCore.Mvc.Formatters.Text.Json" Version="9.0.0-preview.9" />
11-
<PackageReference Include="Cuemon.Extensions.AspNetCore.Mvc.Formatters.Xml" Version="9.0.0-preview.9" />
12-
<PackageReference Include="Codebelt.Extensions.AspNetCore.Mvc.Formatters.Text.Yaml" Version="9.0.0-preview.3" />
10+
<PackageReference Include="Cuemon.Extensions.AspNetCore.Mvc.Formatters.Text.Json" Version="9.0.0-preview.11" />
11+
<PackageReference Include="Cuemon.Extensions.AspNetCore.Mvc.Formatters.Xml" Version="9.0.0-preview.11" />
12+
<PackageReference Include="Codebelt.Extensions.AspNetCore.Mvc.Formatters.Text.Yaml" Version="9.0.0-preview.5" />
1313
</ItemGroup>
1414

1515
<ItemGroup>

test/Codebelt.Extensions.Asp.Versioning.Tests/ProblemDetailsFactoryTest.cs

Lines changed: 41 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
using Microsoft.Extensions.DependencyInjection;
1919
using Xunit;
2020
using Xunit.Abstractions;
21+
using YamlDotNet.Serialization.NamingConventions;
2122

2223
namespace Codebelt.Extensions.Asp.Versioning
2324
{
@@ -162,7 +163,7 @@ public async Task GetRequest_ShouldFailWithBadRequestFormattedAsYamlResponse_As_
162163
services.AddFaultDescriptorOptions();
163164
services.AddControllers(o => o.Filters.AddFaultDescriptor())
164165
.AddApplicationPart(typeof(FakeController).Assembly)
165-
.AddYamlFormatters();
166+
.AddYamlFormatters(o => o.Settings.NamingConvention = PascalCaseNamingConvention.Instance);
166167
services.AddHttpContextAccessor()
167168
.AddRestfulApiVersioning(o =>
168169
{
@@ -186,37 +187,45 @@ public async Task GetRequest_ShouldFailWithBadRequestFormattedAsYamlResponse_As_
186187
Assert.Equal(HttpStatusCode.BadRequest, sut.StatusCode);
187188
Assert.Equal(HttpMethod.Get, sut.RequestMessage.Method);
188189
Assert.EndsWith("*/*", sut.Content.Headers.ContentType.ToString());
189-
Assert.StartsWith(@"Error:
190-
Status: 400
191-
Code: BadRequest
192-
Message: The HTTP resource that matches the request URI 'http://localhost/fake/throw' does not support the API version 'b3'.
193-
Failure:
194-
Type: Cuemon.AspNetCore.Http.BadRequestException
195-
Source: Codebelt.Extensions.Asp.Versioning
196-
Message: The HTTP resource that matches the request URI 'http://localhost/fake/throw' does not support the API version 'b3'.
197-
Stack:
198-
".ReplaceLineEndings(), await sut.Content.ReadAsStringAsync());
199-
Assert.EndsWith(@"Evidence:
200-
Request:
201-
Location: http://localhost/fake/throw
202-
Method: GET
203-
Headers:
204-
Accept:
205-
- text/html
206-
- application/xhtml+xml
207-
- image/avif
208-
- image/webp
209-
- image/apng
210-
- '*/*; q=0.8'
211-
- application/signed-exchange; v=b3; q=0.9
212-
- application/json; q=10.0
213-
Host:
214-
- localhost
215-
Query: []
216-
Form:
217-
Cookies: []
218-
Body: ''
219-
".ReplaceLineEndings(), await sut.Content.ReadAsStringAsync());
190+
Assert.True(Match("""
191+
Error:
192+
Instance: http://localhost/fake/throw
193+
Status: 400
194+
Code: BadRequest
195+
Message: The HTTP resource that matches the request URI 'http://localhost/fake/throw' does not support the API version 'b3'.
196+
Failure:
197+
Type: Cuemon.AspNetCore.Http.BadRequestException
198+
Source: Codebelt.Extensions.Asp.Versioning
199+
Message: The HTTP resource that matches the request URI 'http://localhost/fake/throw' does not support the API version 'b3'.
200+
Stack:
201+
- at Codebelt.Extensions.Asp.Versioning.ServiceCollectionExtensions.<>c.<AddRestfulApiVersioning>*
202+
- at Microsoft.AspNetCore.Http.DefaultProblemDetailsWriter.WriteAsync(ProblemDetailsContext context)
203+
- at Microsoft.AspNetCore.Http.ProblemDetailsService.TryWriteAsync(ProblemDetailsContext context)
204+
- at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|7_0(Endpoint endpoint, Task requestTask, ILogger logger)
205+
- at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)
206+
StatusCode: 400
207+
ReasonPhrase: Bad Request
208+
Evidence:
209+
Request:
210+
Location: http://localhost/fake/throw
211+
Method: GET
212+
Headers:
213+
Accept:
214+
- text/html
215+
- application/xhtml+xml
216+
- image/avif
217+
- image/webp
218+
- image/apng
219+
- '*/*; q=0.8'
220+
- application/signed-exchange; v=b3; q=0.9
221+
- application/json; q=10.0
222+
Host:
223+
- localhost
224+
Query: []
225+
Cookies: []
226+
Body: ''
227+
TraceId: *
228+
""".ReplaceLineEndings(), await sut.Content.ReadAsStringAsync(), o => o.ThrowOnNoMatch = true));
220229
}
221230
}
222231

testenvironments.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{
1010
"name": "Docker-Ubuntu",
1111
"type": "docker",
12-
"dockerImage": "gimlichael/ubuntu-testrunner:net6.0.425-net8.0.401-9.0.100-rc.1.24452.12"
12+
"dockerImage": "gimlichael/ubuntu-testrunner:6.0.427-net8.0.403-9.0.100-rc.2.24474.11"
1313
}
1414
]
1515
}

0 commit comments

Comments
 (0)