Skip to content

Commit ff1f423

Browse files
authored
Merge pull request #99 from lornajane/add-compliant-examples
Add compliant example sets to show expected behaviour
2 parents 99be55f + 223435e commit ff1f423

File tree

25 files changed

+945
-0
lines changed

25 files changed

+945
-0
lines changed

compliant-sets/README.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# OpenAPI Overlay Compliant Sets
2+
3+
The folders in this directory contain sets of "known good" Overlays, along with OpenAPI descriptions before and after the Overlay.
4+
These files are offered as examples of how a series of Overlays are expected to be applied, with the aim of supporting people building tools that apply Overlays.
5+
6+
Each directory contains:
7+
- `overlay.yaml` - the Overlay
8+
- `openapi.yaml` - an OpenAPI description to use
9+
- `output.yaml` - the OpenAPI description after the Overlay has been applied
+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
openapi: 3.1.0
2+
info:
3+
version: 1.0.0
4+
title: Imaginary town
5+
servers:
6+
- url: 'https://example.com'
7+
description: Example server
8+
paths:
9+
/buildings:
10+
get:
11+
summary: All buildings
12+
operationId: buildingsList
13+
responses:
14+
'200':
15+
description: Return all known buildings
16+
content:
17+
application/json:
18+
schema:
19+
type: array
20+
items:
21+
$ref: '#/components/schemas/Building'
22+
'/buildings/{buildingId}':
23+
get:
24+
summary: Specific building
25+
operationId: buildingById
26+
parameters:
27+
- name: buildingId
28+
in: path
29+
required: true
30+
description: Which building to return
31+
schema:
32+
type: string
33+
responses:
34+
'200':
35+
description: Return a building
36+
content:
37+
application/json:
38+
schema:
39+
$ref: '#/components/schemas/Building'
40+
/locations:
41+
get:
42+
summary: All locations
43+
operationId: locationList
44+
responses:
45+
'200':
46+
description: Returns all locations
47+
content:
48+
application/json:
49+
schema:
50+
type: array
51+
items:
52+
type: object
53+
properties:
54+
location_id:
55+
type: integer
56+
example: 44
57+
name:
58+
type: string
59+
example: North Village
60+
components:
61+
schemas:
62+
Building:
63+
type: object
64+
properties:
65+
building:
66+
type: string
67+
example: house
68+
location_id:
69+
type: integer
70+
example: 44
+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
openapi: 3.1.0
2+
info:
3+
version: 1.0.0
4+
title: Imaginary town
5+
license:
6+
name: MIT
7+
url: 'https://opensource.org/licenses/MIT'
8+
servers:
9+
- url: 'https://example.com'
10+
description: Example server
11+
paths:
12+
/buildings:
13+
get:
14+
summary: All buildings
15+
operationId: buildingsList
16+
responses:
17+
'200':
18+
description: Return all known buildings
19+
content:
20+
application/json:
21+
schema:
22+
type: array
23+
items:
24+
$ref: '#/components/schemas/Building'
25+
'/buildings/{buildingId}':
26+
get:
27+
summary: Specific building
28+
operationId: buildingById
29+
parameters:
30+
- name: buildingId
31+
in: path
32+
required: true
33+
description: Which building to return
34+
schema:
35+
type: string
36+
responses:
37+
'200':
38+
description: Return a building
39+
content:
40+
application/json:
41+
schema:
42+
$ref: '#/components/schemas/Building'
43+
/locations:
44+
get:
45+
summary: All locations
46+
operationId: locationList
47+
responses:
48+
'200':
49+
description: Returns all locations
50+
content:
51+
application/json:
52+
schema:
53+
type: array
54+
items:
55+
type: object
56+
properties:
57+
location_id:
58+
type: integer
59+
example: 44
60+
name:
61+
type: string
62+
example: North Village
63+
components:
64+
schemas:
65+
Building:
66+
type: object
67+
properties:
68+
building:
69+
type: string
70+
example: house
71+
location_id:
72+
type: integer
73+
example: 44
74+
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
overlay: '1.0.0'
2+
info:
3+
title: Add MIT license
4+
version: '1.0.0'
5+
actions:
6+
- target: '$.info'
7+
update:
8+
license:
9+
name: MIT
10+
url: https://opensource.org/licenses/MIT
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
openapi: 3.1.0
2+
info:
3+
version: 1.0.0
4+
title: Imaginary town
5+
servers:
6+
- url: 'https://example.com'
7+
description: Example server
8+
paths:
9+
/buildings:
10+
get:
11+
summary: All buildings
12+
operationId: buildingsList
13+
responses:
14+
'200':
15+
description: Return all known buildings
16+
content:
17+
application/json:
18+
schema:
19+
type: array
20+
items:
21+
$ref: '#/components/schemas/Building'
22+
'/buildings/{buildingId}':
23+
get:
24+
summary: Specific building
25+
operationId: buildingById
26+
parameters:
27+
- name: buildingId
28+
in: path
29+
required: true
30+
description: Which building to return
31+
schema:
32+
type: string
33+
responses:
34+
'200':
35+
description: Return a building
36+
content:
37+
application/json:
38+
schema:
39+
$ref: '#/components/schemas/Building'
40+
/locations:
41+
get:
42+
summary: All locations
43+
operationId: locationList
44+
responses:
45+
'200':
46+
description: Returns all locations
47+
content:
48+
application/json:
49+
schema:
50+
type: array
51+
items:
52+
type: object
53+
properties:
54+
location_id:
55+
type: integer
56+
example: 44
57+
name:
58+
type: string
59+
example: North Village
60+
components:
61+
schemas:
62+
Building:
63+
type: object
64+
properties:
65+
building:
66+
type: string
67+
example: house
68+
location_id:
69+
type: integer
70+
example: 44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
openapi: 3.1.0
2+
info:
3+
version: 1.0.0
4+
title: Imaginary town
5+
servers:
6+
- url: 'https://example.com'
7+
description: Example server
8+
paths:
9+
/buildings:
10+
get:
11+
summary: All of the available buildings
12+
operationId: buildingsList
13+
description: This is the summary of getting the buildings
14+
responses:
15+
'200':
16+
description: Return all known buildings
17+
content:
18+
application/json:
19+
schema:
20+
type: array
21+
items:
22+
$ref: '#/components/schemas/Building'
23+
'/buildings/{buildingId}':
24+
get:
25+
summary: Specific building
26+
operationId: buildingById
27+
parameters:
28+
- name: buildingId
29+
in: path
30+
required: true
31+
description: Which building to return
32+
schema:
33+
type: string
34+
responses:
35+
'200':
36+
description: Return a building
37+
content:
38+
application/json:
39+
schema:
40+
$ref: '#/components/schemas/Building'
41+
/locations:
42+
get:
43+
summary: All locations
44+
operationId: locationList
45+
responses:
46+
'200':
47+
description: Returns all locations
48+
content:
49+
application/json:
50+
schema:
51+
type: array
52+
items:
53+
type: object
54+
properties:
55+
location_id:
56+
type: integer
57+
example: 44
58+
name:
59+
type: string
60+
example: North Village
61+
components:
62+
schemas:
63+
Building:
64+
type: object
65+
properties:
66+
building:
67+
type: string
68+
example: house
69+
location_id:
70+
type: integer
71+
example: 44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
overlay: 1.0.0
2+
info:
3+
title: Add a building endpoint description
4+
version: 1.0.0
5+
actions:
6+
- target: $.paths['/buildings'].get
7+
update:
8+
description: This is the summary of getting the buildings
9+
summary: All of the available buildings
10+
+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
openapi: 3.1.0
2+
info:
3+
version: 1.0.0
4+
title: Imaginary town
5+
servers:
6+
- url: 'https://example.com'
7+
description: Example server
8+
paths:
9+
/buildings:
10+
get:
11+
summary: All buildings
12+
operationId: buildingsList
13+
responses:
14+
'200':
15+
description: Return all known buildings
16+
content:
17+
application/json:
18+
schema:
19+
type: array
20+
items:
21+
$ref: '#/components/schemas/Building'
22+
'/buildings/{buildingId}':
23+
get:
24+
summary: Specific building
25+
operationId: buildingById
26+
parameters:
27+
- name: buildingId
28+
in: path
29+
required: true
30+
description: Which building to return
31+
schema:
32+
type: string
33+
responses:
34+
'200':
35+
description: Return a building
36+
content:
37+
application/json:
38+
schema:
39+
$ref: '#/components/schemas/Building'
40+
/locations:
41+
get:
42+
summary: All locations
43+
operationId: locationList
44+
responses:
45+
'200':
46+
description: Returns all locations
47+
content:
48+
application/json:
49+
schema:
50+
type: array
51+
items:
52+
type: object
53+
properties:
54+
location_id:
55+
type: integer
56+
example: 44
57+
name:
58+
type: string
59+
example: North Village
60+
components:
61+
schemas:
62+
Building:
63+
type: object
64+
properties:
65+
building:
66+
type: string
67+
example: house
68+
location_id:
69+
type: integer
70+
example: 44

0 commit comments

Comments
 (0)