Skip to content

Commit b569a32

Browse files
committed
fixed diff
1 parent be35b3c commit b569a32

File tree

1 file changed

+1
-27
lines changed
  • aspnetcore/release-notes/aspnetcore-10/includes

1 file changed

+1
-27
lines changed

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

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -37,28 +37,6 @@ One of the most significant changes is that the `OpenApiAny` class has been drop
3737

3838
:::code language="diff" source="~/release-notes/aspnetcore-10/samples/WebAppOpenAPI10/TransformerJsonNode.cs":::
3939

40-
```diff
41-
options.AddSchemaTransformer((schema, context, cancellationToken) =>
42-
{
43-
if (context.JsonTypeInfo.Type == typeof(WeatherForecast))
44-
{
45-
- schema.Example = new OpenApiObject
46-
+ schema.Example = new JsonObject
47-
{
48-
- ["date"] = new OpenApiString(DateTime.Now.AddDays(1).ToString("yyyy-MM-dd")),
49-
+ ["date"] = DateTime.Now.AddDays(1).ToString("yyyy-MM-dd"),
50-
- ["temperatureC"] = new OpenApiInteger(0),
51-
+ ["temperatureC"] = 0,
52-
- ["temperatureF"] = new OpenApiInteger(32),
53-
+ ["temperatureF"] = 32,
54-
- ["summary"] = new OpenApiString("Bracing"),
55-
+ ["summary"] = "Bracing",
56-
};
57-
}
58-
return Task.CompletedTask;
59-
});
60-
```
61-
6240
Note that these changes are necessary even when only configuring the OpenAPI version to 3.0.
6341

6442
### OpenAPI in YAML
@@ -67,11 +45,7 @@ ASP.NET now supports serving the generated OpenAPI document in YAML format. YAML
6745

6846
To configure an app to serve the generated OpenAPI document in YAML format, specify the endpoint in the MapOpenApi call with a ".yaml" or ".yml" suffix, as shown in the following example:
6947

70-
:::code language="csharp" source="~/release-notes/aspnetcore-10/samples/WebAppOpenAPI10/Program.cs" id="snippet_ConfigOpenApiYAM" highlight="3":::
71-
72-
```csharp
73-
app.MapOpenApi("/openapi/{documentName}.yaml");
74-
```
48+
:::code language="csharp" source="~/release-notes/aspnetcore-10/samples/WebAppOpenAPI10/Program.cs" id="snippet_ConfigOpenApiYAML" highlight="3":::
7549

7650
Support for:
7751

0 commit comments

Comments
 (0)