Skip to content

Commit d845f5f

Browse files
committed
cleanup
1 parent 3f9451c commit d845f5f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/Mvc/Mvc.ApiExplorer/src/EndpointMetadataApiDescriptionProvider.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ public void OnProvidersExecuting(ApiDescriptionProviderContext context)
4343
{
4444
foreach (var endpoint in _endpointDataSource.Endpoints)
4545
{
46-
if (endpoint is RouteEndpoint routeEndpoint
47-
&& routeEndpoint.Metadata.GetMetadata<MethodInfo>() is { } methodInfo
48-
&& routeEndpoint.Metadata.GetMetadata<IHttpMethodMetadata>() is { } httpMethodMetadata)
46+
if (endpoint is RouteEndpoint routeEndpoint &&
47+
routeEndpoint.Metadata.GetMetadata<MethodInfo>() is { } methodInfo &&
48+
routeEndpoint.Metadata.GetMetadata<IHttpMethodMetadata>() is { } httpMethodMetadata)
4949
{
5050
// REVIEW: Should we add an ApiDescription for endpoints without IHttpMethodMetadata? Swagger doesn't handle
5151
// a null HttpMethod even though it's nullable on ApiDescription, so we'd need to define "default" HTTP methods.
@@ -64,7 +64,7 @@ public void OnProvidersExecuted(ApiDescriptionProviderContext context)
6464

6565
private ApiDescription CreateApiDescription(RouteEndpoint routeEndpoint, string httpMethod, MethodInfo methodInfo)
6666
{
67-
// Swagger uses the "controller" name to group endpoints together.
67+
// Swashbuckle uses the "controller" name to group endpoints together.
6868
// For now, put all methods defined the same declaring type together.
6969
string controllerName;
7070

src/Mvc/Mvc.ApiExplorer/test/EndpointMetadataApiDescriptionProviderTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ private interface IInferredJsonInterface
358358

359359
private class ServiceProviderIsService : IServiceProviderIsService
360360
{
361-
public bool IsService(Type serviceType) => serviceType is IInferredServiceInterface;
361+
public bool IsService(Type serviceType) => serviceType == typeof(IInferredServiceInterface);
362362
}
363363
}
364364
}

0 commit comments

Comments
 (0)