Skip to content
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

Linter errors on BackoffRate for not being a float but console formatter removes .0 #35

Open
G-Rath opened this issue Mar 11, 2020 · 1 comment
Labels

Comments

@G-Rath
Copy link

G-Rath commented Mar 11, 2020

State Machine.States.CallWebhook.Retry[0].BackoffRate is 5 but should be a Float

I have the following state machine JSON:

{
  "Comment": "Call a webhook and retry on failure.",
  "StartAt": "CallWebhook",
  "States": {
    "CallWebhook": {
      "Type": "Task",
      "Resource": "<arn>",
      "Retry": [
        {
          "ErrorEquals": [
            "States.ALL"
          ],
          "IntervalSeconds": 60,
          "MaxAttempts": 5,
          "BackoffRate": 5
        }
      ],
      "End": true
    }
  }
}

statelint complains:

statelint ./state-machine.json
One error:
 State Machine.States.CallWebhook.Retry[0].BackoffRate is 5 but should be a Float

I can resolve this by adding .0 to the value, however this is removed by the Step Function "Format JSON" button in the AWS Console.

@wong-a
Copy link
Collaborator

wong-a commented Sep 24, 2020

A number without decimals is a valid value for BackoffRate that is accepted by Step Functions. The spec's definition of BackoffRate:

a number which is the multiplier that increases the retry interval on each attempt (default: 2.0). The value of BackoffRate MUST be greater than or equal to 1.0.

j2119's constraints on this field are incorrect:
https://github.com/awslabs/j2119/blob/232a1a18f1f2c9a9bbe6b3982640d8c28183d4d1/data/AWL.j2119#L38

@wong-a wong-a added the bug label Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants