SudoSOS Back-end API / internal/middleware / AsyncValidatorRegistry
Class: AsyncValidatorRegistry ​
Constructors ​
Constructor ​
ts
new AsyncValidatorRegistry(): AsyncValidatorRegistry;Returns ​
AsyncValidatorRegistry
Methods ​
get() ​
ts
get(modelName): SpecificationFactory<any, Joinable>;Retrieve the spec factory registered for the given model name, or undefined if none.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
modelName | string | The Swagger model name to look up. |
Returns ​
SpecificationFactory<any, Joinable>
register() ​
ts
register(modelName, factory): void;Register an async validation spec factory for a given Swagger model name.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
modelName | string | The Swagger model name (must match the modelName in BodyValidator). |
factory | SpecificationFactory | A function returning a fresh specification per request. |
Returns ​
void