Skip to content

Commit 051c691

Browse files
Merge pull request #34748 from dotnet/main
Merge to Live
2 parents c8faee3 + bdf54c2 commit 051c691

File tree

2 files changed

+3
-41
lines changed

2 files changed

+3
-41
lines changed

aspnetcore/blazor/security/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ Specify the issuer explicitly when deploying to Azure App Service on Linux with
368368

369369
Don't attempt to resolve <xref:Microsoft.AspNetCore.Components.Authorization.AuthenticationStateProvider> within a custom scope because it results in the creation of a new instance of the <xref:Microsoft.AspNetCore.Components.Authorization.AuthenticationStateProvider> that isn't correctly initialized.
370370

371-
To access the <xref:Microsoft.AspNetCore.Components.Authorization.AuthenticationStateProvider> within a service scoped to a component, inject the <xref:Microsoft.AspNetCore.Components.Authorization.AuthenticationStateProvider> with the [`@inject` directive](xref:mvc/views/razor#inject) or the [`[Inject]` attribute](xref:Microsoft.AspNetCore.Components.InjectAttribute) and pass it to the service as a parameter. This approach ensures that the correct, initialized instance of the <xref:Microsoft.AspNetCore.Components.Authorization.AuthenticationStateProvider> is used for each user app instance.
371+
To access the <xref:Microsoft.AspNetCore.Components.Authorization.AuthenticationStateProvider> within a service scoped to a component, inject the <xref:Microsoft.AspNetCore.Components.Authorization.AuthenticationStateProvider> into the component and pass it to the service as a parameter. This approach ensures that the correct, initialized instance of the <xref:Microsoft.AspNetCore.Components.Authorization.AuthenticationStateProvider> is used for each user app instance.
372372

373373
`ExampleService.cs`:
374374

aspnetcore/release-notes/aspnetcore-10/includes/openApi.md

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -35,45 +35,7 @@ OpenAPI 3.1 support was primarly added in the following [PR](https://github.com/
3535

3636
Support for OpenAPI 3.1 requires an update to the underlying OpenAPI.NET library to a new major version, 2.0. This new version has some breaking changes from the previous version. The breaking changes may impact apps if they have any document, operation, or schema transformers.
3737

38-
One of the most significant changes is that the `OpenApiAny` class has been dropped in favor of using `JsonNode` directly. Transformers that use `OpenApiAny` need to be updated to use `JsonNode`. For example, a schema transformer to add an example in .NET 9 might look like the following code:
39-
40-
```csharp
41-
options.AddSchemaTransformer((schema, context, cancellationToken) =>
42-
{
43-
if (context.JsonTypeInfo.Type == typeof(WeatherForecast))
44-
{
45-
schema.Example = new OpenApiObject
46-
{
47-
["date"] = new OpenApiString(DateTime.Now.AddDays(1).ToString("yyyy-MM-dd")),
48-
["temperatureC"] = new OpenApiInteger(0),
49-
["temperatureF"] = new OpenApiInteger(32),
50-
["summary"] = new OpenApiString("Bracing"),
51-
};
52-
}
53-
return Task.CompletedTask;
54-
});
55-
```
56-
57-
In .NET 10 the transformer to do the same task will look like the following code:
58-
59-
```csharp
60-
options.AddSchemaTransformer((schema, context, cancellationToken) =>
61-
{
62-
if (context.JsonTypeInfo.Type == typeof(WeatherForecast))
63-
{
64-
schema.Example = new JsonObject
65-
{
66-
["date"] = DateTime.Now.AddDays(1).ToString("yyyy-MM-dd"),
67-
["temperatureC"] = 0,
68-
["temperatureF"] = 32,
69-
["summary"] = "Bracing",
70-
};
71-
}
72-
return Task.CompletedTask;
73-
});
74-
```
75-
76-
The following example shows the changes in diff format.
38+
One of the most significant changes is that the `OpenApiAny` class has been dropped in favor of using `JsonNode` directly. Transformers that use `OpenApiAny` need to be updated to use `JsonNode`. The following diff shows the changes in schema transformer from .NET 9 to .NET 10:
7739

7840
```diff
7941
options.AddSchemaTransformer((schema, context, cancellationToken) =>
@@ -114,4 +76,4 @@ Support for:
11476
- YAML is currently only available for the the OpenAPI served from the OpenAPI endpoint.
11577
- Generating OpenAPI documents in YAML format at build time isadded in a future preview.
11678

117-
See [this PR](https://github.com/dotnet/aspnetcore/pull/58616) which added support for serving the generated OpenAPI document in YAML format.
79+
See [this PR](https://github.com/dotnet/aspnetcore/pull/58616) which added support for serving the generated OpenAPI document in YAML format.

0 commit comments

Comments
 (0)