跳到内容

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

抽象类: 抽象旋转变相器<Config>

定义如下: cli/src/routeGeneration/routeGenerator.ts:11

将元数据转化为框架特定路由文件的路由生成器的基础实施.

类型参数

Config

Config 增编 ExtendedRoutesConfig

构造器

构造器

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

定义如下: cli/src/routeGeneration/routeGenerator.ts:12

参数

metadata

Metadata

options

Config

回返

AbstractRouteGenerator<Config>

属性

metadata

ts
protected readonly metadata: Metadata;

定义如下: cli/src/routeGeneration/routeGenerator.ts:13


options

ts
protected readonly options: Config;

定义如下: cli/src/routeGeneration/routeGenerator.ts:14

方法

buildContext()

ts
protected buildContext(): object;

定义如下: cli/src/routeGeneration/routeGenerator.ts:76

构建 Handlebars 默认路由模板所使用的模板上下文。

回返

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;
existingGetPaths
ts
existingGetPaths: string[];
iocModule
ts
iocModule: string | undefined;
minimalSwaggerConfig
ts
minimalSwaggerConfig: object;
最小Swagger Config.body 强制化
ts
bodyCoercion: boolean;
最小Swagger 配置. no Implicial 附加品
ts
noImplicitAdditionalProperties: "ignore" | "throw-on-extras" | "silently-remove-extras";
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;

定义如下: cli/src/routeGeneration/routeGenerator.ts:157

参数

useSpecPaths

boolean

回返

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


buildModels()

ts
buildModels(): Models;

定义如下: cli/src/routeGeneration/routeGenerator.ts:23

构建生成的路由处理器所消耗的运行时间模型元数据.

回返

Models


buildParameterSchema()

ts
protected buildParameterSchema(source): ParameterSchema;

定义如下: cli/src/routeGeneration/routeGenerator.ts:199

参数

source

Parameter

回返

ParameterSchema


buildProperty()

ts
protected buildProperty(type): PropertySchema;

定义如下: cli/src/routeGeneration/routeGenerator.ts:219

参数

type

Type

回返

PropertySchema


buildPropertySchema()

ts
protected buildPropertySchema(source): PropertySchema;

定义如下: cli/src/routeGeneration/routeGenerator.ts:188

参数

source

Property

回返

PropertySchema


GenerateCustomRoutes()

ts
abstract GenerateCustomRoutes(): Promise<void>;

定义如下: cli/src/routeGeneration/routeGenerator.ts:20

为活动框架或自定义模板生成已配置的路由输出。

回返

Promise<void>


getRelativeImportPath()

ts
protected getRelativeImportPath(fileLocation): string;

定义如下: cli/src/routeGeneration/routeGenerator.ts:176

参数

fileLocation

string

回返

string


pathTransformer()

ts
protected pathTransformer(path): string;

定义如下: cli/src/routeGeneration/routeGenerator.ts:71

参数

path

string

回返

string


shouldWriteFile()

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

定义如下: cli/src/routeGeneration/routeGenerator.ts:263

参数

fileName

string

content

string

回返

Promise<boolean>

贡献者

暂无相关贡献者

页面历史

暂无最近变更历史

以 TypeScript 为先的 OpenAPI 生成、路由生成与运行时验证。