diff --git a/examples/call-http-query-headers-expressions.yaml b/examples/call-http-query-headers-expressions.yaml new file mode 100644 index 00000000..0b790ab9 --- /dev/null +++ b/examples/call-http-query-headers-expressions.yaml @@ -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} + diff --git a/schema/workflow.yaml b/schema/workflow.yaml index 70804f16..23165212 100644 --- a/schema/workflow.yaml +++ b/schema/workflow.yaml @@ -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