Class: VersionProcessor
A processor class for handling version definitions based on the HTTP context. It uses registered version resolvers to determine the current version from the request and updates the version definition accordingly.
Implements
Constructors
Constructor
new VersionProcessor(
httpOptions):VersionProcessor
Parameters
httpOptions
Returns
VersionProcessor
Methods
process()
process(
version,context):void
Processes the version definition based on the HTTP context. It uses the registered version resolver to determine the current version from the request and updates the version definition accordingly.
Parameters
version
VersionDefinition | undefined
The version definition to be processed.
context
Pick<HttpContext, "request" | "response" | "session">
The HTTP context containing request, response, and session information.
Returns
void
Implementation of
registerVersion()
staticregisterVersion(type,resolver):void
Registers a version resolver for a specific version type.
Parameters
type
The version type for which the resolver is registered.
resolver
The version resolver to be registered.
Returns
void