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

State machine definition does not support JSONata #637

Open
villagoizi opened this issue Dec 12, 2024 · 0 comments
Open

State machine definition does not support JSONata #637

villagoizi opened this issue Dec 12, 2024 · 0 comments

Comments

@villagoizi
Copy link

Does not support JSONata

Description
In this line of code it expects a state.Parameters but when you use JSONata everything changes from Parameters to Arguments.

const functionName = state.Parameters.FunctionName;

You get the following exception when performing an sls deploy:
TypeError: Cannot read properties of undefined (reading 'FunctionName')

This is the definition used

Comment: Validate
StartAt: input validation
QueryLanguage: JSONata
States:
  input validation:
    Type: Task
    Resource: arn:aws:states:::lambda:invoke
    Output: '{% $states.result.Payload %}'
    Assign:
      command: '{% $merge([$states.input.params.path, $states.input.body]) %}'
      meta: '{% $states.input %}'
    Arguments:
      FunctionName:
        'Fn::GetAtt':
          - ValidatorLambda
          - Arn
      Payload:
        rule: ${file(src/model-config/schemas/update.yml)}
        payload: '{% $merge([$states.input.params.path, $states.input.body]) %}'
    Retry:
      - ErrorEquals:
          - States.ALL
        IntervalSeconds: 1
        MaxAttempts: 2
        BackoffRate: 1
        JitterStrategy: FULL
    End: true

Additional data

  • Serverless Framework Core Version you're using: ^3
  • The Plugin Version you're using: ^3.21.1
  • Operating System: Linux
@villagoizi villagoizi changed the title State machine does not support JSONata State machine definition does not support JSONata Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant