Skip to content

Commit 802dcfc

Browse files
committed
Fix CA5372: Use XmlReader for XPathDocument
1 parent f45335b commit 802dcfc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/JsonApiDotNetCore.OpenApi.Swashbuckle/SwaggerComponents/ResourceDocumentationReader.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Collections.Concurrent;
22
using System.Reflection;
3+
using System.Xml;
34
using System.Xml.XPath;
45
using JsonApiDotNetCore.Configuration;
56
using JsonApiDotNetCore.Resources.Annotations;
@@ -68,7 +69,8 @@ internal sealed class ResourceDocumentationReader
6869

6970
if (File.Exists(documentationPath))
7071
{
71-
var document = new XPathDocument(documentationPath);
72+
using var reader = XmlReader.Create(documentationPath);
73+
var document = new XPathDocument(reader);
7274
return document.CreateNavigator();
7375
}
7476

0 commit comments

Comments
 (0)