Decorate your controller to declare a resource.
Example:
import { injectable } from "inversify";
import "reflect-metadata";
import { ApiPath } from "swagger-express-ts";
import { controller } from "inversify-express-utils";
@ApiPath( {
path : "/version",
name : "Version"
} )
@controller( "/version" )
@injectable()
export class VersionController implements interfaces.Controller {
public static TARGET_NAME: string = "VersionController";
}
Define path of resource.
- Required
Define name of resource.
- Required
Define description of resource.
- Optional
Define security to apply all operations from current path.
- Optional
Example:
...
@ApiPath( {
path : "/version",
name : "Version",
security : {
basicAuth : []
}
} )
...
Example:
app.use( swagger.express(
{
definition : {
...
securityDefinitions : {
basicAuth : {
type : SwaggerDefinitionConstant.Security.Type.BASIC_AUTHENTICATION
},
apiKeyHeader : {
type: SwaggerDefinitionConstant.Security.Type.API_KEY,
in: SwaggerDefinitionConstant.Security.In.HEADER,
name: "apiHeader"
}
}
}
}
) );
Define deprecated
- Optional