HAKOM.Versioning.Http.Net Assembly
Provides HTTP-layer versioning support for HAKOM web services.
Remarks
Section titled “Remarks”This assembly extends the core versioning module (IVersion) with ASP.NET Core integration, enabling media-type-based API versioning and version information endpoints for HTTP APIs.
The key capabilities are:
- Media-type version negotiation — The
api-versionparameter in theAcceptheader is used to select the correct controller based on its namespace (e.g.v4_3_1). Enable this by calling SelectEndpointsByNamespaceAndMediaTypeVersion(this IMvcBuilder, HttpStatusCode). - Version information endpoint — A root GET endpoint that returns the service version and all supported API versions. Register it with AddVersionedServiceInformationEndpoints(this IMvcBuilder, string).
- OpenAPI integration — Document and schema filters that add
api-versionparameters to Swagger/OpenAPI media types.
Typical setup in a HAKOM HTTP service:
// In the DI container setup:container .UseVersionedServiceInformation() .UseVersionStringSerializers() .UseVersionedServiceInformationSerializers();
// In the MVC builder setup:mvcBuilder .AddVersionedServiceInformationEndpoints() .SelectEndpointsByNamespaceAndMediaTypeVersion();| Namespaces | |
|---|---|
| HAKOM.Versioning.Http.Net.Api | Contains the public API surface of the HTTP versioning module. |
| HAKOM.Versioning.Http.Net.Api.Exceptions | Contains exception types thrown when HTTP version negotiation fails. |
| HAKOM.Versioning.Http.Net.Api.Extensions | Contains extension methods for registering HTTP versioning services with the dependency injection container and the MVC builder. |
Was this page helpful?Thanks for your feedback!