Skip to content

Retry definition validation doesn't work #213

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

Closed
escos opened this issue Oct 18, 2022 · 1 comment · Fixed by #361
Closed

Retry definition validation doesn't work #213

escos opened this issue Oct 18, 2022 · 1 comment · Fixed by #361
Assignees
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed spec:0.8

Comments

@escos
Copy link

escos commented Oct 18, 2022

Given:
Workflow definition to be validated

{
  "id": "workflow_1",
  "name": "workflow_1",
  "description": "workflow_1",
  "version": "1.0",
  "specVersion": "0.8",
  "start": "Task1",
  "functions": [
    {
      "name": "increment",
      "type": "custom",
      "operation": "worker"
    }
  ],
  "retries": [
    {
      "maxAttempts": 3
    }
  ],
  "states": [
    {
      "name": "Task1",
      "type": "operation",
      "actionMode": "sequential",
      "actions": [
        {
          "functionRef": {
            "refName": "increment",
            "arguments": {
              "input": "some text"
            }
          },
          "retryRef": "const",
          "actionDataFilter": {
            "toStateData": "${ .result }"
          }
        }
      ],
      "end": true
    }
  ]
}

Expected result:
Validation failed (because of name of RetryDefinition missed)

Actual result:
Validation passed.

The same result(validation passed) if 'name' field is empty or/and maxAttempts not defined.
According to specification 'name ' is required and maxAttempts not.
But in the retrydef.json schema they are required both.

Could you please support us in this question? May be we miss something?

@ricardozanini ricardozanini added bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed spec:0.8 labels May 27, 2024
@ricardozanini ricardozanini self-assigned this May 27, 2024
@ricardozanini
Copy link
Member

Hi! maxAttempts is required per the Specification schema: https://github.com/serverlessworkflow/specification/blob/0.8.x/schema/retries.json#L81.

I'll fix the name validation.

ricardozanini added a commit to ricardozanini/sdk-java that referenced this issue May 27, 2024
ricardozanini added a commit to ricardozanini/sdk-java that referenced this issue May 28, 2024
ricardozanini added a commit that referenced this issue May 28, 2024
Fix #213 - Make  a required property for Retry and verify RetryDef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed spec:0.8
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants