Skip to content

Commit edfb960

Browse files
authored
Merge pull request #5200 from karenetheridge/ether/3.3-fix-broken-refs
v3.3: fix broken tests, mostly dangling $refs
2 parents da55d93 + e2d6f79 commit edfb960

9 files changed

+34
-6
lines changed

tests/schema/fail/server_enum_empty.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
openapi: 3.3.0
22

3-
# this example should fail as the server variable enum is empty, and so does not contain the default value
3+
# this example should fail as the server variable enum is empty
4+
# (it also does not contain the default value, but this is not checked by the schema)
45

56
info:
67
title: API

tests/schema/pass/callback-object-examples.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,6 @@ components:
2727
$ref: '#/components/schemas/SomePayload'
2828
responses:
2929
'200':
30-
description: callback successfully processed
30+
description: callback successfully processed
31+
schemas:
32+
SomePayload: {}

tests/schema/pass/example-object-examples.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ info:
33
title: API
44
version: 1.0.0
55
components:
6+
examples:
7+
zip-example: {}
8+
confirmation-success: {}
9+
schemas:
10+
SuccessResponse: {}
11+
Address: {}
612
requestBodies:
713
with-example:
814
content:

tests/schema/pass/media-type-examples.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,19 @@ info:
44
title: API
55
version: 1.0.0
66
components:
7+
examples:
8+
frog-example: {}
9+
schemas:
10+
Address: {}
11+
Pet: {}
712
mediaTypes:
813
StreamingPets:
914
description: |
1015
Streaming sequence of JSON pet representations,
1116
suitable for use with any of the streaming JSON
1217
media types.
1318
itemSchema:
14-
$ref: '#components/schemas/Pet'
19+
$ref: '#/components/schemas/Pet'
1520
paths:
1621
/something:
1722
put:

tests/schema/pass/path-item-object-example.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ openapi: 3.3.0
22
info:
33
title: API
44
version: 1.0.0
5+
components:
6+
schemas:
7+
Pet: {}
8+
ErrorModel: {}
59
paths:
610
/pets/{id}:
711
get:

tests/schema/pass/path_item_servers_parameters.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,5 @@ components:
110110
application/json:
111111
schema:
112112
type: object
113+
schemas:
114+
SomePayload: {}

tests/schema/pass/paths-object-example.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ openapi: 3.3.0
22
info:
33
title: API
44
version: 1.0.0
5+
components:
6+
schemas:
7+
pet: {}
58
paths:
69
/pets:
710
get:
@@ -14,4 +17,4 @@ paths:
1417
schema:
1518
type: array
1619
items:
17-
$ref: '#/components/schemas/pet'
20+
$ref: '#/components/schemas/pet'

tests/schema/pass/request-body-examples.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ openapi: 3.3.0
22
info:
33
title: API
44
version: 1.0.0
5+
components:
6+
schemas:
7+
User: {}
58
paths:
69
/something:
710
put:
@@ -31,4 +34,4 @@ paths:
3134
examples:
3235
user:
3336
summary: User example in other format
34-
externalValue: https://foo.bar/examples/user-example.whatever
37+
externalValue: https://foo.bar/examples/user-example.whatever

tests/schema/pass/response-object-examples.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,6 @@ components:
4040
schema:
4141
type: integer
4242
no-return-value:
43-
description: object created
43+
description: object created
44+
schemas:
45+
VeryComplexType: {}

0 commit comments

Comments
 (0)