Skip to content

Commit 302fe64

Browse files
authored
Merge branch 'main' into Adding_title_for_auth_schema
2 parents 0579a94 + f25a9f5 commit 302fe64

File tree

4 files changed

+88
-27
lines changed

4 files changed

+88
-27
lines changed

ctk/features/call.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Feature: Call Task
2222
endpoint:
2323
uri: https://petstore.swagger.io/v2/pet/findByStatus?status={status}
2424
output:
25-
from: .[0]
25+
as: .[0]
2626
"""
2727
And given the workflow input is:
2828
"""yaml
@@ -108,7 +108,7 @@ Feature: Call Task
108108
parameters:
109109
status: ${ .status }
110110
output:
111-
from: . | length
111+
as: . | length
112112
"""
113113
And given the workflow input is:
114114
"""yaml

dsl-reference.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,17 +1507,20 @@ When set, runtimes must validate output data against the defined schema, unless
15071507
#### Examples
15081508

15091509
```yaml
1510-
schema:
1511-
format: json
1512-
document:
1513-
type: object
1514-
properties:
1515-
petId:
1516-
type: string
1517-
required: [ petId ]
1518-
from:
1519-
petId: '${ .pet.id }'
1520-
to: '.petList += [ . ]'
1510+
output:
1511+
schema:
1512+
format: json
1513+
document:
1514+
type: object
1515+
properties:
1516+
petId:
1517+
type: string
1518+
required: [ petId ]
1519+
as:
1520+
petId: '${ .pet.id }'
1521+
export:
1522+
as:
1523+
'.petList += [ . ]'
15211524
```
15221525

15231526
### Export

examples/star-wars-homeworld.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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: star-wars-homeplanet
6+
version: 1.0.0-alpha2
7+
input:
8+
schema:
9+
format: json
10+
document:
11+
type: object
12+
required:
13+
- id
14+
properties:
15+
id:
16+
type: integer
17+
description: The id of the star wars character to get
18+
minimum: 1
19+
do:
20+
- getStarWarsCharacter:
21+
call: http
22+
with:
23+
method: get
24+
endpoint: https://swapi.dev/api/people/{id}
25+
output: response
26+
export:
27+
as:
28+
homeworld: ${ .content.homeworld }
29+
- getStarWarsHomeworld:
30+
call: http
31+
with:
32+
method: get
33+
endpoint: ${ $context.homeworld }

schema/workflow.yaml

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ $id: https://serverlessworkflow.io/schemas/1.0.0-alpha1/workflow.yaml
22
$schema: https://json-schema.org/draft/2020-12/schema
33
description: Serverless Workflow DSL - Workflow Schema
44
type: object
5+
required: [ document, do ]
56
properties:
67
document:
78
type: object
@@ -252,7 +253,9 @@ $defs:
252253
description: The HTTP endpoint to send the request to.
253254
oneOf:
254255
- $ref: '#/$defs/endpoint'
255-
- type: string
256+
- $ref: '#/$defs/runtimeExpression'
257+
- title: LiteralEndpoint
258+
type: string
256259
format: uri-template
257260
headers:
258261
type: object
@@ -360,23 +363,32 @@ $defs:
360363
type: string
361364
description: The event's unique identifier
362365
source:
363-
type: string
364-
format: uri
365366
description: Identifies the context in which an event happened
367+
oneOf:
368+
- title: LiteralSource
369+
type: string
370+
format: uri-template
371+
- $ref: '#/$defs/runtimeExpression'
366372
type:
367373
type: string
368374
description: This attribute contains a value describing the type of event related to the originating occurrence.
369375
time:
370-
type: string
371-
format: date-time
376+
oneOf:
377+
- title: LiteralTime
378+
type: string
379+
format: date-time
380+
- $ref: '#/$defs/runtimeExpression'
372381
subject:
373382
type: string
374383
datacontenttype:
375384
type: string
376385
description: Content type of data value. This attribute enables data to carry any type of content, whereby format and encoding might differ from that of the chosen event format.
377386
dataschema:
378-
type: string
379-
format: uri
387+
oneOf:
388+
- title: LiteralDataSchema
389+
type: string
390+
format: uri-template
391+
- $ref: '#/$defs/runtimeExpression'
380392
required: [ source, type ]
381393
additionalProperties: true
382394
required: [ event ]
@@ -775,16 +787,22 @@ $defs:
775787
type: object
776788
properties:
777789
type:
778-
type: string
779-
format: uri
780790
description: A URI reference that identifies the error type.
791+
oneOf:
792+
- title: LiteralErrorType
793+
type: string
794+
format: uri-template
795+
- $ref: '#/$defs/runtimeExpression'
781796
status:
782797
type: integer
783798
description: The status code generated by the origin for this occurrence of the error.
784799
instance:
785-
type: string
786-
format: json-pointer
787800
description: A JSON Pointer used to reference the component the error originates from.
801+
oneOf:
802+
- title: LiteralErrorInstance
803+
type: string
804+
format: json-pointer
805+
- $ref: '#/$defs/runtimeExpression'
788806
title:
789807
type: string
790808
description: A short, human-readable summary of the error.
@@ -796,9 +814,12 @@ $defs:
796814
type: object
797815
properties:
798816
uri:
799-
type: string
800-
format: uri-template
801817
description: The endpoint's URI.
818+
oneOf:
819+
- title: LiteralEndpointURI
820+
type: string
821+
format: uri-template
822+
- $ref: '#/$defs/runtimeExpression'
802823
authentication:
803824
$ref: '#/$defs/referenceableAuthenticationPolicy'
804825
description: The authentication policy to use.
@@ -1033,4 +1054,8 @@ $defs:
10331054
description: The duration after which to timeout.
10341055
required: [ after ]
10351056
description: The definition of a timeout.
1036-
required: [ document, do ]
1057+
runtimeExpression:
1058+
title: RuntimeExpression
1059+
type: string
1060+
description: A runtime expression
1061+
pattern: "^\\s*\\$\\{.+\\}\\s*$"

0 commit comments

Comments
 (0)