Skip to content

tsoa-next / @tsoa-next/cli / AbstractRouteGenerator

Abstract Class: AbstractRouteGenerator<Config> ​

Defined in: cli/src/routeGeneration/routeGenerator.ts:12

Base implementation for route generators that transform metadata into framework-specific route files.

Extended by ​

Type Parameters ​

Config ​

Config extends ExtendedRoutesConfig

Constructors ​

Constructor ​

ts
new AbstractRouteGenerator<Config>(metadata, options): AbstractRouteGenerator<Config>;

Defined in: cli/src/routeGeneration/routeGenerator.ts:13

Parameters ​

metadata ​

Metadata

options ​

Config

Returns ​

AbstractRouteGenerator<Config>

Properties ​

metadata ​

ts
protected readonly metadata: Metadata;

Defined in: cli/src/routeGeneration/routeGenerator.ts:14


options ​

ts
protected readonly options: Config;

Defined in: cli/src/routeGeneration/routeGenerator.ts:15

Methods ​

buildContext() ​

ts
protected buildContext(): object;

Defined in: cli/src/routeGeneration/routeGenerator.ts:33

Builds the Handlebars template context used by the default route templates.

Returns ​

object

authenticationModule ​
ts
authenticationModule: string | undefined;
basePath ​
ts
basePath: string = normalisedBasePath;
canImportByAlias ​
ts
canImportByAlias: boolean;
controllers ​
ts
controllers: object[];
embeddedSpecGeneratorArtifacts ​
ts
embeddedSpecGeneratorArtifacts: 
  | {
  spec: Spec;
  yaml: string;
}
  | undefined;
environment ​
ts
environment: ProcessEnv = process.env;
esm ​
ts
esm: boolean | undefined = owner.options.esm;
existingGetPaths ​
ts
existingGetPaths: string[];
iocModule ​
ts
iocModule: string | undefined;
minimalSwaggerConfig ​
ts
minimalSwaggerConfig: object;
minimalSwaggerConfig.bodyCoercion ​
ts
bodyCoercion: boolean = owner.options.bodyCoercion;
minimalSwaggerConfig.noImplicitAdditionalProperties ​
ts
noImplicitAdditionalProperties: "ignore" | "throw-on-extras" | "silently-remove-extras" = owner.options.noImplicitAdditionalProperties;
models ​
ts
models: Models;
multerOpts ​
ts
multerOpts: Config["multerOpts"];
runtimeSpecConfig ​
ts
runtimeSpecConfig: 
  | {
  compilerOptions?: Record<string, unknown>;
  defaultNumberType?: "double" | "float" | "integer" | "long";
  ignore?: string[];
  metadata: Metadata;
  spec: SpecConfig & object;
}
  | undefined;
useFileUploads ​
ts
useFileUploads: boolean;
useSecurity ​
ts
useSecurity: boolean;
useSpecPaths ​
ts
useSpecPaths: boolean;

buildEmbeddedSpecGeneratorArtifacts() ​

ts
protected buildEmbeddedSpecGeneratorArtifacts(useSpecPaths): 
  | {
  spec: Spec;
  yaml: string;
}
  | undefined;

Defined in: cli/src/routeGeneration/routeGenerator.ts:37

Parameters ​

useSpecPaths ​

boolean

Returns ​

| { spec: Spec; yaml: string; } | undefined


buildModels() ​

ts
buildModels(): Models;

Defined in: cli/src/routeGeneration/routeGenerator.ts:24

Builds the runtime model metadata consumed by generated route handlers.

Returns ​

Models


buildParameterSchema() ​

ts
protected buildParameterSchema(source): ParameterSchema;

Defined in: cli/src/routeGeneration/routeGenerator.ts:72

Parameters ​

source ​

Parameter

Returns ​

ParameterSchema


buildProperty() ​

ts
protected buildProperty(type): PropertySchema;

Defined in: cli/src/routeGeneration/routeGenerator.ts:76

Parameters ​

type ​

Type

Returns ​

PropertySchema


buildPropertySchema() ​

ts
protected buildPropertySchema(source): PropertySchema;

Defined in: cli/src/routeGeneration/routeGenerator.ts:68

Parameters ​

source ​

Property

Returns ​

PropertySchema


GenerateCustomRoutes() ​

ts
abstract GenerateCustomRoutes(): Promise<void>;

Defined in: cli/src/routeGeneration/routeGenerator.ts:21

Generates the configured route output for the active framework or custom template.

Returns ​

Promise<void>


getRelativeImportPath() ​

ts
protected getRelativeImportPath(fileLocation): string;

Defined in: cli/src/routeGeneration/routeGenerator.ts:56

Parameters ​

fileLocation ​

string

Returns ​

string


pathTransformer() ​

ts
protected pathTransformer(path): string;

Defined in: cli/src/routeGeneration/routeGenerator.ts:28

Parameters ​

path ​

string

Returns ​

string


shouldWriteFile() ​

ts
protected shouldWriteFile(fileName, content): Promise<boolean>;

Defined in: cli/src/routeGeneration/routeGenerator.ts:80

Parameters ​

fileName ​

string

content ​

string

Returns ​

Promise<boolean>

TypeScript-first OpenAPI generation, route generation, and runtime validation.