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

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

Closed
markmansur opened this issue Jun 19, 2023 · 2 comments · Fixed by #26055
Closed

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

markmansur opened this issue Jun 19, 2023 · 2 comments · Fixed by #26055
Labels
@aws-cdk/aws-stepfunctions Related to AWS StepFunctions bug This issue is a bug. effort/small Small work item – less than a day of effort p1

Comments

@markmansur
Copy link
Contributor

markmansur commented Jun 19, 2023

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

@markmansur markmansur added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 19, 2023
@github-actions github-actions bot added the @aws-cdk/aws-stepfunctions Related to AWS StepFunctions label Jun 19, 2023
@peterwoodworth
Copy link
Contributor

Thanks for creating another report for this - we don't have issues configured to close automatically anymore after just inactivity

@peterwoodworth peterwoodworth added p1 effort/small Small work item – less than a day of effort and removed needs-triage This issue or PR still needs to be triaged. labels Jun 19, 2023
lpizzinidev added a commit to lpizzinidev/aws-cdk that referenced this issue Jun 20, 2023
mergify bot added a commit to lpizzinidev/aws-cdk that referenced this issue Jun 27, 2023
@mergify mergify bot closed this as completed in #26055 Jun 27, 2023
mergify bot pushed a commit that referenced this issue Jun 27, 2023
`FieldUtils.renderObject` was not serializing nested arrays correctly.

For example:
```
{"myNestedArray":[[[123,123],[456,456]]]}
```
Was serialized to:
```
{"myNestedArray":[{"0":[123,123],"1":[456,456]}]}
```

This fix should solve the problem.

Closes #26045.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

lukey-aleios pushed a commit to lukey-aleios/aws-cdk that referenced this issue Jun 30, 2023
…6055)

`FieldUtils.renderObject` was not serializing nested arrays correctly.

For example:
```
{"myNestedArray":[[[123,123],[456,456]]]}
```
Was serialized to:
```
{"myNestedArray":[{"0":[123,123],"1":[456,456]}]}
```

This fix should solve the problem.

Closes aws#26045.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
lukey-aleios pushed a commit to lukey-aleios/aws-cdk that referenced this issue Jun 30, 2023
…6055)

`FieldUtils.renderObject` was not serializing nested arrays correctly.

For example:
```
{"myNestedArray":[[[123,123],[456,456]]]}
```
Was serialized to:
```
{"myNestedArray":[{"0":[123,123],"1":[456,456]}]}
```

This fix should solve the problem.

Closes aws#26045.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-stepfunctions Related to AWS StepFunctions bug This issue is a bug. effort/small Small work item – less than a day of effort p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants