Skip to content

aws-stepfunctions: Nested arrays are not serialized correctly #26045

@markmansur

Description

@markmansur

Describe the bug

If a StepFunction definition contains a nested array, the nested array is serialized as an object where the keys are the array indices.

This looks like an issue with the FieldUtils.renderObject method.

Duplicate of #14599

Expected Behavior

I would expect the following to be logged to the console

{"myNestedArray":[[[123,123],[456,456]]]}

Current Behavior

Current behavior treats the nested array as an object and adds indices
{"myNestedArray":[{"0":[123,123],"1":[456,456]}]}

Reproduction Steps

console.log(
     JSON.stringify(
       FieldUtils.renderObject({
         myNestedArray: [
           [
             [123, 123],
             [456, 456],
           ],
         ],
       }),
     ),
   );

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.84.0

Framework Version

No response

Node.js Version

18

OS

MacOS

Language

Typescript

Language Version

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-stepfunctionsRelated to AWS StepFunctionsbugThis issue is a bug.effort/smallSmall work item – less than a day of effortp1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions