Skip to content

Commit

Permalink
V9.0.0/dotnet rc2 (#5)
Browse files Browse the repository at this point in the history
💬 updated community health pages

⬆️ bump dependencies to support .net9-rc2

👽 consequence changes due to changes on YAML dependency
  • Loading branch information
gimlichael authored Oct 11, 2024
1 parent a743b2c commit 4b7419b
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 45 deletions.
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
For more details, please refer to `PackageReleaseNotes.txt` on a per assembly basis in the `.nuget` folder.

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

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

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


## [7.1.0] 2022-12-11

### Added
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Codebelt.Extensions.Xunit.App" Version="9.0.0-preview.8" />
<PackageReference Include="Codebelt.Extensions.Xunit.App" Version="9.0.0-preview.10" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageReference Include="Asp.Versioning.Http" Version="8.1.0" />
<PackageReference Include="Asp.Versioning.Mvc" Version="8.1.0" />
<PackageReference Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0" />
<PackageReference Include="Cuemon.AspNetCore" Version="9.0.0-preview.9" />
<PackageReference Include="Cuemon.AspNetCore" Version="9.0.0-preview.11" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using Microsoft.Extensions.DependencyInjection;
using Xunit;
using Xunit.Abstractions;
using YamlDotNet.Serialization.NamingConventions;

namespace Codebelt.Extensions.Asp.Versioning
{
Expand Down Expand Up @@ -207,7 +208,7 @@ public async Task GetRequest_ShouldFailWithBadRequestFormattedAsXmlResponse_As_d
.AddApplicationPart(typeof(FakeController).Assembly)
.AddJsonFormatters()
.AddXmlFormatters()
.AddYamlFormatters();
.AddYamlFormatters(o => o.Settings.NamingConvention = PascalCaseNamingConvention.Instance);
services.AddHttpContextAccessor();
services.AddRestfulApiVersioning();
}, app =>
Expand All @@ -228,13 +229,14 @@ public async Task GetRequest_ShouldFailWithBadRequestFormattedAsXmlResponse_As_d
Assert.Equal(HttpStatusCode.BadRequest, sut.StatusCode);
Assert.Equal(HttpMethod.Get, sut.RequestMessage.Method);
Assert.EndsWith(yamlAccept, sut.Content.Headers.ContentType.ToString());
Assert.Equal("""
Assert.True(Match("""
Error:
Instance: http://localhost/fake/throw
Status: 400
Code: BadRequest
Message: The HTTP resource that matches the request URI 'http://localhost/fake/throw' does not support the API version 'd3'.

""", await sut.Content.ReadAsStringAsync(), ignoreLineEndingDifferences: true);
TraceId: *
""".ReplaceLineEndings(), await sut.Content.ReadAsStringAsync(), o => o.ThrowOnNoMatch = true));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Cuemon.Extensions.AspNetCore.Mvc" Version="9.0.0-preview.9" />
<PackageReference Include="Cuemon.Extensions.AspNetCore.Mvc" Version="9.0.0-preview.11" />
<PackageReference Include="Cuemon.Extensions.AspNetCore.Mvc.Formatters.Newtonsoft.Json" Version="9.0.0-preview.7" />
<PackageReference Include="Cuemon.Extensions.AspNetCore.Mvc.Formatters.Text.Json" Version="9.0.0-preview.9" />
<PackageReference Include="Cuemon.Extensions.AspNetCore.Mvc.Formatters.Xml" Version="9.0.0-preview.9" />
<PackageReference Include="Codebelt.Extensions.AspNetCore.Mvc.Formatters.Text.Yaml" Version="9.0.0-preview.3" />
<PackageReference Include="Cuemon.Extensions.AspNetCore.Mvc.Formatters.Text.Json" Version="9.0.0-preview.11" />
<PackageReference Include="Cuemon.Extensions.AspNetCore.Mvc.Formatters.Xml" Version="9.0.0-preview.11" />
<PackageReference Include="Codebelt.Extensions.AspNetCore.Mvc.Formatters.Text.Yaml" Version="9.0.0-preview.5" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using Microsoft.Extensions.DependencyInjection;
using Xunit;
using Xunit.Abstractions;
using YamlDotNet.Serialization.NamingConventions;

