Skip to content

Commit

Permalink
Remove PropertyNamingPolicy assignments in tests.
Browse files Browse the repository at this point in the history
Default serialization has changed in .NET 8 for HTTP API error response classes (see https://learn.microsoft.com/en-us/dotnet/core/compatibility/aspnet-core/8.0/problemdetails-custom-converters).

Setting PropertyNamingPolicy to NULL will return PascalCase, removing these assignments which will verify that the default behaviour is to return camel case
  • Loading branch information
Jakob Ehn committed Jan 2, 2024
1 parent e29ab7c commit 1422aff
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -502,10 +502,6 @@ public async Task Api_Always_Returns_CamelCase_Json_For_Http400BadRequest()
{
services.AddTransient(s => _bankIdUiOptionsProtector.Object);
services.AddTransient(s => _bankIdUiStateProtector.Object);
services.AddMvc().AddJsonOptions(configure =>
{
configure.JsonSerializerOptions.PropertyNamingPolicy = null;
});
});


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Net;
using System.Net.Http;
using System.Text.Encodings.Web;
using System.Text.Json;
using System.Threading.Tasks;

using ActiveLogin.Authentication.BankId.Api;
Expand Down Expand Up @@ -503,10 +504,6 @@ public async Task Api_Always_Returns_CamelCase_Json_For_Http400BadRequest()
{
services.AddTransient(s => _bankIdUiOptionsProtector.Object);
services.AddTransient(s => _bankIdUiStateProtector.Object);
services.AddMvc().AddJsonOptions(configure =>
{
configure.JsonSerializerOptions.PropertyNamingPolicy = null;
});
});


Expand Down

0 comments on commit 1422aff

Please sign in to comment.