You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: aspnetcore/release-notes/aspnetcore-10/includes/OpenApiPopulateXMLDocComments.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
### Populate XML doc comments into OpenAPI document
2
2
3
-
ASP.NET Core OpenAPI document generation wlll now include metadata from XML doc comments on on method, class, and member definitions in the OpenAPI document. You must enable XML doc comments in your project file to use this feature. You can do this by adding the following property to your project file:
3
+
ASP.NET Core OpenAPI document generation will now include metadata from XML doc comments on method, class, and member definitions in the OpenAPI document. You must enable XML doc comments in your project file to use this feature. You can do this by adding the following property to your project file:
4
4
5
5
```xml
6
6
<PropertyGroup>
@@ -10,19 +10,19 @@ ASP.NET Core OpenAPI document generation wlll now include metadata from XML doc
10
10
11
11
At build-time, the OpenAPI package will leverage a source generator to discover XML comments in the current application assembly and any project references and emit source code to insert them into the document via an OpenAPI document transformer.
12
12
13
-
Note that the C# build process does not capture XML doc comments placed on lamda expresions, so to use XML doc comments to add metadata to a minimal API endpoint, you must define the endpoint handler as a method, put the XML doc comments on the method, and then reference that method from the `MapXXX` method. For example, to use XML doc comments to add metadata to a minimal API endpoint originally defined as a lambda expression:
13
+
Note that the C# build process does not capture XML doc comments placed on lambda expresions, so to use XML doc comments to add metadata to a minimal API endpoint, you must define the endpoint handler as a method, put the XML doc comments on the method, and then reference that method from the `MapXXX` method. For example, to use XML doc comments to add metadata to a minimal API endpoint originally defined as a lambda expression:
Then define the `Hello` method with XML doc comments:
25
+
Define the `Hello` method with XML doc comments:
26
26
27
27
```csharp
28
28
staticpartialclassProgram
@@ -42,9 +42,9 @@ static partial class Program
42
42
}
43
43
```
44
44
45
-
Here the `Hello` method is added to the `Program` class, but you can add it to any class in your project.
45
+
In the previous example the `Hello` method is added to the `Program` class, but you can add it to any class in your project.
46
46
47
-
The example above illustrates the `<summary>`, `<remarks>`, and `<param>` XML doc comments.
47
+
The previous example illustrates the `<summary>`, `<remarks>`, and `<param>` XML doc comments.
48
48
For more information about XML doc comments, including all the supported tags, see the [C# documentation](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/xmldoc/recommended-tags).
49
49
50
50
Since the core functionality is provided via a source generator, it can be disabled by adding the following MSBuild to your project file.
@@ -66,7 +66,7 @@ The source generator process XML files included in the `AdditionalFiles` propert
0 commit comments