RA.Utilities.OpenApi
Version 10.3.0
Route groups can now be documented once with WithGroupSummary() / WithGroupDescription(); GroupTagsDocumentTransformer writes that text into the group's OpenAPI tags.
✨ New Features
- Added
WithGroupSummary()andWithGroupDescription()onRouteGroupBuilder: Group-level documentation conventions. Every endpoint in the group (including nested groups) inherits the metadata, so a group is described once instead of repeatingWithSummary()/WithDescription()on every operation. The summary is rendered as the bold heading of the tag description, the description as its body. - Added
GroupTagsDocumentTransformer: Projects the group metadata onto the OpenAPI tags carried by the group's endpoints. Tags without a description are populated; existing tag descriptions are never overwritten, and endpoint-level summary/description metadata is left untouched. - Added
AddGroupTagsDocumentTransformer(IDictionary<string, string> tags): Registers the transformer standalone. AddDefaultsDocumentTransformer()now registersGroupTagsDocumentTransformer, so the default setup writes group documentation without additional configuration.
📝 Notes
- Group text is written only to tags the endpoints actually carry (via
WithTags(...)). A group without tags produces no tag description. - The
tagsargument ofAddGroupTagsDocumentTransformeris required by the current signature but ignored — group text comes from the route group's metadata. - No breaking changes; output is unchanged for APIs that do not use
WithGroupSummary()/WithGroupDescription().
Version 10.2.1
Dependency updates only — no API or behavior changes.
📝 Improvements
- Microsoft.AspNetCore.OpenApi 10.0.12 → 10.0.13.
- Microsoft.OpenApi 2.12.2 → 2.13.0 (stays on the 2.x line required by
Microsoft.AspNetCore.OpenApi10.x). - FluentValidation 12.1.1 → 12.2.0.
Version 10.2.0
The new ValueObjectSchemaTransformer documents the validation constraints of the value objects from RA.Utilities.Core.ValueObjects, and AddDefaultsDocumentTransformer() now registers it automatically.
DocumentInfoTransformer now populates the document Summary, and the registration extension class is renamed to OpenApiOptionsExtensions with its methods refactored to C# 14 extension members.
✨ New Features
- Added
ValueObjectSchemaTransformer: The OpenAPI generator cannot see the validation performed by a value object's constructor, soEmail,Currency,SSN, andIBANwere emitted as property-less objects. The transformer now documents their constraints:Email—string,format: email, pattern,minLength: 1,maxLength: 254.Currency—string, pattern,minLength: 3,maxLength: 3.SSN—string, pattern,minLength: 10,maxLength: 10.IBAN—string,format: iban, pattern,minLength: 13,maxLength: 34.Money— object description and example.- Every schema also receives a description and an example value.
- Added
AddValueObjectSchemaTransformer()for registering the transformer standalone.
⚠️ Breaking Change
DependencyInjectionExtensionsrenamed toOpenApiOptionsExtensions: the static class holding all registration extension methods was renamed, and its methods are now declared as C# 14 extension members onOpenApiOptions. The namespace (RA.Utilities.OpenApi.Extensions), method names, signatures, and extension-method call sites are unchanged — only class-name references break (typeof(DependencyInjectionExtensions), static calls, reflection).
📝 Improvements
AddDefaultsDocumentTransformer()now includes the value object schema transformer, so the default setup documents value objects without additional configuration.- Added a dependency on
RA.Utilities.Core.ValueObjects10.2.0. - Response model dependency updated: the package now references
RA.Utilities.Api.Response10.1.0, whose models moved from theRA.Utilities.Api.Resultsnamespace toRA.Utilities.Api.Response.DefaultResponsesOperationTransformerresolvesErrorResponsefrom the new namespace. The OpenApi public API is unchanged; updateusingdirectives only if your custom transformers reference those models.
📝 Notes
- The transformer is idempotent and is safe to register more than once.
- The release is backward compatible; existing OpenAPI output is unchanged except for the enriched value object schemas.
Version 10.1.0
✨ New Features
- Added
HealthChecksDocumentTransformer: Documents the health check endpoints in the OpenAPI document. Endpoints mapped byMapHealthCheckscarry no API metadata, so the OpenAPI generator never includes them; this transformer adds them explicitly.- Adds
GET /health— the aggregate health status of the service together with the result of each registered health check, returned asapplication/jsonwith200and503responses. - Adds
GET /alive— the liveness state as plain text (Healthy,DegradedorUnhealthy), based on the health checks tagged withlive, returned astext/plainwith200and503responses. - Adds the
HealthCheckReportandHealthCheckEntrycomponent schemas and aHealthtag with a description. - Registration is idempotent — paths, schemas and tags already present in the document are left untouched.
- Adds
AddDefaultsDocumentTransformer()now includes the health checks transformer, registered afterBearerSecurityDocumentTransformerso that no security scheme is applied to the health check operations. They must stay reachable without authentication.- Added the
AddHealthChecksDocumentTransformer(IDictionary<string, string> tags)extension method for registering the transformer standalone.
⚠️ Known Issue
AddHealthChecksDocumentTransformer(tags) currently registers HeadersParameterTransformer instead of HealthChecksDocumentTransformer, and the tags argument is ignored. Use AddDefaultsDocumentTransformer() to document the health check endpoints until this is corrected.
Version 10.0.11
🔧 Fixes & Improvements
- Fixed
AddDefaultsDocumentTransformernull handling: Now throwsArgumentNullExceptionimmediately instead of silently skipping all transformers when options are null. - Fixed
DefaultResponsesOperationTransformerduplicate guard: The dedup check now correctly uses the response key"500"instead ofnameof(Response<>), preventing the 500 response from being added on every invocation. - Fixed
OpenApiOperationUtilities.AddResponseExamplenull reference: Replacedoperation.Responses!withoperation.Responses?to handle null responses safely. - Fixed
FluentValidationSchemaTransformerboolean formatting:ExclusiveMinimum/ExclusiveMaximumnow use lowercase"true"/"false"string literals instead of culture-dependentbool.ToString(). - Fixed
EnumXmlSchemaTransformerre-lock bug: When the XML file doesn't exist, the null result is now cached to avoid re-entering the lock on every call. - Fixed
PolymorphismDocumentTransformerarray construction: Simplified verbosenew[]+CopyToto a collection expression. - Fixed
HeadersParameterSettingsnon-deterministic defaults: ReplacedGuid.NewGuid()with a fixed example GUID for consistent documentation snapshots. - Fixed filename typo:
DepenenceInjectionExtensions.cs→DependencyInjectionExtensions.cs. - Removed commented-out code from
DocumentInfoTransformer. - Added null guard to
TagOperationTransformerconstructor. - Added defaults to
OpenApiExampleModelnon-nullable properties. - Renamed
OpenApiResponseExample.StatusCodes→StatusCode(single int, not a collection). - Normalized
.csprojindentation to 2-space. - Added
InternalsVisibleTofor the test project.
⚠️ Breaking Change
OpenApiResponseExample.StatusCodes → OpenApiResponseExample.StatusCode. Update any code that sets or reads the old property name.
Version 10.0.8
Updated OpenApiOperationUtilities to use JsonNamingPolicy.CamelCase when serializing OpenAPI examples.
Version 10.0.7
Introduced TagOperationTransformer for adding tag descriptions, plus performance optimizations.