Class XmlDocumentationSchemaTransformer
Namespace: Momentum.ServiceDefaults.Api.OpenApi.Transformers
Assembly: Momentum.ServiceDefaults.Api.dll
Transforms OpenAPI schemas by enriching them with XML documentation from model types.
public class XmlDocumentationSchemaTransformer : IOpenApiSchemaTransformerInheritance
object ← XmlDocumentationSchemaTransformer
Implements
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
This transformer enhances schema specifications with:
- Type XML documentation as schema description
- Property documentation for all public properties
- Nullable type information
- Enum value listings
- Support for JsonPropertyName attributes
Constructors
XmlDocumentationSchemaTransformer(ILogger<XmlDocumentationSchemaTransformer>, IXmlDocumentationService)
Transforms OpenAPI schemas by enriching them with XML documentation from model types.
public XmlDocumentationSchemaTransformer(ILogger<XmlDocumentationSchemaTransformer> logger, IXmlDocumentationService xmlDocumentationService)Parameters
logger ILogger<XmlDocumentationSchemaTransformer>
xmlDocumentationService IXmlDocumentationService
Remarks
This transformer enhances schema specifications with:
- Type XML documentation as schema description
- Property documentation for all public properties
- Nullable type information
- Enum value listings
- Support for JsonPropertyName attributes
Methods
TransformAsync(OpenApiSchema, OpenApiSchemaTransformerContext, CancellationToken)
Transforms the specified OpenAPI schema.
public Task TransformAsync(OpenApiSchema schema, OpenApiSchemaTransformerContext context, CancellationToken cancellationToken)Parameters
schema OpenApiSchema
The to modify.
context OpenApiSchemaTransformerContext
The associated with the .
cancellationToken CancellationToken
The cancellation token to use.
Returns
The task object representing the asynchronous operation.