forked from lukeautry/tsoa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.ts
91 lines (76 loc) · 2.03 KB
/
config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
export interface Config {
/**
* Swagger generation configuration object
*/
swagger: SwaggerConfig;
/**
* Route generation configuration object
*/
routes: RoutesConfig;
}
export interface SwaggerConfig {
/**
* Generated SwaggerConfig.json will output here
*/
outputDirectory: string;
/**
* The entry point to your API
*/
entryFile: string;
/**
* API host, expressTemplate.g. localhost:3000 or https://myapi.com
*/
host?: string;
/**
* API version number; defaults to npm package version
*/
version?: string;
/**
* API name; defaults to npm package name
*/
name?: string;
/**
* 'API description; defaults to npm package description
*/
description?: string;
/**
* API license; defaults to npm package license
*/
license?: string;
/**
* Base API path; e.g. the 'v1' in https://myapi.com/v1
*/
basePath?: string;
/**
* Extend generated swagger spec with this object
* Note that generated properties will always take precedence over what get specified here
*/
spec?: any;
/**
* 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 https://www.npmjs.com/package/merge
* The default is set to immediate so it is not breaking previous versions.
* @default 'immediate'
*/
specMerging?: 'immediate' | 'recursive';
}
export interface RoutesConfig {
/**
* Routes directory; generated routes.ts (which contains the generated code wiring up routes using middleware of choice) will be dropped here
*/
routesDir: string;
/**
* The entry point to your API
*/
entryFile: string;
/**
* Base API path; e.g. the '/v1' in https://myapi.com/v1
*/
basePath?: string;
/**
* Middleware provider
*/
middleware?: 'express' | 'hapi' | 'koa';
}