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
ASP.NET collects metadata from the web app's endpoints and uses it to generate an OpenAPI document.
16
16
In controller-based apps, metadata is collected from attributes like [`[EndpointDescription]`](xref:Microsoft.AspNetCore.Http.EndpointDescriptionAttribute), [`[HttpPost]`](xref:Microsoft.AspNetCore.Mvc.HttpPostAttribute),
@@ -396,7 +396,7 @@ This example also illustrates how to define multiple response types for an actio
396
396
397
397
---
398
398
399
-
### Excluding endpoints from the generated document
399
+
### Exclude endpoints from the generated document
400
400
401
401
By default, all endpoints that are defined in an app are documented in the generated OpenAPI file, but endpoints can be excluded from the document using attributes or extension methods.
402
402
@@ -435,7 +435,7 @@ The following example demonstrates how to exclude an endpoint from the generated
435
435
```
436
436
---
437
437
438
-
## Including OpenAPI metadata for data types
438
+
## Include OpenAPI metadata for data types
439
439
440
440
C# classes or records used in request or response bodies are represented as schemas
441
441
in the generated OpenAPI document.
@@ -477,7 +477,7 @@ Note that object and dynamic types have _no_ type defined in the OpenAPI because
477
477
478
478
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`.
479
479
480
-
### Using attributes to add metadata
480
+
### Use attributes to add metadata
481
481
482
482
ASP.NET uses metadata from attributes on class or record properties to set metadata on the corresponding properties of the generated schema.
483
483
@@ -526,7 +526,7 @@ The [`[JsonDerivedType]`](xref:System.Text.Json.Serialization.JsonDerivedTypeAtt
526
526
527
527
An abstract class with a [`[JsonPolymorphic]`](xref:System.Text.Json.Serialization.JsonPolymorphicAttribute) attribute has a `discriminator` field in the schema, but a concrete class with a [`[JsonPolymorphic]`](xref:System.Text.Json.Serialization.JsonPolymorphicAttribute) attribute doesn't have a `discriminator` field. OpenAPI requires that the discriminator property be a required property in the schema, but since the discriminator property isn't defined in the concrete base class, the schema cannot include a `discriminator` field.
528
528
529
-
### Adding metadata with a schema transformer
529
+
### Add metadata with a schema transformer
530
530
531
531
A schema transformer can be used to override any default metadata or add additional metadata, such as `example` values, to the generated schema. See [Use schema transformers](xref:fundamentals/openapi/customize-openapi#use-schema-transformers) for more information.
0 commit comments