Skip to content

Commit be35b3c

Browse files
committed
test .cs but lang set to diff
1 parent 0a16ac1 commit be35b3c

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

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

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,9 @@ With this feature, the default OpenAPI version for generated documents is`3.1`.
1919

2020
:::code language="csharp" source="~/release-notes/aspnetcore-10/samples/WebAppOpenAPI10/Program.cs" id="snippet_DefaultOpenApiVersion" highlight="3":::
2121

22-
```csharp
23-
builder.Services.AddOpenApi(options =>
24-
{
25-
// Specify the OpenAPI version to use.
26-
options.OpenApiVersion = Microsoft.OpenApi.OpenApiSpecVersion.OpenApi3_0;
27-
});
28-
```
29-
3022
When generating the OpenAPI document at build time, the OpenAPI version can be selected by setting the `--openapi-version` in the `OpenApiGenerateDocumentsOptions` MSBuild item:
3123

32-
:::code language="csharp" source="~/release-notes/aspnetcore-10/samples/WebAppOpenAPI10/WebAppOpenAPI10.csproj" id="snippet_ConfigBuildTimeOpenApiDocVersion" highlight="7":::
33-
34-
```xml
35-
<!-- Configure build-time OpenAPI generation to produce an OpenAPI 3.0 document. -->
36-
<OpenApiGenerateDocumentsOptions>--openapi-version OpenApi3_0</OpenApiGenerateDocumentsOptions>
37-
```
24+
:::code language="xml" source="~/release-notes/aspnetcore-10/samples/WebAppOpenAPI10/WebAppOpenAPI10.csproj" id="snippet_ConfigBuildTimeOpenApiDocVersion" highlight="7":::
3825

3926
OpenAPI 3.1 support was primarily added in the following [PR](https://github.com/dotnet/aspnetcore/pull/59480).
4027

@@ -46,9 +33,9 @@ Breaking changes in this iteration include the following:
4633
* Entities within the OpenAPI document, like operations and parameters, are typed as interfaces. Concrete implementations exist for the inlined and referenced variants of an entity. For example, an `IOpenApiSchema` can either be an inlined `OpenApiSchema` or an `OpenApiSchemaReference` that points to a schema defined elsewhere in the document.
4734
* The `Nullable` property has been removed from the `OpenApiSchema` type. To determine if a type is nullable, evaluate if the `OpenApiSchema.Type` property sets `JsonSchemaType.Null`.
4835

49-
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:
36+
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:
5037

51-
:::code language="diff" source="~/release-notes/aspnetcore-10/samples/WebAppOpenAPI10/TransformerJsonNode.diff":::
38+
:::code language="diff" source="~/release-notes/aspnetcore-10/samples/WebAppOpenAPI10/TransformerJsonNode.cs":::
5239

5340
```diff
5441
options.AddSchemaTransformer((schema, context, cancellationToken) =>

0 commit comments

Comments
 (0)