Skip to content

Commit

Permalink
Merge pull request #77 from OAI/harden-expression-and-condition-capab…
Browse files Browse the repository at this point in the history
…ilities

Harden-expression-and-condition-capabilities
  • Loading branch information
frankkilcommins authored Oct 26, 2023
2 parents d1750fc + 63e9d67 commit faef8dc
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 35 deletions.
6 changes: 3 additions & 3 deletions examples/1.0.0/FAPI-PAR.workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ workflows:
value: $inputs.PARrequestBody
successCriteria:
# assertions to determine step was successful
- $statusCode == 200
- condition: $statusCode == 200
outputs:
request_uri: $response.body.request_uri

Expand All @@ -131,7 +131,7 @@ workflows:
value: $inputs.client_id
successCriteria:
# assertions to determine step was successful
- $statusCode == 302
- condition: $statusCode == 302
outputs:
code: $response.body.code # Not really, this is a query parameter (need a way to represent out-of-band props)

Expand Down Expand Up @@ -166,7 +166,7 @@ workflows:
value: $inputs.code_verifier
successCriteria:
# assertions to determine step was successful
- $statusCode == 200
- condition: $statusCode == 200
outputs:
tokenResponse: $response.body

Expand Down
4 changes: 2 additions & 2 deletions examples/1.0.0/LoginAndRetrievePets.workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ workflows:
value: $inputs.password
successCriteria:
# assertions to determine step was successful
- $statusCode == 200
- condition: $statusCode == 200
outputs:
# outputs from this step
tokenExpires: $response.header.X-Expires-After
Expand All @@ -53,7 +53,7 @@ workflows:
in: header
value: $steps.loginUser.outputs.sessionToken
successCriteria:
- $statusCode == 200
- condition: $statusCode == 200
outputs:
# outputs from this step
availablePets: $response.body
Expand Down
24 changes: 16 additions & 8 deletions examples/1.0.0/oauth.workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ workflows:
grant_type: refresh_token
refresh_token: $steps.do-the-auth-flow.outputs.my_refresh_token
successCriteria:
- $statusCode == 200
- $response.body.access_token != null
- condition: $statusCode == 200
- context: $response.body
condition: $.access_token != null
type: JSONPath
outputs:
access_token: $response.body.access_token
refresh_token: $response.body.refresh_token
Expand Down Expand Up @@ -105,8 +107,10 @@ workflows:
value: 'client_credentials'

successCriteria:
- $statusCode == 200
- $response.body.access_token != null
- condition: $statusCode == 200
- context: $response.body
condition: $.access_token != null
type: JSONPath
outputs:
access_token: $response.body.access_token

Expand Down Expand Up @@ -153,8 +157,10 @@ workflows:
in: query
value: '12345'
successCriteria:
- $statusCode == 200
- $response.body.access_token != null
- condition: $statusCode == 200
- context: $response.body
condition: $.access_token != null
type: JSONPath
outputs:
code: $response.body.code # Not really, this is a query parameter

Expand Down Expand Up @@ -185,8 +191,10 @@ workflows:
value: $steps.browser-authorize.outputs.code

successCriteria:
- $statusCode == 200
- $response.body.access_token != null
- condition: $statusCode == 200
- context: $response.body
condition: $.access_token != null
type: JSONPath
outputs:
access_token: $response.body.access_token
refresh_token: $response.body.refresh_token
Expand Down
12 changes: 6 additions & 6 deletions examples/1.0.0/pet-coupons.workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ workflows:
in: query
value: $inputs.my_pet_tags
successCriteria:
- $statusCode == 200
- condition: $statusCode == 200
outputs:
my_pet_id: $outputs[0].id
# there is some implied selection here - findPetsByTags responds with a list of pets,
Expand All @@ -40,7 +40,7 @@ workflows:
in: path
value: $steps.find-pet.outputs.my_pet_id
successCriteria:
- $statusCode == 200
- condition: $statusCode == 200
outputs:
my_coupon_code: $response.body.couponCode
- stepId: place-order
Expand All @@ -53,7 +53,7 @@ workflows:
in: body
value: $steps.find-coupons.outputs.my_coupon_code
successCriteria:
- $statusCode == 200
- condition: $statusCode == 200
outputs:
my_order_id: $response.body.id
- workflowId: buy-available-pet
Expand All @@ -75,7 +75,7 @@ workflows:
- $ref: '#/components/parameters/pageSize'
value: 10
successCriteria:
- $statusCode == 200
- condition: $statusCode == 200
outputs:
my_pet_id: $outputs[0].id
- stepId: place-order
Expand All @@ -85,7 +85,7 @@ workflows:
in: body
value: $steps.find-pet.outputs.my_pet_id
successCriteria:
- $statusCode == 200
- condition: $statusCode == 200
outputs:
my_order_id: $response.body.id
- workflowId: place-order
Expand Down Expand Up @@ -130,7 +130,7 @@ workflows:
target: $request.body#/complete
value: false
successCriteria:
- $statusCode == 200
- condition: $statusCode == 200
outputs:
my_order_id: $response.body.id
components:
Expand Down
Loading

0 comments on commit faef8dc

Please sign in to comment.