serverlessworkflow / specification

Contains the official specification for the Serverless Workflow Domain Specific Language. It provides detailed guidelines and standards for defining, executing, and managing workflows in serverless environments, ensuring consistency and interoperability across implementations.
http://serverlessworkflow.io
Apache License 2.0
730 stars 146 forks source link

flowDirective schema does not support task names #862

Closed matthias-pichler closed 3 months ago

matthias-pichler commented 3 months ago

What seems off:

the schema for the flow directive is:

{
  "flowDirective": {
    "type": "string",
    "enum": [
      "continue",
      "exit",
      "end"
    ],
    "default": "continue"
  }
}

while the docs mention that one can also specify the name of a task: https://github.com/serverlessworkflow/specification/blob/v1.0.0-alpha1/dsl.md#task-flow

and since flowDirective is also used in the schema for the switch task the examples would not pass validation: https://github.com/serverlessworkflow/specification/blob/v1.0.0-alpha1/dsl-reference.md#switch

What you expected to be:

{
  "flowDirective": {
    "anyOf": [
      {
        "type": "string",
        "enum": [
          "continue",
          "exit",
          "end"
        ],
        "default": "continue"
      },
      {
        "type": "string"
      }
    ]
  }
}

Anything else we need to know?:

Environment:

ricardozanini commented 3 months ago

Thanks @matthias-pichler-warrify! I'll take a look at it today.