Options
All
  • Public
  • Public/Protected
  • All
Menu

tsoa - v3.6.0

Index

Type aliases

DeprecatedOptionForAdditionalPropertiesHandling

DeprecatedOptionForAdditionalPropertiesHandling: boolean

these options will be removed in a future version since we would prefer consumers to explicitly state their preference that the tsoa validation throws or removes additional properties

ExtensionType

ExtensionType: string | {}

File

File: { buffer: Buffer; encoding: string; fieldname: string; mimetype: string; originalname: string; size: number }

Type declaration

  • buffer: Buffer
  • encoding: string
  • fieldname: string
  • mimetype: string
  • originalname: string
  • size: number

HttpStatusCodeLiteral

HttpStatusCodeLiteral: 100 | 101 | 102 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 422 | 423 | 424 | 426 | 428 | 429 | 431 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511

HttpStatusCodeStringLiteral

HttpStatusCodeStringLiteral: `${HttpStatusCodeLiteral}`

IocContainerFactory

IocContainerFactory: (request: unknown) => IocContainer

Type declaration

OtherValidOpenApiHttpStatusCode

OtherValidOpenApiHttpStatusCode: "1XX" | "2XX" | "3XX" | "4XX" | "5XX" | "default"

TsoaResponse

TsoaResponse<T, BodyType, HeaderType>: (status: T, data: BodyType, headers?: HeaderType) => any

Type parameters

Type declaration

    • (status: T, data: BodyType, headers?: HeaderType): any
    • Parameters

      • status: T
      • data: BodyType
      • Optional headers: HeaderType

      Returns any

Validator

Functions

Body

  • Body(): Function
  • Inject http Body

    Returns Function

BodyProp

  • BodyProp(name?: string): Function
  • Inject value from body

    Parameters

    • Optional name: string

    Returns Function

Delete

  • Delete(value?: string): Function
  • Parameters

    • Optional value: string

    Returns Function

Deprecated

  • Deprecated(): Function
  • used to show a method as deprecated on swagger documentation

    Returns Function

Example

  • Example<T>(exampleModel: T): Function
  • Type parameters

    • T

    Parameters

    • exampleModel: T

    Returns Function

Extension

  • Parameters

    Returns Function

FormField

  • FormField(name?: string): any
  • Inject uploaded files

    Parameters

    • Optional name: string

    Returns any

Get

  • Get(value?: string): Function
  • Parameters

    • Optional value: string

    Returns Function

Head

  • Head(value?: string): Function
  • Parameters

    • Optional value: string

    Returns Function

Header

  • Header(name?: string): Function
  • Inject value from Http header

    Parameters

    • Optional name: string

    Returns Function

Hidden

  • Hidden(): Function
  • can be used to entirely hide an method from documentation

    Returns Function

Inject

  • Inject(): Function
  • Mark parameter as manually injected, which will not be generated

    Returns Function

NoSecurity

  • NoSecurity(): Function
  • Can be used to indicate that a method requires no security.

    Returns Function

OperationId

  • OperationId(value: string): Function
  • Parameters

    • value: string

    Returns Function

Options

  • Options(value?: string): Function
  • Parameters

    • Optional value: string

    Returns Function

Patch

  • Patch(value?: string): Function
  • Parameters

    • Optional value: string

    Returns Function

Path

  • Path(name?: string): Function
  • Inject value from Path

    Parameters

    • Optional name: string

    Returns Function

Post

  • Post(value?: string): Function
  • Parameters

    • Optional value: string

    Returns Function

Put

  • Put(value?: string): Function
  • Parameters

    • Optional value: string

    Returns Function

Query

  • Query(name?: string): Function
  • Inject value from query string

    Parameters

    • Optional name: string

    Returns Function

Request

  • Request(): Function
  • Inject http request

    Returns Function

Res

  • Res(): Function
  • Inject a library-agnostic responder function that can be used to construct type-checked (usually error-) responses.

    The type of the responder function should be annotated TsoaResponse<Status, Data, Headers> in order to support OpenAPI documentation.

    Returns Function

Response

Route

  • Route(name?: string): Function
  • Parameters

    • Optional name: string

    Returns Function

Security

  • Security(name: string | {}, scopes?: string[]): Function
  • Parameters

    • name: string | {}
    • Optional scopes: string[]

    Returns Function

SuccessResponse

  • SuccessResponse<HeaderType>(name: string | number, description?: string): Function
  • Type parameters

    • HeaderType: {} | "Header names must be of type string" | "Header values must be string or string[]" = {}

    Parameters

    • name: string | number
    • Optional description: string

    Returns Function

Tags

  • Tags(...values: string[]): Function
  • Parameters

    • Rest ...values: string[]

    Returns Function

UploadedFile

  • UploadedFile(name?: string): any
  • Inject uploaded file

    Parameters

    • Optional name: string

    Returns any

UploadedFiles

  • UploadedFiles(name?: string): any
  • Inject uploaded files

    Parameters

    • Optional name: string

    Returns any

ValidateParam

  • Parameters

    Returns any

assertNever

  • assertNever(value: never): never
  • This function does exhaustiveness checking to ensure that you have discriminated a union so that no type remains. Use this to get the typescript compiler to help discover cases that were not considered.

    Parameters

    • value: never

    Returns never

Const generateRoutes

  • Parameters

    Returns Promise<Metadata>

Const generateSpec

  • Parameters

    • swaggerConfig: ExtendedSpecConfig
    • Optional compilerOptions: CompilerOptions
    • Optional ignorePaths: string[]
    • Optional metadata: Metadata

    Returns Promise<Metadata>

Const getSwaggerOutputPath

  • Parameters

    Returns string

isDefaultForAdditionalPropertiesAllowed

  • isDefaultForAdditionalPropertiesAllowed(test: RefObjectModelSchema["additionalProperties"]): test is undefined
  • For Swagger, additionalProperties is implicitly allowed. So use this function to clarify that undefined should be associated with allowing additional properties

    Parameters

    • test: RefObjectModelSchema["additionalProperties"]

      if this is undefined then you should interpret it as a "yes"

    Returns test is undefined

runCLI

  • runCLI(): void
  • Returns void

Generated using TypeDoc