Skip to content

Commit 1bdc425

Browse files
authored
Merge pull request #36578 from dotnet/main
Merge to Live
2 parents 3b02fbe + cc13edf commit 1bdc425

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

aspnetcore/fundamentals/openapi/aspnetcore-openapi.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
---
22
title: Generate OpenAPI documents
3+
ai-usage: ai-assisted
34
author: captainsafia
45
description: Learn how to generate and customize OpenAPI documents in an ASP.NET Core app.
5-
ms.author: safia
66
monikerRange: '>= aspnetcore-6.0'
7+
ms.author: safia
78
ms.custom: mvc
8-
ms.date: 12/10/2025
9+
ms.date: 12/17/2025
910
uid: fundamentals/openapi/aspnetcore-openapi
1011
---
1112
# Generate OpenAPI documents
@@ -183,6 +184,11 @@ You can customize the <xref:Microsoft.AspNetCore.OpenApi.OpenApiOptions.ShouldIn
183184

184185
## Generate OpenAPI documents at build time
185186

187+
> [!NOTE]
188+
> Starting with .NET 9, ASP.NET Core includes built-in OpenAPI support. The [`Microsoft.AspNetCore.OpenApi`](https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi) package provides OpenAPI document generation at runtime, and adding the [`Microsoft.Extensions.ApiDescription.Server` ](https://www.nuget.org/packages/Microsoft.Extensions.ApiDescription.Server) package enables build-time document generation.
189+
>
190+
>ASP.NET Core generates OpenAPI documents only. Interactive UIs such as **Swagger UI** or **Scalar** are not included by default and must be added separately. For guidance on using these UI options, see <xref:fundamentals/openapi/using-openapi-documents>.
191+
186192
In typical web apps, OpenAPI documents are generated at runtime and served via an HTTP request to the app server.
187193

188194
In some scenarios, it's helpful to generate the OpenAPI document during the app's build step. These scenarios include generating OpenAPI documentation that is:

aspnetcore/fundamentals/static-files.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to serve and secure static files and configure Map Static
55
monikerRange: '>= aspnetcore-3.1'
66
ms.author: wpickett
77
ms.custom: mvc
8-
ms.date: 09/17/2025
8+
ms.date: 01/05/2026
99
uid: fundamentals/static-files
1010
---
1111
# Static files in ASP.NET Core
@@ -1123,7 +1123,7 @@ Property | Description
11231123

11241124
Item group | Description | Metadata
11251125
--- | ---
1126-
`StaticWebAssetContentTypeMapping` | Maps file patterns to content types and cache headers for endpoints. | `Pattern`, `Cache`
1126+
`StaticWebAssetContentTypeMapping` | Maps file patterns to content types and cache headers for endpoints. | `Pattern`, `Cache`, `Priority`
11271127
`StaticWebAssetFingerprintPattern` | Defines patterns for applying fingerprints to static web assets for cache busting. | `Pattern`, `Expression`
11281128

11291129
Metadata Descriptions:
@@ -1132,13 +1132,16 @@ Metadata Descriptions:
11321132

11331133
* **`Cache`**: Specifies the `Cache-Control` header value for the matched content type. This controls browser caching behavior (for example, `max-age=3600, must-revalidate` for media files).
11341134

1135+
* **`Priority`**: Controls precedence when multiple `StaticWebAssetContentTypeMapping` items match the same file. Higher numeric values take precedence over lower ones. `Priority` is required.
1136+
11351137
* **`Expression`**: Defines how the fingerprint is inserted into the filename. The default is `#[.{FINGERPRINT}]`, which inserts the fingerprint (`{FINGERPRINT}` placeholder) before the extension.
11361138

11371139
The following example maps the bitmap file pattern (`.bmp`) to the `image/bmp` content type with the `{CACHE HEADER}` placeholder representing the `Cache-Control` header to use for non-fingerprinted endpoints:
11381140

11391141
```xml
11401142
<ItemGroup>
1141-
<StaticWebAssetContentTypeMapping Include="image/bmp" Cache="{CACHE HEADER}" Pattern="*.bmp" />
1143+
<StaticWebAssetContentTypeMapping Include="image/bmp" Cache="{CACHE HEADER}"
1144+
Pattern="*.bmp" Priority="1" />
11421145
</ItemGroup>
11431146
```
11441147

0 commit comments

Comments
 (0)