Skip to content

Commit 54b0264

Browse files
authored
servers is an array of server (#2526)
* servers is an array of server * fix only yaml file * add servers test * update schema.json from shema.yaml
1 parent 14c0908 commit 54b0264

File tree

4 files changed

+26
-3
lines changed

4 files changed

+26
-3
lines changed

schemas/v3.1/schema.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
"default": "https://spec.openapis.org/oas/3.1/dialect/base"
1616
},
1717
"servers": {
18-
"$ref": "#/$defs/server"
18+
"type": "array",
19+
"items": {
20+
"$ref": "#/$defs/server"
21+
}
1922
},
2023
"paths": {
2124
"$ref": "#/$defs/paths"
@@ -1337,4 +1340,4 @@
13371340
}
13381341
}
13391342
}
1340-
}
1343+
}

schemas/v3.1/schema.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ properties:
1212
$ref: '#/$defs/uri'
1313
default: 'https://spec.openapis.org/oas/3.1/dialect/base'
1414
servers:
15-
$ref: '#/$defs/server'
15+
type: array
16+
items:
17+
$ref: '#/$defs/server'
1618
paths:
1719
$ref: '#/$defs/paths'
1820
webhooks:

tests/v3.1/fail/servers.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
openapi: 3.1.0
2+
info:
3+
title: API
4+
version: 1.0.0
5+
paths: {}
6+
servers:
7+
url: /v1
8+
description: Run locally.

tests/v3.1/pass/servers.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
openapi: 3.1.0
2+
info:
3+
title: API
4+
version: 1.0.0
5+
paths: {}
6+
servers:
7+
- url: /v1
8+
description: Run locally.
9+
- url: https://production.com/v1
10+
description: Run on production server.

0 commit comments

Comments
 (0)