Skip to main content

Operation Transformers

Namespace: RA.Utilities.OpenApi.OperationTransformers

DocumentTransformers modify the entire OpenAPI document at once, types in the RA.Utilities.OpenApi.OperationTransformers namespace are designed for more granular control. They implement the IOpenApiOperationTransformer interface, which means they are applied to each individual API operation (i.e., each endpoint) separately.

This allows for more targeted modifications that only make sense in the context of a single endpoint.

Here are the transformers provided in that namespace:

DefaultResponsesOperationTransformer​

The DefaultResponsesOperationTransformer is a specific and targeted utility that automatically adds a standardized OpenAPI response for the HTTP 500 (Internal Server Error) status code to every single operation in your API.

GroupTagsDocumentTransformer​

The GroupTagsDocumentTransformer is the exception in this namespace: it implements IOpenApiDocumentTransformer, not IOpenApiOperationTransformer. It projects group-level documentation declared with WithGroupSummary() / WithGroupDescription() onto the OpenAPI tags of the group.