diff --git a/dsl-reference.md b/dsl-reference.md index 5db2f1da..64d3beb7 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -149,14 +149,14 @@ use: call: http with: method: post - uri: https://fake.log.collector.com + endpoint: https://fake.log.collector.com body: message: "${ \"Executing task '\($task.reference)'...\" }" after: call: http with: method: post - uri: https://fake.log.collector.com + endpoint: https://fake.log.collector.com body: message: "${ \"Executed task '\($task.reference)'...\" }" functions: @@ -259,7 +259,7 @@ do: call: http with: method: get - uri: https://petstore.swagger.io/v2/pet/{petId} + endpoint: https://petstore.swagger.io/v2/pet/{petId} ``` Serverless Workflow defines several default functions that **MUST** be supported by all implementations and runtimes: @@ -371,7 +371,7 @@ do: call: http with: method: get - uri: https://petstore.swagger.io/v2/pet/{petId} + endpoint: https://petstore.swagger.io/v2/pet/{petId} ``` ##### OpenAPI Call @@ -481,7 +481,7 @@ do: call: http with: method: put - uri: https://fake-hospital.com/api/v3/alert/nurses + endpoint: https://fake-hospital.com/api/v3/alert/nurses body: patientId: ${ .patient.fullName } room: ${ .room.number } @@ -489,7 +489,7 @@ do: call: http with: method: put - uri: https://fake-hospital.com/api/v3/alert/doctor + endpoint: https://fake-hospital.com/api/v3/alert/doctor body: patientId: ${ .patient.fullName } room: ${ .room.number } @@ -917,7 +917,7 @@ do: call: http with: method: get - uri: https:// + endpoint: https:// catch: errors: with: @@ -1203,14 +1203,14 @@ use: call: http with: method: post - uri: https://fake.log.collector.com + endpoint: https://fake.log.collector.com body: message: "${ \"Executing task '\($task.reference)'...\" }" after: call: http with: method: post - uri: https://fake.log.collector.com + endpoint: https://fake.log.collector.com body: message: "${ \"Executed task '\($task.reference)'...\" }" do: @@ -1218,7 +1218,7 @@ do: call: http with: method: get - uri: https://fake.com/sample + endpoint: https://fake.com/sample ``` *Intercept HTTP calls to 'https://mocked.service.com' and mock its response:* @@ -1247,7 +1247,7 @@ do: call: http with: method: get - uri: https://fake.com/sample + endpoint: https://fake.com/sample ``` ### Error diff --git a/examples/call-http-shorthand-endpoint.yaml b/examples/call-http-shorthand-endpoint.yaml new file mode 100644 index 00000000..f682ed30 --- /dev/null +++ b/examples/call-http-shorthand-endpoint.yaml @@ -0,0 +1,11 @@ +document: + dsl: 1.0.0-alpha1 + namespace: examples + name: call-http-shorthand-endpoint + version: 1.0.0-alpha1 +do: + getPetById: + call: http + with: + method: get + endpoint: https://petstore.swagger.io/v2/pet/{petId} diff --git a/schema/workflow.yaml b/schema/workflow.yaml index eeef3dd7..75c2093e 100644 --- a/schema/workflow.yaml +++ b/schema/workflow.yaml @@ -215,8 +215,11 @@ $defs: type: string description: The HTTP method of the HTTP request to perform. endpoint: - $ref: '#/$defs/endpoint' description: The HTTP endpoint to send the request to. + oneOf: + - $ref: '#/$defs/endpoint' + - type: string + format: uri-template headers: type: object description: A name/value mapping of the headers, if any, of the HTTP request to perform.