Skip to content
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

Fix example issues #260

Open
wants to merge 7 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
4 changes: 2 additions & 2 deletions examples/1.0.0/ExtendedParametersExample.arazzo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ workflows:
- in: cookie
name: authentication
value: SUPER_SECRET
operationId: animals.postAnimal
operationId: $sourceDescriptions.animals.postAnimal
- stepId: get-step
operationId: animals.getRandomAnimal
operationId: $sourceDescriptions.animals.getRandomAnimal
4 changes: 2 additions & 2 deletions examples/1.0.0/FAPI-PAR.arazzo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ workflows:
# assertions to determine step was successful
- condition: $statusCode == 200
outputs:
request_uri: $response.body.request_uri
request_uri: $response.body#/request_uri

- stepId: AuthzCodeStep
description: OIDC Authorization code request
Expand All @@ -132,7 +132,7 @@ workflows:
# assertions to determine step was successful
- condition: $statusCode == 302
outputs:
code: $response.body.code # Not really, this is a query parameter (need a way to represent out-of-band props)
code: $response.body#/code # Not really, this is a query parameter (need a way to represent out-of-band props)

- stepId: TokenStep
description: Get token from the OIDC Token endpoint
Expand Down
6 changes: 3 additions & 3 deletions examples/1.0.0/LoginAndRetrievePets.arazzo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ workflows:
steps:
- stepId: loginStep
description: This step demonstrates the user login step
operationId: petStoreDescription.loginUser
operationId: $sourceDescriptions.petStoreDescription.loginUser
parameters:
# parameters to inject into the loginUser operation (parameter name must be resolvable at the referenced operation and the value is determined using {expression} syntax)
- name: username
Expand All @@ -43,7 +43,7 @@ workflows:
sessionToken: $response.body
- stepId: getPetStep
description: retrieve a pet by status from the GET pets endpoint
operationPath: $sourceDescriptions.petStoreDescription#/paths/~1pet~1findByStatus/get
operationPath: '{$sourceDescriptions.petStoreDescription.url}#/paths/~1pet~1findByStatus'
parameters:
- name: status
in: query
Expand All @@ -57,4 +57,4 @@ workflows:
# outputs from this step
availablePets: $response.body
outputs:
available: $steps.getPetStep.availablePets
available: $steps.getPetStep.outputs.availablePets
20 changes: 11 additions & 9 deletions examples/1.0.0/bnpl-arazzo.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
arazzo: 1.0.0
info:
title: BNPL Workflow description
description: >-
Describes the steps to secure a loan at checkout from a BNPL platform. It is a multi-step process that requires multiple API calls across several API providers to be completed successfully.
version: 1.0.0
sourceDescriptions:
- name: BnplApi
Expand Down Expand Up @@ -110,7 +112,7 @@ workflows:
type: end
criteria:
- condition: $statusCode == 200
- condition: $response.body.existingCustomerNotEligible == false
- condition: $response.body#/existingCustomerNotEligible == false
- name: qualifyingProductsFound
type: goto
stepId: getCustomerTermsAndConditions
Expand All @@ -127,9 +129,9 @@ workflows:
type: jsonpath
condition: $[?count(@.products) == 0]
outputs:
eligibilityCheckRequired: $response.body.eligibilityCheckRequired
eligibleProducts: $response.body.products
totalLoanAmount: $response.body.totalAmount
eligibilityCheckRequired: $response.body#/eligibilityCheckRequired
eligibleProducts: $response.body#/products
totalLoanAmount: $response.body#/totalAmount
- stepId: getCustomerTermsAndConditions
description: |
Get the terms and conditions for the BNPL loans. This is static data and therefore has no arguments.
Expand Down Expand Up @@ -184,7 +186,7 @@ workflows:
criteria:
- condition: $statusCode == 200
outputs:
customer: $response.body.links.self
customer: $response.body#/links/self
- stepId: initiateBnplTransaction
description: Initiate the BNPL transaction by sending the customer identifier, eligible products, and indicative loan amount to initiate the loan process
operationId: createBnplTransaction
Expand All @@ -203,15 +205,15 @@ workflows:
type: goto
stepId: authenticateCustomerAndAuthorizeLoan
criteria:
- condition: $response.body.redirectAuthToken != null
- condition: $response.body#/redirectAuthToken != null
- name: CustomerAuthorizationNotRequired
type: goto
stepId: retrieveFinalizedPaymentPlan
criteria:
- condition: $response.body.redirectAuthToken == null
- condition: $response.body#/redirectAuthToken == null
outputs:
redirectAuthToken: $response.body.redirectAuthToken
loanTransactionResourceUrl: $response.body.links.self
redirectAuthToken: $response.body#/redirectAuthToken
loanTransactionResourceUrl: $response.body#/links/self
- stepId: authenticateCustomerAndAuthorizeLoan
description: |
Authenticate the customer and seek authorization for the loan.
Expand Down
18 changes: 10 additions & 8 deletions examples/1.0.0/oauth.arazzo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ workflows:
# # Or a previous refresh-token-flow.outputs.refresh_token
steps:
- stepId: do-the-auth-flow
description: >-
This is where you do the authorization code flow
workflowId: authorization-code-flow
parameters:
- name: client_id
Expand All @@ -63,9 +65,9 @@ workflows:
condition: $.access_token != null
type: jsonpath
outputs:
access_token: $response.body.access_token
refresh_token: $response.body.refresh_token
expires_in: $response.body.expires_in
access_token: $response.body#/access_token
refresh_token: $response.body#/refresh_token
expires_in: $response.body#/expires_in

