Skip to content

Commit 2ac77b4

Browse files
authored
Merge branch 'main' into schema-extra-props
2 parents 21eac79 + 333c83c commit 2ac77b4

File tree

5 files changed

+97
-33
lines changed

5 files changed

+97
-33
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
- [About](#about)
1010
- [Ecosystem](#ecosystem)
1111
+ [DSL](dsl.md)
12-
+ [CTK](/ctk/readme.md)
12+
+ [CTK](/ctk/README.md)
1313
+ [SDKs](#sdks)
1414
+ [Runtimes](#runtimes)
1515
+ [Tooling](#Tooling)
@@ -177,4 +177,4 @@ By becoming a sponsor, you'll not only demonstrate your commitment to advancing
177177

178178
Sponsorship opportunities range from financial contributions to in-kind support, and every sponsorship makes a meaningful impact on the project's success and sustainability.
179179

180-
Support our project by [becoming a Sponsor](https://crowdfunding.lfx.linuxfoundation.org/projects/serverless-workflow).
180+
Support our project by [becoming a Sponsor](https://crowdfunding.lfx.linuxfoundation.org/projects/serverless-workflow).

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: 46 additions & 18 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
@@ -256,7 +257,9 @@ $defs:
256257
description: The HTTP endpoint to send the request to.
257258
oneOf:
258259
- $ref: '#/$defs/endpoint'
259-
- type: string
260+
- $ref: '#/$defs/runtimeExpression'
261+
- title: LiteralEndpoint
262+
type: string
260263
format: uri-template
261264
headers:
262265
type: object
@@ -366,23 +369,32 @@ $defs:
366369
type: string
367370
description: The event's unique identifier
368371
source:
369-
type: string
370-
format: uri
371372
description: Identifies the context in which an event happened
373+
oneOf:
374+
- title: LiteralSource
375+
type: string
376+
format: uri-template
377+
- $ref: '#/$defs/runtimeExpression'
372378
type:
373379
type: string
374380
description: This attribute contains a value describing the type of event related to the originating occurrence.
375381
time:
376-
type: string
377-
format: date-time
382+
oneOf:
383+
- title: LiteralTime
384+
type: string
385+
format: date-time
386+
- $ref: '#/$defs/runtimeExpression'
378387
subject:
379388
type: string
380389
datacontenttype:
381390
type: string
382391
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.
383392
dataschema:
384-
type: string
385-
format: uri
393+
oneOf:
394+
- title: LiteralDataSchema
395+
type: string
396+
format: uri-template
397+
- $ref: '#/$defs/runtimeExpression'
386398
required: [ source, type ]
387399
additionalProperties: true
388400
required: [ event ]
@@ -535,7 +547,7 @@ $defs:
535547
required: [ command ]
536548
required: [ shell ]
537549
description: Enables the execution of shell commands within a workflow, enabling workflows to interact with the underlying operating system and perform system-level operations, such as file manipulation, environment configuration, or system administration tasks.
538-
- title: RunWokflow
550+
- title: RunWorkflow
539551
properties:
540552
workflow:
541553
title: RunWorkflowDescriptor
@@ -681,7 +693,8 @@ $defs:
681693
type: object
682694
unevaluatedProperties: false
683695
oneOf:
684-
- properties:
696+
- title: BasicAuthenticationData
697+
properties:
685698
username:
686699
type: string
687700
description: The username to use.
@@ -698,7 +711,8 @@ $defs:
698711
type: object
699712
unevaluatedProperties: false
700713
oneOf:
701-
- properties:
714+
- title: BearerAuthenticationData
715+
properties:
702716
token:
703717
type: string
704718
description: The bearer token to use.
@@ -712,7 +726,8 @@ $defs:
712726
type: object
713727
unevaluatedProperties: false
714728
oneOf:
715-
- properties:
729+
- title: OAuth2AutenthicationData
730+
properties:
716731
authority:
717732
type: string
718733
format: uri
@@ -795,16 +810,22 @@ $defs:
795810
unevaluatedProperties: false
796811
properties:
797812
type:
798-
type: string
799-
format: uri
800813
description: A URI reference that identifies the error type.
814+
oneOf:
815+
- title: LiteralErrorType
816+
type: string
817+
format: uri-template
818+
- $ref: '#/$defs/runtimeExpression'
801819
status:
802820
type: integer
803821
description: The status code generated by the origin for this occurrence of the error.
804822
instance:
805-
type: string
806-
format: json-pointer
807823
description: A JSON Pointer used to reference the component the error originates from.
824+
oneOf:
825+
- title: LiteralErrorInstance
826+
type: string
827+
format: json-pointer
828+
- $ref: '#/$defs/runtimeExpression'
808829
title:
809830
type: string
810831
description: A short, human-readable summary of the error.
@@ -817,9 +838,12 @@ $defs:
817838
unevaluatedProperties: false
818839
properties:
819840
uri:
820-
type: string
821-
format: uri-template
822841
description: The endpoint's URI.
842+
oneOf:
843+
- title: LiteralEndpointURI
844+
type: string
845+
format: uri-template
846+
- $ref: '#/$defs/runtimeExpression'
823847
authentication:
824848
$ref: '#/$defs/referenceableAuthenticationPolicy'
825849
description: The authentication policy to use.
@@ -1068,4 +1092,8 @@ $defs:
10681092
description: The duration after which to timeout.
10691093
required: [ after ]
10701094
description: The definition of a timeout.
1071-
required: [ document, do ]
1095+
runtimeExpression:
1096+
title: RuntimeExpression
1097+
type: string
1098+
description: A runtime expression
1099+
pattern: "^\\s*\\$\\{.+\\}\\s*$"

0 commit comments

Comments
 (0)