Skip to content

tsoa-next / tsoa-next / SpecConfig

Interface: SpecConfig ​

Defined in: packages/runtime/src/config.ts:79

OpenAPI generation settings.

Properties ​

basePath? ​

ts
optional basePath?: string;

Defined in: packages/runtime/src/config.ts:163

Base API path; e.g. the 'v1' in https://myapi.com/v1


contact? ​

ts
optional contact?: object;

Defined in: packages/runtime/src/config.ts:135

Contact information for the published API.

email? ​

ts
optional email?: string;

The email address of the contact person/organization.

Default ​
ts
npm package author email

name? ​

ts
optional name?: string;

The identifying name of the contact person/organization.

Default ​
ts
npm package author

url? ​

ts
optional url?: string;

URL pointing to the contact information.

Default ​
ts
npm package author url

description? ​

ts
optional description?: string;

Defined in: packages/runtime/src/config.ts:124

API description; defaults to npm package description


disableBasePathPrefixSlash? ​

ts
optional disableBasePathPrefixSlash?: boolean;

Defined in: packages/runtime/src/config.ts:170

Controls whether basePath is prefixed with / when composing OpenAPI 3 server URLs.

Only available with spec version 3 or 3.1.


host? ​

ts
optional host?: string;

Defined in: packages/runtime/src/config.ts:88

API host name for Swagger 2 output, for example localhost:3000.


license? ​

ts
optional license?: string;

Defined in: packages/runtime/src/config.ts:158

API license; defaults to npm package license when present


name? ​

ts
optional name?: string;

Defined in: packages/runtime/src/config.ts:119

API name; defaults to npm package name


operationIdTemplate? ​

ts
optional operationIdTemplate?: string;

Defined in: packages/runtime/src/config.ts:198

Template string for generating operation ids. This should be a valid handlebars template and is provided with the following context:

  • 'controllerName' - String name of controller class.
  • 'method' - Tsoa.Method object.

Default ​

ts
'{{titleCase method.name}}'

outputDirectory ​

ts
outputDirectory: string;

Defined in: packages/runtime/src/config.ts:83

Directory where the generated spec file should be written.


rootSecurity? ​

ts
optional rootSecurity?: Security[];

Defined in: packages/runtime/src/config.ts:233

Applies a default security to the entire API. Can be overridden with @Security(...) or @NoSecurity() decorators on controllers or methods.


schemes? ​

ts
optional schemes?: Protocol[];

Defined in: packages/runtime/src/config.ts:216

Supported protocols for Swagger 2 output.


securityDefinitions? ​

ts
optional securityDefinitions?: object;

Defined in: packages/runtime/src/config.ts:203

Security schemes declared for the specification.

Index Signature ​

ts
[name: string]: SecuritySchemes

servers? ​

ts
optional servers?: string[];

Defined in: packages/runtime/src/config.ts:95

Server URLs for OpenAPI 3 output.

Only available with spec version 3 or 3.1.


spec? ​

ts
optional spec?: unknown;

Defined in: packages/runtime/src/config.ts:177

Object merged into the generated spec. Supplied values override generated properties according to the selected merge mode. For Swagger 2.0, configured schemes are applied after this overlay.


specFileBaseName? ​

ts
optional specFileBaseName?: string;

Defined in: packages/runtime/src/config.ts:102

Base-name of swagger.json or swagger.yaml.

@default: "swagger"


specMerging? ​

ts
optional specMerging?: "recursive" | "immediate" | "deepmerge";

Defined in: packages/runtime/src/config.ts:187

Controls how spec is merged into the generated document. Possible values:

  • 'immediate' overrides only top-level elements.
  • 'recursive' performs a deep merge using merge.
  • 'deepmerge' performs a deep merge using ts-deepmerge, including arrays.

Default ​

ts
'immediate'

specVersion? ​

ts
optional specVersion?: SupportedSpecMajorVersion;

Defined in: packages/runtime/src/config.ts:114

Major OpenAPI version to generate; defaults to version 2 when not specified Possible values:

  • 2: generates OpenAPI version 2.
  • 3: generates OpenAPI version 3.
  • 3.1: generates OpenAPI version 3.1.

tags? ​

ts
optional tags?: Tag[];

Defined in: packages/runtime/src/config.ts:210

Top-level tag metadata for the generated specification.


termsOfService? ​

ts
optional termsOfService?: string;

Defined in: packages/runtime/src/config.ts:130

Link to the page that describes the terms of service. Must be in the URL format.


useTitleTagsForInlineObjects? ​

ts
optional useTitleTagsForInlineObjects?: boolean;

Defined in: packages/runtime/src/config.ts:227

Adds titles to inline response and request-body object schemas to improve client generation.


version? ​

ts
optional version?: string;

Defined in: packages/runtime/src/config.ts:105

API version number; defaults to the package version.


xEnumVarnames? ​

ts
optional xEnumVarnames?: boolean;

Defined in: packages/runtime/src/config.ts:222

Enable x-enum-varnames support

Default ​

ts
false

yaml? ​

ts
optional yaml?: boolean;

Defined in: packages/runtime/src/config.ts:213

Writes the generated spec as YAML instead of JSON.

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