outputs:
access_token: $steps.do-the-refresh.outputs.access_token
Expand Down Expand Up @@ -103,7 +105,7 @@ workflows:
condition: $.access_token != null
type: jsonpath
outputs:
access_token: $response.body.access_token
access_token: $response.body#/access_token

outputs:
access_token: $steps.get-client-creds-token.outputs.access_token
Expand Down Expand Up @@ -153,7 +155,7 @@ workflows:
condition: $.access_token != null
type: jsonpath
outputs:
code: $response.body.code # Not really, this is a query parameter
code: $response.body#/code # Not really, this is a query parameter

- stepId: get-access-token
description: >-
Expand All @@ -173,9 +175,9 @@ workflows:
condition: $.access_token != null
type: jsonpath
outputs:
access_token: $response.body.access_token
refresh_token: $response.body.refresh_token
expires_in: $response.body.expires_in
access_token: $response.body#/access_token
refresh_token: $response.body#/refresh_token
expires_in: $response.body#/expires_in
outputs:
access_token: $steps.get-access-token.outputs.access_token
refresh_token: $steps.get-access-token.outputs.refresh_token
Expand Down
17 changes: 11 additions & 6 deletions examples/1.0.0/pet-coupons.arazzo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ workflows:
$ref: "#/components/inputs/apply_coupon_input"
steps:
- stepId: find-pet
description: Find a pet based on the provided tags.
operationId: findPetsByTags
parameters:
- name: pet_tags
Expand All @@ -28,7 +29,7 @@ workflows:
successCriteria:
- condition: $statusCode == 200
outputs:
my_pet_id: $outputs[0].id
my_pet_id: $response.body#/0/id
# there is some implied selection here - findPetsByTags responds with a list of pets,
# but the client only wants to choose one, and that's what will be provided to the next step.
# not totally sure how to indicate that.
Expand All @@ -42,8 +43,9 @@ workflows:
successCriteria:
- condition: $statusCode == 200
outputs:
my_coupon_code: $response.body.couponCode
my_coupon_code: $response.body#/couponCode
- stepId: place-order
description: Place an order for the pet, applying the coupon.
workflowId: place-order
parameters:
- name: pet_id
Expand All @@ -53,7 +55,7 @@ workflows:
successCriteria:
- condition: $statusCode == 200
outputs:
my_order_id: $workflow_order_id
my_order_id: $outputs.workflow_order_id
outputs:
apply_coupon_pet_order_id: $steps.place-order.outputs.my_order_id
- workflowId: buy-available-pet
Expand All @@ -65,6 +67,7 @@ workflows:
$ref: "#/components/inputs/buy_available_pet_input"
steps:
- stepId: find-pet
description: Find a pet that is available for purchase.
operationId: findPetsByStatus
parameters:
- name: status
Expand All @@ -77,16 +80,17 @@ workflows:
successCriteria:
- condition: $statusCode == 200
outputs:
my_pet_id: $outputs[0].id
my_pet_id: $response.body#/0/id
- stepId: place-order
description: Place an order for the pet.
workflowId: place-order
parameters:
- name: pet_id
value: $steps.find-pet.outputs.my_pet_id
successCriteria:
- condition: $statusCode == 200
outputs:
my_order_id: $workflow_order_id
my_order_id: $outputs.workflow_order_id
outputs:
buy_pet_order_id: $steps.place-order.outputs.my_order_id
- workflowId: place-order
Expand All @@ -109,6 +113,7 @@ workflows:
description: The coupon code to apply to the order.
steps:
- stepId: place-order
description: Place an order for the pet.
operationId: placeOrder
requestBody:
contentType: application/json
Expand All @@ -121,7 +126,7 @@ workflows:
successCriteria:
- condition: $statusCode == 200
outputs:
step_order_id: $response.body.id
step_order_id: $response.body#/id
outputs:
workflow_order_id: $steps.place-order.outputs.step_order_id
components:
Expand Down
Loading