Skip to content

Commit

Permalink
getting examples working with microcks
Browse files Browse the repository at this point in the history
  • Loading branch information
philsturgeon committed Jun 26, 2024
1 parent 059f999 commit 1f58daa
Showing 1 changed file with 104 additions and 78 deletions.
182 changes: 104 additions & 78 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,22 +88,25 @@ paths:
allOf:
- $ref: '#/components/schemas/Links-Self'
- $ref: '#/components/schemas/Links-Pagination'
example:
data:
- id: efdbb9d1-02c2-4bc3-afb7-6788d8782b1e
name: Berlin Hauptbahnhof
address: Invalidenstraße 10557 Berlin, Germany
country_code: DE
timezone: Europe/Berlin
- id: b2e783e1-c824-4d63-b37a-d8d698862f1d
name: Paris Gare du Nord
address: 18 Rue de Dunkerque 75010 Paris, France
country_code: FR
timezone: Europe/Paris
links:
self: https://api.example.com/stations&page=2
next: https://api.example.com/stations?page=3
prev: https://api.example.com/stations?page=1
examples:
Stations:
summary: A list of train stations
value:
data:
- id: efdbb9d1-02c2-4bc3-afb7-6788d8782b1e
name: Berlin Hauptbahnhof
address: Invalidenstraße 10557 Berlin, Germany
country_code: DE
timezone: Europe/Berlin
- id: b2e783e1-c824-4d63-b37a-d8d698862f1d
name: Paris Gare du Nord
address: 18 Rue de Dunkerque 75010 Paris, France
country_code: FR
timezone: Europe/Paris
links:
self: https://api.example.com/stations&page=2
next: https://api.example.com/stations?page=3
prev: https://api.example.com/stations?page=1
application/xml:
schema:
allOf:
Expand Down Expand Up @@ -198,29 +201,32 @@ paths:
allOf:
- $ref: '#/components/schemas/Links-Self'
- $ref: '#/components/schemas/Links-Pagination'
example:
data:
- id: ea399ba1-6d95-433f-92d1-83f67b775594
origin: efdbb9d1-02c2-4bc3-afb7-6788d8782b1e
destination: b2e783e1-c824-4d63-b37a-d8d698862f1d
departure_time: '2024-02-01T10:00:00Z'
arrival_time: '2024-02-01T16:00:00Z'
price: 50
operator: Deutsche Bahn
bicycles_allowed: true
dogs_allowed: true
- id: 4d67459c-af07-40bb-bb12-178dbb88e09f
origin: b2e783e1-c824-4d63-b37a-d8d698862f1d
destination: efdbb9d1-02c2-4bc3-afb7-6788d8782b1e
departure_time: '2024-02-01T12:00:00Z'
arrival_time: '2024-02-01T18:00:00Z'
price: 50
operator: SNCF
bicycles_allowed: true
dogs_allowed: true
links:
self: https://api.example.com/trips?origin=efdbb9d1-02c2-4bc3-afb7-6788d8782b1e&destination=b2e783e1-c824-4d63-b37a-d8d698862f1d&date=2024-02-01
next: https://api.example.com/trips?origin=efdbb9d1-02c2-4bc3-afb7-6788d8782b1e&destination=b2e783e1-c824-4d63-b37a-d8d698862f1d&date=2024-02-01&page=2
examples:
Trips:
summary: A list of available train trips
value:
data:
- id: ea399ba1-6d95-433f-92d1-83f67b775594
origin: efdbb9d1-02c2-4bc3-afb7-6788d8782b1e
destination: b2e783e1-c824-4d63-b37a-d8d698862f1d
departure_time: '2024-02-01T10:00:00Z'
arrival_time: '2024-02-01T16:00:00Z'
price: 50
operator: Deutsche Bahn
bicycles_allowed: true
dogs_allowed: true
- id: 4d67459c-af07-40bb-bb12-178dbb88e09f
origin: b2e783e1-c824-4d63-b37a-d8d698862f1d
destination: efdbb9d1-02c2-4bc3-afb7-6788d8782b1e
departure_time: '2024-02-01T12:00:00Z'
arrival_time: '2024-02-01T18:00:00Z'
price: 50
operator: SNCF
bicycles_allowed: true
dogs_allowed: true
links:
self: https://api.example.com/trips?origin=efdbb9d1-02c2-4bc3-afb7-6788d8782b1e&destination=b2e783e1-c824-4d63-b37a-d8d698862f1d&date=2024-02-01
next: https://api.example.com/trips?origin=efdbb9d1-02c2-4bc3-afb7-6788d8782b1e&destination=b2e783e1-c824-4d63-b37a-d8d698862f1d&date=2024-02-01&page=2
application/xml:
schema:
allOf:
Expand Down Expand Up @@ -276,21 +282,24 @@ paths:
allOf:
- $ref: '#/components/schemas/Links-Self'
- $ref: '#/components/schemas/Links-Pagination'
example:
data:
- id: efdbb9d1-02c2-4bc3-afb7-6788d8782b1e
trip_id: efdbb9d1-02c2-4bc3-afb7-6788d8782b1e
passenger_name: John Doe
has_bicycle: true
has_dog: true
- id: b2e783e1-c824-4d63-b37a-d8d698862f1d
trip_id: b2e783e1-c824-4d63-b37a-d8d698862f1d
passenger_name: Jane Smith
has_bicycle: false
has_dog: false
links:
self: https://api.example.com/bookings
next: https://api.example.com/bookings?page=2
examples:
Bookings:
summary: A list of bookings
value:
data:
- id: efdbb9d1-02c2-4bc3-afb7-6788d8782b1e
trip_id: efdbb9d1-02c2-4bc3-afb7-6788d8782b1e
passenger_name: John Doe
has_bicycle: true
has_dog: true
- id: b2e783e1-c824-4d63-b37a-d8d698862f1d
trip_id: b2e783e1-c824-4d63-b37a-d8d698862f1d
passenger_name: Jane Smith
has_bicycle: false
has_dog: false
links:
self: https://api.example.com/bookings
next: https://api.example.com/bookings?page=2
application/xml:
schema:
allOf:
Expand Down Expand Up @@ -348,14 +357,21 @@ paths:
links:
$ref: '#/components/schemas/Links-Self'

