Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions aspnetcore/release-notes/aspnetcore-9.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,8 @@ This section describes new features for OpenAPI

[!INCLUDE[](~/release-notes/aspnetcore-9/includes/openApi.md)]

[!INCLUDE[](~/release-notes/aspnetcore-9/includes/openAPI_completion.md)]

[!INCLUDE[](~/release-notes/aspnetcore-9/includes/transformer-registration.md)]

[!INCLUDE[](~/release-notes/aspnetcore-9/includes/openapi-aot.md)]

[!INCLUDE[](~/release-notes/aspnetcore-9/includes/prob_validation.md)]

## Authentication and authorization

This section describes new features for authentication and authorization.
Expand Down
8 changes: 4 additions & 4 deletions aspnetcore/release-notes/aspnetcore-9/includes/openApi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Built-in support for OpenAPI document generation

The [OpenAPI specification](https://www.openapis.org/) is a standard for describing HTTP APIs. The standard allows developers to define the shape of APIs that can be plugged into client generators, server generators, testing tools, documentation, and more. In .NET 9 Preview, ASP.NET Core provides built-in support for generating OpenAPI documents representing controller-based or minimal APIs via the [Microsoft.AspNetCore.OpenApi](https://nuget.org/packages/Microsoft.AspNetCore.OpenApi) package.
The [OpenAPI specification](https://www.openapis.org/) is a standard for describing HTTP APIs. The standard allows developers to define the shape of APIs that can be plugged into client generators, server generators, testing tools, documentation, and more. In .NET 9, ASP.NET Core provides built-in support for generating OpenAPI documents representing controller-based or minimal APIs via the [Microsoft.AspNetCore.OpenApi](https://nuget.org/packages/Microsoft.AspNetCore.OpenApi) package.

The following highlighted code calls:

Expand All @@ -25,14 +25,14 @@ OpenAPI documents can also be generated at build-time by adding the [`Microsoft.
dotnet add package Microsoft.Extensions.ApiDescription.Server --prerelease
```

In the app's project file, add the following:
To modify the location of the emitted OpenAPI documents, set the target path in the OpenApiDocumentsDirectory property in the app's project file:

:::code language="xml" source="~/release-notes/aspnetcore-9/samples/OpenApiExample/OpenApiExample.csproj" range="9-12":::
:::code language="xml" source="~/release-notes/aspnetcore-9/samples/OpenApiExample/OpenApiExample.csproj" range="9-11":::

Run `dotnet build` and inspect the generated JSON file in the project directory.

![OpenAPI document generation at build-time](~/release-notes/aspnetcore-9/_static/openapidoc2.png)

ASP.NET Core's built-in OpenAPI document generation provides support for various customizations and options. It provides document and operation transformers and has the ability to manage multiple OpenAPI documents for the same application.
ASP.NET Core's built-in OpenAPI document generation provides support for various customizations and options. It provides document, operation, and schema transformers and has the ability to manage multiple OpenAPI documents for the same application.

To learn more about ASP.NET Core's new OpenAPI document capabilities, see [the new Microsoft.AspNetCore.OpenApi docs](https://aka.ms/aspnet/openapi).
13 changes: 0 additions & 13 deletions aspnetcore/release-notes/aspnetcore-9/includes/prob_validation.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,11 @@ app.Run();

record Todo(int Id, string Title, boolean IsCompleted);
```

### `Problem` and `ValidationProblem` result types support construction with `IEnumerable<KeyValuePair<string, object?>>` values

Prior to .NET 9, constructing [Problem](/dotnet/api/microsoft.aspnetcore.http.typedresults.problem) and [ValidationProblem](/dotnet/api/microsoft.aspnetcore.http.typedresults.validationproblem) result types in minimal APIs required that the `errors` and `extensions` properties be initialized with an implementation of `IDictionary<string, object?>`. In this release, these construction APIs support overloads that consume `IEnumerable<KeyValuePair<string, object?>>`.

:::code language="csharp" source="~/fundamentals/openapi/samples/9.x/ProducesProblem/Program.cs" id="snippet_2" :::

Thanks to GitHub user [joegoldman2](https://github.com/joegoldman2) for this contribution!

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@

<PropertyGroup>
<OpenApiDocumentsDirectory>$(MSBuildProjectDirectory)</OpenApiDocumentsDirectory>
<OpenApiGenerateDocuments>true</OpenApiGenerateDocuments>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.0-preview.5" />
</ItemGroup>
Expand Down
Loading