Skip to content

Add compliant example sets to show expected behaviour #99

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions compliant-sets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# OpenAPI Overlay Compliant Sets

The folders in this directory contain sets of "known good" Overlays, along with OpenAPI descriptions before and after the Overlay.
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.

Each directory contains:
- `overlay.yaml` - the Overlay
- `openapi.yaml` - an OpenAPI description to use
- `output.yaml` - the OpenAPI description after the Overlay has been applied
70 changes: 70 additions & 0 deletions compliant-sets/add-a-license/openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
openapi: 3.1.0
info:
version: 1.0.0
title: Imaginary town
servers:
- url: 'https://example.com'
description: Example server
paths:
/buildings:
get:
summary: All buildings
operationId: buildingsList
responses:
'200':
description: Return all known buildings
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Building'
'/buildings/{buildingId}':
get:
summary: Specific building
operationId: buildingById
parameters:
- name: buildingId
in: path
required: true
description: Which building to return
schema:
type: string
responses:
'200':
description: Return a building
content:
application/json:
schema:
$ref: '#/components/schemas/Building'
/locations:
get:
summary: All locations
operationId: locationList
responses:
'200':
description: Returns all locations
content:
application/json:
schema:
type: array
items:
type: object
properties:
location_id:
type: integer
example: 44
name:
type: string
example: North Village
components:
schemas:
Building:
type: object
properties:
building:
type: string
example: house
location_id:
type: integer
example: 44
74 changes: 74 additions & 0 deletions compliant-sets/add-a-license/output.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
openapi: 3.1.0
info:
version: 1.0.0
title: Imaginary town
license:
name: MIT
url: 'https://opensource.org/licenses/MIT'
servers:
- url: 'https://example.com'
description: Example server
paths:
/buildings:
get:
summary: All buildings
operationId: buildingsList
responses:
'200':
description: Return all known buildings
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Building'
'/buildings/{buildingId}':
get:
summary: Specific building
operationId: buildingById
parameters:
- name: buildingId
in: path
required: true
description: Which building to return
schema:
type: string
responses:
'200':
description: Return a building
content:
application/json:
schema:
$ref: '#/components/schemas/Building'
/locations:
get:
summary: All locations
operationId: locationList
responses:
'200':
description: Returns all locations
content:
application/json:
schema:
type: array
items:
type: object
properties:
location_id:
type: integer
example: 44
name:
type: string
example: North Village
components:
schemas:
Building:
type: object
properties:
building:
type: string
example: house
location_id:
type: integer
example: 44

10 changes: 10 additions & 0 deletions compliant-sets/add-a-license/overlay.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
overlay: '1.0.0'
info:
title: Add MIT license
version: '1.0.0'
actions:
- target: '$.info'
update:
license:
name: MIT
url: https://opensource.org/licenses/MIT
70 changes: 70 additions & 0 deletions compliant-sets/description-and-summary/openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
openapi: 3.1.0
info:
version: 1.0.0
title: Imaginary town
servers:
- url: 'https://example.com'
description: Example server
paths:
/buildings:
get:
summary: All buildings
operationId: buildingsList
responses:
'200':
description: Return all known buildings
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Building'
'/buildings/{buildingId}':
get:
summary: Specific building
operationId: buildingById
parameters:
- name: buildingId
in: path
required: true
description: Which building to return
schema:
type: string
responses:
'200':
description: Return a building
content:
application/json:
schema:
$ref: '#/components/schemas/Building'
/locations:
get:
summary: All locations
operationId: locationList
responses:
'200':
description: Returns all locations
content:
application/json:
schema:
type: array
items:
type: object
properties:
location_id:
type: integer
example: 44
name:
type: string
example: North Village
components:
schemas:
Building:
type: object
properties:
building:
type: string
example: house
location_id:
type: integer
example: 44
71 changes: 71 additions & 0 deletions compliant-sets/description-and-summary/output.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
openapi: 3.1.0
info:
version: 1.0.0
title: Imaginary town
servers:
- url: 'https://example.com'
description: Example server
paths:
/buildings:
get:
summary: All of the available buildings
operationId: buildingsList
description: This is the summary of getting the buildings
responses:
'200':
description: Return all known buildings
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Building'
'/buildings/{buildingId}':
get:
summary: Specific building
operationId: buildingById
parameters:
- name: buildingId
in: path
required: true
description: Which building to return
schema:
type: string
responses:
'200':
description: Return a building
content:
application/json:
schema:
$ref: '#/components/schemas/Building'
/locations:
get:
summary: All locations
operationId: locationList
responses:
'200':
description: Returns all locations
content:
application/json:
schema:
type: array
items:
type: object
properties:
location_id:
type: integer
example: 44
name:
type: string
example: North Village
components:
schemas:
Building:
type: object
properties:
building:
type: string
example: house
location_id:
type: integer
example: 44
10 changes: 10 additions & 0 deletions compliant-sets/description-and-summary/overlay.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
overlay: 1.0.0
info:
title: Add a building endpoint description
version: 1.0.0
actions:
- target: $.paths['/buildings'].get
update:
description: This is the summary of getting the buildings
summary: All of the available buildings

70 changes: 70 additions & 0 deletions compliant-sets/remove-example/openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
openapi: 3.1.0
info:
version: 1.0.0
title: Imaginary town
servers:
- url: 'https://example.com'
description: Example server
paths:
/buildings:
get:
summary: All buildings
operationId: buildingsList
responses:
'200':
description: Return all known buildings
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Building'
'/buildings/{buildingId}':
get:
summary: Specific building
operationId: buildingById
parameters:
- name: buildingId
in: path
required: true
description: Which building to return
schema:
type: string
responses:
'200':
description: Return a building
content:
application/json:
schema:
$ref: '#/components/schemas/Building'
/locations:
get:
summary: All locations
operationId: locationList
responses:
'200':
description: Returns all locations
content:
application/json:
schema:
type: array
items:
type: object
properties:
location_id:
type: integer
example: 44
name:
type: string
example: North Village
components:
schemas:
Building:
type: object
properties:
building:
type: string
example: house
location_id:
type: integer
example: 44
Loading