From 5b7d1000b57263053b5fefe4c68e128ec3ef623d Mon Sep 17 00:00:00 2001 From: martincostello Date: Tue, 29 Jul 2025 13:14:05 +0100 Subject: [PATCH] [OpenApi] Use GetCustomAttributes Use `GetCustomAttributes()` instead of `GetCustomAttributes().OfType()` to avoid need to use LINQ. --- src/OpenApi/src/Extensions/JsonNodeSchemaExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenApi/src/Extensions/JsonNodeSchemaExtensions.cs b/src/OpenApi/src/Extensions/JsonNodeSchemaExtensions.cs index bde53bfd7f2e..a9f6cbdadba6 100644 --- a/src/OpenApi/src/Extensions/JsonNodeSchemaExtensions.cs +++ b/src/OpenApi/src/Extensions/JsonNodeSchemaExtensions.cs @@ -320,7 +320,7 @@ internal static void ApplyParameterInfo(this JsonNode schema, ApiParameterDescri schema.ApplyDefaultValue(defaultValueAttribute.Value, jsonTypeInfo); } - if (parameterInfo.GetCustomAttributes().OfType() is { } validationAttributes) + if (parameterInfo.GetCustomAttributes() is { } validationAttributes) { schema.ApplyValidationAttributes(validationAttributes); }