Interface IControllersSwaggerOperationOptions

Settings for Swagger operations and their IDs.

interface IControllersSwaggerOperationOptions {
    idTemplate?: Nilable<string>;
    noAutoIds?: Nilable<boolean>;
    overwriteIds?: Nilable<string>;
}

Properties

idTemplate?: Nilable<string>

Custom template for the IDs.

Supports following variables:

  • {{class}}: Name of the controller class, like MyHttpController
  • {{file}}: Base name of the file (without extension), like index
  • {{http-method}}: get, post, patch, etc.
  • {{method}}: Name of the controller method, like getAllUsers
  • {{path}}: The relative path of the controller file, like /v1/foo/@bar/buzz

Also following, optional formatters (multiple separated by |) are supported:

  • {{method:lower|trim}}: Takes the value of method, converts to lower case and trims the final string
  • {{path:1}}: Takes the 2nd part of the value of path, e.g. /v1/foo/@bar/buzz would extract foo
  • {{method:kebap|upper}}: A method name like addUser would result in ADD-USER

@default: {{http-method}}-{{class}}-{{method}}

noAutoIds?: Nilable<boolean>

Indicates to use no automatic generated operation IDs.

Default

false

overwriteIds?: Nilable<string>

Indicates to always overwrite existing operation IDs.

Default

false

Generated using TypeDoc