cloudformation-cli icon indicating copy to clipboard operation
cloudformation-cli copied to clipboard

Fix for _replace_dynamic_values in canary file auto-generator

Open nikhilkumarsingh opened this issue 11 months ago • 0 comments

Issue #, if available:

N/A

Description of changes:

While generating canary test files from contract input files, we are getting following error if input structure has a list of dicts:

json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)

Example input:

{
        "CreateInputs": {
            "Property": [{"Nested": "{{test123}}"}]
        }
}

The issue is happening because current logic treats list elements as strings.

This commit fixes this issue by updating the parsing logic to be recursive when list items are dicts.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

nikhilkumarsingh avatar Mar 13 '25 17:03 nikhilkumarsingh