mirror of
https://github.com/LukeHagar/redocly-cli.git
synced 2025-12-06 04:21:09 +00:00
122 lines
4.4 KiB
YAML
122 lines
4.4 KiB
YAML
arazzo: 1.0.0
|
|
info:
|
|
title: Redocly Museum API Test Workflow
|
|
description: >-
|
|
Use the Museum API with Arazzo as an example of describing multi-step workflows.
|
|
Built with love by Redocly.
|
|
version: 1.0.0
|
|
|
|
sourceDescriptions:
|
|
- name: museum-api
|
|
type: openapi
|
|
url: ../openapi.yaml
|
|
- name: tickets-from-museum-api
|
|
type: arazzo
|
|
url: museum-tickets.arazzo.yaml
|
|
|
|
workflows:
|
|
- workflowId: get-museum-hours
|
|
description: >-
|
|
This workflow demonstrates how to get the museum opening hours and buy tickets.
|
|
parameters:
|
|
- in: header
|
|
name: Authorization
|
|
value: Basic Og==
|
|
steps:
|
|
- stepId: get-museum-hours
|
|
description: >-
|
|
Get museum hours by resolving request details with getMuseumHours operationId from openapi.yaml description.
|
|
operationId: museum-api.getMuseumHours
|
|
successCriteria:
|
|
- condition: $statusCode == 200
|
|
outputs:
|
|
schedule: $response.body
|
|
- stepId: buy-ticket
|
|
description: >-
|
|
Buy a ticket for the museum by calling an external workflow from another Arazzo file.
|
|
workflowId: $sourceDescriptions.tickets-from-museum-api.workflows.get-museum-tickets
|
|
outputs:
|
|
ticketId: $outputs.ticketId
|
|
- workflowId: events-crud
|
|
description: >-
|
|
This workflow demonstrates how to list, create, update, and delete special events at the museum.
|
|
parameters:
|
|
- in: header
|
|
name: Authorization
|
|
value: Basic Og==
|
|
steps:
|
|
- stepId: list-events
|
|
description: >-
|
|
Request the list of events.
|
|
operationPath: $sourceDescriptions.museum-api#/paths/~1special-events/get
|
|
outputs:
|
|
events: $response.body
|
|
- stepId: create-event
|
|
description: >-
|
|
Create a new special event.
|
|
operationPath: $sourceDescriptions.museum-api#/paths/~1special-events/post
|
|
requestBody:
|
|
payload:
|
|
name: 'Mermaid Treasure Identification and Analysis'
|
|
location: 'Under the seaaa 🦀 🎶 🌊.'
|
|
eventDescription: 'Join us as we review and classify a rare collection of 20 thingamabobs, gadgets, gizmos, whoosits, and whatsits, kindly donated by Ariel.'
|
|
dates:
|
|
- '2023-09-05'
|
|
- '2023-09-08'
|
|
price: 0
|
|
successCriteria:
|
|
- condition: $statusCode == 201
|
|
- context: $response.body
|
|
condition: $.name == 'Mermaid Treasure Identification and Analysis'
|
|
type:
|
|
type: jsonpath
|
|
version: draft-goessner-dispatch-jsonpath-00
|
|
outputs:
|
|
createdEventId: $response.body.eventId
|
|
name: $response.body.name
|
|
- stepId: get-event-by-id
|
|
description: >-
|
|
Get the details of the event that was created in the previous step.
|
|
operationPath: $sourceDescriptions.museum-api#/paths/~1special-events~1{eventId}/get
|
|
parameters:
|
|
- name: eventId
|
|
in: path
|
|
value: $steps.create-event.outputs.createdEventId
|
|
successCriteria:
|
|
- context: $statusCode
|
|
condition: '^200$'
|
|
type: regex
|
|
- stepId: update-event
|
|
description: >-
|
|
Update the created event with new details.
|
|
operationPath: $sourceDescriptions.museum-api#/paths/~1special-events~1{eventId}/patch
|
|
parameters:
|
|
- name: eventId
|
|
in: path
|
|
value: $steps.create-event.outputs.createdEventId
|
|
requestBody:
|
|
payload:
|
|
name: 'Orca Identification and Analysis'
|
|
location: 'Under the seaaa 🦀 🎶 🌊.'
|
|
dates:
|
|
- '2023-09-05'
|
|
- '2023-09-08'
|
|
price: 0
|
|
successCriteria:
|
|
- condition: $statusCode == 200
|
|
- context: $response.body
|
|
condition: $.name == 'Orca Identification and Analysis'
|
|
type: jsonpath
|
|
outputs:
|
|
updatedEventId: $response.body.eventId
|
|
- stepId: delete-event
|
|
description: >-
|
|
Delete the event that was updated in the previous step.
|
|
operationPath: $sourceDescriptions.museum-api#/paths/~1special-events~1{eventId}/delete
|
|
parameters:
|
|
- name: eventId
|
|
in: path
|
|
value: $steps.update-event.outputs.updatedEventId
|
|
successCriteria:
|
|
- condition: $statusCode == 204
|