This repository was archived by the owner on Dec 10, 2021. It is now read-only.
File tree 4 files changed +37
-3
lines changed
4 files changed +37
-3
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,8 @@ export class DefinitionGenerator {
42
42
version = uuid . v4 ( ) ,
43
43
models,
44
44
security,
45
- securitySchemes
45
+ securitySchemes,
46
+ servers
46
47
} = this . config ;
47
48
48
49
_ . merge ( this . definition , {
@@ -62,6 +63,10 @@ export class DefinitionGenerator {
62
63
this . definition . components . securitySchemes = securitySchemes ;
63
64
}
64
65
66
+ if ( servers ) {
67
+ this . definition . servers = servers ;
68
+ }
69
+
65
70
this . definition . components . schemas = await parseModels ( models , this . root ) ;
66
71
67
72
return this ;
@@ -268,7 +273,7 @@ export class DefinitionGenerator {
268
273
schema : {
269
274
$ref : `#/components/schemas/${
270
275
documentationConfig . requestModels [ requestModelType ]
271
- } `
276
+ } `
272
277
}
273
278
} ;
274
279
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ export interface DefinitionConfig {
16
16
version ?: string ;
17
17
securitySchemes : OpenAPIV3 . SecuritySchemeObject ;
18
18
security : Array < OpenAPIV3 . SecurityRequirementObject > ;
19
+ servers : Array < OpenAPIV3 . ServerObject > ;
19
20
models : Array < Model > ;
20
21
}
21
22
Original file line number Diff line number Diff line change @@ -198,7 +198,7 @@ components:
198
198
info :
199
199
title : ' '
200
200
description : ' '
201
- version : 6e48be1a-d9be-41ef-95eb-41ffad58eac3
201
+ version : dfdb63df-5e16-4df6-a915-3e64601a7a2c
202
202
paths :
203
203
' /create/{username} ' :
204
204
post :
@@ -252,3 +252,17 @@ security:
252
252
- bearerAuth :
253
253
- read
254
254
- write
255
+ servers :
256
+ - url : ' https://{customerId}.saas-app.com:{port}/v2'
257
+ description : Production server (uses live data)
258
+ variables :
259
+ customerId :
260
+ default : demo
261
+ description : Customer ID assigned by the service provider
262
+ port :
263
+ enum :
264
+ - ' 443'
265
+ - ' 8443'
266
+ default : ' 443'
267
+ - url : ' https://sandbox-api.example.com:8443/v1'
268
+ description : Sandbox server (uses test data)
Original file line number Diff line number Diff line change @@ -14,6 +14,20 @@ documentation:
14
14
- bearerAuth :
15
15
- read
16
16
- write
17
+ servers :
18
+ - url : https://{customerId}.saas-app.com:{port}/v2
19
+ description : Production server (uses live data)
20
+ variables :
21
+ customerId :
22
+ default : demo
23
+ description : Customer ID assigned by the service provider
24
+ port :
25
+ enum :
26
+ - " 443"
27
+ - " 8443"
28
+ default : " 443"
29
+ - url : https://sandbox-api.example.com:8443/v1
30
+ description : Sandbox server (uses test data)
17
31
models :
18
32
- name : ErrorResponse
19
33
description : This is an error
You can’t perform that action at this time.
0 commit comments