example:
id: efdbb9d1-02c2-4bc3-afb7-6788d8782b1e
trip_id: efdbb9d1-02c2-4bc3-afb7-6788d8782b1e
passenger_name: John Doe
has_bicycle: true
has_dog: true
links:
self: https://api.example.com/bookings/efdbb9d1-02c2-4bc3-afb7-6788d8782b1e
examples:
new_booking:
summary: New Booking
value: |-
{
"id": "{{ uuid() }}",
"trip_id": "{{ request.body/trip_id }}",
"passenger_name": "{{ request.body/passenger_name }}",
"has_bicycle": {{ request.body/has_bicycle }},
"has_dog": {{ request.body/has_dog }},
"links": {
"self": "https://api.example.com/bookings/1725ff48-ab45-4bb5-9d02-88745177dedb"
}
}
application/xml:
schema:
allOf:
Expand Down Expand Up @@ -406,14 +422,17 @@ paths:
- properties:
links:
$ref: '#/components/schemas/Links-Self'
example:
id: efdbb9d1-02c2-4bc3-afb7-6788d8782b1e
trip_id: efdbb9d1-02c2-4bc3-afb7-6788d8782b1e
passenger_name: John Doe
has_bicycle: true
has_dog: true
links:
self: https://api.example.com/bookings/1725ff48-ab45-4bb5-9d02-88745177dedb
examples:
booking_efdbb9d1-02c2-4bc3-afb7-6788d8782b1e:
summary: Booking
value:
id: efdbb9d1-02c2-4bc3-afb7-6788d8782b1e
trip_id: efdbb9d1-02c2-4bc3-afb7-6788d8782b1e
passenger_name: John Doe
has_bicycle: true
has_dog: true
links:
self: https://api.example.com/bookings/1725ff48-ab45-4bb5-9d02-88745177dedb
application/xml:
schema:
allOf:
Expand Down Expand Up @@ -445,6 +464,10 @@ paths:
responses:
'204':
description: Booking deleted
examples:
BookingDeleted:
summary: Booking Deleted
value: ''
'400':
$ref: '#/components/responses/BadRequest'
'401':
Expand Down Expand Up @@ -590,14 +613,17 @@ webhooks:
allOf:
- $ref: '#/components/schemas/Links-Self'
- $ref: '#/components/schemas/Links-Pagination'
example:
id: efdbb9d1-02c2-4bc3-afb7-6788d8782b1e
trip_id: efdbb9d1-02c2-4bc3-afb7-6788d8782b1e
passenger_name: John Doe
has_bicycle: true
has_dog: true
links:
self: https://api.example.com/bookings/1725ff48-ab45-4bb5-9d02-88745177dedb
examples:
new_booking:
summary: New Booking
value:
id: efdbb9d1-02c2-4bc3-afb7-6788d8782b1e
trip_id: efdbb9d1-02c2-4bc3-afb7-6788d8782b1e
passenger_name: John Doe
has_bicycle: true
has_dog: true
links:
self: https://api.example.com/bookings/1725ff48-ab45-4bb5-9d02-88745177dedb
responses:
'200':
description: Return a 200 status to indicate that the data was received successfully.
Expand Down

0 comments on commit 1f58daa

Please sign in to comment.