Class ValueObjectSchemaTransformer
Namespace: AdCodicem.ValueObjects.OpenApi
Assembly: AdCodicem.ValueObjects.OpenApi.dll
Documents a value object as its underlying type rather than as an object with a Value property.
public sealed class ValueObjectSchemaTransformer : IOpenApiSchemaTransformer
Inheritance
object ← ValueObjectSchemaTransformer
Implements
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Remarks
Schema generation is driven by JsonTypeInfo, and a type carrying a custom converter is opaque to it,
so a value object would otherwise appear as an empty schema. This transformer fills it in from the
It runs while the document is built, not per request.
Methods
TransformAsync(OpenApiSchema, OpenApiSchemaTransformerContext, CancellationToken)
Transforms the specified OpenAPI schema.
public Task TransformAsync(OpenApiSchema schema, OpenApiSchemaTransformerContext context, CancellationToken cancellationToken)
Parameters
schema OpenApiSchema
The
context OpenApiSchemaTransformerContext
The
cancellationToken CancellationToken
The cancellation token to use.
Returns
The task object representing the asynchronous operation.