Skip to content

Allow expressions in HTTP query and headers #1080

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

Merged
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
31 changes: 31 additions & 0 deletions examples/call-http-query-headers-expressions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# yaml-language-server: $schema=../schema/workflow.yaml
document:
dsl: 1.0.0-alpha2
namespace: examples
name: http-query-headers-expressions
version: 1.0.0-alpha2
input:
schema:
format: json
document:
type: object
required:
- searchQuery
properties:
searchQuery:
type: string
do:
- setQueryAndHeaders:
set:
query:
search: ${.searchQuery}
headers:
Accept: application/json
- searchStarWarsCharacters:
call: http
with:
method: get
endpoint: https://swapi.dev/api/people/
headers: ${.headers}
query: ${.query}

12 changes: 10 additions & 2 deletions schema/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -357,14 +357,22 @@ $defs:
description: The HTTP endpoint to send the request to.
$ref: '#/$defs/endpoint'
headers:
type: object
oneOf:
- type: object
additionalProperties:
type: string
- $ref: '#/$defs/runtimeExpression'
title: HTTPHeaders
description: A name/value mapping of the headers, if any, of the HTTP request to perform.
body:
title: HTTPBody
description: The body, if any, of the HTTP request to perform.
query:
type: object
oneOf:
- type: object
additionalProperties:
type: string
- $ref: '#/$defs/runtimeExpression'
title: HTTPQuery
description: A name/value mapping of the query parameters, if any, of the HTTP request to perform.
additionalProperties: true
Expand Down
Loading