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/blazor/fundamentals/startup.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -678,7 +678,7 @@ In a component that adopts Interactive WebAssembly rendering, wrap the component
678
678
679
679
#### Global Interactive WebAssembly rendering with prerendering
680
680
681
-
*This scenario applies to global Interactive WebAssembly rendering without prerendering (`@rendermode="InteractiveWebAssembly"` on the `HeadOutlet` and `Routes` components in the `App` component).*
681
+
*This scenario applies to global Interactive WebAssembly rendering with prerendering (`@rendermode="InteractiveWebAssembly"` on the `HeadOutlet` and `Routes` components in the `App` component).*
682
682
683
683
Create a `ContentLoading` component in the `Layout` folder of the `.Client` app that calls <xref:Microsoft.AspNetCore.Components.RendererInfo.IsInteractive?displayProperty=nameWithType>:
Copy file name to clipboardExpand all lines: aspnetcore/blazor/security/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -535,7 +535,7 @@ Two additional abstractions participate in managing authentication state:
535
535
536
536
*<xref:Microsoft.AspNetCore.Components.Server.RevalidatingServerAuthenticationStateProvider> ([reference source](https://github.com/dotnet/aspnetcore/blob/main/src/Components/Server/src/Circuits/RevalidatingServerAuthenticationStateProvider.cs)): A base class for <xref:Microsoft.AspNetCore.Components.Authorization.AuthenticationStateProvider> services used by the Blazor framework to receive an authentication state from the host environment and revalidate it at regular intervals.
537
537
538
-
The default 30 minute revalidation interval can be adjusted in [`RevalidatingIdentityAuthenticationStateProvider` (`Areas/Identity/RevalidatingIdentityAuthenticationStateProvider.cs`)](https://github.com/dotnet/aspnetcore/blob/release/7.0/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Areas/Identity/RevalidatingIdentityAuthenticationStateProvider.cs). The following example shortens the interval to 20 minutes:
538
+
The default 30 minute revalidation interval can be adjusted in [`RevalidatingIdentityAuthenticationStateProvider` (reference source)](https://github.com/dotnet/aspnetcore/blob/v7.0.0/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Areas/Identity/RevalidatingIdentityAuthenticationStateProvider.cs#L26). The following example shortens the interval to 20 minutes:
Copy file name to clipboardExpand all lines: aspnetcore/fundamentals/openapi/aspnetcore-openapi.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -150,11 +150,11 @@ The OpenAPI document is regenerated every time a request to the OpenAPI endpoint
150
150
151
151
## Generate multiple OpenAPI documents
152
152
153
-
In some scenarios, it's helpful to generate multiple OpenAPI documents with different content from a single ASP.NET Core API app. These scenarios include:
153
+
In some scenarios, it's helpful to generate multiple OpenAPI documents with different content from a single ASP.NET Core API app. These scenarios include generating OpenAPI documentation for different:
154
154
155
-
*Generating OpenAPI documentation for different audiences, such as public and internal APIs.
156
-
*Generating OpenAPI documentation for different versions of an API.
157
-
*Generating OpenAPI documentation for different parts of an app, such as a frontend and backend API.
155
+
*Audiences, such as public and internal APIs.
156
+
*Versions of an API.
157
+
*Parts of an app, such as a frontend and backend API.
158
158
159
159
To generate multiple OpenAPI documents, call the <xref:Microsoft.Extensions.DependencyInjection.OpenApiServiceCollectionExtensions.AddOpenApi%2A> extension method once for each document, specifying a different document name in the first parameter each time.
ASP.NET collects metadata from the web app's endpoints and uses it to generate an OpenAPI document.
16
18
In controller-based apps, metadata is collected from attributes like [`[EndpointDescription]`](xref:Microsoft.AspNetCore.Http.EndpointDescriptionAttribute), [`[HttpPost]`](xref:Microsoft.AspNetCore.Mvc.HttpPostAttribute),
17
19
and [`[Produces]`](xref:Microsoft.AspNetCore.Mvc.ProducesAttribute).
@@ -31,7 +33,7 @@ The following table provides an overview of the metadata collected and the strat
ASP.NET Core does not collect metadata from XML doc comments.
36
+
ASP.NET Core can also collect metadata from XML doc comments. For more information, see <xref:fundamentals/openapi/aspnet-openapi-xml> for more details.
35
37
36
38
The following sections demonstrate how to include metadata in an app to customize the generated OpenAPI document.
37
39
@@ -314,8 +316,6 @@ app.MapGet("/todos",
314
316
async (TodoDbdb) =>awaitdb.Todos.ToListAsync());
315
317
```
316
318
317
-
:::moniker range=">= aspnetcore-10.0"
318
-
319
319
[`[ProducesResponseType]`](xref:Microsoft.AspNetCore.Mvc.ProducesResponseTypeAttribute), [`[Produces]`](xref:Microsoft.AspNetCore.Mvc.ProducesAttribute), and [`[ProducesDefaultResponseType]`](xref:Microsoft.AspNetCore.Mvc.ProducesResponseTypeAttribute) also support an optional string property called `Description` that can be used to describe the response. This is useful for explaining why or when clients can expect a specific response:
320
320
321
321
```csharp
@@ -327,8 +327,6 @@ app.MapGet("/todos/{id}",
327
327
async (intid, TodoDbdb) =>/* Code here */);
328
328
```
329
329
330
-
:::moniker-end
331
-
332
330
Using <xref:Microsoft.AspNetCore.Http.TypedResults> in the implementation of an endpoint's route handler automatically includes the response type metadata for the endpoint. For example, the following code automatically annotates the endpoint with a response under the `200` status code with an `application/json` content type.
333
331
334
332
```csharp
@@ -398,8 +396,6 @@ Only one [`[Produces]`](xref:Microsoft.AspNetCore.Mvc.ProducesAttribute) or <xre
398
396
399
397
All of the above attributes can be applied to individual action methods or to the controller class where it applies to all action methods in the controller.
400
398
401
-
:::moniker range=">= aspnetcore-10.0"
402
-
403
399
[`[ProducesResponseType]`](xref:Microsoft.AspNetCore.Mvc.ProducesResponseTypeAttribute), [`[Produces]`](xref:Microsoft.AspNetCore.Mvc.ProducesAttribute), and [`[ProducesDefaultResponseType]`](xref:Microsoft.AspNetCore.Mvc.ProducesResponseTypeAttribute) also support an optional string property called `Description` that can be used to describe the response. This is useful for explaining why or when clients can expect a specific response:
404
400
405
401
```csharp
@@ -412,8 +408,6 @@ All of the above attributes can be applied to individual action methods or to th
Note that object and dynamic types have _no_ type defined in the OpenAPI because these can contain data of any type, including primitive types like int or string.
522
-
523
-
The `type` and `format` can also be set with a [Schema Transformer](xref:fundamentals/openapi/customize-openapi#use-schema-transformers). For example, you may want the `format` of decimal types to be `decimal` instead of `double`.
524
-
525
-
:::moniker-end
526
-
527
-
:::moniker range=">= aspnetcore-10.0"
528
-
529
490
#### Numeric types
530
491
531
492
The JSON Schema library maps standard C# numeric types to OpenAPI `type` and `format` based on the
@@ -593,8 +554,6 @@ Other C# types are represented in the generated OpenAPI document as shown in the
593
554
| object |_omitted_||
594
555
| dynamic |_omitted_||
595
556
596
-
:::moniker-end
597
-
598
557
### Use attributes to add metadata
599
558
600
559
ASP.NET uses metadata from attributes on class or record properties to set metadata on the corresponding properties of the generated schema.
@@ -675,13 +634,6 @@ An enum type without a [`[JsonConverter]`](xref:System.Text.Json.Serialization.
675
634
676
635
#### nullable
677
636
678
-
:::moniker range="< aspnetcore-10.0"
679
-
680
-
Properties defined as a nullable value or reference type have `nullable: true` in the generated schema. This is consistent with the default behavior of the <xref:System.Text.Json> deserializer, which accepts `null` as a valid value for a nullable property.
681
-
682
-
:::moniker-end
683
-
:::moniker range=">= aspnetcore-10.0"
684
-
685
637
Properties defined as a nullable value or reference type appear in the generated schema with a `type` keyword whose value is an array that includes `null` as one of the types. This is consistent with the default behavior of the <xref:System.Text.Json> deserializer, which accepts `null` as a valid value for a nullable property.
686
638
687
639
For example, a C# property defined as `string?` is represented in the generated schema as:
@@ -698,8 +650,6 @@ For example, a C# property defined as `string?` is represented in the generated
698
650
699
651
If the app is configured to produce OpenAPI v3.0 or OpenAPI v2 documents, nullable value or reference types have `nullable: true` in the generated schema because these OpenAPI versions do not allow the `type` field to be an array.
700
652
701
-
:::moniker-end
702
-
703
653
#### additionalProperties
704
654
705
655
Schemas are generated without an `additionalProperties` assertion by default, which implies the default of `true`. This is consistent with the default behavior of the <xref:System.Text.Json> deserializer, which silently ignores additional properties in a JSON object.
@@ -722,3 +672,9 @@ A schema transformer can be used to override any default metadata or add additio
0 commit comments