Skip to content

Commit 0d6f97e

Browse files
authored
Fix typo
1 parent 2c1fce2 commit 0d6f97e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -414,17 +414,17 @@ private static void AddSupportedResponseTypes(
414414
return matchingDescription;
415415
}
416416

417-
static bool TypesAreCompatible(Type? apiResponseType, Type? metadaType)
417+
static bool TypesAreCompatible(Type? apiResponseType, Type? metadataType)
418418
{
419419
// We need to a special check for cases where the inferred type is different than the one specified in attributes.
420420
// For example, an endpoint that defines [ProducesResponseType<IEnumerable<WeatherForecast>>],
421421
// but the endpoint returns weatherForecasts.ToList(). Because List<> is a different type than IEnumerable<>, it would incorrectly return false.
422422
// Currently, we do a "simple" bidirectional check to see if the types are assignable to each other.
423423
// This isn't very thorough, but it works for most cases.
424424
// For more information, check the related bug: https://github.com/dotnet/aspnetcore/issues/60518
425-
return apiResponseType == metadaType ||
426-
metadaType?.IsAssignableFrom(apiResponseType) == true ||
427-
apiResponseType?.IsAssignableFrom(metadaType) == true;
425+
return apiResponseType == metadataType ||
426+
metadataType?.IsAssignableFrom(apiResponseType) == true ||
427+
apiResponseType?.IsAssignableFrom(metadataType) == true;
428428
}
429429
}
430430

0 commit comments

Comments
 (0)