Skip to content

Commit 538a0a6

Browse files
Merge pull request serverlessworkflow#956 from matthias-pichler-warrify/query-params
Allow query parameters in call http
2 parents 434e0eb + 85c43c8 commit 538a0a6

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

dsl-reference.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@ The [HTTP Call](#http-call) enables workflows to interact with external services
372372
| endpoint | [`endpoint`](#endpoint) | `yes` | An URI or an object that describes the HTTP endpoint to call. |
373373
| headers | `map` | `no` | A name/value mapping of the HTTP headers to use, if any. |
374374
| body | `any` | `no` | The HTTP request body, if any. |
375+
| query | `map[string, any]` | `no` | A name/value mapping of the query parameters to use, if any. |
375376
| output | `string` | `no` | The http call's output format.<br>*Supported values are:*<br>*- `raw`, which output's the base-64 encoded [http response](#http-response) content, if any.*<br>*- `content`, which outputs the content of [http response](#http-response), possibly deserialized.*<br>*- `response`, which outputs the [http response](#http-response).*<br>*Defaults to `content`.* |
376377

377378
###### Examples

examples/http-query-params.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# yaml-language-server: $schema=https://serverlessworkflow.io/schemas/1.0.0-alpha2/workflow.yaml
2+
document:
3+
dsl: 1.0.0-alpha2
4+
namespace: examples
5+
name: http-query-params
6+
version: 1.0.0-alpha2
7+
input:
8+
schema:
9+
format: json
10+
document:
11+
type: object
12+
required:
13+
- searchQuery
14+
properties:
15+
searchQuery:
16+
type: string
17+
do:
18+
- searchStarWarsCharacters:
19+
call: http
20+
with:
21+
method: get
22+
endpoint: https://swapi.dev/api/people/
23+
query:
24+
search: ${.searchQuery}
25+

schema/workflow.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,10 @@ $defs:
266266
description: A name/value mapping of the headers, if any, of the HTTP request to perform.
267267
body:
268268
description: The body, if any, of the HTTP request to perform.
269+
query:
270+
type: object
271+
additionalProperties: true
272+
description: A name/value mapping of the query parameters, if any, of the HTTP request to perform.
269273
output:
270274
type: string
271275
enum: [ raw, content, response ]

0 commit comments

Comments
 (0)