Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 762bb4f

Browse files
committed
Fix broken test, adjust message
1 parent 80a6875 commit 762bb4f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

‎src/JsonApiDotNetCore/Configuration/ApplicationBuilderExtensions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ private static void AssertAspNetCoreOpenApiIsNotRegistered(IServiceProvider serv
6262
if (configureInstance != null)
6363
{
6464
throw new InvalidConfigurationException("JsonApiDotNetCore is incompatible with ASP.NET OpenAPI. " +
65-
"Replace 'services.AddOpenApi()' with 'services.AddOpenApiForJsonApi()' from the JsonApiDotNetCore.OpenApi.Swashbuckle NuGet package.");
65+
"Remove 'services.AddOpenApi()', or replace it by calling 'services.AddOpenApiForJsonApi()' after 'services.AddJsonApi()' " +
66+
"from the JsonApiDotNetCore.OpenApi.Swashbuckle NuGet package.");
6667
}
6768
}
6869
}

‎test/DiscoveryTests/AspNetOpenApiTests.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#if !NET8_0
22
using FluentAssertions;
33
using JsonApiDotNetCore.Configuration;
4+
using JsonApiDotNetCore.Errors;
45
using Microsoft.AspNetCore.Builder;
56
using Microsoft.AspNetCore.TestHost;
67
using Microsoft.Extensions.DependencyInjection;
@@ -24,8 +25,9 @@ public async Task Throws_when_AspNet_OpenApi_is_registered()
2425
Action action = app.UseJsonApi;
2526

2627
// Assert
27-
action.Should().ThrowExactly<InvalidOperationException>().WithMessage("JsonApiDotNetCore is incompatible with ASP.NET OpenAPI. " +
28-
"Replace 'services.AddOpenApi()' with 'services.AddOpenApiForJsonApi()' from the JsonApiDotNetCore.OpenApi.Swashbuckle NuGet package.");
28+
action.Should().ThrowExactly<InvalidConfigurationException>().WithMessage("JsonApiDotNetCore is incompatible with ASP.NET OpenAPI. " +
29+
"Remove 'services.AddOpenApi()', or replace it by calling 'services.AddOpenApiForJsonApi()' after 'services.AddJsonApi()' " +
30+
"from the JsonApiDotNetCore.OpenApi.Swashbuckle NuGet package.");
2931
}
3032
}
3133
#endif

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /