@@ -338,13 +338,39 @@ This object can be extended with [Specification Extensions](#specificationExtens
338
338
339
339
A single server would be described as :
340
340
341
+ ` ` ` json
342
+ {
343
+ "url": "https://development.gigantic-server.com/v1",
344
+ "description": "Development server"
345
+ }
346
+ ` ` `
347
+
341
348
` ` ` yaml
342
349
url: https://development.gigantic-server.com/v1
343
350
description: Development server
344
351
` ` `
345
352
346
353
The following shows how multiple servers can be described, for example, at the OpenAPI Object's [`servers`](#oasServers):
347
354
355
+ ` ` ` json
356
+ {
357
+ "servers": [
358
+ {
359
+ "url": "https://development.gigantic-server.com/v1",
360
+ "description": "Development server"
361
+ },
362
+ {
363
+ "url": "https://staging.gigantic-server.com/v1",
364
+ "description": "Staging server"
365
+ },
366
+ {
367
+ "url": "https://api.gigantic-server.com/v1",
368
+ "description": "Production server"
369
+ }
370
+ ]
371
+ }
372
+ ` ` `
373
+
348
374
` ` ` yaml
349
375
servers:
350
376
- url: https://development.gigantic-server.com/v1
@@ -357,6 +383,33 @@ servers:
357
383
358
384
The following shows how variables can be used for a server configuration :
359
385
386
+ ` ` ` json
387
+ {
388
+ "servers": [
389
+ {
390
+ "url": "https://{username}.gigantic-server.com:{port}/{basePath}",
391
+ "description": "The production API server",
392
+ "variables": {
393
+ "username": {
394
+ "default": "demo",
395
+ "description": "this value is assigned by the service provider, in this example ` gigantic-server.com`"
396
+ },
397
+ " port " : {
398
+ " enum " : [
399
+ 8443,
400
+ 443
401
+ ],
402
+ " default " : 8443
403
+ },
404
+ " basePath " : {
405
+ " default " : " v2"
406
+ }
407
+ }
408
+ }
409
+ ]
410
+ }
411
+ ```
412
+
360
413
``` yaml
361
414
servers :
362
415
- url : https://{username}.gigantic-server.com:{port}/{basePath}
0 commit comments