Interface SpecConfig

interface SpecConfig {
    basePath?: string;
    contact?: {
        email?: string;
        name?: string;
        url?: string;
    };
    description?: string;
    host?: string;
    license?: string;
    name?: string;
    operationIdTemplate?: string;
    outputDirectory: string;
    rootSecurity?: Swagger.Security[];
    schemes?: Swagger.Protocol[];
    securityDefinitions?: {
        [name: string]: Swagger.SecuritySchemes;
    };
    spec?: unknown;
    specFileBaseName?: string;
    specMerging?: "recursive" | "immediate" | "deepmerge";
    specVersion?: Swagger.SupportedSpecMajorVersion;
    tags?: Swagger.Tag[];
    termsOfService?: string;
    useTitleTagsForInlineObjects?: boolean;
    version?: string;
    xEnumVarnames?: boolean;
    yaml?: boolean;
}

Hierarchy

  • SpecConfig

    Properties

    basePath?: string

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

    contact?: {
        email?: string;
        name?: string;
        url?: string;
    }

    Contact Information

    Type declaration

    • Optional email?: string

      The email address of the contact person/organization.

      Default

      npm package author email
      
    • Optional name?: string

      The identifying name of the contact person/organization.

      Default

      npm package author
      
    • Optional url?: string

      API Info url The URL pointing to the contact information.

      Default

      npm package author url
      
    description?: string

    API description; defaults to npm package description

    host?: string

    API host, expressTemplate.g. localhost:3000 or myapi.com

    license?: string

    API license; defaults to npm package license

    name?: string

    API name; defaults to npm package name

    operationIdTemplate?: string

    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

    '{{titleCase method.name}}'
    
    outputDirectory: string

    Generated SwaggerConfig.json will output here

    rootSecurity?: Swagger.Security[]

    Applies a default security to the entire API. Can be overridden with

    Security

    or

    No Security

    decorators on controllers or methods

    schemes?: Swagger.Protocol[]
    securityDefinitions?: {
        [name: string]: Swagger.SecuritySchemes;
    }

    Security Definitions Object A declaration of the security schemes available to be used in the specification. This does not enforce the security schemes on the operations and only serves to provide the relevant details for each scheme.

    Type declaration

    spec?: unknown

    Extend generated swagger spec with this object Note that generated properties will always take precedence over what get specified here

    specFileBaseName?: string

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

    @default: "swagger"

    specMerging?: "recursive" | "immediate" | "deepmerge"

    Alter how the spec is merged to generated swagger spec. Possible values:

    • 'immediate' is overriding top level elements only thus you can not append a new path or alter an existing value without erasing same level elements.
    • 'recursive' proceed to a deep merge and will concat every branches or override or create new values if needed.

    See

    Default

    'immediate'
    

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

    • 2: generates OpenAPI version 2.
    • 3: generates OpenAPI version 3.
    tags?: Swagger.Tag[]

    Swagger Tags Information for your API

    termsOfService?: string

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

    useTitleTagsForInlineObjects?: boolean

    Sets a title for inline objects for responses and requestBodies This helps to generate more consistent clients

    version?: string

    API version number; defaults to npm package version

    xEnumVarnames?: boolean

    Enable x-enum-varnames support

    Default

    false
    
    yaml?: boolean

    Generated using TypeDoc