Skip to content

Commit

Permalink
Merge pull request serverlessworkflow#956 from matthias-pichler-warri…
Browse files Browse the repository at this point in the history
…fy/query-params

Allow query parameters in call http
  • Loading branch information
ricardozanini authored Aug 6, 2024
2 parents 434e0eb + 85c43c8 commit 538a0a6
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions dsl-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ The [HTTP Call](#http-call) enables workflows to interact with external services
| endpoint | [`endpoint`](#endpoint) | `yes` | An URI or an object that describes the HTTP endpoint to call. |
| headers | `map` | `no` | A name/value mapping of the HTTP headers to use, if any. |
| body | `any` | `no` | The HTTP request body, if any. |
| query | `map[string, any]` | `no` | A name/value mapping of the query parameters to use, if any. |
| 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`.* |

###### Examples
Expand Down
25 changes: 25 additions & 0 deletions examples/http-query-params.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# yaml-language-server: $schema=https://serverlessworkflow.io/schemas/1.0.0-alpha2/workflow.yaml
document:
dsl: 1.0.0-alpha2
namespace: examples
name: http-query-params
version: 1.0.0-alpha2
input:
schema:
format: json
document:
type: object
required:
- searchQuery
properties:
searchQuery:
type: string
do:
- searchStarWarsCharacters:
call: http
with:
method: get
endpoint: https://swapi.dev/api/people/
query:
search: ${.searchQuery}

4 changes: 4 additions & 0 deletions schema/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ $defs:
description: A name/value mapping of the headers, if any, of the HTTP request to perform.
body:
description: The body, if any, of the HTTP request to perform.
query:
type: object
additionalProperties: true
description: A name/value mapping of the query parameters, if any, of the HTTP request to perform.
output:
type: string
enum: [ raw, content, response ]
Expand Down

0 comments on commit 538a0a6

Please sign in to comment.