namespace Codebelt.Extensions.Asp.Versioning
{
Expand Down Expand Up @@ -162,7 +163,7 @@ public async Task GetRequest_ShouldFailWithBadRequestFormattedAsYamlResponse_As_
services.AddFaultDescriptorOptions();
services.AddControllers(o => o.Filters.AddFaultDescriptor())
.AddApplicationPart(typeof(FakeController).Assembly)
.AddYamlFormatters();
.AddYamlFormatters(o => o.Settings.NamingConvention = PascalCaseNamingConvention.Instance);
services.AddHttpContextAccessor()
.AddRestfulApiVersioning(o =>
{
Expand All @@ -186,37 +187,45 @@ public async Task GetRequest_ShouldFailWithBadRequestFormattedAsYamlResponse_As_
Assert.Equal(HttpStatusCode.BadRequest, sut.StatusCode);
Assert.Equal(HttpMethod.Get, sut.RequestMessage.Method);
Assert.EndsWith("*/*", sut.Content.Headers.ContentType.ToString());
Assert.StartsWith(@"Error:
Status: 400
Code: BadRequest
Message: The HTTP resource that matches the request URI 'http://localhost/fake/throw' does not support the API version 'b3'.
Failure:
Type: Cuemon.AspNetCore.Http.BadRequestException
Source: Codebelt.Extensions.Asp.Versioning
Message: The HTTP resource that matches the request URI 'http://localhost/fake/throw' does not support the API version 'b3'.
Stack:
".ReplaceLineEndings(), await sut.Content.ReadAsStringAsync());
Assert.EndsWith(@"Evidence:
Request:
Location: http://localhost/fake/throw
Method: GET
Headers:
Accept:
- text/html
- application/xhtml+xml
- image/avif
- image/webp
- image/apng
- '*/*; q=0.8'
- application/signed-exchange; v=b3; q=0.9
- application/json; q=10.0
Host:
- localhost
Query: []
Form:
Cookies: []
Body: ''
".ReplaceLineEndings(), await sut.Content.ReadAsStringAsync());
Assert.True(Match("""
Error:
Instance: http://localhost/fake/throw
Status: 400
Code: BadRequest
Message: The HTTP resource that matches the request URI 'http://localhost/fake/throw' does not support the API version 'b3'.
Failure:
Type: Cuemon.AspNetCore.Http.BadRequestException
Source: Codebelt.Extensions.Asp.Versioning
Message: The HTTP resource that matches the request URI 'http://localhost/fake/throw' does not support the API version 'b3'.
Stack:
- at Codebelt.Extensions.Asp.Versioning.ServiceCollectionExtensions.<>c.<AddRestfulApiVersioning>*
- at Microsoft.AspNetCore.Http.DefaultProblemDetailsWriter.WriteAsync(ProblemDetailsContext context)
- at Microsoft.AspNetCore.Http.ProblemDetailsService.TryWriteAsync(ProblemDetailsContext context)
- at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|7_0(Endpoint endpoint, Task requestTask, ILogger logger)
- at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)
StatusCode: 400
ReasonPhrase: Bad Request
Evidence:
Request:
Location: http://localhost/fake/throw
Method: GET
Headers:
Accept:
- text/html
- application/xhtml+xml
- image/avif
- image/webp
- image/apng
- '*/*; q=0.8'
- application/signed-exchange; v=b3; q=0.9
- application/json; q=10.0
Host:
- localhost
Query: []
Cookies: []
Body: ''
TraceId: *
""".ReplaceLineEndings(), await sut.Content.ReadAsStringAsync(), o => o.ThrowOnNoMatch = true));
}
}

Expand Down
2 changes: 1 addition & 1 deletion testenvironments.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{
"name": "Docker-Ubuntu",
"type": "docker",
"dockerImage": "gimlichael/ubuntu-testrunner:net6.0.425-net8.0.401-9.0.100-rc.1.24452.12"
"dockerImage": "gimlichael/ubuntu-testrunner:6.0.427-net8.0.403-9.0.100-rc.2.24474.11"
}
]
}

0 comments on commit 4b7419b

Please sign in to comment.