Added Server Object JSON examples.
Enhanced Server Object YAML examples with JSON examples to be consistent with remainder of document.
MODIFY
versions/3.0.md
versions/3.0.md
@@ -338,6 +338,13 @@ This object can be extended with [Specification Extensions](#specificationExtens
A single server would be described as:
+```json
+{
+ "url": "https://development.gigantic-server.com/v1",
+ "description": "Development server"
+}
+```
+
```yaml
url: https://development.gigantic-server.com/v1
description: Development server
@@ -345,6 +352,25 @@ description: Development server
The following shows how multiple servers can be described, for example, at the OpenAPI Object's [`servers`](#oasServers):
+```json
+{
+ "servers": [
+ {
+ "url": "https://development.gigantic-server.com/v1",
+ "description": "Development server"
+ },
+ {
+ "url": "https://staging.gigantic-server.com/v1",
+ "description": "Staging server"
+ },
+ {
+ "url": "https://api.gigantic-server.com/v1",
+ "description": "Production server"
+ }
+ ]
+}
+```
+
```yaml
servers:
- url: https://development.gigantic-server.com/v1
@@ -357,6 +383,33 @@ servers:
The following shows how variables can be used for a server configuration:
+```json
+{
+ "servers": [
+ {
+ "url": "https://{username}.gigantic-server.com:{port}/{basePath}",
+ "description": "The production API server",
+ "variables": {
+ "username": {
+ "default": "demo",
+ "description": "this value is assigned by the service provider, in this example `gigantic-server.com`"
+ },
+ "port": {
+ "enum": [
+ 8443,
+ 443
+ ],
+ "default": 8443
+ },
+ "basePath": {
+ "default": "v2"
+ }
+ }
+ }
+ ]
+}
+```
+
```yaml
servers:
- url: https://{username}.gigantic-server.com:{port}/{basePath}

Added Server Object JSON examples.

Enhanced Server Object YAML examples with JSON examples to be consistent with remainder of document.